@powerhousedao/connect 4.0.0-staging.4 → 4.0.0-staging.5
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/assets/{AddDriveModal.CkAoSG6A.js → AddDriveModal.Bn5gHzqC.js} +2 -2
- package/dist/assets/{AddDriveModal.CkAoSG6A.js.map → AddDriveModal.Bn5gHzqC.js.map} +1 -1
- package/dist/assets/{AddLocalDriveModal.D96D5Bah.js → AddLocalDriveModal.DJ7OB4Yo.js} +2 -2
- package/dist/assets/{AddLocalDriveModal.D96D5Bah.js.map → AddLocalDriveModal.DJ7OB4Yo.js.map} +1 -1
- package/dist/assets/{AddRemoteDriveModal.BPvQppgL.js → AddRemoteDriveModal.IOAtDyOA.js} +2 -2
- package/dist/assets/{AddRemoteDriveModal.BPvQppgL.js.map → AddRemoteDriveModal.IOAtDyOA.js.map} +1 -1
- package/dist/assets/{ConfirmationModal.C6BEQwoI.js → ConfirmationModal.BLX_Fgxf.js} +2 -2
- package/dist/assets/{ConfirmationModal.C6BEQwoI.js.map → ConfirmationModal.BLX_Fgxf.js.map} +1 -1
- package/dist/assets/{CookiesPolicyModal.BEhaheOU.js → CookiesPolicyModal.CkS39vny.js} +2 -2
- package/dist/assets/{CookiesPolicyModal.BEhaheOU.js.map → CookiesPolicyModal.CkS39vny.js.map} +1 -1
- package/dist/assets/{CreateDocumentModal.Czgcpl-j.js → CreateDocumentModal.BvaKbxez.js} +2 -2
- package/dist/assets/{CreateDocumentModal.Czgcpl-j.js.map → CreateDocumentModal.BvaKbxez.js.map} +1 -1
- package/dist/assets/{DebugSettingsModal.B1hSJnrj.js → DebugSettingsModal.ISJCIPbV.js} +2 -2
- package/dist/assets/{DebugSettingsModal.B1hSJnrj.js.map → DebugSettingsModal.ISJCIPbV.js.map} +1 -1
- package/dist/assets/{DeleteDriveModal.B3SG8tZB.js → DeleteDriveModal.C8k99Qt3.js} +2 -2
- package/dist/assets/{DeleteDriveModal.B3SG8tZB.js.map → DeleteDriveModal.C8k99Qt3.js.map} +1 -1
- package/dist/assets/{DeleteItemModal.pMEEVzdV.js → DeleteItemModal.DYsVSZ5o.js} +2 -2
- package/dist/assets/{DeleteItemModal.pMEEVzdV.js.map → DeleteItemModal.DYsVSZ5o.js.map} +1 -1
- package/dist/assets/{DisclaimerModal.C2qfI8uK.js → DisclaimerModal.C40A4BZS.js} +2 -2
- package/dist/assets/{DisclaimerModal.C2qfI8uK.js.map → DisclaimerModal.C40A4BZS.js.map} +1 -1
- package/dist/assets/{DriveSettingsModal.C1ZtlJBT.js → DriveSettingsModal.YG4M4mId.js} +2 -2
- package/dist/assets/{DriveSettingsModal.C1ZtlJBT.js.map → DriveSettingsModal.YG4M4mId.js.map} +1 -1
- package/dist/assets/{SettingsModal.weUaW9r2.js → SettingsModal.DufLgyeX.js} +2 -2
- package/dist/assets/{SettingsModal.weUaW9r2.js.map → SettingsModal.DufLgyeX.js.map} +1 -1
- package/dist/assets/{Trans.BGcRaz_1.js → Trans.-pu2RC5T.js} +2 -2
- package/dist/assets/{Trans.BGcRaz_1.js.map → Trans.-pu2RC5T.js.map} +1 -1
- package/dist/assets/{UpgradeDriveModal.BdzKq7CR.js → UpgradeDriveModal.BVZNcfsQ.js} +2 -2
- package/dist/assets/{UpgradeDriveModal.BdzKq7CR.js.map → UpgradeDriveModal.BVZNcfsQ.js.map} +1 -1
- package/dist/assets/app-skeleton.js +1 -1
- package/dist/assets/{app.IGCDAOZy.js → app.aFJmM9Er.js} +4 -4
- package/dist/assets/{app.IGCDAOZy.js.map → app.aFJmM9Er.js.map} +1 -1
- package/dist/assets/{atlas-import.sl0ixljF.js → atlas-import.CR0HtUvl.js} +2 -2
- package/dist/assets/{atlas-import.sl0ixljF.js.map → atlas-import.CR0HtUvl.js.map} +1 -1
- package/dist/assets/{connect.config.DXj_NcAD.js → connect.config.CrBOGgX2.js} +2 -2
- package/dist/assets/{connect.config.DXj_NcAD.js.map → connect.config.CrBOGgX2.js.map} +1 -1
- package/dist/assets/{content.D0qyPh5w.js → content.CHskkKDX.js} +3 -3
- package/dist/assets/{content.D0qyPh5w.js.map → content.CHskkKDX.js.map} +1 -1
- package/dist/assets/{cookie-banner.CwExKJub.js → cookie-banner.D5bw0gUz.js} +2 -2
- package/dist/assets/{cookie-banner.CwExKJub.js.map → cookie-banner.D5bw0gUz.js.map} +1 -1
- package/dist/assets/{home.BdPuMONz.js → home.DtvXSyR2.js} +2 -2
- package/dist/assets/{home.BdPuMONz.js.map → home.DtvXSyR2.js.map} +1 -1
- package/dist/assets/{index.CEWm2x_k.js → index.4e_lqcUE.js} +2 -2
- package/dist/assets/{index.CEWm2x_k.js.map → index.4e_lqcUE.js.map} +1 -1
- package/dist/assets/{index.CjY5uEZi.js → index.6oC5I2mG.js} +2 -2
- package/dist/assets/{index.CjY5uEZi.js.map → index.6oC5I2mG.js.map} +1 -1
- package/dist/assets/{index.BMFeeSMw.js → index.C1_FvQqd.js} +2 -2
- package/dist/assets/{index.BMFeeSMw.js.map → index.C1_FvQqd.js.map} +1 -1
- package/dist/assets/{index.CjJMrKrN.js → index.Cll-QH04.js} +2 -2
- package/dist/assets/{index.CjJMrKrN.js.map → index.Cll-QH04.js.map} +1 -1
- package/dist/assets/{index.BapSoqiD.js → index.DFyMrewv.js} +4 -4
- package/dist/assets/{index.BapSoqiD.js.map → index.DFyMrewv.js.map} +1 -1
- package/dist/assets/{index.CcKlpSip.js → index.DqK-WT1G.js} +2 -2
- package/dist/assets/{index.CcKlpSip.js.map → index.DqK-WT1G.js.map} +1 -1
- package/dist/assets/{index.Bgc-eQUW.js → index.sCzynzye.js} +3 -3
- package/dist/assets/{index.Bgc-eQUW.js.map → index.sCzynzye.js.map} +1 -1
- package/dist/assets/{index.BugWqDXU.js → index.zAl8tZ8o.js} +2 -2
- package/dist/assets/{index.BugWqDXU.js.map → index.zAl8tZ8o.js.map} +1 -1
- package/dist/assets/{main.BSZldL3R.js → main.BVoItuFx.js} +3 -3
- package/dist/assets/{main.BSZldL3R.js.map → main.BVoItuFx.js.map} +1 -1
- package/dist/assets/{modal.CFXMMGqy.js → modal.Cye_KKu6.js} +3 -3
- package/dist/assets/{modal.CFXMMGqy.js.map → modal.Cye_KKu6.js.map} +1 -1
- package/dist/assets/{modals.BBmZcSn8.js → modals.DUmyVHFz.js} +2 -2
- package/dist/assets/{modals.BBmZcSn8.js.map → modals.DUmyVHFz.js.map} +1 -1
- package/dist/assets/{nodefs.BbkfN3E3.js → nodefs.Ckv3nYAO.js} +2 -2
- package/dist/assets/{nodefs.BbkfN3E3.js.map → nodefs.Ckv3nYAO.js.map} +1 -1
- package/dist/assets/{opfs-ahp.EtXrzCL2.js → opfs-ahp.js-oMwzH.js} +2 -2
- package/dist/assets/{opfs-ahp.EtXrzCL2.js.map → opfs-ahp.js-oMwzH.js.map} +1 -1
- package/dist/assets/{react-error-boundary.esm.CwMnLDyV.js → react-error-boundary.esm.BVdm9PKb.js} +2 -2
- package/dist/assets/{react-error-boundary.esm.CwMnLDyV.js.map → react-error-boundary.esm.BVdm9PKb.js.map} +1 -1
- package/dist/assets/{registerServiceWorker.D6Jhmty2.js → registerServiceWorker.B6gZbhCh.js} +2 -2
- package/dist/assets/{registerServiceWorker.D6Jhmty2.js.map → registerServiceWorker.B6gZbhCh.js.map} +1 -1
- package/dist/assets/{root.BEIAZMzg.js → root.DwbQdJvE.js} +2 -2
- package/dist/assets/{root.BEIAZMzg.js.map → root.DwbQdJvE.js.map} +1 -1
- package/dist/assets/{toast.C3qNDopK.js → toast.EfwsdSRg.js} +2 -2
- package/dist/assets/{toast.C3qNDopK.js.map → toast.EfwsdSRg.js.map} +1 -1
- package/dist/assets/{useAcceptedCookies.Ws9gc6Mz.js → useAcceptedCookies.DAMRdvWB.js} +2 -2
- package/dist/assets/{useAcceptedCookies.Ws9gc6Mz.js.map → useAcceptedCookies.DAMRdvWB.js.map} +1 -1
- package/dist/assets/useConnectConfig.BSHylBzU.js +2 -0
- package/dist/assets/{useConnectConfig.BNPmyZ38.js.map → useConnectConfig.BSHylBzU.js.map} +1 -1
- package/dist/assets/useDefaultDocumentModelEditor.CAft-9eW.js +2 -0
- package/dist/assets/{useDefaultDocumentModelEditor.ohnz8nUq.js.map → useDefaultDocumentModelEditor.CAft-9eW.js.map} +1 -1
- package/dist/assets/{useDocumentDriveServer.UnOYIa0q.js → useDocumentDriveServer.IAJBSerk.js} +2 -2
- package/dist/assets/{useDocumentDriveServer.UnOYIa0q.js.map → useDocumentDriveServer.IAJBSerk.js.map} +1 -1
- package/dist/assets/{useFeatureFlags.DTzTxTCq.js → useFeatureFlags.Brp-qdYo.js} +2 -2
- package/dist/assets/{useFeatureFlags.DTzTxTCq.js.map → useFeatureFlags.Brp-qdYo.js.map} +1 -1
- package/dist/assets/{user.CZolGXW4.js → user.BQpdDebz.js} +4 -4
- package/dist/assets/{user.CZolGXW4.js.map → user.BQpdDebz.js.map} +1 -1
- package/dist/index.html +1 -1
- package/dist/vite-envs.sh +1 -1
- package/package.json +9 -9
- package/dist/assets/useConnectConfig.BNPmyZ38.js +0 -2
- package/dist/assets/useDefaultDocumentModelEditor.ohnz8nUq.js +0 -2
|
@@ -227,7 +227,7 @@ ${ds}`),Jn.pop(),`{${ns}}`}case"number":return isFinite(Hn)?String(Hn):Ar?Ar(Hn)
|
|
|
227
227
|
"modules": []
|
|
228
228
|
}
|
|
229
229
|
]
|
|
230
|
-
}`,examples:[]},local:{schema:"",initialValue:"{}",examples:[]}}}]},documentModelDocumentModelModule={reducer:reducer$3,documentModel:documentModelState,actions:{...creators,...actions$1},utils:{...documentModelUtils,...customUtils$1}},isDefinedNonNullAny=e=>e!=null;anyType().refine(e=>isDefinedNonNullAny(e));const TransmitterTypeSchema=enumType(["Internal","MatrixConnect","PullResponder","RESTWebhook","SecureConnect","SwitchboardPush"]),TriggerTypeSchema=enumType(["PullResponder"]);function AddFileInputSchema(){return objectType({document:unknownType().nullish(),documentType:stringType(),id:stringType(),name:stringType(),parentFolder:stringType().nullish(),synchronizationUnits:arrayType(SynchronizationUnitSchema())})}function AddFolderInputSchema(){return objectType({id:stringType(),name:stringType(),parentFolder:stringType().nullish()})}function AddListenerInputSchema(){return objectType({listener:ListenerSchema()})}function AddTriggerInputSchema(){return objectType({trigger:TriggerSchema()})}function CopyNodeInputSchema(){return objectType({srcId:stringType(),synchronizationUnits:arrayType(SynchronizationUnitSchema()).nullish(),targetId:stringType(),targetName:stringType().nullish(),targetParentFolder:stringType().nullish()})}function DeleteNodeInputSchema(){return objectType({id:stringType()})}function ListenerSchema(){return objectType({__typename:literalType("Listener").optional(),block:booleanType(),callInfo:ListenerCallInfoSchema().nullable(),filter:ListenerFilterSchema(),label:stringType().nullable(),listenerId:stringType(),system:booleanType()})}function ListenerCallInfoSchema(){return objectType({__typename:literalType("ListenerCallInfo").optional(),data:stringType().nullable(),name:stringType().nullable(),transmitterType:TransmitterTypeSchema.nullable()})}function ListenerFilterSchema(){return objectType({__typename:literalType("ListenerFilter").optional(),branch:arrayType(stringType()).nullable(),documentId:arrayType(stringType()).nullable(),documentType:arrayType(stringType()),scope:arrayType(stringType()).nullable()})}function MoveNodeInputSchema(){return objectType({srcFolder:stringType(),targetParentFolder:stringType().nullish()})}function PullResponderTriggerDataSchema(){return objectType({__typename:literalType("PullResponderTriggerData").optional(),interval:stringType(),listenerId:stringType(),url:stringType()})}function RemoveListenerInputSchema(){return objectType({listenerId:stringType()})}function RemoveTriggerInputSchema(){return objectType({triggerId:stringType()})}function SetAvailableOfflineInputSchema(){return objectType({availableOffline:booleanType()})}function SetDriveIconInputSchema(){return objectType({icon:stringType()})}function SetDriveNameInputSchema(){return objectType({name:stringType()})}function SetSharingTypeInputSchema(){return objectType({type:stringType()})}function SynchronizationUnitSchema(){return objectType({__typename:literalType("SynchronizationUnit").optional(),branch:stringType(),scope:stringType(),syncId:stringType()})}function TriggerSchema(){return objectType({__typename:literalType("Trigger").optional(),data:TriggerDataSchema().nullable(),id:stringType(),type:TriggerTypeSchema})}function TriggerDataSchema(){return PullResponderTriggerDataSchema()}function UpdateFileInputSchema(){return objectType({documentType:stringType().nullish(),id:stringType(),name:stringType().nullish(),parentFolder:stringType().nullish()})}function UpdateNodeInputSchema(){return objectType({id:stringType(),name:stringType().nullish(),parentFolder:stringType().nullish()})}const reducer$2={setDriveNameOperation(e,t,tr){e.name=t.input.name},setDriveIconOperation(e,t,tr){e.icon=t.input.icon},setSharingTypeOperation(e,t,tr){e.sharingType=t.input.type},setAvailableOfflineOperation(e,t,tr){e.availableOffline=t.input.availableOffline},addListenerOperation(e,t,tr){if(e.listeners.find(rr=>rr.listenerId===t.input.listener.listenerId))throw new Error(`A listener with Id: ${t.input.listener.listenerId} already exists`);e.listeners.push(t.input.listener)},removeListenerOperation(e,t,tr){e.listeners=e.listeners.filter(rr=>rr.listenerId!==t.input.listenerId)},addTriggerOperation(e,t,tr){if(e.triggers.find(rr=>rr.id===t.input.trigger.id))throw new Error(`A trigger with Id: ${t.input.trigger.id} already exists`);e.triggers.push(t.input.trigger)},removeTriggerOperation(e,t,tr){e.triggers=e.triggers.filter(rr=>rr.id!==t.input.triggerId)}};class DocumentModelNotFoundError extends Error{constructor(tr,rr){super(`Document model "${tr}" not found`,{cause:rr});Rs(this,"id");this.id=tr}}class OperationError extends Error{constructor(tr,rr,ir,lr){super(ir,{cause:lr??rr});Rs(this,"status");Rs(this,"operation");this.status=tr,this.operation=rr}}class ConflictOperationError extends OperationError{constructor(t,tr){super("CONFLICT",tr,`Conflicting operation on index ${tr.index}`,{existingOperation:t,newOperation:tr})}}class DocumentIdValidationError extends Error{constructor(t){super(`Invalid document id: ${t}`)}}class DocumentSlugValidationError extends Error{constructor(t){super(`Invalid slug: ${t}`)}}class DocumentAlreadyExistsError extends Error{constructor(tr){super(`Document with id ${tr} uses id or slug that already exists`);Rs(this,"documentId");this.documentId=tr}}class DocumentNotFoundError extends Error{constructor(tr){super(`Document with id ${tr} not found`);Rs(this,"documentId");this.documentId=tr}}class SynchronizationUnitNotFoundError extends Error{constructor(tr,rr){super(tr);Rs(this,"syncUnitId");this.syncUnitId=rr}}const isValidDocumentId=e=>e&&e.length>0&&/^[a-zA-Z0-9_-]+$/.test(e),isValidSlug=e=>e&&e.length>0&&/^[a-zA-Z0-9_-]+$/.test(e),addFile=e=>createAction("ADD_FILE",{...e},void 0,AddFileInputSchema,"global"),addFolder=e=>createAction("ADD_FOLDER",{...e},void 0,AddFolderInputSchema,"global"),deleteNode=e=>createAction("DELETE_NODE",{...e},void 0,DeleteNodeInputSchema,"global"),updateFile=e=>createAction("UPDATE_FILE",{...e},void 0,UpdateFileInputSchema,"global"),updateNode=e=>createAction("UPDATE_NODE",{...e},void 0,UpdateNodeInputSchema,"global"),copyNode=e=>createAction("COPY_NODE",{...e},void 0,CopyNodeInputSchema,"global"),moveNode=e=>createAction("MOVE_NODE",{...e},void 0,MoveNodeInputSchema,"global");function isFileNode(e){return e.kind==="file"}function isFolderNode(e){return e.kind==="folder"}function getAncestors(e,t){if(e.parentFolder){const tr=t.find(rr=>rr.id===e.parentFolder);if(!tr)throw new Error(`Parent node with id ${e.parentFolder} not found`);return[tr,...getAncestors(tr,t)]}else return[]}function getDescendants(e,t){const tr=t.filter(ir=>ir.parentFolder===e.id),rr=tr.map(ir=>getDescendants(ir,t));return[...tr,...rr.flat()]}function generateNodesCopy(e,t,tr){const rr=tr.find(hr=>hr.id===e.srcId);if(!rr)throw new Error(`Node with id ${e.srcId} not found`);const ir=[{...rr,name:e.targetName||rr.name,parentFolder:e.targetParentFolder||null},...getDescendants(rr,tr)],lr={};e.targetParentFolder&&(lr[e.targetParentFolder]=e.targetParentFolder);const dr=hr=>{let mr=lr[hr];if(!mr){const gr=hr;mr=t(hr),lr[gr]=mr}return mr};return ir.map(hr=>({srcId:hr.id,targetId:dr(hr.id),targetName:hr.name,targetParentFolder:hr.parentFolder?dr(hr.parentFolder):null,synchronizationUnits:isFileNode(hr)?hr.synchronizationUnits.map(mr=>({...mr,syncId:generateSynchronizationUnitId(tr)})):void 0}))}function generateSynchronizationUnitId(e){let t="";for(;!t||e.find(tr=>isFileNode(tr)&&tr.synchronizationUnits.find(rr=>rr.syncId===t));)t=generateId$1();return t}function generateSynchronizationUnits(e,t,tr="main"){return t.map(rr=>({scope:rr,branch:tr,syncId:generateSynchronizationUnitId(e.nodes)}))}function generateAddNodeAction(e,t,tr){return addFile({...t,synchronizationUnits:generateSynchronizationUnits(e,tr)})}function generateCopyNodeAction(e,t){const tr=e.nodes.find(ir=>ir.id===t.srcId);if(!tr)throw new Error(`Node with id ${t.srcId} not found`);let rr;return isFileNode(tr)&&(rr=tr.synchronizationUnits.map(ir=>({...ir,syncId:generateSynchronizationUnitId(e.nodes)}))),copyNode({...t,synchronizationUnits:rr})}function getNextCopyNumber(e,t){let tr=0;const rr=new RegExp(`^${escapeRegExp(t)} \\(copy\\)(?: (\\d+))?$`);for(const ir of e){const lr=ir.match(rr);if(lr){const dr=lr[1]?parseInt(lr[1],10):1;dr>tr&&(tr=dr)}}return tr+1}function escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function handleTargetNameCollisions(e){const{nodes:t,targetParentFolder:tr,srcName:rr}=e,ir=t.filter(fr=>tr===""?fr.parentFolder===null:fr.parentFolder===tr).map(fr=>fr.name);return ir.includes(rr)?`${rr} (copy) ${getNextCopyNumber(ir,rr)}`:rr}const customUtils=Object.freeze(Object.defineProperty({__proto__:null,escapeRegExp,generateAddNodeAction,generateCopyNodeAction,generateNodesCopy,generateSynchronizationUnitId,generateSynchronizationUnits,getAncestors,getDescendants,getNextCopyNumber,handleTargetNameCollisions,isFileNode,isFolderNode},Symbol.toStringTag,{value:"Module"})),reducer$1={addFileOperation(e,t,tr){if(e.nodes.find(fr=>fr.id===t.input.id))throw new Error(`Node with id ${t.input.id} already exists!`);if(!isValidDocumentId(t.input.id))throw new DocumentIdValidationError(t.input.id);const rr=handleTargetNameCollisions({nodes:e.nodes,srcName:t.input.name,targetParentFolder:t.input.parentFolder||null}),ir=t.input.synchronizationUnits,lr=ir.find(fr=>!!e.nodes.find(hr=>isFileNode(hr)&&hr.synchronizationUnits.find(mr=>mr.syncId===fr.syncId)));if(lr)throw new Error(`A synchronization unit with Id ${lr.syncId} already exists`);const dr={id:t.input.id,name:rr,kind:"file",parentFolder:t.input.parentFolder??null,synchronizationUnits:ir,documentType:t.input.documentType};e.nodes.push(dr),tr==null||tr({type:"CREATE_CHILD_DOCUMENT",input:{id:t.input.id,documentType:t.input.documentType,synchronizationUnits:ir,document:t.input.document}})},addFolderOperation(e,t){if(e.nodes.find(rr=>rr.id===t.input.id))throw new Error(`Node with id ${t.input.id} already exists!`);const tr=handleTargetNameCollisions({nodes:e.nodes,srcName:t.input.name,targetParentFolder:t.input.parentFolder||null});e.nodes.push({...t.input,name:tr,kind:"folder",parentFolder:t.input.parentFolder??null})},deleteNodeOperation(e,t,tr){const rr=e.nodes.find(lr=>lr.id===t.input.id);if(!rr)throw new Error(`Node with id ${t.input.id} not found`);const ir=getDescendants(rr,e.nodes);e.nodes=e.nodes.filter(lr=>lr.id!==t.input.id&&!ir.find(dr=>dr.id===lr.id)),[rr,...ir].filter(lr=>isFileNode(lr)).forEach(lr=>{tr==null||tr({type:"DELETE_CHILD_DOCUMENT",input:{id:lr.id}})})},updateFileOperation(e,t){e.nodes=e.nodes.map(tr=>tr.id===t.input.id?{...tr,name:handleTargetNameCollisions({nodes:e.nodes,srcName:t.input.name??tr.name,targetParentFolder:t.input.parentFolder||null}),documentType:t.input.documentType??tr.documentType}:tr)},updateNodeOperation(e,t){e.nodes=e.nodes.map(tr=>tr.id===t.input.id?{...tr,name:handleTargetNameCollisions({nodes:e.nodes,srcName:t.input.name??tr.name,targetParentFolder:t.input.parentFolder||null}),parentFolder:t.input.parentFolder===null?null:tr.parentFolder}:tr)},copyNodeOperation(e,t,tr){const rr=e.nodes.find(hr=>hr.id===t.input.srcId);if(!rr)throw new Error(`Node with id ${t.input.srcId} not found`);if(!isValidDocumentId(t.input.targetId))throw new DocumentIdValidationError(t.input.targetId);if(e.nodes.find(hr=>hr.id===t.input.targetId))throw new Error(`Node with id ${t.input.targetId} already exists`);const lr=handleTargetNameCollisions({nodes:e.nodes,srcName:t.input.targetName||rr.name,targetParentFolder:t.input.targetParentFolder||null}),dr={...rr,id:t.input.targetId,slug:t.input.targetId,name:lr,parentFolder:t.input.targetParentFolder||null},fr=isFileNode(dr);if(fr){const hr=t.input.synchronizationUnits;if(!t.input.synchronizationUnits)throw new Error("Synchronization units were not provided");const mr=hr.find(gr=>!!e.nodes.find(yr=>isFileNode(yr)&&yr.synchronizationUnits.find(_r=>_r.syncId===gr.syncId)));if(mr)throw new Error(`A synchronization unit with Id ${mr.syncId} already exists`);dr.synchronizationUnits=hr}e.nodes.push(dr),fr&&(tr==null||tr({type:"COPY_CHILD_DOCUMENT",input:{id:t.input.srcId,newId:t.input.targetId,synchronizationUnits:dr.synchronizationUnits}}))},moveNodeOperation(e,t){if(t.input.srcFolder===t.input.targetParentFolder)throw new Error("Circular Reference Error: Attempting to move a node to its current parent folder");const tr=e.nodes.find(ir=>ir.id===t.input.srcFolder);if(!tr)throw new Error(`Node with id ${t.input.srcFolder} not found`);const rr=handleTargetNameCollisions({nodes:e.nodes,srcName:tr.name,targetParentFolder:t.input.targetParentFolder||null});if(isFolderNode(tr)&&getDescendants(tr,e.nodes).find(lr=>lr.id===t.input.targetParentFolder))throw new Error("Circular Reference Error: Cannot move a folder to one of its descendants");e.nodes=e.nodes.map(ir=>ir.id===t.input.srcFolder?{...ir,name:rr,parentFolder:t.input.targetParentFolder||null}:ir)}},stateReducer=(e,t,tr)=>{if(isDocumentAction(t))return e;switch(t.type){case"ADD_FILE":AddFileInputSchema().parse(t.input),reducer$1.addFileOperation(e[t.scope],t,tr);break;case"ADD_FOLDER":AddFolderInputSchema().parse(t.input),reducer$1.addFolderOperation(e[t.scope],t,tr);break;case"DELETE_NODE":DeleteNodeInputSchema().parse(t.input),reducer$1.deleteNodeOperation(e[t.scope],t,tr);break;case"UPDATE_FILE":UpdateFileInputSchema().parse(t.input),reducer$1.updateFileOperation(e[t.scope],t,tr);break;case"UPDATE_NODE":UpdateNodeInputSchema().parse(t.input),reducer$1.updateNodeOperation(e[t.scope],t,tr);break;case"COPY_NODE":CopyNodeInputSchema().parse(t.input),reducer$1.copyNodeOperation(e[t.scope],t,tr);break;case"MOVE_NODE":MoveNodeInputSchema().parse(t.input),reducer$1.moveNodeOperation(e[t.scope],t,tr);break;case"SET_DRIVE_NAME":SetDriveNameInputSchema().parse(t.input),reducer$2.setDriveNameOperation(e[t.scope],t,tr);break;case"SET_DRIVE_ICON":SetDriveIconInputSchema().parse(t.input),reducer$2.setDriveIconOperation(e[t.scope],t,tr);break;case"SET_SHARING_TYPE":SetSharingTypeInputSchema().parse(t.input),reducer$2.setSharingTypeOperation(e[t.scope],t,tr);break;case"SET_AVAILABLE_OFFLINE":SetAvailableOfflineInputSchema().parse(t.input),reducer$2.setAvailableOfflineOperation(e[t.scope],t,tr);break;case"ADD_LISTENER":AddListenerInputSchema().parse(t.input),reducer$2.addListenerOperation(e[t.scope],t,tr);break;case"REMOVE_LISTENER":RemoveListenerInputSchema().parse(t.input),reducer$2.removeListenerOperation(e[t.scope],t,tr);break;case"ADD_TRIGGER":AddTriggerInputSchema().parse(t.input),reducer$2.addTriggerOperation(e[t.scope],t,tr);break;case"REMOVE_TRIGGER":RemoveTriggerInputSchema().parse(t.input),reducer$2.removeTriggerOperation(e[t.scope],t,tr);break;default:return e}},reducer=createReducer(stateReducer),initialGlobalState={name:"",nodes:[],icon:null},initialLocalState={listeners:[],triggers:[],sharingType:"private",availableOffline:!1},utils$1={fileExtension:"phdd",createState(e){return{global:{...initialGlobalState,...e==null?void 0:e.global},local:{...initialLocalState,...e==null?void 0:e.local}}},createExtendedState(e){return baseCreateExtendedState({...e},utils$1.createState)},createDocument(e){const t=baseCreateDocument(utils$1.createExtendedState(e),utils$1.createState);return t.header.documentType=driveDocumentType,t.header.id=generateId$1(),t},saveToFile(e,t,tr){return baseSaveToFile(e,t,"phdd",tr)},saveToFileHandle(e,t){return baseSaveToFileHandle(e,t)},loadFromFile(e){return baseLoadFromFile(e,reducer)},loadFromInput(e){return baseLoadFromInput(e,reducer)}},createDocument=utils$1.createDocument,setDriveName=e=>createAction("SET_DRIVE_NAME",{...e},void 0,SetDriveNameInputSchema,"global"),setDriveIcon=e=>createAction("SET_DRIVE_ICON",{...e},void 0,SetDriveIconInputSchema,"global"),setSharingType=e=>createAction("SET_SHARING_TYPE",{...e},void 0,SetSharingTypeInputSchema,"local"),setAvailableOffline=e=>createAction("SET_AVAILABLE_OFFLINE",{...e},void 0,SetAvailableOfflineInputSchema,"local"),addListener=e=>createAction("ADD_LISTENER",{...e},void 0,AddListenerInputSchema,"local"),removeListener=e=>createAction("REMOVE_LISTENER",{...e},void 0,RemoveListenerInputSchema,"local"),addTrigger=e=>createAction("ADD_TRIGGER",{...e},void 0,AddTriggerInputSchema,"local"),removeTrigger=e=>createAction("REMOVE_TRIGGER",{...e},void 0,RemoveTriggerInputSchema,"local"),DocumentDriveActions=Object.freeze(Object.defineProperty({__proto__:null,addFile,addFolder,addListener,addTrigger,copyNode,deleteNode,moveNode,removeListener,removeTrigger,setAvailableOffline,setDriveIcon,setDriveName,setSharingType,updateFile,updateNode},Symbol.toStringTag,{value:"Module"})),utils={...utils$1,...customUtils},actions={...actions$2,...DocumentDriveActions},module={reducer,actions,utils,documentModel},driveDocumentModelModule=module,LogLevels={verbose:1,debug:2,info:3,warn:4,error:5,silent:6};function isLogLevel(e){return typeof e=="string"&&e in LogLevels}var define_process_env_default={},Zi,Ia,Ji,Yi,el;class ConsoleLogger{constructor(t,tr){bs(this,Yi);bs(this,Zi);bs(this,Ia,"env");bs(this,Ji);gs(this,Zi,(t||[]).map(rr=>`[${rr}]`)),gs(this,Ji,tr),this.log=this.log.bind(this),this.info=this.info.bind(this),this.warn=this.warn.bind(this),this.error=this.error.bind(this),this.debug=this.debug.bind(this),this.verbose=this.verbose.bind(this)}get level(){return xr(this,Ia)}set level(t){if(t!=="env"&&!isLogLevel(t))throw new Error(`Invalid log level: ${JSON.stringify(t)}.
|
|
230
|
+
}`,examples:[]},local:{schema:"",initialValue:"{}",examples:[]}}}]},documentModelDocumentModelModule={reducer:reducer$3,documentModel:documentModelState,actions:{...creators,...actions$1},utils:{...documentModelUtils,...customUtils$1}},isDefinedNonNullAny=e=>e!=null;anyType().refine(e=>isDefinedNonNullAny(e));const TransmitterTypeSchema=enumType(["Internal","MatrixConnect","PullResponder","RESTWebhook","SecureConnect","SwitchboardPush"]),TriggerTypeSchema=enumType(["PullResponder"]);function AddFileInputSchema(){return objectType({document:unknownType().nullish(),documentType:stringType(),id:stringType(),name:stringType(),parentFolder:stringType().nullish(),synchronizationUnits:arrayType(SynchronizationUnitSchema())})}function AddFolderInputSchema(){return objectType({id:stringType(),name:stringType(),parentFolder:stringType().nullish()})}function AddListenerInputSchema(){return objectType({listener:ListenerSchema()})}function AddTriggerInputSchema(){return objectType({trigger:TriggerSchema()})}function CopyNodeInputSchema(){return objectType({srcId:stringType(),synchronizationUnits:arrayType(SynchronizationUnitSchema()).nullish(),targetId:stringType(),targetName:stringType().nullish(),targetParentFolder:stringType().nullish()})}function DeleteNodeInputSchema(){return objectType({id:stringType()})}function ListenerSchema(){return objectType({__typename:literalType("Listener").optional(),block:booleanType(),callInfo:ListenerCallInfoSchema().nullable(),filter:ListenerFilterSchema(),label:stringType().nullable(),listenerId:stringType(),system:booleanType()})}function ListenerCallInfoSchema(){return objectType({__typename:literalType("ListenerCallInfo").optional(),data:stringType().nullable(),name:stringType().nullable(),transmitterType:TransmitterTypeSchema.nullable()})}function ListenerFilterSchema(){return objectType({__typename:literalType("ListenerFilter").optional(),branch:arrayType(stringType()).nullable(),documentId:arrayType(stringType()).nullable(),documentType:arrayType(stringType()),scope:arrayType(stringType()).nullable()})}function MoveNodeInputSchema(){return objectType({srcFolder:stringType(),targetParentFolder:stringType().nullish()})}function PullResponderTriggerDataSchema(){return objectType({__typename:literalType("PullResponderTriggerData").optional(),interval:stringType(),listenerId:stringType(),url:stringType()})}function RemoveListenerInputSchema(){return objectType({listenerId:stringType()})}function RemoveTriggerInputSchema(){return objectType({triggerId:stringType()})}function SetAvailableOfflineInputSchema(){return objectType({availableOffline:booleanType()})}function SetDriveIconInputSchema(){return objectType({icon:stringType()})}function SetDriveNameInputSchema(){return objectType({name:stringType()})}function SetSharingTypeInputSchema(){return objectType({type:stringType()})}function SynchronizationUnitSchema(){return objectType({__typename:literalType("SynchronizationUnit").optional(),branch:stringType(),scope:stringType(),syncId:stringType()})}function TriggerSchema(){return objectType({__typename:literalType("Trigger").optional(),data:TriggerDataSchema().nullable(),id:stringType(),type:TriggerTypeSchema})}function TriggerDataSchema(){return PullResponderTriggerDataSchema()}function UpdateFileInputSchema(){return objectType({documentType:stringType().nullish(),id:stringType(),name:stringType().nullish(),parentFolder:stringType().nullish()})}function UpdateNodeInputSchema(){return objectType({id:stringType(),name:stringType().nullish(),parentFolder:stringType().nullish()})}const reducer$2={setDriveNameOperation(e,t,tr){e.name=t.input.name},setDriveIconOperation(e,t,tr){e.icon=t.input.icon},setSharingTypeOperation(e,t,tr){e.sharingType=t.input.type},setAvailableOfflineOperation(e,t,tr){e.availableOffline=t.input.availableOffline},addListenerOperation(e,t,tr){if(e.listeners.find(rr=>rr.listenerId===t.input.listener.listenerId))throw new Error(`A listener with Id: ${t.input.listener.listenerId} already exists`);e.listeners.push(t.input.listener)},removeListenerOperation(e,t,tr){e.listeners=e.listeners.filter(rr=>rr.listenerId!==t.input.listenerId)},addTriggerOperation(e,t,tr){if(e.triggers.find(rr=>rr.id===t.input.trigger.id))throw new Error(`A trigger with Id: ${t.input.trigger.id} already exists`);e.triggers.push(t.input.trigger)},removeTriggerOperation(e,t,tr){e.triggers=e.triggers.filter(rr=>rr.id!==t.input.triggerId)}};class DocumentModelNotFoundError extends Error{constructor(tr,rr){super(`Document model "${tr}" not found`,{cause:rr});Rs(this,"id");this.id=tr}}class OperationError extends Error{constructor(tr,rr,ir,lr){super(ir,{cause:lr??rr});Rs(this,"status");Rs(this,"operation");this.status=tr,this.operation=rr,lr instanceof Error&&(this.stack=lr.stack)}}class ConflictOperationError extends OperationError{constructor(t,tr){super("CONFLICT",tr,`Conflicting operation on index ${tr.index}`,{existingOperation:t,newOperation:tr})}}class DocumentIdValidationError extends Error{constructor(t){super(`Invalid document id: ${t}`)}}class DocumentSlugValidationError extends Error{constructor(t){super(`Invalid slug: ${t}`)}}class DocumentAlreadyExistsError extends Error{constructor(tr){super(`Document with id ${tr} uses id or slug that already exists`);Rs(this,"documentId");this.documentId=tr}}class DocumentNotFoundError extends Error{constructor(tr){super(`Document with id ${tr} not found`);Rs(this,"documentId");this.documentId=tr}}class SynchronizationUnitNotFoundError extends Error{constructor(tr,rr){super(tr);Rs(this,"syncUnitId");this.syncUnitId=rr}}const isValidDocumentId=e=>e&&e.length>0&&/^[a-zA-Z0-9_-]+$/.test(e),isValidSlug=e=>e&&e.length>0&&/^[a-zA-Z0-9_-]+$/.test(e),addFile=e=>createAction("ADD_FILE",{...e},void 0,AddFileInputSchema,"global"),addFolder=e=>createAction("ADD_FOLDER",{...e},void 0,AddFolderInputSchema,"global"),deleteNode=e=>createAction("DELETE_NODE",{...e},void 0,DeleteNodeInputSchema,"global"),updateFile=e=>createAction("UPDATE_FILE",{...e},void 0,UpdateFileInputSchema,"global"),updateNode=e=>createAction("UPDATE_NODE",{...e},void 0,UpdateNodeInputSchema,"global"),copyNode=e=>createAction("COPY_NODE",{...e},void 0,CopyNodeInputSchema,"global"),moveNode=e=>createAction("MOVE_NODE",{...e},void 0,MoveNodeInputSchema,"global");function isFileNode(e){return e.kind==="file"}function isFolderNode(e){return e.kind==="folder"}function getAncestors(e,t){if(e.parentFolder){const tr=t.find(rr=>rr.id===e.parentFolder);if(!tr)throw new Error(`Parent node with id ${e.parentFolder} not found`);return[tr,...getAncestors(tr,t)]}else return[]}function getDescendants(e,t){const tr=t.filter(ir=>ir.parentFolder===e.id),rr=tr.map(ir=>getDescendants(ir,t));return[...tr,...rr.flat()]}function generateNodesCopy(e,t,tr){const rr=tr.find(hr=>hr.id===e.srcId);if(!rr)throw new Error(`Node with id ${e.srcId} not found`);const ir=[{...rr,name:e.targetName||rr.name,parentFolder:e.targetParentFolder||null},...getDescendants(rr,tr)],lr={};e.targetParentFolder&&(lr[e.targetParentFolder]=e.targetParentFolder);const dr=hr=>{let mr=lr[hr];if(!mr){const gr=hr;mr=t(hr),lr[gr]=mr}return mr};return ir.map(hr=>({srcId:hr.id,targetId:dr(hr.id),targetName:hr.name,targetParentFolder:hr.parentFolder?dr(hr.parentFolder):null,synchronizationUnits:isFileNode(hr)?hr.synchronizationUnits.map(mr=>({...mr,syncId:generateSynchronizationUnitId(tr)})):void 0}))}function generateSynchronizationUnitId(e){let t="";for(;!t||e.find(tr=>isFileNode(tr)&&tr.synchronizationUnits.find(rr=>rr.syncId===t));)t=generateId$1();return t}function generateSynchronizationUnits(e,t,tr="main"){return t.map(rr=>({scope:rr,branch:tr,syncId:generateSynchronizationUnitId(e.nodes)}))}function generateAddNodeAction(e,t,tr){return addFile({...t,synchronizationUnits:generateSynchronizationUnits(e,tr)})}function generateCopyNodeAction(e,t){const tr=e.nodes.find(ir=>ir.id===t.srcId);if(!tr)throw new Error(`Node with id ${t.srcId} not found`);let rr;return isFileNode(tr)&&(rr=tr.synchronizationUnits.map(ir=>({...ir,syncId:generateSynchronizationUnitId(e.nodes)}))),copyNode({...t,synchronizationUnits:rr})}function getNextCopyNumber(e,t){let tr=0;const rr=new RegExp(`^${escapeRegExp(t)} \\(copy\\)(?: (\\d+))?$`);for(const ir of e){const lr=ir.match(rr);if(lr){const dr=lr[1]?parseInt(lr[1],10):1;dr>tr&&(tr=dr)}}return tr+1}function escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function handleTargetNameCollisions(e){const{nodes:t,targetParentFolder:tr,srcName:rr}=e,ir=t.filter(fr=>tr===""?fr.parentFolder===null:fr.parentFolder===tr).map(fr=>fr.name);return ir.includes(rr)?`${rr} (copy) ${getNextCopyNumber(ir,rr)}`:rr}const customUtils=Object.freeze(Object.defineProperty({__proto__:null,escapeRegExp,generateAddNodeAction,generateCopyNodeAction,generateNodesCopy,generateSynchronizationUnitId,generateSynchronizationUnits,getAncestors,getDescendants,getNextCopyNumber,handleTargetNameCollisions,isFileNode,isFolderNode},Symbol.toStringTag,{value:"Module"})),reducer$1={addFileOperation(e,t,tr){if(e.nodes.find(fr=>fr.id===t.input.id))throw new Error(`Node with id ${t.input.id} already exists!`);if(!isValidDocumentId(t.input.id))throw new DocumentIdValidationError(t.input.id);const rr=handleTargetNameCollisions({nodes:e.nodes,srcName:t.input.name,targetParentFolder:t.input.parentFolder||null}),ir=t.input.synchronizationUnits,lr=ir.find(fr=>!!e.nodes.find(hr=>isFileNode(hr)&&hr.synchronizationUnits.find(mr=>mr.syncId===fr.syncId)));if(lr)throw new Error(`A synchronization unit with Id ${lr.syncId} already exists`);const dr={id:t.input.id,name:rr,kind:"file",parentFolder:t.input.parentFolder??null,synchronizationUnits:ir,documentType:t.input.documentType};e.nodes.push(dr),tr==null||tr({type:"CREATE_CHILD_DOCUMENT",input:{id:t.input.id,documentType:t.input.documentType,synchronizationUnits:ir,document:t.input.document}})},addFolderOperation(e,t){if(e.nodes.find(rr=>rr.id===t.input.id))throw new Error(`Node with id ${t.input.id} already exists!`);const tr=handleTargetNameCollisions({nodes:e.nodes,srcName:t.input.name,targetParentFolder:t.input.parentFolder||null});e.nodes.push({...t.input,name:tr,kind:"folder",parentFolder:t.input.parentFolder??null})},deleteNodeOperation(e,t,tr){const rr=e.nodes.find(lr=>lr.id===t.input.id);if(!rr)throw new Error(`Node with id ${t.input.id} not found`);const ir=getDescendants(rr,e.nodes);e.nodes=e.nodes.filter(lr=>lr.id!==t.input.id&&!ir.find(dr=>dr.id===lr.id)),[rr,...ir].filter(lr=>isFileNode(lr)).forEach(lr=>{tr==null||tr({type:"DELETE_CHILD_DOCUMENT",input:{id:lr.id}})})},updateFileOperation(e,t){e.nodes=e.nodes.map(tr=>tr.id===t.input.id?{...tr,name:handleTargetNameCollisions({nodes:e.nodes,srcName:t.input.name??tr.name,targetParentFolder:t.input.parentFolder||null}),documentType:t.input.documentType??tr.documentType}:tr)},updateNodeOperation(e,t){e.nodes=e.nodes.map(tr=>tr.id===t.input.id?{...tr,name:handleTargetNameCollisions({nodes:e.nodes,srcName:t.input.name??tr.name,targetParentFolder:t.input.parentFolder||null}),parentFolder:t.input.parentFolder===null?null:tr.parentFolder}:tr)},copyNodeOperation(e,t,tr){const rr=e.nodes.find(hr=>hr.id===t.input.srcId);if(!rr)throw new Error(`Node with id ${t.input.srcId} not found`);if(!isValidDocumentId(t.input.targetId))throw new DocumentIdValidationError(t.input.targetId);if(e.nodes.find(hr=>hr.id===t.input.targetId))throw new Error(`Node with id ${t.input.targetId} already exists`);const lr=handleTargetNameCollisions({nodes:e.nodes,srcName:t.input.targetName||rr.name,targetParentFolder:t.input.targetParentFolder||null}),dr={...rr,id:t.input.targetId,slug:t.input.targetId,name:lr,parentFolder:t.input.targetParentFolder||null},fr=isFileNode(dr);if(fr){const hr=t.input.synchronizationUnits;if(!t.input.synchronizationUnits)throw new Error("Synchronization units were not provided");const mr=hr.find(gr=>!!e.nodes.find(yr=>isFileNode(yr)&&yr.synchronizationUnits.find(_r=>_r.syncId===gr.syncId)));if(mr)throw new Error(`A synchronization unit with Id ${mr.syncId} already exists`);dr.synchronizationUnits=hr}e.nodes.push(dr),fr&&(tr==null||tr({type:"COPY_CHILD_DOCUMENT",input:{id:t.input.srcId,newId:t.input.targetId,synchronizationUnits:dr.synchronizationUnits}}))},moveNodeOperation(e,t){if(t.input.srcFolder===t.input.targetParentFolder)throw new Error("Circular Reference Error: Attempting to move a node to its current parent folder");const tr=e.nodes.find(ir=>ir.id===t.input.srcFolder);if(!tr)throw new Error(`Node with id ${t.input.srcFolder} not found`);const rr=handleTargetNameCollisions({nodes:e.nodes,srcName:tr.name,targetParentFolder:t.input.targetParentFolder||null});if(isFolderNode(tr)&&getDescendants(tr,e.nodes).find(lr=>lr.id===t.input.targetParentFolder))throw new Error("Circular Reference Error: Cannot move a folder to one of its descendants");e.nodes=e.nodes.map(ir=>ir.id===t.input.srcFolder?{...ir,name:rr,parentFolder:t.input.targetParentFolder||null}:ir)}},stateReducer=(e,t,tr)=>{if(isDocumentAction(t))return e;switch(t.type){case"ADD_FILE":AddFileInputSchema().parse(t.input),reducer$1.addFileOperation(e[t.scope],t,tr);break;case"ADD_FOLDER":AddFolderInputSchema().parse(t.input),reducer$1.addFolderOperation(e[t.scope],t,tr);break;case"DELETE_NODE":DeleteNodeInputSchema().parse(t.input),reducer$1.deleteNodeOperation(e[t.scope],t,tr);break;case"UPDATE_FILE":UpdateFileInputSchema().parse(t.input),reducer$1.updateFileOperation(e[t.scope],t,tr);break;case"UPDATE_NODE":UpdateNodeInputSchema().parse(t.input),reducer$1.updateNodeOperation(e[t.scope],t,tr);break;case"COPY_NODE":CopyNodeInputSchema().parse(t.input),reducer$1.copyNodeOperation(e[t.scope],t,tr);break;case"MOVE_NODE":MoveNodeInputSchema().parse(t.input),reducer$1.moveNodeOperation(e[t.scope],t,tr);break;case"SET_DRIVE_NAME":SetDriveNameInputSchema().parse(t.input),reducer$2.setDriveNameOperation(e[t.scope],t,tr);break;case"SET_DRIVE_ICON":SetDriveIconInputSchema().parse(t.input),reducer$2.setDriveIconOperation(e[t.scope],t,tr);break;case"SET_SHARING_TYPE":SetSharingTypeInputSchema().parse(t.input),reducer$2.setSharingTypeOperation(e[t.scope],t,tr);break;case"SET_AVAILABLE_OFFLINE":SetAvailableOfflineInputSchema().parse(t.input),reducer$2.setAvailableOfflineOperation(e[t.scope],t,tr);break;case"ADD_LISTENER":AddListenerInputSchema().parse(t.input),reducer$2.addListenerOperation(e[t.scope],t,tr);break;case"REMOVE_LISTENER":RemoveListenerInputSchema().parse(t.input),reducer$2.removeListenerOperation(e[t.scope],t,tr);break;case"ADD_TRIGGER":AddTriggerInputSchema().parse(t.input),reducer$2.addTriggerOperation(e[t.scope],t,tr);break;case"REMOVE_TRIGGER":RemoveTriggerInputSchema().parse(t.input),reducer$2.removeTriggerOperation(e[t.scope],t,tr);break;default:return e}},reducer=createReducer(stateReducer),initialGlobalState={name:"",nodes:[],icon:null},initialLocalState={listeners:[],triggers:[],sharingType:"private",availableOffline:!1},utils$1={fileExtension:"phdd",createState(e){return{global:{...initialGlobalState,...e==null?void 0:e.global},local:{...initialLocalState,...e==null?void 0:e.local}}},createExtendedState(e){return baseCreateExtendedState({...e},utils$1.createState)},createDocument(e){const t=baseCreateDocument(utils$1.createExtendedState(e),utils$1.createState);return t.header.documentType=driveDocumentType,t.header.id=generateId$1(),t},saveToFile(e,t,tr){return baseSaveToFile(e,t,"phdd",tr)},saveToFileHandle(e,t){return baseSaveToFileHandle(e,t)},loadFromFile(e){return baseLoadFromFile(e,reducer)},loadFromInput(e){return baseLoadFromInput(e,reducer)}},createDocument=utils$1.createDocument,setDriveName=e=>createAction("SET_DRIVE_NAME",{...e},void 0,SetDriveNameInputSchema,"global"),setDriveIcon=e=>createAction("SET_DRIVE_ICON",{...e},void 0,SetDriveIconInputSchema,"global"),setSharingType=e=>createAction("SET_SHARING_TYPE",{...e},void 0,SetSharingTypeInputSchema,"local"),setAvailableOffline=e=>createAction("SET_AVAILABLE_OFFLINE",{...e},void 0,SetAvailableOfflineInputSchema,"local"),addListener=e=>createAction("ADD_LISTENER",{...e},void 0,AddListenerInputSchema,"local"),removeListener=e=>createAction("REMOVE_LISTENER",{...e},void 0,RemoveListenerInputSchema,"local"),addTrigger=e=>createAction("ADD_TRIGGER",{...e},void 0,AddTriggerInputSchema,"local"),removeTrigger=e=>createAction("REMOVE_TRIGGER",{...e},void 0,RemoveTriggerInputSchema,"local"),DocumentDriveActions=Object.freeze(Object.defineProperty({__proto__:null,addFile,addFolder,addListener,addTrigger,copyNode,deleteNode,moveNode,removeListener,removeTrigger,setAvailableOffline,setDriveIcon,setDriveName,setSharingType,updateFile,updateNode},Symbol.toStringTag,{value:"Module"})),utils={...utils$1,...customUtils},actions={...actions$2,...DocumentDriveActions},module={reducer,actions,utils,documentModel},driveDocumentModelModule=module,LogLevels={verbose:1,debug:2,info:3,warn:4,error:5,silent:6};function isLogLevel(e){return typeof e=="string"&&e in LogLevels}var define_process_env_default={},Zi,Ia,Ji,Yi,el;class ConsoleLogger{constructor(t,tr){bs(this,Yi);bs(this,Zi);bs(this,Ia,"env");bs(this,Ji);gs(this,Zi,(t||[]).map(rr=>`[${rr}]`)),gs(this,Ji,tr),this.log=this.log.bind(this),this.info=this.info.bind(this),this.warn=this.warn.bind(this),this.error=this.error.bind(this),this.debug=this.debug.bind(this),this.verbose=this.verbose.bind(this)}get level(){return xr(this,Ia)}set level(t){if(t!=="env"&&!isLogLevel(t))throw new Error(`Invalid log level: ${JSON.stringify(t)}.
|
|
231
231
|
Must be one of ${Object.keys(LogLevels).concat(["env"]).join(", ")}.`);gs(this,Ia,t)}get errorHandler(){return xr(this,Ji)}set errorHandler(t){gs(this,Ji,t)}log(...t){return this.debug(...t)}verbose(...t){if(!(xr(this,Yi,el)>LogLevels.verbose))return this.debug(...t)}debug(...t){if(!(xr(this,Yi,el)>LogLevels.debug))return console.debug(...xr(this,Zi),...t)}info(...t){if(!(xr(this,Yi,el)>LogLevels.info))return console.info(...xr(this,Zi),...t)}warn(...t){if(!(xr(this,Yi,el)>LogLevels.warn))return console.warn(...xr(this,Zi),...t)}error(...t){if(!(xr(this,Yi,el)>LogLevels.error))return xr(this,Ji)&&xr(this,Ji).call(this,...t),console.error(...xr(this,Zi),...t)}}Zi=new WeakMap,Ia=new WeakMap,Ji=new WeakMap,Yi=new WeakSet,el=function(){if(xr(this,Ia)==="env"){const t=typeof process<"u"&&"env"in process?define_process_env_default.LOG_LEVEL:void 0;return!t||!(t in LogLevels)?LogLevels.debug:LogLevels[t]}return LogLevels[xr(this,Ia)]};const loggerInstance=new ConsoleLogger;let logLevel="env",errorHandler;loggerInstance.level=logLevel;loggerInstance.errorHandler=errorHandler;const logger=loggerInstance,setLogLevel=e=>{logLevel=e,loggerInstance.level=e},childLogger=e=>{const t=new ConsoleLogger(e);return t.level=logLevel,t.errorHandler=errorHandler,t};var RunAsap;(function(e){e.useMessageChannel=typeof MessageChannel>"u"?new Error("MessageChannel is not supported"):rr=>{const ir=new AbortController,lr=ir.signal,dr=new MessageChannel;return dr.port1.postMessage(null),dr.port2.addEventListener("message",()=>{rr(),dr.port1.close(),dr.port2.close()},{once:!0,signal:lr}),dr.port2.start(),()=>ir.abort()},e.usePostMessage=(()=>{const rr=typeof window=="object"&&window||typeof global=="object"&&global||typeof self=="object"&&self;if(!rr)return new Error("No global object found");const ir=rr;if(!ir.postMessage||!ir.addEventListener||ir.importScripts)return new Error("postMessage is not supported");let lr=0;const dr=new Map;function fr(){return lr===9007199254740991?0:++lr}const hr="com.usePostMessage"+Math.random();return ir.addEventListener("message",mr=>{const gr=mr;if(typeof gr.data!="string"||gr.source!==ir||!gr.data.startsWith(hr))return;const yr=gr.data.split(":").at(1);if(yr===void 0)return;const _r=+yr,br=dr.get(_r);br&&(br(),dr.delete(_r))},!1),mr=>{const gr=fr();return dr.set(gr,mr),ir.postMessage(hr+":"+gr,{targetOrigin:"*"}),()=>{dr.delete(gr)}}})(),e.useSetImmediate=typeof window<"u"?new Error("setImmediate is not supported on the browser"):typeof setImmediate>"u"?new Error("setImmediate is not supported"):rr=>{const ir=setImmediate(rr);return()=>clearImmediate(ir)},e.useSetTimeout=rr=>{const ir=setTimeout(rr,0);return()=>clearTimeout(ir)};function t(rr){return e.useSetImmediate instanceof Error?e.useMessageChannel instanceof Error?e.usePostMessage instanceof Error?e.useSetTimeout(rr):e.usePostMessage(rr):e.useMessageChannel(rr):e.useSetImmediate(rr)}e.runAsap=t;function tr(rr,ir=t){if(ir instanceof Error)throw new Error("queueMethod is not supported",{cause:ir});return new Promise((lr,dr)=>{ir(()=>{rr().then(lr).catch(dr)})})}e.runAsapAsync=tr})(RunAsap||(RunAsap={}));const runAsap=RunAsap.runAsap,runAsapAsync=RunAsap.runAsapAsync;function isDocumentDrive(e){return e.header.documentType===driveDocumentType}function mergeOperations(e,t){const tr=Object.keys(e).reduce((ir,lr)=>{var fr;const dr=lr;return ir[dr]=((fr=e[dr].at(-1))==null?void 0:fr.index)??0,ir},{}),rr=t.find(ir=>ir.index<(tr[ir.scope]??0));if(rr)throw new OperationError("ERROR",rr,`Tried to add operation with index ${rr.index} and document is at index ${tr[rr.scope]}`);return t.sort((ir,lr)=>ir.index-lr.index).reduce((ir,lr)=>{const dr=ir[lr.scope]||[];return{...ir,[lr.scope]:[...dr,lr]}},e)}function isBefore(e,t){return new Date(e)<new Date(t)}let createNanoEvents=()=>({emit(e,...t){for(let tr=this.events[e]||[],rr=0,ir=tr.length;rr<ir;rr++)tr[rr](...t)},events:{},on(e,t){var tr;return((tr=this.events)[e]||(tr[e]=[])).push(t),()=>{var rr;this.events[e]=(rr=this.events[e])==null?void 0:rr.filter(ir=>t!==ir)}}});function isOperationJob(e){return"operations"in e}function isActionJob(e){return"actions"in e}class MemoryQueue{constructor(t){Rs(this,"id");Rs(this,"blocked",!1);Rs(this,"deleted",!1);Rs(this,"items",[]);Rs(this,"dependencies",new Array);this.id=t}async setDeleted(t){this.deleted=t}async isDeleted(){return this.deleted}async addJob(t){return this.items.push(t),Promise.resolve()}async getNextJob(){const t=this.items.shift();return Promise.resolve(t)}async amountOfJobs(){return Promise.resolve(this.items.length)}getId(){return this.id}async setBlocked(t){this.blocked=t}async isBlocked(){return this.blocked}async getJobs(){return this.items}async addDependencies(t){this.dependencies.find(tr=>tr.jobId===t.jobId)||this.dependencies.push(t),this.isBlocked()||this.setBlocked(!0)}async removeDependencies(t){this.dependencies=this.dependencies.filter(tr=>tr.jobId!==t.jobId&&tr.driveId!==t.driveId),this.dependencies.length===0&&await this.setBlocked(!1)}}class BaseQueueManager{constructor(t=3,tr=0){Rs(this,"emitter",createNanoEvents());Rs(this,"ticker",0);Rs(this,"queues",[]);Rs(this,"workers");Rs(this,"timeout");Rs(this,"delegate");this.workers=t,this.timeout=tr}async init(t,tr){this.delegate=t;for(let rr=0;rr<this.workers;rr++)setTimeout(()=>this.processNextJob.bind(this)().catch(tr),100*rr);return Promise.resolve()}async addJob(t){if(!this.delegate)throw new Error("No server delegate defined");const tr=generateId$1(),rr=this.getQueue(t.driveId,t.documentId);if(await rr.isDeleted())throw new Error("Queue is deleted");if(t.documentId&&!await this.delegate.exists(t.documentId)&&!await rr.isBlocked()){await rr.setBlocked(!0);const mr=await this.getQueue(t.driveId).getJobs();for(const gr of mr)(isOperationJob(gr)?gr.operations:gr.actions).find(br=>{const wr=br.input;return br.type==="ADD_FILE"&&wr.id===t.documentId})&&await rr.addDependencies(gr)}const lr=isOperationJob(t)?t.operations:t.actions??[],dr=lr.filter(hr=>hr.type==="ADD_FILE");for(const hr of dr){const mr=hr.input;await this.getQueue(t.driveId,mr.id).addDependencies({jobId:tr,...t})}const fr=lr.filter(hr=>hr.type==="DELETE_NODE");for(const hr of fr){const mr=hr.input;await this.getQueue(t.driveId,mr.id).setDeleted(!0)}return await rr.addJob({jobId:tr,...t}),tr}getQueue(t,tr){const rr=this.getQueueId(t,tr);let ir=this.queues.find(lr=>lr.getId()===rr);return ir||(ir=new MemoryQueue(rr),this.queues.push(ir)),ir}removeQueue(t,tr){const rr=this.getQueueId(t,tr);this.queues=this.queues.filter(ir=>ir.getId()!==rr),this.emit("queueRemoved",rr)}getQueueByIndex(t){const tr=this.queues[t];return tr||null}getQueues(){return this.queues.map(t=>t.getId())}retryNextJob(t){const tr=t!==void 0?t:this.timeout;(tr>0?ir=>setTimeout(ir,tr):runAsap)(()=>this.processNextJob())}async findFirstNonEmptyQueue(t){const tr=this.queues.length;for(let rr=0;rr<tr;rr++){const ir=(t+rr)%tr,lr=this.queues[ir];if(lr&&await lr.amountOfJobs()>0)return ir}return null}async processNextJob(){if(!this.delegate)throw new Error("No server delegate defined");if(this.queues.length===0){this.retryNextJob();return}const t=this.queues[this.ticker];if(!t){this.ticker=0,this.retryNextJob();return}if(await t.amountOfJobs()===0){const lr=await this.findFirstNonEmptyQueue(this.ticker);lr!==null?(this.ticker=lr,this.retryNextJob(0)):this.retryNextJob();return}if(this.ticker=this.ticker===this.queues.length-1?0:this.ticker+1,await t.isBlocked()){this.retryNextJob();return}await t.setBlocked(!0);const ir=await t.getNextJob();if(!ir){this.retryNextJob();return}try{const lr=await this.delegate.processJob(ir),fr=(isOperationJob(ir)?ir.operations:ir.actions).filter(hr=>hr.type==="ADD_FILE");if(fr.length>0)for(const hr of fr)await this.getQueue(ir.driveId,hr.input.id).removeDependencies(ir);this.emit("jobCompleted",ir,lr)}catch(lr){logger.error("job failed",lr),this.emit("jobFailed",ir,lr)}finally{await t.setBlocked(!1),this.retryNextJob(0)}}emit(t,...tr){this.emitter.emit(t,...tr)}on(t,tr){return this.emitter.on(t,tr)}getQueueId(t,tr){return`queue:${t}${tr?`:${tr}`:""}`}}class ReadDriveError extends Error{}class ReadDriveNotFoundError extends ReadDriveError{constructor(t){super(`Read drive ${t} not found.`)}}class ReadDriveSlugNotFoundError extends ReadDriveError{constructor(t){super(`Read drive with slug ${t} not found.`)}}class ReadDocumentNotFoundError extends ReadDriveError{constructor(t,tr){super(`Document with id ${tr} not found on read drive ${t}.`)}}const versionInfo=Object.freeze({major:16,minor:11,patch:0,preReleaseTag:null});function devAssert(e,t){if(!!!e)throw new Error(t)}function isObjectLike(e){return typeof e=="object"&&e!==null}function invariant(e,t){if(!!!e)throw new Error(t??"Unexpected invariant triggered.")}const LineRegExp=/\r\n|[\n\r]/g;function getLocation(e,t){let tr=0,rr=1;for(const ir of e.body.matchAll(LineRegExp)){if(typeof ir.index=="number"||invariant(!1),ir.index>=t)break;tr=ir.index+ir[0].length,rr+=1}return{line:rr,column:t+1-tr}}function printLocation(e){return printSourceLocation(e.source,getLocation(e.source,e.start))}function printSourceLocation(e,t){const tr=e.locationOffset.column-1,rr="".padStart(tr)+e.body,ir=t.line-1,lr=e.locationOffset.line-1,dr=t.line+lr,fr=t.line===1?tr:0,hr=t.column+fr,mr=`${e.name}:${dr}:${hr}
|
|
232
232
|
`,gr=rr.split(/\r\n|[\n\r]/g),yr=gr[ir];if(yr.length>120){const _r=Math.floor(hr/80),br=hr%80,wr=[];for(let vr=0;vr<yr.length;vr+=80)wr.push(yr.slice(vr,vr+80));return mr+printPrefixedLines([[`${dr} |`,wr[0]],...wr.slice(1,_r+1).map(vr=>["|",vr]),["|","^".padStart(br)],["|",wr[_r+1]]])}return mr+printPrefixedLines([[`${dr-1} |`,gr[ir-1]],[`${dr} |`,yr],["|","^".padStart(hr)],[`${dr+1} |`,gr[ir+1]]])}function printPrefixedLines(e){const t=e.filter(([rr,ir])=>ir!==void 0),tr=Math.max(...t.map(([rr])=>rr.length));return t.map(([rr,ir])=>rr.padStart(tr)+(ir?" "+ir:"")).join(`
|
|
233
233
|
`)}function toNormalizedOptions(e){const t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}class GraphQLError extends Error{constructor(t,...tr){var rr,ir,lr;const{nodes:dr,source:fr,positions:hr,path:mr,originalError:gr,extensions:yr}=toNormalizedOptions(tr);super(t),this.name="GraphQLError",this.path=mr??void 0,this.originalError=gr??void 0,this.nodes=undefinedIfEmpty(Array.isArray(dr)?dr:dr?[dr]:void 0);const _r=undefinedIfEmpty((rr=this.nodes)===null||rr===void 0?void 0:rr.map(wr=>wr.loc).filter(wr=>wr!=null));this.source=fr??(_r==null||(ir=_r[0])===null||ir===void 0?void 0:ir.source),this.positions=hr??(_r==null?void 0:_r.map(wr=>wr.start)),this.locations=hr&&fr?hr.map(wr=>getLocation(fr,wr)):_r==null?void 0:_r.map(wr=>getLocation(wr.source,wr.start));const br=isObjectLike(gr==null?void 0:gr.extensions)?gr==null?void 0:gr.extensions:void 0;this.extensions=(lr=yr??br)!==null&&lr!==void 0?lr:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),gr!=null&&gr.stack?Object.defineProperty(this,"stack",{value:gr.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,GraphQLError):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(const tr of this.nodes)tr.loc&&(t+=`
|
|
@@ -475,14 +475,14 @@ ${t.join(`
|
|
|
475
475
|
error
|
|
476
476
|
}
|
|
477
477
|
}
|
|
478
|
-
`,{strands:rr.map(fr=>({...fr,operations:fr.operations.map(hr=>({...hr,input:stringify$2(hr.input)}))}))});if(!dr.pushUpdates)throw new Error("Couldn't update listener revision");return dr.pushUpdates}catch(dr){throw this.logger.error(dr),dr}}}var TransmitterType;(function(e){e[e.Internal=0]="Internal",e[e.SwitchboardPush=1]="SwitchboardPush",e[e.PullResponder=2]="PullResponder",e[e.SecureConnect=3]="SecureConnect",e[e.MatrixConnect=4]="MatrixConnect",e[e.RESTWebhook=5]="RESTWebhook"})(TransmitterType||(TransmitterType={}));const DefaultListenerManagerOptions={sequentialUpdates:!0};function filterOperationsByRevision(e,t){return t?Object.keys(e).reduce((tr,rr)=>{const ir=t[rr];return ir!==void 0&&(tr[rr]=e[rr].filter(lr=>lr.index<=ir)),tr},{global:[],local:[]}):e}function isAtRevision(e,t){return!t||Object.entries(t).find(([tr,rr])=>{const ir=e.operations[tr].at(-1);return rr===-1?ir!==void 0:(ir==null?void 0:ir.index)!==rr})===void 0}class BaseDocumentDriveServer{constructor(t,tr,rr,ir,lr,dr,fr,hr,mr){Rs(this,"logger",childLogger(["BaseDocumentDriveServer"]));Rs(this,"documentModelModules");Rs(this,"legacyStorage");Rs(this,"documentStorage");Rs(this,"cache");Rs(this,"queueManager");Rs(this,"eventEmitter");Rs(this,"options");Rs(this,"listenerManager");Rs(this,"synchronizationManager");Rs(this,"generateJwtHandler");Rs(this,"defaultDrivesManager");Rs(this,"defaultDrivesManagerDelegate",{detachDrive:this.detachDrive.bind(this),emit:(...t)=>this.eventEmitter.emit("defaultRemoteDrive",...t)});Rs(this,"queueDelegate",{exists:t=>this.documentStorage.exists(t),processOperationJob:async({driveId:t,documentId:tr,operations:rr,options:ir})=>!tr||t===tr?this.processDriveOperations(t,rr,ir):this.processOperations(t,tr,rr,ir),processActionJob:async({driveId:t,documentId:tr,actions:rr,options:ir})=>tr?this.processActions(t,tr,rr,ir):this.processDriveActions(t,rr,ir),processJob:async t=>{if(isOperationJob(t))return this.queueDelegate.processOperationJob(t);if(isActionJob(t))return this.queueDelegate.processActionJob(t);throw new Error("Unknown job type",t)}});Rs(this,"triggerMap",new Map);Rs(this,"initializePromise");this.documentModelModules=t,this.legacyStorage=tr,this.documentStorage=rr,this.cache=ir,this.queueManager=lr,this.eventEmitter=dr,this.synchronizationManager=fr,this.listenerManager=hr,this.options={...mr,defaultDrives:{...mr==null?void 0:mr.defaultDrives},listenerManager:{...DefaultListenerManagerOptions,...mr==null?void 0:mr.listenerManager},jwtHandler:(mr==null?void 0:mr.jwtHandler)===void 0?()=>Promise.resolve(""):mr.jwtHandler,taskQueueMethod:(mr==null?void 0:mr.taskQueueMethod)===void 0?RunAsap.runAsap:mr.taskQueueMethod},this.defaultDrivesManager=new DefaultDrivesManager(this,this.defaultDrivesManagerDelegate,mr),this.initializePromise=this._initialize()}get listeners(){return this.listenerManager}initialize(){return this.initializePromise}async _initialize(){await this.listenerManager.initialize(this.handleListenerError),await this.queueManager.init(this.queueDelegate,rr=>{this.logger.error("Error initializing queue manager",rr),t.push(rr)});try{await this.defaultDrivesManager.removeOldremoteDrives()}catch(rr){this.logger.error(rr)}const t=[],tr=await this.getDrives();for(const rr of tr)await this._initializeDrive(rr).catch(ir=>{this.logger.error(`Error initializing drive ${rr}`,ir),t.push(ir)});return this.options.defaultDrives.loadOnInit!==!1&&await this.defaultDrivesManager.initializeDefaultRemoteDrives(),t.length===0?null:t}setDocumentModelModules(t){this.documentModelModules=[...t],this.synchronizationManager.setDocumentModelModules([...t]),this.eventEmitter.emit("documentModelModules",[...t])}initializeDefaultRemoteDrives(){return this.defaultDrivesManager.initializeDefaultRemoteDrives()}getDefaultRemoteDrives(){return this.defaultDrivesManager.getDefaultRemoteDrives()}setDefaultDriveAccessLevel(t,tr){return this.defaultDrivesManager.setDefaultDriveAccessLevel(t,tr)}setAllDefaultDrivesAccessLevel(t){return this.defaultDrivesManager.setAllDefaultDrivesAccessLevel(t)}getOperationSource(t){return t.type==="local"?"push":"pull"}handleListenerError(t,tr,rr){this.logger.error(`Listener ${rr.listener.label??rr.listener.listenerId} error:`,t);const ir=t instanceof OperationError?t.status:"ERROR";this.synchronizationManager.updateSyncStatus(tr,{push:ir},t)}shouldSyncRemoteDrive(t){return t.state.local.availableOffline&&t.state.local.triggers.length>0}async startSyncRemoteDrive(t){let tr=this.triggerMap.get(t);const rr=await this.getSynchronizationUnitsIds(t),ir=await this.getDrive(t);for(const lr of ir.state.local.triggers)if(!(tr!=null&&tr.get(lr.id))){tr||(tr=new Map),this.synchronizationManager.updateSyncStatus(t,{pull:"SYNCING"});for(const dr of rr)this.synchronizationManager.updateSyncStatus(dr.syncId,{pull:"SYNCING"});if(PullResponderTransmitter.isPullResponderTrigger(lr)){let dr=!0;const fr=PullResponderTransmitter.setupPull(t,lr,this.saveStrand.bind(this),hr=>{const mr=hr instanceof OperationError?hr.status:"ERROR";this.synchronizationManager.updateSyncStatus(t,{pull:mr},hr),hr instanceof ClientError&&this.eventEmitter.emit("clientStrandsError",t,lr,hr.response.status,hr.message)},hr=>{const mr=hr.filter(yr=>yr.status!=="SUCCESS");mr.length<1&&this.synchronizationManager.updateSyncStatus(t,{pull:"SUCCESS"});const gr=hr.filter(yr=>yr.documentId!=="").map(yr=>yr.documentId);if(this.getSynchronizationUnitsIds(t,gr).then(yr=>{for(const _r of yr){const br=mr.find(wr=>wr.documentId===_r.documentId);br?this.synchronizationManager.updateSyncStatus(_r.syncId,{pull:br.status},br.error):this.synchronizationManager.updateSyncStatus(_r.syncId,{pull:"SUCCESS"})}}).catch(console.error),dr){dr=!1;const yr=ir.state.local.listeners.find(_r=>{var br;return lr.data.url===((br=_r.callInfo)==null?void 0:br.data)});yr&&this.getSynchronizationUnitsRevision(t,rr).then(_r=>{for(const br of _r)this.listenerManager.updateListenerRevision(yr.listenerId,t,br.syncId,br.revision).catch(this.logger.error)}).catch(this.logger.error)}},void 0,this.listeners);tr.set(lr.id,fr),this.triggerMap.set(t,tr)}}}async stopSyncRemoteDrive(t){const rr=(await this.getSynchronizationUnitsIds(t)).filter(lr=>lr.documentId!=="").map(lr=>lr.syncId),ir=this.triggerMap.get(t);ir==null||ir.forEach(lr=>lr()),this.synchronizationManager.updateSyncStatus(t,null);for(const lr of rr)this.synchronizationManager.updateSyncStatus(lr,null);return this.triggerMap.delete(t)}async _initializeDrive(t){var rr,ir,lr;const tr=await this.getDrive(t);this.logger.verbose(`[SYNC DEBUG] Initializing drive ${t} with slug "${tr.header.slug}"`),await this.synchronizationManager.initializeDriveSyncStatus(t,tr),this.shouldSyncRemoteDrive(tr)&&(this.logger.verbose(`[SYNC DEBUG] Starting sync for remote drive ${t}`),await this.startSyncRemoteDrive(t)),this.logger.verbose(`[SYNC DEBUG] Processing ${tr.state.local.listeners.length} listeners for drive ${t}`);for(const dr of tr.state.local.listeners)if(((rr=dr.callInfo)==null?void 0:rr.transmitterType)==="SwitchboardPush"){this.logger.verbose(`[SYNC DEBUG] Setting up SwitchboardPush listener ${dr.listenerId} for drive ${t}`);const fr=new SwitchboardPushTransmitter(dr.callInfo.data??"",this.listeners);this.logger.verbose(`[SYNC DEBUG] Created SwitchboardPush transmitter with URL: ${dr.callInfo.data||"none"}`),await this.listenerManager.setListener(t,{block:dr.block,driveId:tr.header.id,filter:{branch:dr.filter.branch??[],documentId:dr.filter.documentId??[],documentType:dr.filter.documentType??[],scope:dr.filter.scope??[]},listenerId:dr.listenerId,callInfo:dr.callInfo,system:dr.system,label:dr.label??"",transmitter:fr}).then(()=>{this.logger.verbose(`[SYNC DEBUG] Successfully set up listener ${dr.listenerId} for drive ${t}`)})}else if(((ir=dr.callInfo)==null?void 0:ir.transmitterType)==="PullResponder"){this.logger.verbose(`[SYNC DEBUG] Setting up PullResponder listener ${dr.listenerId} for drive ${t}`);const fr={driveId:t,listenerId:dr.listenerId,block:!1,filter:dr.filter,system:!1,label:`PullResponder #${dr.listenerId}`,callInfo:{data:"",name:"PullResponder",transmitterType:"PullResponder"}},hr=new PullResponderTransmitter(fr,this.listenerManager);fr.transmitter=hr,await this.listenerManager.setListener(t,fr)}else this.logger.error(`Skipping listener ${dr.listenerId} with unsupported type ${((lr=dr.callInfo)==null?void 0:lr.transmitterType)||"unknown"}`)}getSynchronizationUnits(t,tr,rr,ir,lr){return this.synchronizationManager.getSynchronizationUnits(t,tr,rr,ir,lr)}getSynchronizationUnitsIds(t,tr,rr,ir,lr){return this.synchronizationManager.getSynchronizationUnitsIds(t,tr,rr,ir,lr)}getOperationData(t,tr,rr){return this.synchronizationManager.getOperationData(t,tr,rr)}getSynchronizationUnitsRevision(t,tr){return this.synchronizationManager.getSynchronizationUnitsRevision(t,tr)}getDocumentModelModule(t){const tr=this.documentModelModules.find(rr=>rr.documentModel.id===t);if(!tr)throw new Error(`Document type ${t} not supported`);return tr}getDocumentModelModules(){return[...this.documentModelModules]}async addDrive(t,tr){const rr=createDocument({state:{global:{icon:t.global.icon??null,name:t.global.name},local:t.local??{}}});return t.id&&t.id.length>0&&(rr.header.id=t.id),t.slug&&t.slug.length>0&&(rr.header.slug=t.slug),tr&&(rr.header.meta={preferredEditor:tr}),await this.documentStorage.create(rr),t.slug&&t.slug.length>0&&await this.cache.deleteDriveBySlug(t.slug),await this._initializeDrive(rr.header.id),this.eventEmitter.emit("driveAdded",rr),rr}async addRemoteDrive(t,tr){var vr;await((vr=this.generateJwtHandler)==null?void 0:vr.call(this,t));const{id:rr,name:ir,slug:lr,icon:dr,meta:fr}=tr.expectedDriveInfo||await requestPublicDriveWithTokenFromReactor(t,this),{pullFilter:hr,pullInterval:mr,availableOffline:gr,sharingType:yr,listeners:_r,triggers:br}=tr,wr=await PullResponderTransmitter.createPullResponderTrigger(rr,t,{pullFilter:hr,pullInterval:mr},this.listeners);return await this.addDrive({id:rr,slug:lr,global:{name:ir,icon:dr},local:{triggers:[...br,wr],listeners:_r,availableOffline:gr,sharingType:yr}},fr==null?void 0:fr.preferredEditor)}async deleteDrive(t){const tr=await Promise.allSettled([this.stopSyncRemoteDrive(t),this.listenerManager.removeDrive(t),this.cache.deleteDrive(t),this.documentStorage.delete(t)]);this.eventEmitter.emit("driveDeleted",t),tr.forEach(rr=>{if(rr.status==="rejected")throw rr.reason})}async getDrives(){const t=[];let tr;do{const{documents:rr,nextCursor:ir}=await this.documentStorage.findByType("powerhouse/document-drive",100,tr);t.push(...rr),tr=ir}while(tr);return t}async getDrivesSlugs(){const t=await this.getDrives();return this.documentStorage.resolveSlugs(t)}async getDrive(t,tr){let rr;try{const dr=await this.cache.getDrive(t);if(dr&&isDocumentDrive(dr)&&(rr=dr,isAtRevision(rr,tr==null?void 0:tr.revisions)))return rr}catch(dr){this.logger.error("Error getting drive from cache",dr)}const ir=rr??await this.documentStorage.get(t),lr=this._buildDocument(ir,tr);if(isDocumentDrive(lr))return tr!=null&&tr.revisions||this.cache.setDrive(t,lr).catch(this.logger.error),lr;throw new Error(`Document with id ${t} is not a Document Drive`)}async getDriveBySlug(t,tr){try{const lr=await this.cache.getDriveBySlug(t);if(lr)return lr}catch(lr){this.logger.error("Error getting drive from cache",lr)}const rr=await this.documentStorage.getBySlug(t),ir=this._buildDocument(rr,tr);if(isDocumentDrive(ir))return this.cache.setDriveBySlug(t,ir).catch(this.logger.error),ir;throw new Error(`Document with slug ${t} is not a Document Drive`)}async getDriveIdBySlug(t){try{const rr=await this.cache.getDriveBySlug(t);if(rr)return rr.header.id}catch(rr){this.logger.error("Error getting drive from cache",rr)}return(await this.documentStorage.getBySlug(t)).header.id}async getDocument(t,tr,rr){let ir;try{if(ir=await this.cache.getDocument(tr),ir&&isAtRevision(ir,rr==null?void 0:rr.revisions))return ir}catch(fr){this.logger.error("Error getting document from cache",fr)}const lr=ir??await this.documentStorage.get(tr),dr=this._buildDocument(lr,rr);return rr!=null&&rr.revisions||this.cache.setDocument(tr,dr).catch(this.logger.error),dr}getDocuments(t){return this.documentStorage.getChildren(t)}async createDocument(t,tr){let rr;if(tr.document){if(tr.documentType!==tr.document.header.documentType)throw new Error(`Provided document is not ${tr.documentType}`);rr=this._buildDocument(tr.document).state}const ir=tr.document??this.getDocumentModelModule(tr.documentType).utils.createDocument();let lr;tr.id&&tr.id.length>0?tr.document?(lr=ir.header,ir.header.id=tr.id,this.logger.warn("Assigning an id to a document is deprecated. Use the header field instead.")):(this.logger.warn("Creating a document with an id is deprecated. Use the header field instead."),lr=createUnsignedHeader(),lr.id=tr.id,lr.documentType=tr.documentType):tr.header?(await validateHeader(tr.header),lr=tr.header):(lr=createUnsignedHeader(),lr.documentType=tr.documentType);const dr={header:lr,history:ir.history,operations:ir.operations,initialState:ir.initialState,clipboard:[],state:rr??ir.state};await this.documentStorage.create(dr);try{await this.documentStorage.addChild(t,lr.id)}catch(hr){this.logger.error("Error adding child document",hr);try{await this.documentStorage.delete(lr.id)}catch(mr){this.logger.error("FATAL: Could not revert document creation. This means that we created a document but failed to add it to the drive..",mr)}throw hr}for(const hr of tr.synchronizationUnits)this.synchronizationManager.updateSyncStatus(hr.syncId,{pull:this.triggerMap.get(t)?"INITIAL_SYNC":void 0,push:this.listenerManager.driveHasListeners(t)?"SUCCESS":void 0});const fr=Object.values(ir.operations).flat();return fr.length&&(isDocumentDrive(ir)?await this.legacyStorage.addDriveOperations(t,fr,ir):await this.legacyStorage.addDocumentOperations(t,lr.id,fr,ir)),ir}async deleteDocument(t,tr){try{const rr=await this.getSynchronizationUnitsIds(t,[tr]);for(const ir of rr)this.synchronizationManager.updateSyncStatus(ir.syncId,null);await this.listenerManager.removeSyncUnits(t,rr)}catch(rr){this.logger.warn("Error deleting document",rr)}return await this.cache.deleteDocument(tr),this.documentStorage.delete(tr)}async _processOperations(t,tr,rr,ir){const lr=[],dr=[],fr=await this._addDocumentResultingStage(rr,t,tr);let hr=this._buildDocument(fr),mr;const gr=groupOperationsByScope(ir);for(const yr of Object.keys(gr)){const _r=rr.operations[yr],br=removeExistingOperations(gr[yr]||[],_r);if(br.length<1)continue;const wr=garbageCollect(sortOperations(_r)),[vr,Sr]=attachBranch(wr,br),Mr=(Sr.length<1?vr:merge(wr,vr,reshuffleByTimestamp)).filter(Ar=>wr.length<1||precedes(wr[wr.length-1],Ar));for(const Ar of Mr){let kr=!1;if(Sr.length>0){const Or=ir.find(Dr=>Dr.hash===Ar.hash);kr=!Or||Or.index!==Ar.index||Or.skip!==Ar.skip}try{const Or=this.options.taskQueueMethod,Dr=()=>this._performOperation(t,tr,hr,Ar,kr),$r=await(Or?runAsapAsync(Dr,Or):Dr());hr=$r.document,dr.push(...$r.signals),lr.push($r.operation)}catch(Or){mr=Or instanceof OperationError?Or:new OperationError("ERROR",Ar,Or.message,Or.cause);break}}}return{document:hr,operationsApplied:lr,signals:dr,error:mr}}async _addDocumentResultingStage(t,tr,rr,ir){var fr,hr,mr,gr;const lr=(ir==null?void 0:ir.revisions)!==void 0?filterOperationsByRevision(t.operations,ir.revisions):t.operations,dr=garbageCollectDocumentOperations(lr);for(const yr of Object.keys(dr)){const _r=dr[yr].at(-1);_r&&!_r.resultingState&&(_r.resultingState=await(rr?(hr=(fr=this.legacyStorage).getOperationResultingState)==null?void 0:hr.call(fr,tr,rr,_r.index,_r.scope,"main"):(gr=(mr=this.legacyStorage).getDriveOperationResultingState)==null?void 0:gr.call(mr,tr,_r.index,_r.scope,"main")))}return{...t,operations:dr}}_buildDocument(t,tr){if(t.state&&(!tr||tr.checkHashes===!1)&&isAtRevision(t,tr==null?void 0:tr.revisions))return t;const rr=this.getDocumentModelModule(t.header.documentType),ir=(tr==null?void 0:tr.revisions)!==void 0?filterOperationsByRevision(t.operations,tr.revisions):t.operations,lr=garbageCollectDocumentOperations(ir);return replayDocument(t.initialState,lr,rr.reducer,void 0,t.header,void 0,{...tr,checkHashes:(tr==null?void 0:tr.checkHashes)??!0,reuseOperationResultingState:(tr==null?void 0:tr.checkHashes)??!0})}async _performOperation(t,tr,rr,ir,lr=!1){var vr,Sr,Ir,Mr;const dr=this.getDocumentModelModule(rr.header.documentType),fr=[];let hr=rr;const mr=ir.scope,yr=garbageCollectDocumentOperations({...rr.operations,[mr]:skipHeaderOperations(rr.operations[mr],ir)})[mr].at(-1);yr&&!yr.resultingState&&(yr.resultingState=await(tr?(Sr=(vr=this.legacyStorage).getOperationResultingState)==null?void 0:Sr.call(vr,t,tr,yr.index,yr.scope,"main"):(Mr=(Ir=this.legacyStorage).getDriveOperationResultingState)==null?void 0:Mr.call(Ir,t,yr.index,yr.scope,"main")));const _r=[];hr=dr.reducer(hr,ir,Ar=>{let kr;switch(Ar.type){case"CREATE_CHILD_DOCUMENT":kr=()=>this.createDocument(t,Ar.input);break;case"DELETE_CHILD_DOCUMENT":kr=()=>this.deleteDocument(t,Ar.input.id);break;case"COPY_CHILD_DOCUMENT":kr=()=>this.getDocument(t,Ar.input.id).then(Or=>{const Dr={...Or,header:{...Or.header,slug:Ar.input.newId}};return this.createDocument(t,{id:Ar.input.newId,documentType:Or.header.documentType,document:Dr,synchronizationUnits:Ar.input.synchronizationUnits})});break}kr&&_r.push(()=>kr().then(Or=>({signal:Ar,result:Or})))},{skip:ir.skip,reuseOperationResultingState:!0});const wr=hr.operations[ir.scope].filter(Ar=>Ar.index==ir.index&&Ar.skip==ir.skip).at(0);if(!wr)throw new OperationError("ERROR",ir,`Operation with index ${ir.index}:${ir.skip} was not applied.`);if(!wr.error&&wr.hash!==ir.hash&&!lr)throw new ConflictOperationError(ir,wr);for(const Ar of _r){const kr=await Ar();fr.push(kr)}return{document:hr,signals:fr,operation:wr}}addOperation(t,tr,rr,ir){return this.addOperations(t,tr,[rr],ir)}async _addOperations(t,tr,rr){if(this.legacyStorage.addDocumentOperationsWithTransaction)await this.legacyStorage.addDocumentOperationsWithTransaction(t,tr,rr);else{const ir=await this.documentStorage.get(tr),lr=await rr(ir);lr.operations.length>0&&await this.legacyStorage.addDocumentOperations(t,tr,lr.operations,lr.document)}}queueOperation(t,tr,rr,ir){return this.queueOperations(t,tr,[rr],ir)}async resultIfExistingOperations(t,tr,rr){try{const ir=await this.getDocument(t,tr);return rr.find(dr=>!dr.id||!ir.operations[dr.scope].find(fr=>fr.id===dr.id&&fr.index===dr.index&&fr.type===dr.type&&fr.hash===dr.hash))?void 0:{status:"SUCCESS",document:ir,operations:rr,signals:[]}}catch(ir){ir.message.includes(`Document with id ${tr} not found`)||console.error(ir);return}}async queueOperations(t,tr,rr,ir){const lr=await this.resultIfExistingOperations(t,tr,rr);if(lr)return lr;let dr;const fr=new Promise((hr,mr)=>{const gr=this.queueManager.on("jobCompleted",(_r,br)=>{_r.jobId===dr&&(gr(),yr(),hr(br))}),yr=this.queueManager.on("jobFailed",(_r,br)=>{_r.jobId===dr&&(gr(),yr(),mr(br))})});try{dr=await this.queueManager.addJob({driveId:t,documentId:tr,operations:rr,options:ir})}catch(hr){throw this.logger.error("Error adding job",hr),hr}return fr}async queueAction(t,tr,rr,ir){return this.queueActions(t,tr,[rr],ir)}async queueActions(t,tr,rr,ir){try{const lr=await this.queueManager.addJob({driveId:t,documentId:tr,actions:rr,options:ir});return await new Promise((dr,fr)=>{const hr=this.queueManager.on("jobCompleted",(gr,yr)=>{gr.jobId===lr&&(hr(),mr(),dr(yr))}),mr=this.queueManager.on("jobFailed",(gr,yr)=>{gr.jobId===lr&&(hr(),mr(),fr(yr))})})}catch(lr){throw this.logger.error("Error adding job",lr),lr}}async queueDriveAction(t,tr,rr){return this.queueDriveActions(t,[tr],rr)}async queueDriveActions(t,tr,rr){try{const ir=await this.queueManager.addJob({driveId:t,actions:tr,options:rr});return await new Promise((lr,dr)=>{const fr=this.queueManager.on("jobCompleted",(mr,gr)=>{mr.jobId===ir&&(fr(),hr(),lr(gr))}),hr=this.queueManager.on("jobFailed",(mr,gr)=>{mr.jobId===ir&&(fr(),hr(),dr(gr))})})}catch(ir){throw this.logger.error("Error adding drive job",ir),ir}}async addOperations(t,tr,rr,ir){return this.queueOperations(t,tr,rr,ir)}async processOperations(t,tr,rr,ir){const lr=await this.resultIfExistingOperations(t,tr,rr);if(lr)return lr;let dr;const fr=[],hr=[];let mr;try{await this._addOperations(t,tr,async Sr=>{const Ir=await this._processOperations(t,tr,Sr,rr);if(!Ir.document)throw this.logger.error("Invalid document"),Ir.error??new Error("Invalid document");return dr=Ir.document,mr=Ir.error,hr.push(...Ir.signals),fr.push(...Ir.operationsApplied),{operations:Ir.operationsApplied,document:Ir.document}}),dr&&this.cache.setDocument(tr,dr).catch(this.logger.error);const{scopes:gr,branches:yr}=fr.reduce((Sr,Ir)=>(Sr.scopes.includes(Ir.scope)||Sr.scopes.push(Ir.scope),Sr),{scopes:[],branches:["main"]}),_r=await this.getSynchronizationUnits(t,[tr],gr,yr),wr=fr.find(Sr=>!rr.find(Ir=>Ir.id===Sr.id&&Ir.index===Sr.index&&Ir.skip===Sr.skip&&Ir.hash===Sr.hash))?{type:"local"}:(ir==null?void 0:ir.source)??{type:"local"},vr=this.getOperationSource(wr);if(this.listenerManager.updateSynchronizationRevisions(t,_r,wr,()=>{this.synchronizationManager.updateSyncStatus(t,{[vr]:"SYNCING"});for(const Sr of _r)this.synchronizationManager.updateSyncStatus(Sr.syncId,{[vr]:"SYNCING"})},this.handleListenerError.bind(this),(ir==null?void 0:ir.forceSync)??wr.type==="local").then(Sr=>{Sr.length&&this.synchronizationManager.updateSyncStatus(t,{[vr]:"SUCCESS"});for(const Ir of _r)this.synchronizationManager.updateSyncStatus(Ir.syncId,{[vr]:"SUCCESS"})}).catch(Sr=>{this.logger.error("Non handled error updating sync revision",Sr),this.synchronizationManager.updateSyncStatus(t,{[vr]:"ERROR"},Sr);for(const Ir of _r)this.synchronizationManager.updateSyncStatus(Ir.syncId,{[vr]:"ERROR"},Sr)}),mr)throw mr;return this.eventEmitter.emit("documentOperationsAdded",t,tr,rr),this.eventEmitter.emit("operationsAdded",t,tr,rr),{status:"SUCCESS",document:dr,operations:fr,signals:hr}}catch(gr){const yr=gr instanceof OperationError?gr:new OperationError("ERROR",void 0,gr.message,gr.cause);return{status:yr.status,error:yr,document:dr,operations:fr,signals:hr}}}addDriveOperation(t,tr,rr){return this.addDriveOperations(t,[tr],rr)}async _addDriveOperations(t,tr){if(this.legacyStorage.addDriveOperationsWithTransaction)return this.legacyStorage.addDriveOperationsWithTransaction(t,tr);{const rr=await this.documentStorage.get(t),ir=await tr(rr);return ir.operations.length>0&&await this.legacyStorage.addDriveOperations(t,ir.operations,ir.document),ir}}queueDriveOperation(t,tr,rr){return this.queueDriveOperations(t,[tr],rr)}async resultIfExistingDriveOperations(t,tr){try{const rr=await this.getDrive(t);return tr.find(lr=>!lr.id||!rr.operations[lr.scope].find(dr=>dr.id===lr.id&&dr.index===lr.index&&dr.type===lr.type&&dr.hash===lr.hash))?void 0:{status:"SUCCESS",document:rr,operations:tr,signals:[]}}catch(rr){console.error(rr);return}}async queueDriveOperations(t,tr,rr){const ir=await this.resultIfExistingDriveOperations(t,tr);if(ir)return ir;try{const lr=await this.queueManager.addJob({driveId:t,operations:tr,options:rr});return await new Promise((dr,fr)=>{const hr=this.queueManager.on("jobCompleted",(gr,yr)=>{gr.jobId===lr&&(hr(),mr(),dr(yr))}),mr=this.queueManager.on("jobFailed",(gr,yr)=>{gr.jobId===lr&&(hr(),mr(),fr(yr))})})}catch(lr){throw this.logger.error("Error adding drive job",lr),lr}}async addDriveOperations(t,tr,rr){return this.queueDriveOperations(t,tr,rr)}async processDriveOperations(t,tr,rr){let ir;const lr=[],dr=[];let fr;const hr=await this.resultIfExistingDriveOperations(t,tr);if(hr)return hr;try{if(await this._addDriveOperations(t,async gr=>{const yr=await this._processOperations(t,void 0,gr,tr.slice());return ir=yr.document,lr.push(...yr.operationsApplied),dr.push(...yr.signals),fr=yr.error,{operations:yr.operationsApplied,document:yr.document}}),!ir||!isDocumentDrive(ir))throw fr??new Error("Invalid Document Drive document");this.cache.setDrive(t,ir).catch(this.logger.error);const mr=lr.filter(gr=>gr.scope==="global").slice().pop();if(mr){const yr=lr.find(br=>!tr.find(wr=>wr.id===br.id&&wr.index===br.index&&wr.skip===br.skip&&wr.hash===br.hash))?{type:"local"}:(rr==null?void 0:rr.source)??{type:"local"},_r=this.getOperationSource(yr);this.listenerManager.updateSynchronizationRevisions(t,[{syncId:"0",documentId:"",scope:"global",branch:"main",documentType:"powerhouse/document-drive",lastUpdated:mr.timestamp,revision:mr.index}],yr,()=>{this.synchronizationManager.updateSyncStatus(t,{[_r]:"SYNCING"})},this.handleListenerError.bind(this),(rr==null?void 0:rr.forceSync)??yr.type==="local").then(br=>{br.length&&this.synchronizationManager.updateSyncStatus(t,{[_r]:"SUCCESS"})}).catch(br=>{this.logger.error("Non handled error updating sync revision",br),this.synchronizationManager.updateSyncStatus(t,{[_r]:"ERROR"},br)})}if(this.shouldSyncRemoteDrive(ir)?this.startSyncRemoteDrive(t):this.stopSyncRemoteDrive(t),fr)throw fr;return this.eventEmitter.emit("driveOperationsAdded",t,tr),this.eventEmitter.emit("operationsAdded",t,null,tr),{status:"SUCCESS",document:ir,operations:lr,signals:dr}}catch(mr){const gr=mr instanceof OperationError?mr:new OperationError("ERROR",void 0,mr.message,mr.cause);return{status:gr.status,error:gr,document:ir,operations:lr,signals:dr}}}_buildOperations(t,tr){const rr=[],{reducer:ir}=this.getDocumentModelModule(t.header.documentType);for(const lr of tr){t=ir(t,lr);const dr=t.operations[lr.scope].slice().pop();if(!dr)throw new Error("Error creating operations");rr.push(dr)}return rr}async addAction(t,tr,rr,ir){return this.addActions(t,tr,[rr],ir)}async addActions(t,tr,rr,ir){return this.queueActions(t,tr,rr,ir)}async processActions(t,tr,rr,ir){const lr=await this.getDocument(t,tr),dr=this._buildOperations(lr,rr);return this.processOperations(t,tr,dr,ir)}async addDriveAction(t,tr,rr){return this.addDriveActions(t,[tr],rr)}async addDriveActions(t,tr,rr){return this.queueDriveActions(t,tr,rr)}async processDriveActions(t,tr,rr){const ir=await this.getDrive(t),lr=this._buildOperations(ir,tr);return this.processDriveOperations(t,lr,rr)}async detachDrive(t){const tr=await this.getDrive(t),rr=tr.state.local.listeners||[],ir=tr.state.local.triggers||[];for(const lr of rr)await this.addDriveAction(t,removeListener({listenerId:lr.listenerId}));for(const lr of ir)await this.addDriveAction(t,removeTrigger({triggerId:lr.id}));await this.addDriveAction(t,setSharingType({type:"LOCAL"}))}getSyncStatus(t){return this.synchronizationManager.getSyncStatus(t)}on(t,tr){return this.eventEmitter.on(t,tr)}emit(t,...tr){return this.eventEmitter.emit(t,...tr)}getSynchronizationUnit(t,tr){return this.synchronizationManager.getSynchronizationUnit(t,tr)}updateSyncStatus(t,tr,rr){this.synchronizationManager.updateSyncStatus(t,tr,rr)}initializeDriveSyncStatus(t,tr){return this.synchronizationManager.initializeDriveSyncStatus(t,tr)}getCombinedSyncUnitStatus(t){return this.synchronizationManager.getCombinedSyncUnitStatus(t)}async saveStrand(t,tr){const rr=t.operations.map(lr=>({...lr,scope:t.scope,branch:t.branch}));let ir;if(t.documentId)try{ir=await this.queueOperations(t.driveId,t.documentId,rr,{source:tr})}catch(lr){throw this.logger.error("Error queueing operations",lr),lr}else try{ir=await this.queueDriveOperations(t.driveId,rr,{source:tr})}catch(lr){throw this.logger.error("Error queueing operations",lr),lr}if(ir.status==="ERROR"){const lr=t.documentId!==""?(await this.getSynchronizationUnitsIds(t.driveId,[t.documentId],[t.scope],[t.branch])).map(fr=>fr.syncId):[t.driveId],dr=this.getOperationSource(tr);for(const fr of lr)this.synchronizationManager.updateSyncStatus(fr,{[dr]:ir.status},ir.error)}return this.eventEmitter.emit("strandUpdate",t),ir}setGenerateJwtHandler(t){this.generateJwtHandler=t,this.listenerManager.setGenerateJwtHandler(t)}removeJwtHandler(){this.generateJwtHandler=void 0,this.listenerManager.removeJwtHandler()}}const DocumentDriveServer=ReadModeServer(BaseDocumentDriveServer);class AbortError extends Error{constructor(t){super(t||"Aborted"),this.name="AbortError"}}class MemoryStorage{constructor(){Rs(this,"documents");Rs(this,"driveManifests");Rs(this,"slugToDocumentId");this.documents={},this.driveManifests={},this.slugToDocumentId={}}resolveIds(t,tr){const rr=[];for(const ir of t){const lr=this.slugToDocumentId[ir];if(!lr)throw new DocumentNotFoundError(ir);rr.push(lr)}if(tr!=null&&tr.aborted)throw new AbortError("Aborted");return Promise.resolve(rr)}resolveSlugs(t,tr){const rr=[];for(const ir of t){const lr=this.documents[ir];if(!lr)throw new DocumentNotFoundError(ir);rr.push(lr.header.slug)}if(tr!=null&&tr.aborted)throw new AbortError("Aborted");return Promise.resolve(rr)}exists(t){return Promise.resolve(!!this.documents[t])}create(t){var ir;const tr=t.header.id;if(!isValidDocumentId(tr))throw new DocumentIdValidationError(tr);if(this.documents[tr])throw new DocumentAlreadyExistsError(tr);const rr=((ir=t.header.slug)==null?void 0:ir.length)>0?t.header.slug:tr;if(!isValidSlug(rr))throw new DocumentSlugValidationError(rr);if(rr&&this.slugToDocumentId[rr])throw new DocumentAlreadyExistsError(tr);if(t.header.slug=rr,this.documents[tr]=t,rr){if(this.slugToDocumentId[rr])throw new DocumentAlreadyExistsError(tr);this.slugToDocumentId[rr]=tr}return t.header.documentType==="powerhouse/document-drive"&&this.updateDriveManifest(tr,{documentIds:new Set}),Promise.resolve()}get(t){const tr=this.documents[t];return tr?Promise.resolve(tr):Promise.reject(new DocumentNotFoundError(t))}getBySlug(t){const tr=this.slugToDocumentId[t];return tr?this.get(tr):Promise.reject(new DocumentNotFoundError(t))}async findByType(t,tr=100,rr){const ir=Object.entries(this.documents).filter(([hr,mr])=>mr.header.documentType===t).map(([hr,mr])=>({id:hr,document:mr}));ir.sort((hr,mr)=>{const gr=new Date(hr.document.header.createdAtUtcIso),yr=new Date(mr.document.header.createdAtUtcIso);if(gr.getTime()===yr.getTime()){const _r=hr.id,br=mr.id;return _r.localeCompare(br)}return gr.getTime()-yr.getTime()});let lr=0;if(rr){const hr=ir.findIndex(({id:mr})=>mr===rr);hr!==-1&&(lr=hr)}const dr=Math.min(lr+tr,ir.length);let fr;return dr<ir.length&&(fr=ir[dr].id),{documents:ir.slice(lr,dr).map(({id:hr})=>hr),nextCursor:fr}}async delete(t){var lr;const tr=this.documents[t];if(tr){const dr=((lr=tr.header.slug)==null?void 0:lr.length)>0?tr.header.slug:t;dr&&this.slugToDocumentId[dr]===t&&delete this.slugToDocumentId[dr]}const rr=await this.getParents(t);for(const dr of rr)await this.removeChild(dr,t);const ir=await this.getChildren(t);for(const dr of ir)(await this.getParents(dr)).length===1&&await this.delete(dr);return delete this.driveManifests[t],this.documents[t]?(delete this.documents[t],Promise.resolve(!0)):Promise.resolve(!1)}async addChild(t,tr){if(t===tr)return Promise.reject(new Error("Cannot associate a document with itself"));if((await this.getChildren(tr)).includes(t))return Promise.reject(new Error("Cannot associate a document with its child"));const ir=this.getManifest(t);return ir.documentIds.add(tr),this.updateDriveManifest(t,ir),Promise.resolve()}async removeChild(t,tr){const rr=this.getManifest(t);return rr.documentIds.delete(tr)?(this.updateDriveManifest(t,rr),Promise.resolve(!0)):Promise.resolve(!1)}async getChildren(t){return[...this.getManifest(t).documentIds]}async getParents(t){const tr=[];for(const[rr,ir]of Object.entries(this.driveManifests))ir.documentIds.has(t)&&tr.push(rr);return tr}async clear(){this.documents={},this.driveManifests={},this.slugToDocumentId={}}async addDocumentOperations(t,tr,rr,ir){const lr=await this.get(tr);if(!ir)return Promise.reject(new DocumentNotFoundError(tr));const dr=mergeOperations(lr.operations,rr);this.documents[tr]={...lr,...ir,operations:dr}}async addDriveOperations(t,tr,rr){const ir=await this.get(t),lr=mergeOperations(ir.operations,tr);this.documents[t]={...ir,...rr,operations:lr}}async getSynchronizationUnitsRevision(t){return(await Promise.allSettled(t.map(async rr=>{try{const ir=await this.get(rr.documentId);if(!ir)return;const lr=ir.operations[rr.scope].at(-1);if(lr)return{documentId:rr.documentId,scope:rr.scope,branch:rr.branch,lastUpdated:lr.timestamp,revision:lr.index}}catch{return}}))).reduce((rr,ir)=>(ir.status==="fulfilled"&&ir.value!==void 0&&rr.push(ir.value),rr),[])}getManifest(t){return this.driveManifests[t]||(this.driveManifests[t]={documentIds:new Set}),this.driveManifests[t]}updateDriveManifest(t,tr){this.driveManifests[t]=tr}}class DefaultEventEmitter{constructor(){Rs(this,"emitter",createNanoEvents())}emit(t,...tr){return this.emitter.emit(t,...tr)}on(t,tr){return this.emitter.on(t,tr)}}function debounce$1(e,t=250){let tr;return(rr,...ir)=>(tr&&clearTimeout(tr),new Promise((lr,dr)=>{rr?e(...ir).then(lr).catch(dr):tr=setTimeout(()=>{e(...ir).then(lr).catch(dr)},t)}))}const Ec=class Ec{constructor(t,tr=DefaultListenerManagerOptions){Rs(this,"logger",childLogger(["ListenerManager",Math.floor(Math.random()*999).toString()]));Rs(this,"syncManager");Rs(this,"options");Rs(this,"generateJwtHandler");Rs(this,"listenerStateByDriveId",new Map);Rs(this,"triggerUpdate",debounce$1(this._triggerUpdate.bind(this),Ec.LISTENER_UPDATE_DELAY));this.syncManager=t,this.options={...DefaultListenerManagerOptions,...tr},this.logger.verbose("constructor(...)")}setGenerateJwtHandler(t){this.generateJwtHandler=t}removeJwtHandler(){this.generateJwtHandler=void 0}async initialize(t){this.logger.verbose("initialize(...)"),typeof window<"u"&&window.addEventListener("online",()=>{this.triggerUpdate(!1,{type:"local"},t).catch(tr=>{this.logger.error("Non handled error updating listeners",tr)})})}driveHasListeners(t){return this.listenerStateByDriveId.has(t)}async setListener(t,tr){if(this.logger.verbose(`setListener(drive: ${t}, listener: ${tr.listenerId})`),t!==tr.driveId)throw new Error("Drive ID mismatch");let rr;try{rr=this.getListenerState(t,tr.listenerId)}catch{rr={}}this.setListenerState(t,tr.listenerId,{...rr,block:tr.block,driveId:tr.driveId,pendingTimeout:"0",listener:tr,listenerStatus:"CREATED",syncUnits:new Map}),await this.triggerUpdate(!0,{type:"local"})}async removeListener(t,tr){this.logger.verbose("setListener()");const rr=this.listenerStateByDriveId.get(t);return rr?Promise.resolve(rr.delete(tr)):!1}async removeSyncUnits(t,tr){const rr=this.listenerStateByDriveId.get(t);if(rr){for(const[,ir]of rr)for(const lr of tr)ir.syncUnits.delete(lr.syncId);return Promise.resolve()}}async updateSynchronizationRevisions(t,tr,rr,ir,lr,dr=!1){const fr=this.listenerStateByDriveId.get(t);if(!fr)return[];const hr=[];for(const[,mr]of fr){if(hr.find(yr=>yr.listenerId===mr.listener.listenerId))continue;const gr=mr.listener.transmitter;if(gr!=null&&gr.transmit)for(const yr of tr){if(!this._checkFilter(mr.listener.filter,yr))continue;const _r=mr.syncUnits.get(yr.syncId);if(!_r||_r.listenerRev<yr.revision){hr.push(mr.listener);break}}}return hr.length?(ir==null||ir(hr),this.triggerUpdate(dr,rr,lr)):[]}async updateListenerRevision(t,tr,rr,ir){const lr=this.listenerStateByDriveId.get(tr);if(!lr)return;const dr=lr.get(t);if(!dr)return;const fr=new Date().toISOString(),hr=dr.syncUnits.get(rr);return hr?(hr.listenerRev=ir,hr.lastUpdated=fr):dr.syncUnits.set(rr,{listenerRev:ir,lastUpdated:fr}),Promise.resolve()}async _triggerUpdate(t,tr,rr=500){var lr,dr;if(this.logger.verbose(`_triggerUpdate(source: ${t.type}, maxContinues: ${rr})`,this.listenerStateByDriveId),rr<0)throw new Error("Maximum retries exhausted.");const ir=[];for(const[fr,hr]of this.listenerStateByDriveId)for(const[mr,gr]of hr){const yr=gr.listener.transmitter;if(!(yr!=null&&yr.transmit))continue;const _r=await this.getListenerSyncUnits(fr,mr),br=[];this.logger.verbose("syncUnits",_r);const wr=_r.map(vr=>async()=>{const Sr=gr.syncUnits.get(vr.syncId);if(Sr&&Sr.listenerRev>=vr.revision){this.logger.verbose(`Abandoning push for sync unit ${vr.syncId}: already up-to-date (${Sr.listenerRev} >= ${vr.revision})`);return}else this.logger.verbose(`Listener out-of-date for sync unit (${vr.scope}, ${vr.documentId}): ${Sr==null?void 0:Sr.listenerRev} < ${vr.revision}`);const Ir=[];try{const Mr=await this.syncManager.getOperationData(fr,vr.syncId,{fromRevision:Sr==null?void 0:Sr.listenerRev});Ir.push(...Mr)}catch(Mr){this.logger.error(Mr)}if(!Ir.length){this.logger.verbose(`Abandoning push for ${vr.syncId}: no operations found`);return}br.push({driveId:fr,documentId:vr.documentId,branch:vr.branch,operations:Ir,scope:vr.scope})});if(this.options.sequentialUpdates){this.logger.verbose(`Collecting ${wr.length} syncUnit strandUpdates in sequence`);for(const vr of wr)await vr()}else this.logger.verbose(`Collecting ${wr.length} syncUnit strandUpdates in parallel`),await Promise.all(wr.map(vr=>vr()));if(br.length==0){this.logger.verbose(`No strandUpdates needed for listener ${mr}`);continue}gr.pendingTimeout=new Date(new Date().getTime()/1e3+300).toISOString(),gr.listenerStatus="PENDING";try{this.logger.verbose(`_triggerUpdate(source: ${t.type}) > transmitter.transmit`);const vr=await yr.transmit(br,t);this.logger.verbose(`_triggerUpdate(source: ${t.type}) > transmission succeeded`,vr),gr.pendingTimeout="0",gr.listenerStatus="PENDING";const Sr=new Date().toISOString();let Ir=!1;for(const Mr of vr){const Ar=_r.find(kr=>Mr.documentId===kr.documentId&&Mr.scope===kr.scope&&Mr.branch===kr.branch);if(Ar){gr.syncUnits.set(Ar.syncId,{lastUpdated:Sr,listenerRev:Mr.revision});const kr=br.find(Or=>Or.driveId===Mr.driveId&&Or.documentId===Mr.documentId&&Or.scope===Mr.scope&&Or.branch===Mr.branch);if(kr&&kr.operations.length>0){const Or=(lr=kr.operations.at(kr.operations.length-1))==null?void 0:lr.index;Or!==Mr.revision?(this.logger.verbose(`Revision still out-of-date for ${kr.documentId}:${kr.scope}:${kr.branch} ${Or} <> ${Mr.revision}`),Ir=!0):this.logger.verbose(`Revision match for ${kr.documentId}:${kr.scope}:${kr.branch} ${Or}`)}else this.logger.verbose(`Cannot find strand update for (${Mr.documentId}:${Mr.scope}:${Mr.branch} in drive ${Mr.driveId})`)}else this.logger.warn(`Received revision for untracked unit for listener ${gr.listener.listenerId}`,Mr)}for(const Mr of vr){const Ar=Mr.status==="ERROR";if((dr=Mr.error)!=null&&dr.includes("Missing operations"))Ir=!0;else if(Ar)throw new OperationError(Mr.status,void 0,Mr.error,Mr.error)}if(!Ir)ir.push({listenerId:gr.listener.listenerId,listenerRevisions:vr});else{const Mr=await this._triggerUpdate(t,tr,rr-1);ir.push(...Mr)}gr.listenerStatus="SUCCESS"}catch(vr){tr==null||tr(vr,fr,gr),gr.listenerStatus=vr instanceof OperationError?vr.status:"ERROR"}}return this.logger.verbose(`Returning listener updates (maxContinues: ${rr})`,ir),ir}_checkFilter(t,tr){const{branch:rr,documentId:ir,scope:lr,documentType:dr}=tr;return!!((!t.branch||t.branch.includes(rr)||t.branch.includes("*"))&&(!t.documentId||t.documentId.includes(ir)||t.documentId.includes("*"))&&(!t.scope||t.scope.includes(lr)||t.scope.includes("*"))&&(!t.documentType||t.documentType.includes(dr)||t.documentType.includes("*")))}getListenerSyncUnits(t,tr){var lr;const rr=(lr=this.listenerStateByDriveId.get(t))==null?void 0:lr.get(tr);if(!rr)return[];const ir=rr.listener.filter;return this.syncManager.getSynchronizationUnits(t,ir.documentId??["*"],ir.scope??["*"],ir.branch??["*"],ir.documentType??["*"])}getListenerSyncUnitIds(t,tr){var lr;const rr=(lr=this.listenerStateByDriveId.get(t))==null?void 0:lr.get(tr);if(!rr)return Promise.resolve([]);const ir=rr.listener.filter;return this.syncManager.getSynchronizationUnitsIds(t,ir.documentId??["*"],ir.scope??["*"],ir.branch??["*"],ir.documentType??["*"])}async removeDrive(t){var rr,ir;const tr=this.listenerStateByDriveId.get(t);if(tr){this.listenerStateByDriveId.delete(t);for(const[lr,dr]of tr)try{await((ir=(rr=dr.listener.transmitter)==null?void 0:rr.disconnect)==null?void 0:ir.call(rr))}catch(fr){this.logger.error(fr)}}}async getStrands(t,tr,rr){this.logger.verbose(`[SYNC DEBUG] ListenerManager.getStrands called for drive: ${t}, listener: ${tr}, options: ${JSON.stringify(rr||{})}`);let ir;try{ir=this.getListenerState(t,tr),this.logger.verbose(`[SYNC DEBUG] Found listener state for drive: ${t}, listener: ${tr}, status: ${ir.listenerStatus}`)}catch(dr){throw this.logger.error(`[SYNC DEBUG] Failed to find listener state for drive: ${t}, listener: ${tr}. Error: ${dr}`),dr}const lr=[];try{const dr=await this.getListenerSyncUnits(t,tr);this.logger.verbose(`[SYNC DEBUG] Retrieved ${dr.length} sync units for drive: ${t}, listener: ${tr}`);const fr=rr==null?void 0:rr.limit;let hr=0;const mr=dr.map(gr=>async()=>{if(fr&&hr>=fr)return;if(gr.revision<0){this.logger.verbose(`[SYNC DEBUG] Skipping sync unit with negative revision: ${gr.syncId}, revision: ${gr.revision}`);return}const yr=ir.syncUnits.get(gr.syncId);if(yr&&yr.listenerRev>=gr.revision){this.logger.verbose(`[SYNC DEBUG] Skipping sync unit - listener already up to date: ${gr.syncId}, listenerRev: ${yr.listenerRev}, revision: ${gr.revision}`);return}const{documentId:_r,scope:br,branch:wr}=gr;try{this.logger.verbose(`[SYNC DEBUG] Getting operations for syncUnit: ${gr.syncId}, documentId: ${_r}, scope: ${br}, branch: ${wr}`);const vr=await this.syncManager.getOperationData(t,gr.syncId,{since:rr==null?void 0:rr.since,fromRevision:(rr==null?void 0:rr.fromRevision)??(yr==null?void 0:yr.listenerRev),limit:fr?fr-hr:void 0});if(this.logger.verbose(`[SYNC DEBUG] Retrieved ${vr.length} operations for syncUnit: ${gr.syncId}`),!vr.length)return;hr+=vr.length,lr.push({driveId:t,documentId:_r,scope:br,branch:wr,operations:vr}),this.logger.verbose(`[SYNC DEBUG] Added strand with ${vr.length} operations for syncUnit: ${gr.syncId}`)}catch(vr){this.logger.error(`Error getting operations for syncUnit: ${gr.syncId}, error: ${vr}`);return}});if(this.options.sequentialUpdates){this.logger.verbose(`[SYNC DEBUG] Processing ${mr.length} sync units sequentially`);for(const gr of mr)await gr()}else this.logger.verbose(`[SYNC DEBUG] Processing ${mr.length} sync units in parallel`),await Promise.all(mr.map(gr=>gr()))}catch(dr){this.logger.error(`Error in getStrands: ${dr}`)}return this.logger.verbose(`ListenerManager.getStrands returning ${lr.length} strands for drive: ${t}, listener: ${tr}`),lr}getListenerState(t,tr){let rr=this.listenerStateByDriveId.get(t);rr||(rr=new Map,this.listenerStateByDriveId.set(t,rr));const ir=rr.get(tr);if(!ir)throw new Error("Listener not found");return ir}setListenerState(t,tr,rr){let ir=this.listenerStateByDriveId.get(t);ir||(ir=new Map,this.listenerStateByDriveId.set(t,ir)),ir.set(tr,rr)}};Rs(Ec,"LISTENER_UPDATE_DELAY",250);let ListenerManager=Ec;class TransmitterFactory{constructor(t){Rs(this,"listenerManager");this.listenerManager=t}instance(t,tr,rr){var ir;switch(t){case"SwitchboardPush":{if(!((ir=tr.callInfo)!=null&&ir.data))throw new Error("No call info data: "+JSON.stringify(tr));return new SwitchboardPushTransmitter(tr.callInfo.data,this.listenerManager)}case"Internal":throw new Error("Internal transmitter not implemented");default:return new PullResponderTransmitter(tr,this.listenerManager)}}}class SynchronizationManager{constructor(t,tr,rr,ir,lr){Rs(this,"storage");Rs(this,"documentStorage");Rs(this,"cache");Rs(this,"documentModelModules");Rs(this,"eventEmitter");Rs(this,"syncStatus",new Map);Rs(this,"logger",childLogger(["SynchronizationManager"]));this.storage=t,this.documentStorage=tr,this.cache=rr,this.documentModelModules=ir,this.eventEmitter=lr}async getSynchronizationUnits(t,tr,rr,ir,lr){const dr=await this.getSynchronizationUnitsIds(t,tr,rr,ir,lr);return this.logger.verbose(`getSynchronizationUnits query: ${JSON.stringify(dr)}`),this.getSynchronizationUnitsRevision(t,dr)}async getSynchronizationUnitsRevision(t,tr){const rr=await this.getDrive(t),ir=await this.storage.getSynchronizationUnitsRevision(tr);this.logger.verbose(`getSynchronizationUnitsRevision: ${JSON.stringify(ir)}`);const lr=tr.map(dr=>({...dr,lastUpdated:rr.header.createdAtUtcIso,revision:-1}));for(const dr of ir){const fr=lr.find(hr=>dr.documentId===hr.documentId&&dr.scope===hr.scope&&dr.branch===hr.branch);fr&&(fr.revision=dr.revision,fr.lastUpdated=dr.lastUpdated)}return lr}async getSynchronizationUnitsIds(t,tr,rr,ir,lr){const fr=(await this.getDrive(t)).state.global.nodes.filter(mr=>isFileNode(mr)&&(!(tr!=null&&tr.length)||tr.includes(mr.id)||tr.includes("*"))&&(!(lr!=null&&lr.length)||lr.includes(mr.documentType)||lr.includes("*")));(!tr||tr.includes("*")||tr.includes(""))&&(!(lr!=null&&lr.length)||lr.includes("powerhouse/document-drive")||lr.includes("*"))&&fr.unshift({id:t,documentType:"powerhouse/document-drive",synchronizationUnits:[{syncId:"0",scope:"global",branch:"main"}]});const hr=[];for(const mr of fr){const gr=rr!=null&&rr.length||ir!=null&&ir.length?mr.synchronizationUnits.filter(yr=>(!(rr!=null&&rr.length)||rr.includes(yr.scope)||rr.includes("*"))&&(!(ir!=null&&ir.length)||ir.includes(yr.branch)||ir.includes("*"))):mr.synchronizationUnits;gr.length&&hr.push(...gr.map(yr=>({driveId:t,documentId:mr.id,syncId:yr.syncId,documentType:mr.documentType,scope:yr.scope,branch:yr.branch})))}return hr}async getSynchronizationUnitIdInfo(t,tr){const ir=(await this.getDrive(t)).state.global.nodes.find(dr=>isFileNode(dr)&&dr.synchronizationUnits.find(fr=>fr.syncId===tr));if(!ir||!isFileNode(ir))return;const lr=ir.synchronizationUnits.find(dr=>dr.syncId===tr);if(lr)return{syncId:tr,scope:lr.scope,branch:lr.branch,documentId:ir.id,documentType:ir.documentType}}async getSynchronizationUnit(t,tr){const rr=await this.getSynchronizationUnitIdInfo(t,tr);if(!rr)return;const{scope:ir,branch:lr,documentId:dr,documentType:fr}=rr,hr=await this.getDocument(t,dr),mr=hr.operations[ir]??[],gr=mr[mr.length-1];return{syncId:tr,scope:ir,branch:lr,documentId:dr,documentType:fr,lastUpdated:gr.timestamp??hr.header.lastModifiedAtUtcIso,revision:gr.index??0}}async getOperationData(t,tr,rr){this.logger.verbose(`[SYNC DEBUG] SynchronizationManager.getOperationData called for drive: ${t}, syncId: ${tr}, filter: ${JSON.stringify(rr)}`);const ir=tr==="0"?{documentId:"",scope:"global"}:await this.getSynchronizationUnitIdInfo(t,tr);if(!ir)throw this.logger.error(`SYNC DEBUG] Invalid Sync Id ${tr} in drive ${t}`),new Error(`Invalid Sync Id ${tr} in drive ${t}`);this.logger.verbose(`[SYNC DEBUG] Found sync unit: documentId: ${ir.documentId}, scope: ${ir.scope}`);const lr=tr==="0"?await this.getDrive(t):await this.getDocument(t,ir.documentId);this.logger.verbose(`[SYNC DEBUG] Retrieved document ${ir.documentId} with type: ${lr.header.documentType}`);const dr=lr.operations[ir.scope]??[];this.logger.verbose(`[SYNC DEBUG] Found ${dr.length} total operations in scope ${ir.scope}`);const fr=dr.filter(mr=>Object.keys(rr).length===0||(rr.since===void 0||isBefore(rr.since,mr.timestamp))&&(rr.fromRevision===void 0||mr.index>rr.fromRevision));this.logger.verbose(`[SYNC DEBUG] Filtered to ${fr.length} operations based on filter criteria`+(rr.fromRevision!==void 0?` (fromRevision: ${rr.fromRevision})`:""));const hr=rr.limit?fr.slice(0,rr.limit):fr;if(this.logger.verbose(`[SYNC DEBUG] Returning ${hr.length} operations after applying limit`),hr.length>0){const mr=hr[0],gr=hr[hr.length-1];this.logger.verbose(`[SYNC DEBUG] First operation: index=${mr.index}, type=${mr.type}`),this.logger.verbose(`[SYNC DEBUG] Last operation: index=${gr.index}, type=${gr.type}`)}return hr.map(mr=>({hash:mr.hash,index:mr.index,timestamp:mr.timestamp,type:mr.type,input:mr.input,skip:mr.skip,context:mr.context,id:mr.id}))}async getDrive(t){try{const ir=await this.cache.getDrive(t);if(ir&&isDocumentDrive(ir))return ir}catch(ir){this.logger.error("Error getting drive from cache",ir)}const tr=await this.documentStorage.get(t),rr=this._buildDocument(tr);if(!isDocumentDrive(rr))throw new Error(`Document with id ${t} is not a Document Drive`);return rr}async getDocument(t,tr){try{const ir=await this.cache.getDocument(tr);if(ir)return ir}catch(ir){this.logger.error("Error getting document from cache",ir)}const rr=await this.documentStorage.get(tr);return this._buildDocument(rr)}_buildDocument(t){const tr=this.getDocumentModelModule(t.header.documentType),rr=garbageCollectDocumentOperations(t.operations);return replayDocument(t.initialState,rr,tr.reducer,void 0,t.header,void 0,{checkHashes:!0,reuseOperationResultingState:!0})}setDocumentModelModules(t){this.documentModelModules=t}getDocumentModelModule(t){const tr=this.documentModelModules.find(rr=>rr.documentModel.id===t);if(!tr)throw new Error(`Document type ${t} not supported`);return tr}getCombinedSyncUnitStatus(t){if(!t.pull&&!t.push||t.pull==="INITIAL_SYNC")return"INITIAL_SYNC";if(t.push==="INITIAL_SYNC")return t.pull||"INITIAL_SYNC";const tr=["ERROR","MISSING","CONFLICT","SYNCING","SUCCESS"];return Object.values(t).sort((ir,lr)=>tr.indexOf(ir)-tr.indexOf(lr))[0]}getSyncStatus(t){const tr=this.syncStatus.get(t);return tr?this.getCombinedSyncUnitStatus(tr):new SynchronizationUnitNotFoundError(`Sync status not found for syncUnitId: ${t}`,t)}updateSyncStatus(t,tr,rr){if(tr===null){this.syncStatus.delete(t);return}const ir=this.syncStatus.get(t);if(!ir){this.initSyncStatus(t,tr);return}if(Object.entries(tr).some(([dr,fr])=>ir[dr]!==fr)){const dr=Object.entries(tr).reduce((mr,[gr,yr])=>({...mr,[gr]:mr[gr]==="INITIAL_SYNC"&&yr==="SYNCING"?"INITIAL_SYNC":yr}),ir),fr=this.getCombinedSyncUnitStatus(ir),hr=this.getCombinedSyncUnitStatus(dr);this.syncStatus.set(t,dr),fr!==hr&&this.eventEmitter&&this.eventEmitter.emit("syncStatus",t,this.getCombinedSyncUnitStatus(dr),rr,dr)}}initSyncStatus(t,tr){const rr=Object.entries(tr).reduce((ir,[lr,dr])=>({...ir,[lr]:dr!=="SYNCING"?dr:"INITIAL_SYNC"}),{});this.syncStatus.set(t,rr),this.eventEmitter&&this.eventEmitter.emit("syncStatus",t,this.getCombinedSyncUnitStatus(rr),void 0,rr)}async initializeDriveSyncStatus(t,tr){const rr=await this.getSynchronizationUnitsIds(t),ir={pull:tr.state.local.triggers.length>0?"INITIAL_SYNC":void 0,push:tr.state.local.listeners.length>0?"SUCCESS":void 0};if(!ir.pull&&!ir.push)return;const lr=[t,...rr.map(dr=>dr.syncId)];for(const dr of lr)this.initSyncStatus(dr,ir)}}class ReactorBuilder{constructor(t){Rs(this,"documentModelModules",[]);Rs(this,"storage");Rs(this,"cache");Rs(this,"queueManager");Rs(this,"eventEmitter");Rs(this,"options");Rs(this,"synchronizationManager");Rs(this,"listenerManager");Rs(this,"transmitterFactory");this.documentModelModules=t}withStorage(t){return this.storage=t,this}withCache(t){return this.cache=t,this}withQueueManager(t){return this.queueManager=t,this}withEventEmitter(t){return this.eventEmitter=t,this}withSynchronizationManager(t){return this.synchronizationManager=t,this}withListenerManager(t){return this.listenerManager=t,this}withTransmitterFactory(t){return this.transmitterFactory=t,this}withOptions(t){return this.options=t,this}build(){var t;if(this.storage||(this.storage=new MemoryStorage),this.cache||(this.cache=new InMemoryCache),this.queueManager||(this.queueManager=new BaseQueueManager),this.eventEmitter||(this.eventEmitter=new DefaultEventEmitter),this.synchronizationManager||(this.synchronizationManager=new SynchronizationManager(this.storage,this.storage,this.cache,this.documentModelModules,this.eventEmitter)),!this.listenerManager){const tr={...DefaultListenerManagerOptions,...(t=this.options)==null?void 0:t.listenerManager};this.listenerManager=new ListenerManager(this.synchronizationManager,tr)}return this.transmitterFactory||(this.transmitterFactory=new TransmitterFactory(this.listenerManager)),new DocumentDriveServer(this.documentModelModules,this.storage,this.storage,this.cache,this.queueManager,this.eventEmitter,this.synchronizationManager,this.listenerManager,this.options)}}var Sc,Pu;class InternalTransmitter{constructor(t,tr,rr){bs(this,Sc);Rs(this,"drive");Rs(this,"processor");Rs(this,"taskQueueMethod");Rs(this,"transmitQueue");this.drive=t,this.processor=tr,this.taskQueueMethod=rr===void 0?RunAsap.runAsap:rr}async transmit(t,tr){var ir;const rr=async()=>{var dr;const lr=[];for(const fr of t){const hr=await As(this,Sc,Pu).call(this,fr),mr=await(fr.documentId?this.drive.getDocument(fr.driveId,fr.documentId):this.drive.getDrive(fr.driveId)),gr=((dr=hr.at(-1))==null?void 0:dr.state)??{};lr.push({...fr,documentType:mr.header.documentType,operations:hr,state:gr})}try{return await this.processor.onStrands(lr),t.map(({operations:fr,...hr})=>{var mr;return{...hr,status:"SUCCESS",revision:((mr=fr.at(fr.length-1))==null?void 0:mr.index)??-1}})}catch(fr){return logger.error(fr),t.map(({operations:hr,...mr})=>{var gr;return{...mr,status:"ERROR",revision:(((gr=hr.at(0))==null?void 0:gr.index)??0)-1}})}};return this.transmitQueue=((ir=this.transmitQueue)==null?void 0:ir.then(()=>rr()))??rr(),this.transmitQueue}async disconnect(){await this.processor.onDisconnect()}}Sc=new WeakSet,Pu=async function(t){const tr=[],rr=new Map,ir=async lr=>{const dr=rr.get(lr);if(dr)return dr;const fr={revisions:{[t.scope]:lr},checkHashes:!1},hr=await(t.documentId?this.drive.getDocument(t.driveId,t.documentId,fr):this.drive.getDrive(t.driveId,fr));return lr<0?rr.set(lr,hr.initialState.state[t.scope]):rr.set(lr,hr.state[t.scope]),rr.get(lr)};for(const lr of t.operations){const dr=()=>ir(lr.index),fr=await(this.taskQueueMethod?RunAsap.runAsapAsync(dr,this.taskQueueMethod):dr()),hr=()=>ir(lr.index-1),mr=await(this.taskQueueMethod?RunAsap.runAsapAsync(hr,this.taskQueueMethod):hr());tr.push({...lr,state:fr,previousState:mr})}return tr};const createDriveState=utils$1.createState;function useUserPermissions(){return{isAllowedToCreateDocuments:!0,isAllowedToEditDocuments:!0}}function documentToHash(e){return Object.keys(e.operations).map(t=>{var tr;return`${t}:${e.operations[t].length}:${(tr=e.operations[t].at(-1))==null?void 0:tr.hash}`}).join(":")}const __vite_import_meta_env__$2={},isSelfAtom=(e,t)=>e.unstable_is?e.unstable_is(t):t===e,hasInitialValue=e=>"init"in e,isActuallyWritableAtom=e=>!!e.write,isAtomStateInitialized=e=>"v"in e||"e"in e,returnAtomValue=e=>{if("e"in e)throw e.e;if((__vite_import_meta_env__$2?"production":void 0)!=="production"&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v},promiseStateMap=new WeakMap,isPendingPromise=e=>{var t;return isPromiseLike$1(e)&&!!((t=promiseStateMap.get(e))!=null&&t[0])},abortPromise=e=>{const t=promiseStateMap.get(e);t!=null&&t[0]&&(t[0]=!1,t[1].forEach(tr=>tr()))},registerAbortHandler=(e,t)=>{let tr=promiseStateMap.get(e);if(!tr){tr=[!0,new Set],promiseStateMap.set(e,tr);const rr=()=>{tr[0]=!1};e.then(rr,rr)}tr[1].add(t)},isPromiseLike$1=e=>typeof(e==null?void 0:e.then)=="function",addPendingPromiseToDependency=(e,t,tr)=>{tr.p.has(e)||(tr.p.add(e),t.then(()=>{tr.p.delete(e)},()=>{tr.p.delete(e)}))},setAtomStateValueOrPromise=(e,t,tr)=>{const rr=tr(e),ir="v"in rr,lr=rr.v;if(isPromiseLike$1(t))for(const dr of rr.d.keys())addPendingPromiseToDependency(e,t,tr(dr));rr.v=t,delete rr.e,(!ir||!Object.is(lr,rr.v))&&(++rr.n,isPromiseLike$1(lr)&&abortPromise(lr))},getMountedOrPendingDependents=(e,t,tr)=>{var rr;const ir=new Set;for(const lr of((rr=tr.get(e))==null?void 0:rr.t)||[])tr.has(lr)&&ir.add(lr);for(const lr of t.p)ir.add(lr);return ir},createStoreHook=()=>{const e=new Set,t=()=>{e.forEach(tr=>tr())};return t.add=tr=>(e.add(tr),()=>{e.delete(tr)}),t},createStoreHookForAtoms=()=>{const e={},t=new WeakMap,tr=rr=>{var ir,lr;(ir=t.get(e))==null||ir.forEach(dr=>dr(rr)),(lr=t.get(rr))==null||lr.forEach(dr=>dr())};return tr.add=(rr,ir)=>{const lr=rr||e,dr=(t.has(lr)?t:t.set(lr,new Set)).get(lr);return dr.add(ir),()=>{dr==null||dr.delete(ir),dr.size||t.delete(lr)}},tr},initializeStoreHooks=e=>(e.c||(e.c=createStoreHookForAtoms()),e.m||(e.m=createStoreHookForAtoms()),e.u||(e.u=createStoreHookForAtoms()),e.f||(e.f=createStoreHook()),e),BUILDING_BLOCKS=Symbol(),buildStore=(e=new WeakMap,t=new WeakMap,tr=new WeakMap,rr=new Set,ir=new Set,lr=new Set,dr={},fr=(_r,...br)=>_r.read(...br),hr=(_r,...br)=>_r.write(...br),mr=(_r,br)=>{var wr;return(wr=_r.unstable_onInit)==null?void 0:wr.call(_r,br)},gr=(_r,br)=>{var wr;return(wr=_r.onMount)==null?void 0:wr.call(_r,br)},...yr)=>{const _r=yr[0]||($r=>{if((__vite_import_meta_env__$2?"production":void 0)!=="production"&&!$r)throw new Error("Atom is undefined or null");let Fr=e.get($r);return Fr||(Fr={d:new Map,p:new Set,n:0},e.set($r,Fr),mr==null||mr($r,Dr)),Fr}),br=yr[1]||(()=>{const $r=[],Fr=Lr=>{try{Lr()}catch(qn){$r.push(qn)}};do{dr.f&&Fr(dr.f);const Lr=new Set,qn=Lr.add.bind(Lr);rr.forEach(Kn=>{var Gr;return(Gr=t.get(Kn))==null?void 0:Gr.l.forEach(qn)}),rr.clear(),lr.forEach(qn),lr.clear(),ir.forEach(qn),ir.clear(),Lr.forEach(Fr),rr.size&&wr()}while(rr.size||lr.size||ir.size);if($r.length)throw new AggregateError($r)}),wr=yr[2]||(()=>{const $r=[],Fr=new WeakSet,Lr=new WeakSet,qn=Array.from(rr);for(;qn.length;){const Kn=qn[qn.length-1],Gr=_r(Kn);if(Lr.has(Kn)){qn.pop();continue}if(Fr.has(Kn)){if(tr.get(Kn)===Gr.n)$r.push([Kn,Gr]);else if((__vite_import_meta_env__$2?"production":void 0)!=="production"&&tr.has(Kn))throw new Error("[Bug] invalidated atom exists");Lr.add(Kn),qn.pop();continue}Fr.add(Kn);for(const Zn of getMountedOrPendingDependents(Kn,Gr,t))Fr.has(Zn)||qn.push(Zn)}for(let Kn=$r.length-1;Kn>=0;--Kn){const[Gr,Zn]=$r[Kn];let zr=!1;for(const $n of Zn.d.keys())if($n!==Gr&&rr.has($n)){zr=!0;break}zr&&(vr(Gr),Mr(Gr)),tr.delete(Gr)}}),vr=yr[3]||($r=>{var Fr;const Lr=_r($r);if(isAtomStateInitialized(Lr)&&(t.has($r)&&tr.get($r)!==Lr.n||Array.from(Lr.d).every(([Jn,Yn])=>vr(Jn).n===Yn)))return Lr;Lr.d.clear();let qn=!0;const Kn=()=>{t.has($r)&&(Mr($r),wr(),br())},Gr=Jn=>{var Yn;if(isSelfAtom($r,Jn)){const ds=_r(Jn);if(!isAtomStateInitialized(ds))if(hasInitialValue(Jn))setAtomStateValueOrPromise(Jn,Jn.init,_r);else throw new Error("no atom init");return returnAtomValue(ds)}const Xn=vr(Jn);try{return returnAtomValue(Xn)}finally{Lr.d.set(Jn,Xn.n),isPendingPromise(Lr.v)&&addPendingPromiseToDependency($r,Lr.v,Xn),(Yn=t.get(Jn))==null||Yn.t.add($r),qn||Kn()}};let Zn,zr;const $n={get signal(){return Zn||(Zn=new AbortController),Zn.signal},get setSelf(){return(__vite_import_meta_env__$2?"production":void 0)!=="production"&&!isActuallyWritableAtom($r)&&console.warn("setSelf function cannot be used with read-only atom"),!zr&&isActuallyWritableAtom($r)&&(zr=(...Jn)=>{if((__vite_import_meta_env__$2?"production":void 0)!=="production"&&qn&&console.warn("setSelf function cannot be called in sync"),!qn)try{return Ir($r,...Jn)}finally{wr(),br()}}),zr}},Hn=Lr.n;try{const Jn=fr($r,Gr,$n);return setAtomStateValueOrPromise($r,Jn,_r),isPromiseLike$1(Jn)&&(registerAbortHandler(Jn,()=>Zn==null?void 0:Zn.abort()),Jn.then(Kn,Kn)),Lr}catch(Jn){return delete Lr.v,Lr.e=Jn,++Lr.n,Lr}finally{qn=!1,Hn!==Lr.n&&tr.get($r)===Hn&&(tr.set($r,Lr.n),rr.add($r),(Fr=dr.c)==null||Fr.call(dr,$r))}}),Sr=yr[4]||($r=>{const Fr=[$r];for(;Fr.length;){const Lr=Fr.pop(),qn=_r(Lr);for(const Kn of getMountedOrPendingDependents(Lr,qn,t)){const Gr=_r(Kn);tr.set(Kn,Gr.n),Fr.push(Kn)}}}),Ir=yr[5]||(($r,...Fr)=>{let Lr=!0;const qn=Gr=>returnAtomValue(vr(Gr)),Kn=(Gr,...Zn)=>{var zr;const $n=_r(Gr);try{if(isSelfAtom($r,Gr)){if(!hasInitialValue(Gr))throw new Error("atom not writable");const Hn=$n.n,Jn=Zn[0];setAtomStateValueOrPromise(Gr,Jn,_r),Mr(Gr),Hn!==$n.n&&(rr.add(Gr),(zr=dr.c)==null||zr.call(dr,Gr),Sr(Gr));return}else return Ir(Gr,...Zn)}finally{Lr||(wr(),br())}};try{return hr($r,qn,Kn,...Fr)}finally{Lr=!1}}),Mr=yr[6]||($r=>{var Fr;const Lr=_r($r),qn=t.get($r);if(qn&&!isPendingPromise(Lr.v)){for(const[Kn,Gr]of Lr.d)if(!qn.d.has(Kn)){const Zn=_r(Kn);Ar(Kn).t.add($r),qn.d.add(Kn),Gr!==Zn.n&&(rr.add(Kn),(Fr=dr.c)==null||Fr.call(dr,Kn),Sr(Kn))}for(const Kn of qn.d||[])if(!Lr.d.has(Kn)){qn.d.delete(Kn);const Gr=kr(Kn);Gr==null||Gr.t.delete($r)}}}),Ar=yr[7]||($r=>{var Fr;const Lr=_r($r);let qn=t.get($r);if(!qn){vr($r);for(const Kn of Lr.d.keys())Ar(Kn).t.add($r);if(qn={l:new Set,d:new Set(Lr.d.keys()),t:new Set},t.set($r,qn),(Fr=dr.m)==null||Fr.call(dr,$r),isActuallyWritableAtom($r)){const Kn=()=>{let Gr=!0;const Zn=(...zr)=>{try{return Ir($r,...zr)}finally{Gr||(wr(),br())}};try{const zr=gr($r,Zn);zr&&(qn.u=()=>{Gr=!0;try{zr()}finally{Gr=!1}})}finally{Gr=!1}};ir.add(Kn)}}return qn}),kr=yr[8]||($r=>{var Fr;const Lr=_r($r);let qn=t.get($r);if(qn&&!qn.l.size&&!Array.from(qn.t).some(Kn=>{var Gr;return(Gr=t.get(Kn))==null?void 0:Gr.d.has($r)})){qn.u&&lr.add(qn.u),qn=void 0,t.delete($r),(Fr=dr.u)==null||Fr.call(dr,$r);for(const Kn of Lr.d.keys()){const Gr=kr(Kn);Gr==null||Gr.t.delete($r)}return}return qn}),Or=[e,t,tr,rr,ir,lr,dr,fr,hr,mr,gr,_r,br,wr,vr,Sr,Ir,Mr,Ar,kr],Dr={get:$r=>returnAtomValue(vr($r)),set:($r,...Fr)=>{try{return Ir($r,...Fr)}finally{wr(),br()}},sub:($r,Fr)=>{const qn=Ar($r).l;return qn.add(Fr),br(),()=>{qn.delete(Fr),kr($r),br()}}};return Object.defineProperty(Dr,BUILDING_BLOCKS,{value:Or}),Dr},INTERNAL_buildStoreRev1=buildStore,INTERNAL_initializeStoreHooks=initializeStoreHooks,INTERNAL_registerAbortHandler=registerAbortHandler,__vite_import_meta_env__$1={};let keyCount=0;function atom(e,t){const tr=`atom${++keyCount}`,rr={toString(){return(__vite_import_meta_env__$1?"production":void 0)!=="production"&&this.debugLabel?tr+":"+this.debugLabel:tr}};return typeof e=="function"?rr.read=e:(rr.init=e,rr.read=defaultRead,rr.write=defaultWrite),t&&(rr.write=t),rr}function defaultRead(e){return e(this)}function defaultWrite(e,t,tr){return t(this,typeof tr=="function"?tr(e(this)):tr)}const createDevStoreRev4=()=>{let e=0;const t=INTERNAL_initializeStoreHooks({}),tr=new WeakMap,rr=new WeakMap,ir=INTERNAL_buildStoreRev1(tr,rr,void 0,void 0,void 0,void 0,t,void 0,(fr,hr,mr,...gr)=>e?mr(fr,...gr):fr.write(hr,mr,...gr)),lr=new Set;return t.m.add(void 0,fr=>{lr.add(fr);const hr=tr.get(fr);hr.m=rr.get(fr)}),t.u.add(void 0,fr=>{lr.delete(fr);const hr=tr.get(fr);delete hr.m}),Object.assign(ir,{dev4_get_internal_weak_map:()=>(console.log("Deprecated: Use devstore from the devtools library"),tr),dev4_get_mounted_atoms:()=>lr,dev4_restore_atoms:fr=>{const hr={read:()=>null,write:(mr,gr)=>{++e;try{for(const[yr,_r]of fr)"init"in yr&&gr(yr,_r)}finally{--e}}};ir.set(hr)}})};function createStore$2(){return(__vite_import_meta_env__$1?"production":void 0)!=="production"?createDevStoreRev4():INTERNAL_buildStoreRev1()}let defaultStore;function getDefaultStore(){return defaultStore||(defaultStore=createStore$2(),(__vite_import_meta_env__$1?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=defaultStore),globalThis.__JOTAI_DEFAULT_STORE__!==defaultStore&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),defaultStore}const __vite_import_meta_env__={},StoreContext=createContext(void 0);function useStore(e){return useContext(StoreContext)||getDefaultStore()}function Provider({children:e,store:t}){const tr=useRef(void 0);return!t&&!tr.current&&(tr.current=createStore$2()),createElement(StoreContext.Provider,{value:t||tr.current},e)}const isPromiseLike=e=>typeof(e==null?void 0:e.then)=="function",attachPromiseStatus=e=>{e.status||(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}))},use=React__default.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(attachPromiseStatus(e),e)}),continuablePromiseMap=new WeakMap,createContinuablePromise=(e,t)=>{let tr=continuablePromiseMap.get(e);return tr||(tr=new Promise((rr,ir)=>{let lr=e;const dr=mr=>gr=>{lr===mr&&rr(gr)},fr=mr=>gr=>{lr===mr&&ir(gr)},hr=()=>{try{const mr=t();isPromiseLike(mr)?(continuablePromiseMap.set(mr,tr),lr=mr,mr.then(dr(mr),fr(mr)),INTERNAL_registerAbortHandler(mr,hr)):rr(mr)}catch(mr){ir(mr)}};e.then(dr(e),fr(e)),INTERNAL_registerAbortHandler(e,hr)}),continuablePromiseMap.set(e,tr)),tr};function useAtomValue(e,t){const{delay:tr,unstable_promiseStatus:rr=!React__default.use}={},ir=useStore(),[[lr,dr,fr],hr]=useReducer(gr=>{const yr=ir.get(e);return Object.is(gr[0],yr)&&gr[1]===ir&&gr[2]===e?gr:[yr,ir,e]},void 0,()=>[ir.get(e),ir,e]);let mr=lr;if((dr!==ir||fr!==e)&&(hr(),mr=ir.get(e)),useEffect(()=>{const gr=ir.sub(e,()=>{if(rr)try{const yr=ir.get(e);isPromiseLike(yr)&&attachPromiseStatus(createContinuablePromise(yr,()=>ir.get(e)))}catch{}if(typeof tr=="number"){setTimeout(hr,tr);return}hr()});return hr(),gr},[ir,e,tr,rr]),useDebugValue(mr),isPromiseLike(mr)){const gr=createContinuablePromise(mr,()=>ir.get(e));return rr&&attachPromiseStatus(gr),use(gr)}return mr}function useSetAtom(e,t){const tr=useStore();return useCallback((...ir)=>{if((__vite_import_meta_env__?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return tr.set(e,...ir)},[tr,e])}function useAtom(e,t){return[useAtomValue(e),useSetAtom(e)]}function useDocument(e,t={}){const{documentId:tr,documentType:rr,driveId:ir}=t,[lr,dr]=useState(),fr=useCallback(hr=>{if(!e)throw new Error("Reactor is not loaded");return e.on("strandUpdate",hr)},[e]);return useEffect(()=>{e&&(!ir||!tr||!rr||e.getDocument(ir,tr).then(dr).catch(console.error))},[ir,tr,rr,e]),useEffect(()=>!e||!ir||!tr||!rr?void 0:fr(mr=>{mr.driveId===ir&&mr.documentId===tr&&e.getDocument(ir,tr).then(dr).catch(console.error)}),[fr,ir,tr,rr]),lr}const documentDrivesAtom=atom(new Map);documentDrivesAtom.debugLabel="documentDrivesAtomInReactorBrowser";function drivesToHash(e){return e.map(documentToHash).join("&")}const readWriteDocumentDrivesAtom=e=>()=>atom(t=>e?t(documentDrivesAtom).get(e)??[]:[],(t,tr,rr)=>{tr(documentDrivesAtom,ir=>{if(!e)return new Map;const lr=ir.get(e)??[];return lr.length!==rr.length||drivesToHash(lr)!==drivesToHash(rr)?new Map(ir).set(e,rr):ir})}),documentDrivesInitialized=atom("INITIAL");documentDrivesInitialized.debugLabel="documentDrivesInitializedInReactorBrowser";const FETCH_TIMEOUT=250;let timeout;const listeners=new Array;function waitForResult(e,t,tr){timeout&&clearTimeout(timeout),listeners.push(t);const rr=[...listeners];timeout=setTimeout(()=>{e().then(()=>{for(;rr.length;){const ir=rr.shift();if(ir){ir();const lr=listeners.indexOf(ir);lr>-1&&listeners.splice(lr,1)}}}).catch(tr)},FETCH_TIMEOUT)}async function fetchDocumentdrives(e){const t=[],tr=await e.getDrives();for(const rr of tr)try{const ir=await e.getDrive(rr);t.push(ir)}catch(ir){console.error(ir)}return t}function useDocumentDrives(e){const[t,tr]=useAtom(useMemo(readWriteDocumentDrivesAtom(e),[e])),rr=useCallback(async()=>{if(e)return new Promise((fr,hr)=>{waitForResult(()=>fetchDocumentdrives(e).then(mr=>{tr(mr)}).catch(hr),fr,hr)})},[e]),[ir,lr]=useAtom(documentDrivesInitialized);ir==="INITIAL"&&e&&(lr("LOADING"),rr().then(()=>lr("LOADED")).catch(()=>lr("ERROR")));const dr=useCallback(fr=>{if(!e)return;const hr=e.on("strandUpdate",()=>rr()),mr=e.on("syncStatus",async(vr,Sr,Ir)=>{Ir&&console.error(Ir),Ir&&await rr()}),gr=e.on("driveAdded",()=>rr()),yr=e.on("driveDeleted",()=>rr()),_r=e.on("driveOperationsAdded",()=>rr()),br=e.on("clientStrandsError",fr.strandsErrorHandler),wr=e.on("defaultRemoteDrive",()=>rr());return()=>{hr(),mr(),gr(),yr(),_r(),br(),wr()}},[e,rr]);return useMemo(()=>[t,rr,dr,ir],[t,ir])}async function signOperation(e,t,tr,rr,ir,lr){if(!lr||!e.context||!e.context.signer)return e;if(!ir)return console.error(`Document model '${rr.header.documentType}' does not have a reducer`),e;const dr={documentId:tr,signer:e.context.signer};return await buildSignedOperation(e,ir,rr,dr,t)}function addActionContext(e,t,tr){return tr?{context:{signer:{app:{name:"Connect",key:t||""},user:{address:tr.address,networkId:tr.networkId,chainId:tr.chainId},signatures:[]}},...e}:e}function debounceOperations(e,t=50){let tr;const rr=[];return ir=>{tr&&clearTimeout(tr);const lr=rr.findIndex(dr=>dr.scope===ir.scope&&dr.index===ir.index);if(lr>-1){const dr=rr[lr];dr.type===ir.type&&JSON.stringify(ir.input)===JSON.stringify(dr.input)||console.warn("Two conflicting operations were dispatched:",dr,ir),rr[lr]=ir}else rr.push(ir);return new Promise((dr,fr)=>{tr=setTimeout(()=>{e(rr).then(dr).catch(fr)},t)})}}function useAddDebouncedOperations(e,t){const{driveId:tr,documentId:rr}=t,[ir]=useDocumentDrives(e),lr=useRef(ir),{isAllowedToEditDocuments:dr}=useUserPermissions()||{isAllowedToEditDocuments:!1};useEffect(()=>{lr.current=ir},[ir]);const fr=useCallback(async(mr,gr,yr)=>{if(!dr)throw new Error("User is not allowed to edit documents");if(!e)throw new Error("Reactor is not loaded");if(!lr.current.find(wr=>wr.header.id===mr))throw new Error(`Drive with id ${mr} not found`);return(await e.queueOperations(mr,gr,yr)).document},[dr,e]);return useMemo(()=>debounceOperations(mr=>fr(tr,rr,mr)),[fr,tr,rr])}function useDocumentDispatch(e,t,tr=console.error){const[rr,ir]=useState(t),[lr,dr]=useState(),fr=mr=>{dr(mr),tr(mr)};return useEffect(()=>{ir(t)},[t]),[rr,(mr,gr,yr)=>{dr(void 0),ir(_r=>{if(!e||!_r)return _r;try{const br=e(_r,mr),wr=mr.scope??"global",vr=br.operations[wr],Sr=vr[vr.length-1];if(Sr.error){const Ir=new Error(Sr.error);fr(Ir),yr==null||yr(Ir)}return gr==null||gr(Sr,{prevState:{..._r},newState:{...br}}),br}catch(br){return fr(br),yr==null||yr(br),_r}})},lr]}function useDocumentEditorProps(e,t){const{nodeId:tr,driveId:rr,documentModelModule:ir,document:lr,user:dr,connectDid:fr,sign:hr}=t,mr=useAddDebouncedOperations(e,{driveId:rr,documentId:tr}),[gr,yr,_r]=useDocumentDispatch(ir.reducer,lr);function br(wr,vr){const Sr=(Ir,Mr)=>{const{prevState:Ar}=Mr;signOperation(Ir,hr,tr,Ar,ir.reducer,dr).then(kr=>mr(kr)).catch(console.error)};yr(addActionContext(wr,fr,dr),Sr,vr)}return{dispatch:br,document:gr,error:_r}}const generateId=()=>generateId$1().toString();function getNode(e,t){return t.state.global.nodes.find(tr=>tr.id===e)}function createDriveActions(e,t,tr){const rr=e,ir=rr.header.id,{selectedNode:lr}=tr,dr=async(wr,vr,Sr=generateId())=>{t(addFolder({id:Sr,name:wr,parentFolder:vr??null}))},fr=async(wr,vr,Sr,Ir,Mr=generateId())=>{const Ar=generateAddNodeAction(rr.state.global,{id:Mr,name:wr,parentFolder:Ir??null,documentType:vr,document:Sr},["global"]);t(Ar)},hr=async(wr,vr=lr&&isFolderNode(lr)?lr.id:void 0,Sr=wr.name.replace(/\.zip$/gim,""))=>{const Ir=vr?getNode(vr,rr):void 0;if(vr&&!Ir)throw new Error(`Parent folder with id "${vr}" not found`);if(Ir&&!isFolderNode(Ir))throw new Error(`Parent folder with id "${vr}" is not a folder`);await tr.addFile(wr,ir,Sr,vr)},mr=async wr=>{t(deleteNode({id:wr}))},gr=async(wr,vr)=>{t(updateNode({id:wr,name:vr}))},yr=async(wr,vr)=>{t(moveNode({srcFolder:wr,targetParentFolder:vr}))},_r=async(wr,vr)=>{const Sr=vr?getNode(vr,rr):void 0;if(vr&&!Sr&&vr!==ir)throw new Error(`Target node with id "${vr}" not found`);if(Sr&&!isFolderNode(Sr))throw new Error(`Target node with id "${vr}" is not a folder`);const Ir=getNode(wr,rr);if(!Ir)throw new Error(`Source node with id "${wr}" not found`);const Ar=generateNodesCopy({srcId:wr,targetParentFolder:Sr==null?void 0:Sr.id,targetName:Ir.name},generateId,rr.state.global.nodes).map(kr=>copyNode(kr));for(const kr of Ar)t(kr)},br=async wr=>{const vr=getNode(wr,rr);if(!vr)throw new Error(`Node with id "${wr}" not found`);await _r(vr.id,vr.parentFolder||void 0)};return{context:tr,selectNode:tr.selectNode,addFolder:dr,addFile:hr,addDocument:fr,deleteNode:mr,renameNode:gr,moveNode:yr,copyNode:_r,duplicateNode:br}}function useDriveActions(e,t,tr){return useMemo(()=>createDriveActions(e,t,tr),[e,t,tr])}const DRIVE$1="DRIVE",FILE$1="FILE",DriveContext=createContext(void 0),DriveContextProvider=({value:e,children:t})=>jsx$1(DriveContext.Provider,{value:e,children:t});function useDriveContext(){const e=useContext(DriveContext);if(!e)throw new Error("useDriveContext must be used within a DriveContextProvider");return e}const defaultTreeItemContextValue={driveNodes:[],selectedNode:null,selectedNodePath:[],selectedDriveNode:null,selectedParentNode:null,setDriveNodes:()=>{},setSelectedNode:()=>{},getNodeById:()=>null,getParentNode:()=>null,getIsSelected:()=>!1,getIsInSelectedNodePath:()=>!1,getSiblings:()=>[]},UiNodesContext=createContext(defaultTreeItemContextValue),UiNodesContextProvider=({children:e})=>{const[t,tr]=useState([]),[rr,ir]=useState(null),[lr,dr]=useState([]),[fr,hr]=useState(null),[mr,gr]=useState(null),yr=useCallback(($r,Fr)=>{if(!(Fr!=null&&Fr.length))return null;for(const Lr of Fr){if(Lr.id===$r)return Lr;const qn=Lr.nodeMap[$r];if(qn)return qn}return null},[]),_r=useCallback($r=>yr($r,t),[yr,t]),br=useCallback(($r,Fr)=>!$r||!(Fr!=null&&Fr.length)?null:$r.kind===DRIVE$1?$r:Fr.find(Lr=>Lr.id===$r.driveId)??null,[]),wr=useCallback(($r,Fr)=>{if(!(Fr!=null&&Fr.length)||$r.kind===DRIVE$1)return null;const Lr=yr($r.parentFolder,Fr);if(!Lr)return null;if(Lr.kind===FILE$1)throw new Error(`Parent node ${$r.parentFolder} is a file, not a folder`);return Lr},[yr]),vr=useCallback($r=>wr($r,t),[wr,t]),Sr=useCallback(($r,Fr)=>!$r||!(Fr!=null&&Fr.length)?null:$r.kind===FILE$1?wr($r,Fr):$r,[wr]),Ir=useCallback(($r,Fr)=>{const Lr=[],qn=Fr.find(Gr=>Gr.id===$r.driveId);let Kn=$r;for(;Kn;)Lr.push(Kn),Kn=Kn.parentFolder===(qn==null?void 0:qn.id)?qn:Kn.parentFolder?qn==null?void 0:qn.nodeMap[Kn.parentFolder]:void 0;return Lr.reverse()},[]),Mr=useCallback($r=>{if(ir($r),hr(br($r,t)),gr(Sr($r,t)),!$r){dr([]);return}if($r.kind===DRIVE$1){dr([$r]);return}const Fr=Ir($r,t);dr(Fr)},[t,Ir,br,Sr]),Ar=useCallback($r=>rr===$r,[rr]),kr=useCallback($r=>$r.kind===FILE$1?!1:lr.includes($r),[lr]),Or=useCallback($r=>{if($r.kind===DRIVE$1)return console.warn("Drive nodes do not have siblings, as they are top-level nodes"),[];const Fr=wr($r,t);return(Fr==null?void 0:Fr.children)??[]},[wr,t]);useEffect(()=>{if(!rr)return;const $r=yr(rr.id,t);$r&&Mr($r)},[t,yr,rr,Mr]);const Dr=useMemo(()=>({driveNodes:t,selectedNode:rr,selectedNodePath:lr,selectedDriveNode:fr,selectedParentNode:mr,getNodeById:_r,getParentNode:vr,setDriveNodes:tr,setSelectedNode:Mr,getIsSelected:Ar,getIsInSelectedNodePath:kr,getSiblings:Or}),[t,rr,lr,fr,mr,_r,vr,Mr,Ar,kr,Or]);return jsx$1(UiNodesContext.Provider,{value:Dr,children:e})},useUiNodesContext=()=>useContext(UiNodesContext);function toNode(e){if(e.kind==="DRIVE")throw new Error("Cannot convert drive node to regular node");const{id:t,name:tr,parentFolder:rr,kind:ir}=e;if(ir==="FOLDER")return{id:t,name:tr,parentFolder:rr,kind:"folder"};{const lr=e;return{id:t,name:tr,parentFolder:rr,kind:"file",documentType:lr.documentType,synchronizationUnits:lr.synchronizationUnits}}}function createUiNodeAdapter(e){return{...e,addFile:(t,tr)=>e.addFile(t,tr==null?void 0:tr.id),addFolder:(t,tr=void 0)=>e.addFolder(t,tr),renameNode:(t,tr)=>{const rr=toNode(tr);return e.renameNode(rr.id,t)},deleteNode:t=>{const tr=toNode(t);return e.deleteNode(tr.id)},moveNode:async(t,tr)=>{if(tr.kind===FILE$1||t.parentFolder===tr.id)return;const rr=toNode(t),ir=toNode(tr);return e.moveNode(rr.id,ir.id)},copyNode:(t,tr)=>e.copyNode(t.id,tr.id),duplicateNode:t=>{const tr=toNode(t);return e.duplicateNode(tr.id)}}}function useDriveActionsWithUiNodes(e,t){const{selectedNode:tr,selectedDriveNode:rr,setSelectedNode:ir,getNodeById:lr}=useUiNodesContext(),dr=useDriveContext(),fr=useMemo(()=>({...dr,selectedNode:tr,onSelectNode:gr=>{dr.selectNode(gr),ir(lr(gr.id))}}),[tr,rr==null?void 0:rr.driveId,ir,lr]),hr=useDriveActions(e,t,fr);return useMemo(()=>createUiNodeAdapter(hr),[hr])}var p$1=Object.create,i=Object.defineProperty,c$2=Object.getOwnPropertyDescriptor,f$1=Object.getOwnPropertyNames,l$2=Object.getPrototypeOf,s$1=Object.prototype.hasOwnProperty,a=e=>{throw TypeError(e)},_$3=(e,t,tr)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:tr}):e[t]=tr,d$1=(e,t)=>()=>(e&&(t=e(e=0)),t),D$4=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),F$3=(e,t)=>{for(var tr in t)i(e,tr,{get:t[tr],enumerable:!0})},g$5=(e,t,tr,rr)=>{if(t&&typeof t=="object"||typeof t=="function")for(let ir of f$1(t))!s$1.call(e,ir)&&ir!==tr&&i(e,ir,{get:()=>t[ir],enumerable:!(rr=c$2(t,ir))||rr.enumerable});return e},L$4=(e,t,tr)=>(tr=e!=null?p$1(l$2(e)):{},g$5(i(tr,"default",{value:e,enumerable:!0}),e)),P$3=(e,t,tr)=>_$3(e,typeof t!="symbol"?t+"":t,tr),n=(e,t,tr)=>t.has(e)||a("Cannot "+tr),h$2=(e,t,tr)=>(n(e,t,"read from private field"),tr?tr.call(e):t.get(e)),R$3=(e,t,tr)=>t.has(e)?a("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,tr),x$4=(e,t,tr,rr)=>(n(e,t,"write to private field"),t.set(e,tr),tr),T$2=(e,t,tr)=>(n(e,t,"access private method"),tr),U$3=(e,t,tr,rr)=>({set _(ir){x$4(e,t,ir)},get _(){return h$2(e,t,rr)}}),u$2=d$1(()=>{}),hn={};F$3(hn,{ABSTIME:()=>Et,ACLITEM:()=>Vt,BIT:()=>Wt,BOOL:()=>be,BPCHAR:()=>_e$1,BYTEA:()=>ge$1,CHAR:()=>gt,CID:()=>St,CIDR:()=>Tt,CIRCLE:()=>Ut,DATE:()=>He$1,FLOAT4:()=>je$1,FLOAT8:()=>Qe$1,GTSVECTOR:()=>rn,INET:()=>kt,INT2:()=>ve,INT4:()=>Ge,INT8:()=>we,INTERVAL:()=>vt,JSON:()=>Ae$1,JSONB:()=>Ye,MACADDR:()=>Ot,MACADDR8:()=>Nt,MONEY:()=>Lt,NUMERIC:()=>Qt,OID:()=>We$1,PATH:()=>Mt,PG_DEPENDENCIES:()=>en,PG_LSN:()=>Xt,PG_NDISTINCT:()=>Zt,PG_NODE_TREE:()=>Bt,POLYGON:()=>Rt,REFCURSOR:()=>_t,REGCLASS:()=>Yt,REGCONFIG:()=>sn,REGDICTIONARY:()=>an,REGNAMESPACE:()=>on,REGOPER:()=>Ht,REGOPERATOR:()=>qt,REGPROC:()=>wt,REGPROCEDURE:()=>zt,REGROLE:()=>un,REGTYPE:()=>$t,RELTIME:()=>Ct,SMGR:()=>It,TEXT:()=>F$2,TID:()=>At,TIME:()=>Ft,TIMESTAMP:()=>qe$1,TIMESTAMPTZ:()=>xe,TIMETZ:()=>Gt,TINTERVAL:()=>Pt,TSQUERY:()=>nn,TSVECTOR:()=>tn,TXID_SNAPSHOT:()=>Jt,UUID:()=>Kt,VARBIT:()=>jt,VARCHAR:()=>ze,XID:()=>xt,XML:()=>Dt,arrayParser:()=>yn,arraySerializer:()=>Ke$1,parseType:()=>ue,parsers:()=>ln,serializers:()=>cn,types:()=>$e});u$2();var ht=globalThis.JSON.parse,bt=globalThis.JSON.stringify,be=16,ge$1=17,gt=18,we=20,ve=21,Ge=23,wt=24,F$2=25,We$1=26,At=27,xt=28,St=29,Ae$1=114,Dt=142,Bt=194,It=210,Mt=602,Rt=604,Tt=650,je$1=700,Qe$1=701,Et=702,Ct=703,Pt=704,Ut=718,Nt=774,Lt=790,Ot=829,kt=869,Vt=1033,_e$1=1042,ze=1043,He$1=1082,Ft=1083,qe$1=1114,xe=1184,vt=1186,Gt=1266,Wt=1560,jt=1562,Qt=1700,_t=1790,zt=2202,Ht=2203,qt=2204,Yt=2205,$t=2206,Kt=2950,Jt=2970,Xt=3220,Zt=3361,en=3402,tn=3614,nn=3615,rn=3642,sn=3734,an=3769,Ye=3802,on=4089,un=4096,$e={string:{to:F$2,from:[F$2,ze,_e$1],serialize:e=>{if(typeof e=="string")return e;if(typeof e=="number")return e.toString();throw new Error("Invalid input for string type")},parse:e=>e},number:{to:0,from:[ve,Ge,We$1,je$1,Qe$1],serialize:e=>e.toString(),parse:e=>+e},bigint:{to:we,from:[we],serialize:e=>e.toString(),parse:e=>{let t=BigInt(e);return t<Number.MIN_SAFE_INTEGER||t>Number.MAX_SAFE_INTEGER?t:Number(t)}},json:{to:Ae$1,from:[Ae$1,Ye],serialize:e=>typeof e=="string"?e:bt(e),parse:e=>ht(e)},boolean:{to:be,from:[be],serialize:e=>{if(typeof e!="boolean")throw new Error("Invalid input for boolean type");return e?"t":"f"},parse:e=>e==="t"},date:{to:xe,from:[He$1,qe$1,xe],serialize:e=>{if(typeof e=="string")return e;if(typeof e=="number")return new Date(e).toISOString();if(e instanceof Date)return e.toISOString();throw new Error("Invalid input for date type")},parse:e=>new Date(e)},bytea:{to:ge$1,from:[ge$1],serialize:e=>{if(!(e instanceof Uint8Array))throw new Error("Invalid input for bytea type");return"\\x"+Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},parse:e=>{let t=e.slice(2);return Uint8Array.from({length:t.length/2},(tr,rr)=>parseInt(t.substring(rr*2,(rr+1)*2),16))}}},Se=pn($e),ln=Se.parsers,cn=Se.serializers;function ue(e,t,tr){if(e===null)return null;let rr=(tr==null?void 0:tr[t])??Se.parsers[t];return rr?rr(e,t):e}function pn(e){return Object.keys(e).reduce(({parsers:t,serializers:tr},rr)=>{let{to:ir,from:lr,serialize:dr,parse:fr}=e[rr];return tr[ir]=dr,tr[rr]=dr,t[rr]=fr,Array.isArray(lr)?lr.forEach(hr=>{t[hr]=fr,tr[hr]=dr}):(t[lr]=fr,tr[lr]=dr),{parsers:t,serializers:tr}},{parsers:{},serializers:{}})}var dn=/\\/g,fn=/"/g;function mn(e){return e.replace(dn,"\\\\").replace(fn,'\\"')}function Ke$1(e,t,tr){if(Array.isArray(e)===!1)return e;if(!e.length)return"{}";let rr=e[0],ir=tr===1020?";":",";return Array.isArray(rr)?`{${e.map(lr=>Ke$1(lr,t,tr)).join(ir)}}`:`{${e.map(lr=>(lr===void 0&&(lr=null),lr===null?"null":'"'+mn(t?t(lr):lr.toString())+'"')).join(ir)}}`}var he={i:0,char:null,str:"",quoted:!1,last:0,p:null};function yn(e,t,tr){return he.i=he.last=0,Je(he,e,t,tr)[0]}function Je(e,t,tr,rr){let ir=[],lr=rr===1020?";":",";for(;e.i<t.length;e.i++){if(e.char=t[e.i],e.quoted)e.char==="\\"?e.str+=t[++e.i]:e.char==='"'?(ir.push(tr?tr(e.str):e.str),e.str="",e.quoted=t[e.i+1]==='"',e.last=e.i+2):e.str+=e.char;else if(e.char==='"')e.quoted=!0;else if(e.char==="{")e.last=++e.i,ir.push(Je(e,t,tr,rr));else if(e.char==="}"){e.quoted=!1,e.last<e.i&&ir.push(tr?tr(t.slice(e.last,e.i)):t.slice(e.last,e.i)),e.last=e.i+1;break}else e.char===lr&&e.p!=="}"&&e.p!=='"'&&(ir.push(tr?tr(t.slice(e.last,e.i)):t.slice(e.last,e.i)),e.last=e.i+1);e.p=e.char}return e.last<e.i&&ir.push(tr?tr(t.slice(e.last,e.i+1)):t.slice(e.last,e.i+1)),ir}var wn={};F$3(wn,{parseDescribeStatementResults:()=>De,parseResults:()=>bn});u$2();function bn(e,t,tr,rr){let ir=[],lr={rows:[],fields:[]},dr=0,fr={...t,...tr==null?void 0:tr.parsers};return e.forEach(hr=>{switch(hr.name){case"rowDescription":{let mr=hr;lr.fields=mr.fields.map(gr=>({name:gr.name,dataTypeID:gr.dataTypeID}));break}case"dataRow":{if(!lr)break;let mr=hr;(tr==null?void 0:tr.rowMode)==="array"?lr.rows.push(mr.fields.map((gr,yr)=>ue(gr,lr.fields[yr].dataTypeID,fr))):lr.rows.push(Object.fromEntries(mr.fields.map((gr,yr)=>[lr.fields[yr].name,ue(gr,lr.fields[yr].dataTypeID,fr)])));break}case"commandComplete":{dr+=gn(hr),ir.push({...lr,affectedRows:dr,...rr?{blob:rr}:{}}),lr={rows:[],fields:[]};break}}}),ir.length===0&&ir.push({affectedRows:0,rows:[],fields:[]}),ir}function gn(e){let t=e.text.split(" ");switch(t[0]){case"INSERT":return parseInt(t[2],10);case"UPDATE":case"DELETE":case"COPY":return parseInt(t[1],10);default:return 0}}function De(e){let t=e.find(tr=>tr.name==="parameterDescription");return t?t.dataTypeIDs:[]}var Ue$1={};F$3(Ue$1,{AuthenticationCleartextPassword:()=>G$2,AuthenticationMD5Password:()=>W$2,AuthenticationOk:()=>v$2,AuthenticationSASL:()=>j$2,AuthenticationSASLContinue:()=>Q$1,AuthenticationSASLFinal:()=>_$2,BackendKeyDataMessage:()=>J$2,CommandCompleteMessage:()=>ee$1,CopyDataMessage:()=>z$2,CopyResponse:()=>H$4,DataRowMessage:()=>te$1,DatabaseError:()=>E$2,Field:()=>q$3,NoticeMessage:()=>ne,NotificationResponseMessage:()=>X,ParameterDescriptionMessage:()=>$$3,ParameterStatusMessage:()=>K$2,ReadyForQueryMessage:()=>Z$1,RowDescriptionMessage:()=>Y$1,bindComplete:()=>Ie$1,closeComplete:()=>Me,copyDone:()=>Pe$1,emptyQuery:()=>Ce,noData:()=>Re,parseComplete:()=>Be,portalSuspended:()=>Te$1,replicationStart:()=>Ee});u$2();var Be={name:"parseComplete",length:5},Ie$1={name:"bindComplete",length:5},Me={name:"closeComplete",length:5},Re={name:"noData",length:5},Te$1={name:"portalSuspended",length:5},Ee={name:"replicationStart",length:4},Ce={name:"emptyQuery",length:4},Pe$1={name:"copyDone",length:4},v$2=class{constructor(t){this.length=t,this.name="authenticationOk"}},G$2=class{constructor(t){this.length=t,this.name="authenticationCleartextPassword"}},W$2=class{constructor(t,tr){this.length=t,this.salt=tr,this.name="authenticationMD5Password"}},j$2=class{constructor(t,tr){this.length=t,this.mechanisms=tr,this.name="authenticationSASL"}},Q$1=class{constructor(t,tr){this.length=t,this.data=tr,this.name="authenticationSASLContinue"}},_$2=class{constructor(t,tr){this.length=t,this.data=tr,this.name="authenticationSASLFinal"}},E$2=class extends Error{constructor(t,tr,rr){super(t),this.length=tr,this.name=rr}},z$2=class{constructor(t,tr){this.length=t,this.chunk=tr,this.name="copyData"}},H$4=class{constructor(t,tr,rr,ir){this.length=t,this.name=tr,this.binary=rr,this.columnTypes=new Array(ir)}},q$3=class{constructor(t,tr,rr,ir,lr,dr,fr){this.name=t,this.tableID=tr,this.columnID=rr,this.dataTypeID=ir,this.dataTypeSize=lr,this.dataTypeModifier=dr,this.format=fr}},Y$1=class{constructor(t,tr){this.length=t,this.fieldCount=tr,this.name="rowDescription",this.fields=new Array(this.fieldCount)}},$$3=class{constructor(t,tr){this.length=t,this.parameterCount=tr,this.name="parameterDescription",this.dataTypeIDs=new Array(this.parameterCount)}},K$2=class{constructor(t,tr,rr){this.length=t,this.parameterName=tr,this.parameterValue=rr,this.name="parameterStatus"}},J$2=class{constructor(t,tr,rr){this.length=t,this.processID=tr,this.secretKey=rr,this.name="backendKeyData"}},X=class{constructor(e,t,tr,rr){this.length=e,this.processId=t,this.channel=tr,this.payload=rr,this.name="notification"}},Z$1=class{constructor(t,tr){this.length=t,this.status=tr,this.name="readyForQuery"}},ee$1=class{constructor(t,tr){this.length=t,this.text=tr,this.name="commandComplete"}},te$1=class{constructor(t,tr){this.length=t,this.fields=tr,this.name="dataRow",this.fieldCount=tr.length}},ne=class{constructor(e,t){this.length=e,this.message=t,this.name="notice"}},zn={};F$3(zn,{Parser:()=>ye,messages:()=>Ue$1,serialize:()=>O$3});u$2();u$2();u$2();u$2();function C$3(e){let t=e.length;for(let tr=e.length-1;tr>=0;tr--){let rr=e.charCodeAt(tr);rr>127&&rr<=2047?t++:rr>2047&&rr<=65535&&(t+=2),rr>=56320&&rr<=57343&&tr--}return t}var b$3,g$4,U$2,ce$2,N$1,x$3,le,P$2,Xe,R$2=class{constructor(t=256){this.size=t,R$3(this,x$3),R$3(this,b$3),R$3(this,g$4,5),R$3(this,U$2,!1),R$3(this,ce$2,new TextEncoder),R$3(this,N$1,0),x$4(this,b$3,T$2(this,x$3,le).call(this,t))}addInt32(t){return T$2(this,x$3,P$2).call(this,4),h$2(this,b$3).setInt32(h$2(this,g$4),t,h$2(this,U$2)),x$4(this,g$4,h$2(this,g$4)+4),this}addInt16(t){return T$2(this,x$3,P$2).call(this,2),h$2(this,b$3).setInt16(h$2(this,g$4),t,h$2(this,U$2)),x$4(this,g$4,h$2(this,g$4)+2),this}addCString(t){return t&&this.addString(t),T$2(this,x$3,P$2).call(this,1),h$2(this,b$3).setUint8(h$2(this,g$4),0),U$3(this,g$4)._++,this}addString(t=""){let tr=C$3(t);return T$2(this,x$3,P$2).call(this,tr),h$2(this,ce$2).encodeInto(t,new Uint8Array(h$2(this,b$3).buffer,h$2(this,g$4))),x$4(this,g$4,h$2(this,g$4)+tr),this}add(t){return T$2(this,x$3,P$2).call(this,t.byteLength),new Uint8Array(h$2(this,b$3).buffer).set(new Uint8Array(t),h$2(this,g$4)),x$4(this,g$4,h$2(this,g$4)+t.byteLength),this}flush(t){let tr=T$2(this,x$3,Xe).call(this,t);return x$4(this,g$4,5),x$4(this,b$3,T$2(this,x$3,le).call(this,this.size)),new Uint8Array(tr)}};b$3=new WeakMap,g$4=new WeakMap,U$2=new WeakMap,ce$2=new WeakMap,N$1=new WeakMap,x$3=new WeakSet,le=function(e){return new DataView(new ArrayBuffer(e))},P$2=function(e){if(h$2(this,b$3).byteLength-h$2(this,g$4)<e){let t=h$2(this,b$3).buffer,tr=t.byteLength+(t.byteLength>>1)+e;x$4(this,b$3,T$2(this,x$3,le).call(this,tr)),new Uint8Array(h$2(this,b$3).buffer).set(new Uint8Array(t))}},Xe=function(e){if(e){h$2(this,b$3).setUint8(h$2(this,N$1),e);let t=h$2(this,g$4)-(h$2(this,N$1)+1);h$2(this,b$3).setInt32(h$2(this,N$1)+1,t,h$2(this,U$2))}return h$2(this,b$3).buffer.slice(e?0:5,h$2(this,g$4))};var m$2=new R$2,An=e=>{m$2.addInt16(3).addInt16(0);for(let rr of Object.keys(e))m$2.addCString(rr).addCString(e[rr]);m$2.addCString("client_encoding").addCString("UTF8");let t=m$2.addCString("").flush(),tr=t.byteLength+4;return new R$2().addInt32(tr).add(t).flush()},xn=()=>{let e=new DataView(new ArrayBuffer(8));return e.setInt32(0,8,!1),e.setInt32(4,80877103,!1),new Uint8Array(e.buffer)},Sn=e=>m$2.addCString(e).flush(112),Dn=(e,t)=>(m$2.addCString(e).addInt32(C$3(t)).addString(t),m$2.flush(112)),Bn=e=>m$2.addString(e).flush(112),In=e=>m$2.addCString(e).flush(81),Mn=[],Rn=e=>{var rr,ir;let t=e.name??"";t.length>63&&(console.error("Warning! Postgres only supports 63 characters for query names."),console.error("You supplied %s (%s)",t,t.length),console.error("This can cause conflicts and silent errors executing queries"));let tr=m$2.addCString(t).addCString(e.text).addInt16(((rr=e.types)==null?void 0:rr.length)??0);return(ir=e.types)==null||ir.forEach(lr=>tr.addInt32(lr)),m$2.flush(80)},L$3=new R$2,Tn=(e,t)=>{for(let tr=0;tr<e.length;tr++){let rr=t?t(e[tr],tr):e[tr];if(rr===null)m$2.addInt16(0),L$3.addInt32(-1);else if(rr instanceof ArrayBuffer||ArrayBuffer.isView(rr)){let ir=ArrayBuffer.isView(rr)?rr.buffer.slice(rr.byteOffset,rr.byteOffset+rr.byteLength):rr;m$2.addInt16(1),L$3.addInt32(ir.byteLength),L$3.add(ir)}else m$2.addInt16(0),L$3.addInt32(C$3(rr)),L$3.addString(rr)}},En=(e={})=>{let t=e.portal??"",tr=e.statement??"",rr=e.binary??!1,ir=e.values??Mn,lr=ir.length;return m$2.addCString(t).addCString(tr),m$2.addInt16(lr),Tn(ir,e.valueMapper),m$2.addInt16(lr),m$2.add(L$3.flush()),m$2.addInt16(rr?1:0),m$2.flush(66)},Cn=new Uint8Array([69,0,0,0,9,0,0,0,0,0]),Pn=e=>{if(!e||!e.portal&&!e.rows)return Cn;let t=e.portal??"",tr=e.rows??0,rr=C$3(t),ir=4+rr+1+4,lr=new DataView(new ArrayBuffer(1+ir));return lr.setUint8(0,69),lr.setInt32(1,ir,!1),new TextEncoder().encodeInto(t,new Uint8Array(lr.buffer,5)),lr.setUint8(rr+5,0),lr.setUint32(lr.byteLength-4,tr,!1),new Uint8Array(lr.buffer)},Un=(e,t)=>{let tr=new DataView(new ArrayBuffer(16));return tr.setInt32(0,16,!1),tr.setInt16(4,1234,!1),tr.setInt16(6,5678,!1),tr.setInt32(8,e,!1),tr.setInt32(12,t,!1),new Uint8Array(tr.buffer)},Ne=(e,t)=>{let tr=new R$2;return tr.addCString(t),tr.flush(e)},Nn=m$2.addCString("P").flush(68),Ln=m$2.addCString("S").flush(68),On=e=>e.name?Ne(68,`${e.type}${e.name??""}`):e.type==="P"?Nn:Ln,kn=e=>{let t=`${e.type}${e.name??""}`;return Ne(67,t)},Vn=e=>m$2.add(e).flush(100),Fn=e=>Ne(102,e),pe$1=e=>new Uint8Array([e,0,0,0,4]),vn=pe$1(72),Gn=pe$1(83),Wn=pe$1(88),jn=pe$1(99),O$3={startup:An,password:Sn,requestSsl:xn,sendSASLInitialResponseMessage:Dn,sendSCRAMClientFinalMessage:Bn,query:In,parse:Rn,bind:En,execute:Pn,describe:On,close:kn,flush:()=>vn,sync:()=>Gn,end:()=>Wn,copyData:Vn,copyDone:()=>jn,copyFail:Fn,cancel:Un};u$2();u$2();var Le={text:0,binary:1};u$2();var Qn=new ArrayBuffer(0),M$3,w$3,fe,me$1,re$1,de=class{constructor(e=0){R$3(this,M$3,new DataView(Qn)),R$3(this,w$3),R$3(this,fe,"utf-8"),R$3(this,me$1,new TextDecoder(h$2(this,fe))),R$3(this,re$1,!1),x$4(this,w$3,e)}setBuffer(e,t){x$4(this,w$3,e),x$4(this,M$3,new DataView(t))}int16(){let e=h$2(this,M$3).getInt16(h$2(this,w$3),h$2(this,re$1));return x$4(this,w$3,h$2(this,w$3)+2),e}byte(){let e=h$2(this,M$3).getUint8(h$2(this,w$3));return U$3(this,w$3)._++,e}int32(){let e=h$2(this,M$3).getInt32(h$2(this,w$3),h$2(this,re$1));return x$4(this,w$3,h$2(this,w$3)+4),e}string(e){return h$2(this,me$1).decode(this.bytes(e))}cstring(){let e=h$2(this,w$3),t=e;for(;h$2(this,M$3).getUint8(t++)!==0;);let tr=this.string(t-e-1);return x$4(this,w$3,t),tr}bytes(e){let t=h$2(this,M$3).buffer.slice(h$2(this,w$3),h$2(this,w$3)+e);return x$4(this,w$3,h$2(this,w$3)+e),new Uint8Array(t)}};M$3=new WeakMap,w$3=new WeakMap,fe=new WeakMap,me$1=new WeakMap,re$1=new WeakMap;var Oe=1,_n=4,Ze=Oe+_n,et=new ArrayBuffer(0),A$2,S$2,D$3,o$1,l$1,tt,nt,rt,st,it,at,ot,ke$1,ut,lt,ct,pt,dt,ft,mt,yt,Ve$1,ye=class{constructor(){R$3(this,l$1),R$3(this,A$2,new DataView(et)),R$3(this,S$2,0),R$3(this,D$3,0),R$3(this,o$1,new de)}parse(e,t){T$2(this,l$1,tt).call(this,ArrayBuffer.isView(e)?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):e);let tr=h$2(this,D$3)+h$2(this,S$2),rr=h$2(this,D$3);for(;rr+Ze<=tr;){let ir=h$2(this,A$2).getUint8(rr),lr=h$2(this,A$2).getUint32(rr+Oe,!1),dr=Oe+lr;if(dr+rr<=tr){let fr=T$2(this,l$1,nt).call(this,rr+Ze,ir,lr,h$2(this,A$2).buffer);t(fr),rr+=dr}else break}rr===tr?(x$4(this,A$2,new DataView(et)),x$4(this,S$2,0),x$4(this,D$3,0)):(x$4(this,S$2,tr-rr),x$4(this,D$3,rr))}};A$2=new WeakMap,S$2=new WeakMap,D$3=new WeakMap,o$1=new WeakMap,l$1=new WeakSet,tt=function(e){if(h$2(this,S$2)>0){let t=h$2(this,S$2)+e.byteLength;if(t+h$2(this,D$3)>h$2(this,A$2).byteLength){let tr;if(t<=h$2(this,A$2).byteLength&&h$2(this,D$3)>=h$2(this,S$2))tr=h$2(this,A$2).buffer;else{let rr=h$2(this,A$2).byteLength*2;for(;t>=rr;)rr*=2;tr=new ArrayBuffer(rr)}new Uint8Array(tr).set(new Uint8Array(h$2(this,A$2).buffer,h$2(this,D$3),h$2(this,S$2))),x$4(this,A$2,new DataView(tr)),x$4(this,D$3,0)}new Uint8Array(h$2(this,A$2).buffer).set(new Uint8Array(e),h$2(this,D$3)+h$2(this,S$2)),x$4(this,S$2,t)}else x$4(this,A$2,new DataView(e)),x$4(this,D$3,0),x$4(this,S$2,e.byteLength)},nt=function(e,t,tr,rr){switch(t){case 50:return Ie$1;case 49:return Be;case 51:return Me;case 110:return Re;case 115:return Te$1;case 99:return Pe$1;case 87:return Ee;case 73:return Ce;case 68:return T$2(this,l$1,dt).call(this,e,tr,rr);case 67:return T$2(this,l$1,st).call(this,e,tr,rr);case 90:return T$2(this,l$1,rt).call(this,e,tr,rr);case 65:return T$2(this,l$1,ut).call(this,e,tr,rr);case 82:return T$2(this,l$1,yt).call(this,e,tr,rr);case 83:return T$2(this,l$1,ft).call(this,e,tr,rr);case 75:return T$2(this,l$1,mt).call(this,e,tr,rr);case 69:return T$2(this,l$1,Ve$1).call(this,e,tr,rr,"error");case 78:return T$2(this,l$1,Ve$1).call(this,e,tr,rr,"notice");case 84:return T$2(this,l$1,lt).call(this,e,tr,rr);case 116:return T$2(this,l$1,pt).call(this,e,tr,rr);case 71:return T$2(this,l$1,at).call(this,e,tr,rr);case 72:return T$2(this,l$1,ot).call(this,e,tr,rr);case 100:return T$2(this,l$1,it).call(this,e,tr,rr);default:return new E$2("received invalid response: "+t.toString(16),tr,"error")}},rt=function(e,t,tr){h$2(this,o$1).setBuffer(e,tr);let rr=h$2(this,o$1).string(1);return new Z$1(t,rr)},st=function(e,t,tr){h$2(this,o$1).setBuffer(e,tr);let rr=h$2(this,o$1).cstring();return new ee$1(t,rr)},it=function(e,t,tr){let rr=tr.slice(e,e+(t-4));return new z$2(t,new Uint8Array(rr))},at=function(e,t,tr){return T$2(this,l$1,ke$1).call(this,e,t,tr,"copyInResponse")},ot=function(e,t,tr){return T$2(this,l$1,ke$1).call(this,e,t,tr,"copyOutResponse")},ke$1=function(e,t,tr,rr){h$2(this,o$1).setBuffer(e,tr);let ir=h$2(this,o$1).byte()!==0,lr=h$2(this,o$1).int16(),dr=new H$4(t,rr,ir,lr);for(let fr=0;fr<lr;fr++)dr.columnTypes[fr]=h$2(this,o$1).int16();return dr},ut=function(e,t,tr){h$2(this,o$1).setBuffer(e,tr);let rr=h$2(this,o$1).int32(),ir=h$2(this,o$1).cstring(),lr=h$2(this,o$1).cstring();return new X(t,rr,ir,lr)},lt=function(e,t,tr){h$2(this,o$1).setBuffer(e,tr);let rr=h$2(this,o$1).int16(),ir=new Y$1(t,rr);for(let lr=0;lr<rr;lr++)ir.fields[lr]=T$2(this,l$1,ct).call(this);return ir},ct=function(){let e=h$2(this,o$1).cstring(),t=h$2(this,o$1).int32(),tr=h$2(this,o$1).int16(),rr=h$2(this,o$1).int32(),ir=h$2(this,o$1).int16(),lr=h$2(this,o$1).int32(),dr=h$2(this,o$1).int16()===0?Le.text:Le.binary;return new q$3(e,t,tr,rr,ir,lr,dr)},pt=function(e,t,tr){h$2(this,o$1).setBuffer(e,tr);let rr=h$2(this,o$1).int16(),ir=new $$3(t,rr);for(let lr=0;lr<rr;lr++)ir.dataTypeIDs[lr]=h$2(this,o$1).int32();return ir},dt=function(e,t,tr){h$2(this,o$1).setBuffer(e,tr);let rr=h$2(this,o$1).int16(),ir=new Array(rr);for(let lr=0;lr<rr;lr++){let dr=h$2(this,o$1).int32();ir[lr]=dr===-1?null:h$2(this,o$1).string(dr)}return new te$1(t,ir)},ft=function(e,t,tr){h$2(this,o$1).setBuffer(e,tr);let rr=h$2(this,o$1).cstring(),ir=h$2(this,o$1).cstring();return new K$2(t,rr,ir)},mt=function(e,t,tr){h$2(this,o$1).setBuffer(e,tr);let rr=h$2(this,o$1).int32(),ir=h$2(this,o$1).int32();return new J$2(t,rr,ir)},yt=function(e,t,tr){h$2(this,o$1).setBuffer(e,tr);let rr=h$2(this,o$1).int32();switch(rr){case 0:return new v$2(t);case 3:return new G$2(t);case 5:return new W$2(t,h$2(this,o$1).bytes(4));case 10:{let ir=[];for(;;){let lr=h$2(this,o$1).cstring();if(lr.length===0)return new j$2(t,ir);ir.push(lr)}}case 11:return new Q$1(t,h$2(this,o$1).string(t-8));case 12:return new _$2(t,h$2(this,o$1).string(t-8));default:throw new Error("Unknown authenticationOk message type "+rr)}},Ve$1=function(e,t,tr,rr){h$2(this,o$1).setBuffer(e,tr);let ir={},lr=h$2(this,o$1).string(1);for(;lr!=="\0";)ir[lr]=h$2(this,o$1).cstring(),lr=h$2(this,o$1).string(1);let dr=ir.M,fr=rr==="notice"?new ne(t,dr):new E$2(dr,t,rr);return fr.severity=ir.S,fr.code=ir.C,fr.detail=ir.D,fr.hint=ir.H,fr.position=ir.P,fr.internalPosition=ir.p,fr.internalQuery=ir.q,fr.where=ir.W,fr.schema=ir.s,fr.table=ir.t,fr.column=ir.c,fr.dataType=ir.d,fr.constraint=ir.n,fr.file=ir.F,fr.line=ir.L,fr.routine=ir.R,fr};u$2();var Fe$1=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",se$1;async function Rr(){if(Fe$1||se$1)return;let e=new URL(""+new URL("postgres-CyuUVpXN.wasm",import.meta.url).href,import.meta.url);se$1=fetch(e)}var k$3;async function Tr(e,t){if(t||k$3)return WebAssembly.instantiate(t||k$3,e),{instance:await WebAssembly.instantiate(t||k$3,e),module:t||k$3};let tr=new URL(""+new URL("postgres-CyuUVpXN.wasm",import.meta.url).href,import.meta.url);if(Fe$1){let rr=await(await __vitePreload(async()=>{const{readFile:dr}=await Promise.resolve().then(()=>__viteBrowserExternal$1);return{readFile:dr}},void 0,import.meta.url)).readFile(tr),{module:ir,instance:lr}=await WebAssembly.instantiate(rr,e);return k$3=ir,{instance:lr,module:ir}}else{se$1||(se$1=fetch(tr));let rr=await se$1,{module:ir,instance:lr}=await WebAssembly.instantiateStreaming(rr,e);return k$3=ir,{instance:lr,module:ir}}}async function Er(){let e=new URL(""+new URL("postgres-CkP7QCDB.data",import.meta.url).href,import.meta.url);return Fe$1?(await(await __vitePreload(async()=>{const{readFile:t}=await Promise.resolve().then(()=>__viteBrowserExternal$1);return{readFile:t}},void 0,import.meta.url)).readFile(e)).buffer:(await fetch(e)).arrayBuffer()}var Cr=()=>{var tr,rr;if((tr=globalThis.crypto)!=null&&tr.randomUUID)return globalThis.crypto.randomUUID();let e=new Uint8Array(16);if((rr=globalThis.crypto)!=null&&rr.getRandomValues)globalThis.crypto.getRandomValues(e);else for(let ir=0;ir<e.length;ir++)e[ir]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=[];return e.forEach(ir=>{t.push(ir.toString(16).padStart(2,"0"))}),t.slice(0,4).join("")+"-"+t.slice(4,6).join("")+"-"+t.slice(6,8).join("")+"-"+t.slice(8,10).join("")+"-"+t.slice(10).join("")};async function Pr(e,t,tr,rr){if(!tr||tr.length===0)return t;rr=rr??e;let ir;try{await e.execProtocol(O$3.parse({text:t}),{syncToFs:!1}),ir=De((await e.execProtocol(O$3.describe({type:"S"}),{syncToFs:!1})).messages)}finally{await e.execProtocol(O$3.sync(),{syncToFs:!1})}let lr=t.replace(/\$([0-9]+)/g,(dr,fr)=>"%"+fr+"L");return(await rr.query(`SELECT format($1, ${tr.map((dr,fr)=>`$${fr+2}`).join(", ")}) as query`,[lr,...tr],{paramTypes:[F$2,...ir]})).rows[0].query}function Ur(e){let t,tr=!1,rr=async()=>{if(!t){tr=!1;return}tr=!0;let{args:ir,resolve:lr,reject:dr}=t;t=void 0;try{let fr=await e(...ir);lr(fr)}catch(fr){dr(fr)}finally{rr()}};return async(...ir)=>{t&&t.resolve(void 0);let lr=new Promise((dr,fr)=>{t={args:ir,resolve:dr,reject:fr}});return tr||rr(),lr}}function Nr(e){let t;return e.startsWith('"')&&e.endsWith('"')?t=e.substring(1,e.length-1):t=e.toLowerCase(),t}u$2();var o={part:"part",container:"container"};function s(e,t,...tr){let rr=e.length-1,ir=tr.length-1;if(ir!==-1){if(ir===0){e[rr]=e[rr]+tr[0]+t;return}e[rr]=e[rr]+tr[0],e.push(...tr.slice(1,ir)),e.push(tr[ir]+t)}}function y$1(e,...t){let tr=[e[0]];tr.raw=[e.raw[0]];let rr=[];for(let ir=0;ir<t.length;ir++){let lr=t[ir],dr=ir+1;if((lr==null?void 0:lr._templateType)===o.part){s(tr,e[dr],lr.str),s(tr.raw,e.raw[dr],lr.str);continue}if((lr==null?void 0:lr._templateType)===o.container){s(tr,e[dr],...lr.strings),s(tr.raw,e.raw[dr],...lr.strings.raw),rr.push(...lr.values);continue}tr.push(e[dr]),tr.raw.push(e.raw[dr]),rr.push(lr)}return{_templateType:"container",strings:tr,values:rr}}function g$3(e,...t){let{strings:tr,values:rr}=y$1(e,...t);return{query:[tr[0],...rr.flatMap((ir,lr)=>[`$${lr+1}`,tr[lr+1]])].join(""),params:rr}}u$2();var b$2,u$1,r,l,g$2,h$1,R$1,z$1=class{constructor(){R$3(this,r),this.serializers={...cn},this.parsers={...ln},R$3(this,b$2,!1),R$3(this,u$1,!1)}async _initArrayTypes({force:t=!1}={}){if(h$2(this,b$2)&&!t)return;x$4(this,b$2,!0);let tr=await this.query(`
|
|
478
|
+
`,{strands:rr.map(fr=>({...fr,operations:fr.operations.map(hr=>({...hr,input:stringify$2(hr.input)}))}))});if(!dr.pushUpdates)throw new Error("Couldn't update listener revision");return dr.pushUpdates}catch(dr){throw this.logger.error(dr),dr}}}var TransmitterType;(function(e){e[e.Internal=0]="Internal",e[e.SwitchboardPush=1]="SwitchboardPush",e[e.PullResponder=2]="PullResponder",e[e.SecureConnect=3]="SecureConnect",e[e.MatrixConnect=4]="MatrixConnect",e[e.RESTWebhook=5]="RESTWebhook"})(TransmitterType||(TransmitterType={}));const DefaultListenerManagerOptions={sequentialUpdates:!0};function filterOperationsByRevision(e,t){return t?Object.keys(e).reduce((tr,rr)=>{const ir=t[rr];return ir!==void 0&&(tr[rr]=e[rr].filter(lr=>lr.index<=ir)),tr},{global:[],local:[]}):e}function isAtRevision(e,t){return!t||Object.entries(t).find(([tr,rr])=>{const ir=e.operations[tr].at(-1);return rr===-1?ir!==void 0:(ir==null?void 0:ir.index)!==rr})===void 0}class BaseDocumentDriveServer{constructor(t,tr,rr,ir,lr,dr,fr,hr,mr){Rs(this,"logger",childLogger(["BaseDocumentDriveServer"]));Rs(this,"documentModelModules");Rs(this,"legacyStorage");Rs(this,"documentStorage");Rs(this,"cache");Rs(this,"queueManager");Rs(this,"eventEmitter");Rs(this,"options");Rs(this,"listenerManager");Rs(this,"synchronizationManager");Rs(this,"generateJwtHandler");Rs(this,"defaultDrivesManager");Rs(this,"defaultDrivesManagerDelegate",{detachDrive:this.detachDrive.bind(this),emit:(...t)=>this.eventEmitter.emit("defaultRemoteDrive",...t)});Rs(this,"queueDelegate",{exists:t=>this.documentStorage.exists(t),processOperationJob:async({driveId:t,documentId:tr,operations:rr,options:ir})=>!tr||t===tr?this.processDriveOperations(t,rr,ir):this.processOperations(t,tr,rr,ir),processActionJob:async({driveId:t,documentId:tr,actions:rr,options:ir})=>tr?this.processActions(t,tr,rr,ir):this.processDriveActions(t,rr,ir),processJob:async t=>{if(isOperationJob(t))return this.queueDelegate.processOperationJob(t);if(isActionJob(t))return this.queueDelegate.processActionJob(t);throw new Error("Unknown job type",t)}});Rs(this,"triggerMap",new Map);Rs(this,"initializePromise");this.documentModelModules=t,this.legacyStorage=tr,this.documentStorage=rr,this.cache=ir,this.queueManager=lr,this.eventEmitter=dr,this.synchronizationManager=fr,this.listenerManager=hr,this.options={...mr,defaultDrives:{...mr==null?void 0:mr.defaultDrives},listenerManager:{...DefaultListenerManagerOptions,...mr==null?void 0:mr.listenerManager},jwtHandler:(mr==null?void 0:mr.jwtHandler)===void 0?()=>Promise.resolve(""):mr.jwtHandler,taskQueueMethod:(mr==null?void 0:mr.taskQueueMethod)===void 0?RunAsap.runAsap:mr.taskQueueMethod},this.defaultDrivesManager=new DefaultDrivesManager(this,this.defaultDrivesManagerDelegate,mr),this.initializePromise=this._initialize()}get listeners(){return this.listenerManager}initialize(){return this.initializePromise}async _initialize(){await this.listenerManager.initialize(this.handleListenerError),await this.queueManager.init(this.queueDelegate,rr=>{this.logger.error("Error initializing queue manager",rr),t.push(rr)});try{await this.defaultDrivesManager.removeOldremoteDrives()}catch(rr){this.logger.error(rr)}const t=[],tr=await this.getDrives();for(const rr of tr)await this._initializeDrive(rr).catch(ir=>{this.logger.error(`Error initializing drive ${rr}`,ir),t.push(ir)});return this.options.defaultDrives.loadOnInit!==!1&&await this.defaultDrivesManager.initializeDefaultRemoteDrives(),t.length===0?null:t}setDocumentModelModules(t){this.documentModelModules=[...t],this.synchronizationManager.setDocumentModelModules([...t]),this.eventEmitter.emit("documentModelModules",[...t])}initializeDefaultRemoteDrives(){return this.defaultDrivesManager.initializeDefaultRemoteDrives()}getDefaultRemoteDrives(){return this.defaultDrivesManager.getDefaultRemoteDrives()}setDefaultDriveAccessLevel(t,tr){return this.defaultDrivesManager.setDefaultDriveAccessLevel(t,tr)}setAllDefaultDrivesAccessLevel(t){return this.defaultDrivesManager.setAllDefaultDrivesAccessLevel(t)}getOperationSource(t){return t.type==="local"?"push":"pull"}handleListenerError(t,tr,rr){this.logger.error(`Listener ${rr.listener.label??rr.listener.listenerId} error:`,t);const ir=t instanceof OperationError?t.status:"ERROR";this.synchronizationManager.updateSyncStatus(tr,{push:ir},t)}shouldSyncRemoteDrive(t){return t.state.local.availableOffline&&t.state.local.triggers.length>0}async startSyncRemoteDrive(t){let tr=this.triggerMap.get(t);const rr=await this.getSynchronizationUnitsIds(t),ir=await this.getDrive(t);for(const lr of ir.state.local.triggers)if(!(tr!=null&&tr.get(lr.id))){tr||(tr=new Map),this.synchronizationManager.updateSyncStatus(t,{pull:"SYNCING"});for(const dr of rr)this.synchronizationManager.updateSyncStatus(dr.syncId,{pull:"SYNCING"});if(PullResponderTransmitter.isPullResponderTrigger(lr)){let dr=!0;const fr=PullResponderTransmitter.setupPull(t,lr,this.saveStrand.bind(this),hr=>{const mr=hr instanceof OperationError?hr.status:"ERROR";this.synchronizationManager.updateSyncStatus(t,{pull:mr},hr),hr instanceof ClientError&&this.eventEmitter.emit("clientStrandsError",t,lr,hr.response.status,hr.message)},hr=>{const mr=hr.filter(yr=>yr.status!=="SUCCESS");mr.length<1&&this.synchronizationManager.updateSyncStatus(t,{pull:"SUCCESS"});const gr=hr.filter(yr=>yr.documentId!=="").map(yr=>yr.documentId);if(this.getSynchronizationUnitsIds(t,gr).then(yr=>{for(const _r of yr){const br=mr.find(wr=>wr.documentId===_r.documentId);br?this.synchronizationManager.updateSyncStatus(_r.syncId,{pull:br.status},br.error):this.synchronizationManager.updateSyncStatus(_r.syncId,{pull:"SUCCESS"})}}).catch(console.error),dr){dr=!1;const yr=ir.state.local.listeners.find(_r=>{var br;return lr.data.url===((br=_r.callInfo)==null?void 0:br.data)});yr&&this.getSynchronizationUnitsRevision(t,rr).then(_r=>{for(const br of _r)this.listenerManager.updateListenerRevision(yr.listenerId,t,br.syncId,br.revision).catch(this.logger.error)}).catch(this.logger.error)}},void 0,this.listeners);tr.set(lr.id,fr),this.triggerMap.set(t,tr)}}}async stopSyncRemoteDrive(t){const rr=(await this.getSynchronizationUnitsIds(t)).filter(lr=>lr.documentId!=="").map(lr=>lr.syncId),ir=this.triggerMap.get(t);ir==null||ir.forEach(lr=>lr()),this.synchronizationManager.updateSyncStatus(t,null);for(const lr of rr)this.synchronizationManager.updateSyncStatus(lr,null);return this.triggerMap.delete(t)}async _initializeDrive(t){var rr,ir,lr;const tr=await this.getDrive(t);this.logger.verbose(`[SYNC DEBUG] Initializing drive ${t} with slug "${tr.header.slug}"`),await this.synchronizationManager.initializeDriveSyncStatus(t,tr),this.shouldSyncRemoteDrive(tr)&&(this.logger.verbose(`[SYNC DEBUG] Starting sync for remote drive ${t}`),await this.startSyncRemoteDrive(t)),this.logger.verbose(`[SYNC DEBUG] Processing ${tr.state.local.listeners.length} listeners for drive ${t}`);for(const dr of tr.state.local.listeners)if(((rr=dr.callInfo)==null?void 0:rr.transmitterType)==="SwitchboardPush"){this.logger.verbose(`[SYNC DEBUG] Setting up SwitchboardPush listener ${dr.listenerId} for drive ${t}`);const fr=new SwitchboardPushTransmitter(dr.callInfo.data??"",this.listeners);this.logger.verbose(`[SYNC DEBUG] Created SwitchboardPush transmitter with URL: ${dr.callInfo.data||"none"}`),await this.listenerManager.setListener(t,{block:dr.block,driveId:tr.header.id,filter:{branch:dr.filter.branch??[],documentId:dr.filter.documentId??[],documentType:dr.filter.documentType??[],scope:dr.filter.scope??[]},listenerId:dr.listenerId,callInfo:dr.callInfo,system:dr.system,label:dr.label??"",transmitter:fr}).then(()=>{this.logger.verbose(`[SYNC DEBUG] Successfully set up listener ${dr.listenerId} for drive ${t}`)})}else if(((ir=dr.callInfo)==null?void 0:ir.transmitterType)==="PullResponder"){this.logger.verbose(`[SYNC DEBUG] Setting up PullResponder listener ${dr.listenerId} for drive ${t}`);const fr={driveId:t,listenerId:dr.listenerId,block:!1,filter:dr.filter,system:!1,label:`PullResponder #${dr.listenerId}`,callInfo:{data:"",name:"PullResponder",transmitterType:"PullResponder"}},hr=new PullResponderTransmitter(fr,this.listenerManager);fr.transmitter=hr,await this.listenerManager.setListener(t,fr)}else this.logger.error(`Skipping listener ${dr.listenerId} with unsupported type ${((lr=dr.callInfo)==null?void 0:lr.transmitterType)||"unknown"}`)}getSynchronizationUnits(t,tr,rr,ir,lr){return this.synchronizationManager.getSynchronizationUnits(t,tr,rr,ir,lr)}getSynchronizationUnitsIds(t,tr,rr,ir,lr){return this.synchronizationManager.getSynchronizationUnitsIds(t,tr,rr,ir,lr)}getOperationData(t,tr,rr){return this.synchronizationManager.getOperationData(t,tr,rr)}getSynchronizationUnitsRevision(t,tr){return this.synchronizationManager.getSynchronizationUnitsRevision(t,tr)}getDocumentModelModule(t){const tr=this.documentModelModules.find(rr=>rr.documentModel.id===t);if(!tr)throw new Error(`Document type ${t} not supported`);return tr}getDocumentModelModules(){return[...this.documentModelModules]}async addDrive(t,tr){const rr=createDocument({state:{global:{icon:t.global.icon??null,name:t.global.name},local:t.local??{}}});return t.id&&t.id.length>0&&(rr.header.id=t.id),t.slug&&t.slug.length>0&&(rr.header.slug=t.slug),tr&&(rr.header.meta={preferredEditor:tr}),await this.documentStorage.create(rr),t.slug&&t.slug.length>0&&await this.cache.deleteDriveBySlug(t.slug),await this._initializeDrive(rr.header.id),this.eventEmitter.emit("driveAdded",rr),rr}async addRemoteDrive(t,tr){var vr;await((vr=this.generateJwtHandler)==null?void 0:vr.call(this,t));const{id:rr,name:ir,slug:lr,icon:dr,meta:fr}=tr.expectedDriveInfo||await requestPublicDriveWithTokenFromReactor(t,this),{pullFilter:hr,pullInterval:mr,availableOffline:gr,sharingType:yr,listeners:_r,triggers:br}=tr,wr=await PullResponderTransmitter.createPullResponderTrigger(rr,t,{pullFilter:hr,pullInterval:mr},this.listeners);return await this.addDrive({id:rr,slug:lr,global:{name:ir,icon:dr},local:{triggers:[...br,wr],listeners:_r,availableOffline:gr,sharingType:yr}},fr==null?void 0:fr.preferredEditor)}async deleteDrive(t){const tr=await Promise.allSettled([this.stopSyncRemoteDrive(t),this.listenerManager.removeDrive(t),this.cache.deleteDrive(t),this.documentStorage.delete(t)]);this.eventEmitter.emit("driveDeleted",t),tr.forEach(rr=>{if(rr.status==="rejected")throw rr.reason})}async getDrives(){const t=[];let tr;do{const{documents:rr,nextCursor:ir}=await this.documentStorage.findByType("powerhouse/document-drive",100,tr);t.push(...rr),tr=ir}while(tr);return t}async getDrivesSlugs(){const t=await this.getDrives();return this.documentStorage.resolveSlugs(t)}async getDrive(t,tr){let rr;try{const dr=await this.cache.getDrive(t);if(dr&&isDocumentDrive(dr)&&(rr=dr,isAtRevision(rr,tr==null?void 0:tr.revisions)))return rr}catch(dr){this.logger.error("Error getting drive from cache",dr)}const ir=rr??await this.documentStorage.get(t),lr=this._buildDocument(ir,tr);if(isDocumentDrive(lr))return tr!=null&&tr.revisions||this.cache.setDrive(t,lr).catch(this.logger.error),lr;throw new Error(`Document with id ${t} is not a Document Drive`)}async getDriveBySlug(t,tr){try{const lr=await this.cache.getDriveBySlug(t);if(lr)return lr}catch(lr){this.logger.error("Error getting drive from cache",lr)}const rr=await this.documentStorage.getBySlug(t),ir=this._buildDocument(rr,tr);if(isDocumentDrive(ir))return this.cache.setDriveBySlug(t,ir).catch(this.logger.error),ir;throw new Error(`Document with slug ${t} is not a Document Drive`)}async getDriveIdBySlug(t){try{const rr=await this.cache.getDriveBySlug(t);if(rr)return rr.header.id}catch(rr){this.logger.error("Error getting drive from cache",rr)}return(await this.documentStorage.getBySlug(t)).header.id}async getDocument(t,tr,rr){let ir;try{if(ir=await this.cache.getDocument(tr),ir&&isAtRevision(ir,rr==null?void 0:rr.revisions))return ir}catch(fr){this.logger.error("Error getting document from cache",fr)}const lr=ir??await this.documentStorage.get(tr),dr=this._buildDocument(lr,rr);return rr!=null&&rr.revisions||this.cache.setDocument(tr,dr).catch(this.logger.error),dr}getDocuments(t){return this.documentStorage.getChildren(t)}async createDocument(t,tr){let rr;if(tr.document){if(tr.documentType!==tr.document.header.documentType)throw new Error(`Provided document is not ${tr.documentType}`);rr=this._buildDocument(tr.document).state}const ir=tr.document??this.getDocumentModelModule(tr.documentType).utils.createDocument();let lr;tr.id&&tr.id.length>0?tr.document?(lr=ir.header,ir.header.id=tr.id,this.logger.warn("Assigning an id to a document is deprecated. Use the header field instead.")):(this.logger.warn("Creating a document with an id is deprecated. Use the header field instead."),lr=createUnsignedHeader(),lr.id=tr.id,lr.documentType=tr.documentType):tr.header?(await validateHeader(tr.header),lr=tr.header):(lr=createUnsignedHeader(),lr.documentType=tr.documentType);const dr={header:lr,history:ir.history,operations:ir.operations,initialState:ir.initialState,clipboard:[],state:rr??ir.state};await this.documentStorage.create(dr);try{await this.documentStorage.addChild(t,lr.id)}catch(hr){this.logger.error("Error adding child document",hr);try{await this.documentStorage.delete(lr.id)}catch(mr){this.logger.error("FATAL: Could not revert document creation. This means that we created a document but failed to add it to the drive..",mr)}throw hr}for(const hr of tr.synchronizationUnits)this.synchronizationManager.updateSyncStatus(hr.syncId,{pull:this.triggerMap.get(t)?"INITIAL_SYNC":void 0,push:this.listenerManager.driveHasListeners(t)?"SUCCESS":void 0});const fr=Object.values(ir.operations).flat();return fr.length&&(isDocumentDrive(ir)?await this.legacyStorage.addDriveOperations(t,fr,ir):await this.legacyStorage.addDocumentOperations(t,lr.id,fr,ir)),ir}async deleteDocument(t,tr){try{const rr=await this.getSynchronizationUnitsIds(t,[tr]);for(const ir of rr)this.synchronizationManager.updateSyncStatus(ir.syncId,null);await this.listenerManager.removeSyncUnits(t,rr)}catch(rr){this.logger.warn("Error deleting document",rr)}return await this.cache.deleteDocument(tr),this.documentStorage.delete(tr)}async _processOperations(t,tr,rr,ir){const lr=[],dr=[],fr=await this._addDocumentResultingStage(rr,t,tr);let hr=this._buildDocument(fr),mr;const gr=groupOperationsByScope(ir);for(const yr of Object.keys(gr)){const _r=rr.operations[yr],br=removeExistingOperations(gr[yr]||[],_r);if(br.length<1)continue;const wr=garbageCollect(sortOperations(_r)),[vr,Sr]=attachBranch(wr,br),Mr=(Sr.length<1?vr:merge(wr,vr,reshuffleByTimestamp)).filter(Ar=>wr.length<1||precedes(wr[wr.length-1],Ar));for(const Ar of Mr){let kr=!1;if(Sr.length>0){const Or=ir.find(Dr=>Dr.hash===Ar.hash);kr=!Or||Or.index!==Ar.index||Or.skip!==Ar.skip}try{const Or=this.options.taskQueueMethod,Dr=()=>this._performOperation(t,tr,hr,Ar,kr),$r=await(Or?runAsapAsync(Dr,Or):Dr());hr=$r.document,dr.push(...$r.signals),lr.push($r.operation)}catch(Or){mr=Or instanceof OperationError?Or:new OperationError("ERROR",Ar,Or.message,Or.cause);break}}}return{document:hr,operationsApplied:lr,signals:dr,error:mr}}async _addDocumentResultingStage(t,tr,rr,ir){var fr,hr,mr,gr;const lr=(ir==null?void 0:ir.revisions)!==void 0?filterOperationsByRevision(t.operations,ir.revisions):t.operations,dr=garbageCollectDocumentOperations(lr);for(const yr of Object.keys(dr)){const _r=dr[yr].at(-1);_r&&!_r.resultingState&&(_r.resultingState=await(rr?(hr=(fr=this.legacyStorage).getOperationResultingState)==null?void 0:hr.call(fr,tr,rr,_r.index,_r.scope,"main"):(gr=(mr=this.legacyStorage).getDriveOperationResultingState)==null?void 0:gr.call(mr,tr,_r.index,_r.scope,"main")))}return{...t,operations:dr}}_buildDocument(t,tr){if(t.state&&(!tr||tr.checkHashes===!1)&&isAtRevision(t,tr==null?void 0:tr.revisions))return t;const rr=this.getDocumentModelModule(t.header.documentType),ir=(tr==null?void 0:tr.revisions)!==void 0?filterOperationsByRevision(t.operations,tr.revisions):t.operations,lr=garbageCollectDocumentOperations(ir);return replayDocument(t.initialState,lr,rr.reducer,void 0,t.header,void 0,{...tr,checkHashes:(tr==null?void 0:tr.checkHashes)??!0,reuseOperationResultingState:(tr==null?void 0:tr.checkHashes)??!0})}async _performOperation(t,tr,rr,ir,lr=!1){var vr,Sr,Ir,Mr;const dr=this.getDocumentModelModule(rr.header.documentType),fr=[];let hr=rr;const mr=ir.scope,yr=garbageCollectDocumentOperations({...rr.operations,[mr]:skipHeaderOperations(rr.operations[mr],ir)})[mr].at(-1);yr&&!yr.resultingState&&(yr.resultingState=await(tr?(Sr=(vr=this.legacyStorage).getOperationResultingState)==null?void 0:Sr.call(vr,t,tr,yr.index,yr.scope,"main"):(Mr=(Ir=this.legacyStorage).getDriveOperationResultingState)==null?void 0:Mr.call(Ir,t,yr.index,yr.scope,"main")));const _r=[];hr=dr.reducer(hr,ir,Ar=>{let kr;switch(Ar.type){case"CREATE_CHILD_DOCUMENT":kr=()=>this.createDocument(t,Ar.input);break;case"DELETE_CHILD_DOCUMENT":kr=()=>this.deleteDocument(t,Ar.input.id);break;case"COPY_CHILD_DOCUMENT":kr=()=>this.getDocument(t,Ar.input.id).then(Or=>{const Dr={...Or,header:{...Or.header,slug:Ar.input.newId}};return this.createDocument(t,{id:Ar.input.newId,documentType:Or.header.documentType,document:Dr,synchronizationUnits:Ar.input.synchronizationUnits})});break}kr&&_r.push(()=>kr().then(Or=>({signal:Ar,result:Or})))},{skip:ir.skip,reuseOperationResultingState:!0});const wr=hr.operations[ir.scope].filter(Ar=>Ar.index==ir.index&&Ar.skip==ir.skip).at(0);if(!wr)throw new OperationError("ERROR",ir,`Operation with index ${ir.index}:${ir.skip} was not applied.`);if(!wr.error&&wr.hash!==ir.hash&&!lr)throw new ConflictOperationError(ir,wr);for(const Ar of _r){const kr=await Ar();fr.push(kr)}return{document:hr,signals:fr,operation:wr}}addOperation(t,tr,rr,ir){return this.addOperations(t,tr,[rr],ir)}async _addOperations(t,tr,rr){if(this.legacyStorage.addDocumentOperationsWithTransaction)await this.legacyStorage.addDocumentOperationsWithTransaction(t,tr,rr);else{const ir=await this.documentStorage.get(tr),lr=await rr(ir);lr.operations.length>0&&await this.legacyStorage.addDocumentOperations(t,tr,lr.operations,lr.document)}}queueOperation(t,tr,rr,ir){return this.queueOperations(t,tr,[rr],ir)}async resultIfExistingOperations(t,tr,rr){try{const ir=await this.getDocument(t,tr);return rr.find(dr=>!dr.id||!ir.operations[dr.scope].find(fr=>fr.id===dr.id&&fr.index===dr.index&&fr.type===dr.type&&fr.hash===dr.hash))?void 0:{status:"SUCCESS",document:ir,operations:rr,signals:[]}}catch(ir){ir.message.includes(`Document with id ${tr} not found`)||console.error(ir);return}}async queueOperations(t,tr,rr,ir){const lr=await this.resultIfExistingOperations(t,tr,rr);if(lr)return lr;let dr;const fr=new Promise((hr,mr)=>{const gr=this.queueManager.on("jobCompleted",(_r,br)=>{_r.jobId===dr&&(gr(),yr(),hr(br))}),yr=this.queueManager.on("jobFailed",(_r,br)=>{_r.jobId===dr&&(gr(),yr(),mr(br))})});try{dr=await this.queueManager.addJob({driveId:t,documentId:tr,operations:rr,options:ir})}catch(hr){throw this.logger.error("Error adding job",hr),hr}return fr}async queueAction(t,tr,rr,ir){return this.queueActions(t,tr,[rr],ir)}async queueActions(t,tr,rr,ir){try{const lr=await this.queueManager.addJob({driveId:t,documentId:tr,actions:rr,options:ir});return await new Promise((dr,fr)=>{const hr=this.queueManager.on("jobCompleted",(gr,yr)=>{gr.jobId===lr&&(hr(),mr(),dr(yr))}),mr=this.queueManager.on("jobFailed",(gr,yr)=>{gr.jobId===lr&&(hr(),mr(),fr(yr))})})}catch(lr){throw this.logger.error("Error adding job",lr),lr}}async queueDriveAction(t,tr,rr){return this.queueDriveActions(t,[tr],rr)}async queueDriveActions(t,tr,rr){try{const ir=await this.queueManager.addJob({driveId:t,actions:tr,options:rr});return await new Promise((lr,dr)=>{const fr=this.queueManager.on("jobCompleted",(mr,gr)=>{mr.jobId===ir&&(fr(),hr(),lr(gr))}),hr=this.queueManager.on("jobFailed",(mr,gr)=>{mr.jobId===ir&&(fr(),hr(),dr(gr))})})}catch(ir){throw this.logger.error("Error adding drive job",ir),ir}}async addOperations(t,tr,rr,ir){return this.queueOperations(t,tr,rr,ir)}async processOperations(t,tr,rr,ir){const lr=await this.resultIfExistingOperations(t,tr,rr);if(lr)return lr;let dr;const fr=[],hr=[];let mr;try{await this._addOperations(t,tr,async Sr=>{const Ir=await this._processOperations(t,tr,Sr,rr);if(!Ir.document)throw this.logger.error("Invalid document"),Ir.error??new Error("Invalid document");return dr=Ir.document,mr=Ir.error,hr.push(...Ir.signals),fr.push(...Ir.operationsApplied),{operations:Ir.operationsApplied,document:Ir.document}}),dr&&this.cache.setDocument(tr,dr).catch(this.logger.error);const{scopes:gr,branches:yr}=fr.reduce((Sr,Ir)=>(Sr.scopes.includes(Ir.scope)||Sr.scopes.push(Ir.scope),Sr),{scopes:[],branches:["main"]}),_r=await this.getSynchronizationUnits(t,[tr],gr,yr),wr=fr.find(Sr=>!rr.find(Ir=>Ir.id===Sr.id&&Ir.index===Sr.index&&Ir.skip===Sr.skip&&Ir.hash===Sr.hash))?{type:"local"}:(ir==null?void 0:ir.source)??{type:"local"},vr=this.getOperationSource(wr);if(this.listenerManager.updateSynchronizationRevisions(t,_r,wr,()=>{this.synchronizationManager.updateSyncStatus(t,{[vr]:"SYNCING"});for(const Sr of _r)this.synchronizationManager.updateSyncStatus(Sr.syncId,{[vr]:"SYNCING"})},this.handleListenerError.bind(this),(ir==null?void 0:ir.forceSync)??wr.type==="local").then(Sr=>{Sr.length&&this.synchronizationManager.updateSyncStatus(t,{[vr]:"SUCCESS"});for(const Ir of _r)this.synchronizationManager.updateSyncStatus(Ir.syncId,{[vr]:"SUCCESS"})}).catch(Sr=>{this.logger.error("Non handled error updating sync revision",Sr),this.synchronizationManager.updateSyncStatus(t,{[vr]:"ERROR"},Sr);for(const Ir of _r)this.synchronizationManager.updateSyncStatus(Ir.syncId,{[vr]:"ERROR"},Sr)}),mr)throw mr;return this.eventEmitter.emit("documentOperationsAdded",t,tr,rr),this.eventEmitter.emit("operationsAdded",t,tr,rr),{status:"SUCCESS",document:dr,operations:fr,signals:hr}}catch(gr){const yr=gr instanceof OperationError?gr:new OperationError("ERROR",void 0,gr.message,gr.cause);return{status:yr.status,error:yr,document:dr,operations:fr,signals:hr}}}addDriveOperation(t,tr,rr){return this.addDriveOperations(t,[tr],rr)}async _addDriveOperations(t,tr){if(this.legacyStorage.addDriveOperationsWithTransaction)return this.legacyStorage.addDriveOperationsWithTransaction(t,tr);{const rr=await this.documentStorage.get(t),ir=await tr(rr);return ir.operations.length>0&&await this.legacyStorage.addDriveOperations(t,ir.operations,ir.document),ir}}queueDriveOperation(t,tr,rr){return this.queueDriveOperations(t,[tr],rr)}async resultIfExistingDriveOperations(t,tr){try{const rr=await this.getDrive(t);return tr.find(lr=>!lr.id||!rr.operations[lr.scope].find(dr=>dr.id===lr.id&&dr.index===lr.index&&dr.type===lr.type&&dr.hash===lr.hash))?void 0:{status:"SUCCESS",document:rr,operations:tr,signals:[]}}catch(rr){console.error(rr);return}}async queueDriveOperations(t,tr,rr){const ir=await this.resultIfExistingDriveOperations(t,tr);if(ir)return ir;try{const lr=await this.queueManager.addJob({driveId:t,operations:tr,options:rr});return await new Promise((dr,fr)=>{const hr=this.queueManager.on("jobCompleted",(gr,yr)=>{gr.jobId===lr&&(hr(),mr(),dr(yr))}),mr=this.queueManager.on("jobFailed",(gr,yr)=>{gr.jobId===lr&&(hr(),mr(),fr(yr))})})}catch(lr){throw this.logger.error("Error adding drive job",lr),lr}}async addDriveOperations(t,tr,rr){return this.queueDriveOperations(t,tr,rr)}async processDriveOperations(t,tr,rr){let ir;const lr=[],dr=[];let fr;const hr=await this.resultIfExistingDriveOperations(t,tr);if(hr)return hr;try{if(await this._addDriveOperations(t,async gr=>{const yr=await this._processOperations(t,void 0,gr,tr.slice());return ir=yr.document,lr.push(...yr.operationsApplied),dr.push(...yr.signals),fr=yr.error,{operations:yr.operationsApplied,document:yr.document}}),!ir||!isDocumentDrive(ir))throw fr??new Error("Invalid Document Drive document");this.cache.setDrive(t,ir).catch(this.logger.error);const mr=lr.filter(gr=>gr.scope==="global").slice().pop();if(mr){const yr=lr.find(br=>!tr.find(wr=>wr.id===br.id&&wr.index===br.index&&wr.skip===br.skip&&wr.hash===br.hash))?{type:"local"}:(rr==null?void 0:rr.source)??{type:"local"},_r=this.getOperationSource(yr);this.listenerManager.updateSynchronizationRevisions(t,[{syncId:"0",documentId:"",scope:"global",branch:"main",documentType:"powerhouse/document-drive",lastUpdated:mr.timestamp,revision:mr.index}],yr,()=>{this.synchronizationManager.updateSyncStatus(t,{[_r]:"SYNCING"})},this.handleListenerError.bind(this),(rr==null?void 0:rr.forceSync)??yr.type==="local").then(br=>{br.length&&this.synchronizationManager.updateSyncStatus(t,{[_r]:"SUCCESS"})}).catch(br=>{this.logger.error("Non handled error updating sync revision",br),this.synchronizationManager.updateSyncStatus(t,{[_r]:"ERROR"},br)})}if(this.shouldSyncRemoteDrive(ir)?this.startSyncRemoteDrive(t):this.stopSyncRemoteDrive(t),fr)throw fr;return this.eventEmitter.emit("driveOperationsAdded",t,tr),this.eventEmitter.emit("operationsAdded",t,null,tr),{status:"SUCCESS",document:ir,operations:lr,signals:dr}}catch(mr){const gr=mr instanceof OperationError?mr:new OperationError("ERROR",void 0,mr.message,mr);return{status:gr.status,error:gr,document:ir,operations:lr,signals:dr}}}_buildOperations(t,tr){const rr=[],{reducer:ir}=this.getDocumentModelModule(t.header.documentType);for(const lr of tr){t=ir(t,lr);const dr=t.operations[lr.scope].slice().pop();if(!dr)throw new Error("Error creating operations");rr.push(dr)}return rr}async addAction(t,tr,rr,ir){return this.addActions(t,tr,[rr],ir)}async addActions(t,tr,rr,ir){return this.queueActions(t,tr,rr,ir)}async processActions(t,tr,rr,ir){const lr=await this.getDocument(t,tr),dr=this._buildOperations(lr,rr);return this.processOperations(t,tr,dr,ir)}async addDriveAction(t,tr,rr){return this.addDriveActions(t,[tr],rr)}async addDriveActions(t,tr,rr){return this.queueDriveActions(t,tr,rr)}async processDriveActions(t,tr,rr){const ir=await this.getDrive(t),lr=this._buildOperations(ir,tr);return this.processDriveOperations(t,lr,rr)}async detachDrive(t){const tr=await this.getDrive(t),rr=tr.state.local.listeners||[],ir=tr.state.local.triggers||[];for(const lr of rr)await this.addDriveAction(t,removeListener({listenerId:lr.listenerId}));for(const lr of ir)await this.addDriveAction(t,removeTrigger({triggerId:lr.id}));await this.addDriveAction(t,setSharingType({type:"LOCAL"}))}getSyncStatus(t){return this.synchronizationManager.getSyncStatus(t)}on(t,tr){return this.eventEmitter.on(t,tr)}emit(t,...tr){return this.eventEmitter.emit(t,...tr)}getSynchronizationUnit(t,tr){return this.synchronizationManager.getSynchronizationUnit(t,tr)}updateSyncStatus(t,tr,rr){this.synchronizationManager.updateSyncStatus(t,tr,rr)}initializeDriveSyncStatus(t,tr){return this.synchronizationManager.initializeDriveSyncStatus(t,tr)}getCombinedSyncUnitStatus(t){return this.synchronizationManager.getCombinedSyncUnitStatus(t)}async saveStrand(t,tr){const rr=t.operations.map(lr=>({...lr,scope:t.scope,branch:t.branch}));let ir;if(t.documentId)try{ir=await this.queueOperations(t.driveId,t.documentId,rr,{source:tr})}catch(lr){throw this.logger.error("Error queueing operations",lr),lr}else try{ir=await this.queueDriveOperations(t.driveId,rr,{source:tr})}catch(lr){throw this.logger.error("Error queueing operations",lr),lr}if(ir.status==="ERROR"){const lr=t.documentId!==""?(await this.getSynchronizationUnitsIds(t.driveId,[t.documentId],[t.scope],[t.branch])).map(fr=>fr.syncId):[t.driveId],dr=this.getOperationSource(tr);for(const fr of lr)this.synchronizationManager.updateSyncStatus(fr,{[dr]:ir.status},ir.error)}return this.eventEmitter.emit("strandUpdate",t),ir}setGenerateJwtHandler(t){this.generateJwtHandler=t,this.listenerManager.setGenerateJwtHandler(t)}removeJwtHandler(){this.generateJwtHandler=void 0,this.listenerManager.removeJwtHandler()}}const DocumentDriveServer=ReadModeServer(BaseDocumentDriveServer);class AbortError extends Error{constructor(t){super(t||"Aborted"),this.name="AbortError"}}class MemoryStorage{constructor(){Rs(this,"documents");Rs(this,"driveManifests");Rs(this,"slugToDocumentId");this.documents={},this.driveManifests={},this.slugToDocumentId={}}resolveIds(t,tr){const rr=[];for(const ir of t){const lr=this.slugToDocumentId[ir];if(!lr)throw new DocumentNotFoundError(ir);rr.push(lr)}if(tr!=null&&tr.aborted)throw new AbortError("Aborted");return Promise.resolve(rr)}resolveSlugs(t,tr){const rr=[];for(const ir of t){const lr=this.documents[ir];if(!lr)throw new DocumentNotFoundError(ir);rr.push(lr.header.slug)}if(tr!=null&&tr.aborted)throw new AbortError("Aborted");return Promise.resolve(rr)}exists(t){return Promise.resolve(!!this.documents[t])}create(t){var ir;const tr=t.header.id;if(!isValidDocumentId(tr))throw new DocumentIdValidationError(tr);if(this.documents[tr])throw new DocumentAlreadyExistsError(tr);const rr=((ir=t.header.slug)==null?void 0:ir.length)>0?t.header.slug:tr;if(!isValidSlug(rr))throw new DocumentSlugValidationError(rr);if(rr&&this.slugToDocumentId[rr])throw new DocumentAlreadyExistsError(tr);if(t.header.slug=rr,this.documents[tr]=t,rr){if(this.slugToDocumentId[rr])throw new DocumentAlreadyExistsError(tr);this.slugToDocumentId[rr]=tr}return t.header.documentType==="powerhouse/document-drive"&&this.updateDriveManifest(tr,{documentIds:new Set}),Promise.resolve()}get(t){const tr=this.documents[t];return tr?Promise.resolve(tr):Promise.reject(new DocumentNotFoundError(t))}getBySlug(t){const tr=this.slugToDocumentId[t];return tr?this.get(tr):Promise.reject(new DocumentNotFoundError(t))}async findByType(t,tr=100,rr){const ir=Object.entries(this.documents).filter(([hr,mr])=>mr.header.documentType===t).map(([hr,mr])=>({id:hr,document:mr}));ir.sort((hr,mr)=>{const gr=new Date(hr.document.header.createdAtUtcIso),yr=new Date(mr.document.header.createdAtUtcIso);if(gr.getTime()===yr.getTime()){const _r=hr.id,br=mr.id;return _r.localeCompare(br)}return gr.getTime()-yr.getTime()});let lr=0;if(rr){const hr=ir.findIndex(({id:mr})=>mr===rr);hr!==-1&&(lr=hr)}const dr=Math.min(lr+tr,ir.length);let fr;return dr<ir.length&&(fr=ir[dr].id),{documents:ir.slice(lr,dr).map(({id:hr})=>hr),nextCursor:fr}}async delete(t){var lr;const tr=this.documents[t];if(tr){const dr=((lr=tr.header.slug)==null?void 0:lr.length)>0?tr.header.slug:t;dr&&this.slugToDocumentId[dr]===t&&delete this.slugToDocumentId[dr]}const rr=await this.getParents(t);for(const dr of rr)await this.removeChild(dr,t);const ir=await this.getChildren(t);for(const dr of ir)(await this.getParents(dr)).length===1&&await this.delete(dr);return delete this.driveManifests[t],this.documents[t]?(delete this.documents[t],Promise.resolve(!0)):Promise.resolve(!1)}async addChild(t,tr){if(t===tr)return Promise.reject(new Error("Cannot associate a document with itself"));if((await this.getChildren(tr)).includes(t))return Promise.reject(new Error("Cannot associate a document with its child"));const ir=this.getManifest(t);return ir.documentIds.add(tr),this.updateDriveManifest(t,ir),Promise.resolve()}async removeChild(t,tr){const rr=this.getManifest(t);return rr.documentIds.delete(tr)?(this.updateDriveManifest(t,rr),Promise.resolve(!0)):Promise.resolve(!1)}async getChildren(t){return[...this.getManifest(t).documentIds]}async getParents(t){const tr=[];for(const[rr,ir]of Object.entries(this.driveManifests))ir.documentIds.has(t)&&tr.push(rr);return tr}async clear(){this.documents={},this.driveManifests={},this.slugToDocumentId={}}async addDocumentOperations(t,tr,rr,ir){const lr=await this.get(tr);if(!ir)return Promise.reject(new DocumentNotFoundError(tr));const dr=mergeOperations(lr.operations,rr);this.documents[tr]={...lr,...ir,operations:dr}}async addDriveOperations(t,tr,rr){const ir=await this.get(t),lr=mergeOperations(ir.operations,tr);this.documents[t]={...ir,...rr,operations:lr}}async getSynchronizationUnitsRevision(t){return(await Promise.allSettled(t.map(async rr=>{try{const ir=await this.get(rr.documentId);if(!ir)return;const lr=ir.operations[rr.scope].at(-1);if(lr)return{documentId:rr.documentId,scope:rr.scope,branch:rr.branch,lastUpdated:lr.timestamp,revision:lr.index}}catch{return}}))).reduce((rr,ir)=>(ir.status==="fulfilled"&&ir.value!==void 0&&rr.push(ir.value),rr),[])}getManifest(t){return this.driveManifests[t]||(this.driveManifests[t]={documentIds:new Set}),this.driveManifests[t]}updateDriveManifest(t,tr){this.driveManifests[t]=tr}}class DefaultEventEmitter{constructor(){Rs(this,"emitter",createNanoEvents())}emit(t,...tr){return this.emitter.emit(t,...tr)}on(t,tr){return this.emitter.on(t,tr)}}function debounce$1(e,t=250){let tr;return(rr,...ir)=>(tr&&clearTimeout(tr),new Promise((lr,dr)=>{rr?e(...ir).then(lr).catch(dr):tr=setTimeout(()=>{e(...ir).then(lr).catch(dr)},t)}))}const Ec=class Ec{constructor(t,tr=DefaultListenerManagerOptions){Rs(this,"logger",childLogger(["ListenerManager",Math.floor(Math.random()*999).toString()]));Rs(this,"syncManager");Rs(this,"options");Rs(this,"generateJwtHandler");Rs(this,"listenerStateByDriveId",new Map);Rs(this,"triggerUpdate",debounce$1(this._triggerUpdate.bind(this),Ec.LISTENER_UPDATE_DELAY));this.syncManager=t,this.options={...DefaultListenerManagerOptions,...tr},this.logger.verbose("constructor(...)")}setGenerateJwtHandler(t){this.generateJwtHandler=t}removeJwtHandler(){this.generateJwtHandler=void 0}async initialize(t){this.logger.verbose("initialize(...)"),typeof window<"u"&&window.addEventListener("online",()=>{this.triggerUpdate(!1,{type:"local"},t).catch(tr=>{this.logger.error("Non handled error updating listeners",tr)})})}driveHasListeners(t){return this.listenerStateByDriveId.has(t)}async setListener(t,tr){if(this.logger.verbose(`setListener(drive: ${t}, listener: ${tr.listenerId})`),t!==tr.driveId)throw new Error("Drive ID mismatch");let rr;try{rr=this.getListenerState(t,tr.listenerId)}catch{rr={}}this.setListenerState(t,tr.listenerId,{...rr,block:tr.block,driveId:tr.driveId,pendingTimeout:"0",listener:tr,listenerStatus:"CREATED",syncUnits:new Map}),await this.triggerUpdate(!0,{type:"local"})}async removeListener(t,tr){this.logger.verbose("setListener()");const rr=this.listenerStateByDriveId.get(t);return rr?Promise.resolve(rr.delete(tr)):!1}async removeSyncUnits(t,tr){const rr=this.listenerStateByDriveId.get(t);if(rr){for(const[,ir]of rr)for(const lr of tr)ir.syncUnits.delete(lr.syncId);return Promise.resolve()}}async updateSynchronizationRevisions(t,tr,rr,ir,lr,dr=!1){const fr=this.listenerStateByDriveId.get(t);if(!fr)return[];const hr=[];for(const[,mr]of fr){if(hr.find(yr=>yr.listenerId===mr.listener.listenerId))continue;const gr=mr.listener.transmitter;if(gr!=null&&gr.transmit)for(const yr of tr){if(!this._checkFilter(mr.listener.filter,yr))continue;const _r=mr.syncUnits.get(yr.syncId);if(!_r||_r.listenerRev<yr.revision){hr.push(mr.listener);break}}}return hr.length?(ir==null||ir(hr),this.triggerUpdate(dr,rr,lr)):[]}async updateListenerRevision(t,tr,rr,ir){const lr=this.listenerStateByDriveId.get(tr);if(!lr)return;const dr=lr.get(t);if(!dr)return;const fr=new Date().toISOString(),hr=dr.syncUnits.get(rr);return hr?(hr.listenerRev=ir,hr.lastUpdated=fr):dr.syncUnits.set(rr,{listenerRev:ir,lastUpdated:fr}),Promise.resolve()}async _triggerUpdate(t,tr,rr=500){var lr,dr;if(this.logger.verbose(`_triggerUpdate(source: ${t.type}, maxContinues: ${rr})`,this.listenerStateByDriveId),rr<0)throw new Error("Maximum retries exhausted.");const ir=[];for(const[fr,hr]of this.listenerStateByDriveId)for(const[mr,gr]of hr){const yr=gr.listener.transmitter;if(!(yr!=null&&yr.transmit))continue;const _r=await this.getListenerSyncUnits(fr,mr),br=[];this.logger.verbose("syncUnits",_r);const wr=_r.map(vr=>async()=>{const Sr=gr.syncUnits.get(vr.syncId);if(Sr&&Sr.listenerRev>=vr.revision){this.logger.verbose(`Abandoning push for sync unit ${vr.syncId}: already up-to-date (${Sr.listenerRev} >= ${vr.revision})`);return}else this.logger.verbose(`Listener out-of-date for sync unit (${vr.scope}, ${vr.documentId}): ${Sr==null?void 0:Sr.listenerRev} < ${vr.revision}`);const Ir=[];try{const Mr=await this.syncManager.getOperationData(fr,vr.syncId,{fromRevision:Sr==null?void 0:Sr.listenerRev});Ir.push(...Mr)}catch(Mr){this.logger.error(Mr)}if(!Ir.length){this.logger.verbose(`Abandoning push for ${vr.syncId}: no operations found`);return}br.push({driveId:fr,documentId:vr.documentId,branch:vr.branch,operations:Ir,scope:vr.scope})});if(this.options.sequentialUpdates){this.logger.verbose(`Collecting ${wr.length} syncUnit strandUpdates in sequence`);for(const vr of wr)await vr()}else this.logger.verbose(`Collecting ${wr.length} syncUnit strandUpdates in parallel`),await Promise.all(wr.map(vr=>vr()));if(br.length==0){this.logger.verbose(`No strandUpdates needed for listener ${mr}`);continue}gr.pendingTimeout=new Date(new Date().getTime()/1e3+300).toISOString(),gr.listenerStatus="PENDING";try{this.logger.verbose(`_triggerUpdate(source: ${t.type}) > transmitter.transmit`);const vr=await yr.transmit(br,t);this.logger.verbose(`_triggerUpdate(source: ${t.type}) > transmission succeeded`,vr),gr.pendingTimeout="0",gr.listenerStatus="PENDING";const Sr=new Date().toISOString();let Ir=!1;for(const Mr of vr){const Ar=_r.find(kr=>Mr.documentId===kr.documentId&&Mr.scope===kr.scope&&Mr.branch===kr.branch);if(Ar){gr.syncUnits.set(Ar.syncId,{lastUpdated:Sr,listenerRev:Mr.revision});const kr=br.find(Or=>Or.driveId===Mr.driveId&&Or.documentId===Mr.documentId&&Or.scope===Mr.scope&&Or.branch===Mr.branch);if(kr&&kr.operations.length>0){const Or=(lr=kr.operations.at(kr.operations.length-1))==null?void 0:lr.index;Or!==Mr.revision?(this.logger.verbose(`Revision still out-of-date for ${kr.documentId}:${kr.scope}:${kr.branch} ${Or} <> ${Mr.revision}`),Ir=!0):this.logger.verbose(`Revision match for ${kr.documentId}:${kr.scope}:${kr.branch} ${Or}`)}else this.logger.verbose(`Cannot find strand update for (${Mr.documentId}:${Mr.scope}:${Mr.branch} in drive ${Mr.driveId})`)}else this.logger.warn(`Received revision for untracked unit for listener ${gr.listener.listenerId}`,Mr)}for(const Mr of vr){const Ar=Mr.status==="ERROR";if((dr=Mr.error)!=null&&dr.includes("Missing operations"))Ir=!0;else if(Ar)throw new OperationError(Mr.status,void 0,Mr.error,Mr.error)}if(!Ir)ir.push({listenerId:gr.listener.listenerId,listenerRevisions:vr});else{const Mr=await this._triggerUpdate(t,tr,rr-1);ir.push(...Mr)}gr.listenerStatus="SUCCESS"}catch(vr){tr==null||tr(vr,fr,gr),gr.listenerStatus=vr instanceof OperationError?vr.status:"ERROR"}}return this.logger.verbose(`Returning listener updates (maxContinues: ${rr})`,ir),ir}_checkFilter(t,tr){const{branch:rr,documentId:ir,scope:lr,documentType:dr}=tr;return!!((!t.branch||t.branch.includes(rr)||t.branch.includes("*"))&&(!t.documentId||t.documentId.includes(ir)||t.documentId.includes("*"))&&(!t.scope||t.scope.includes(lr)||t.scope.includes("*"))&&(!t.documentType||t.documentType.includes(dr)||t.documentType.includes("*")))}getListenerSyncUnits(t,tr){var lr;const rr=(lr=this.listenerStateByDriveId.get(t))==null?void 0:lr.get(tr);if(!rr)return[];const ir=rr.listener.filter;return this.syncManager.getSynchronizationUnits(t,ir.documentId??["*"],ir.scope??["*"],ir.branch??["*"],ir.documentType??["*"])}getListenerSyncUnitIds(t,tr){var lr;const rr=(lr=this.listenerStateByDriveId.get(t))==null?void 0:lr.get(tr);if(!rr)return Promise.resolve([]);const ir=rr.listener.filter;return this.syncManager.getSynchronizationUnitsIds(t,ir.documentId??["*"],ir.scope??["*"],ir.branch??["*"],ir.documentType??["*"])}async removeDrive(t){var rr,ir;const tr=this.listenerStateByDriveId.get(t);if(tr){this.listenerStateByDriveId.delete(t);for(const[lr,dr]of tr)try{await((ir=(rr=dr.listener.transmitter)==null?void 0:rr.disconnect)==null?void 0:ir.call(rr))}catch(fr){this.logger.error(fr)}}}async getStrands(t,tr,rr){this.logger.verbose(`[SYNC DEBUG] ListenerManager.getStrands called for drive: ${t}, listener: ${tr}, options: ${JSON.stringify(rr||{})}`);let ir;try{ir=this.getListenerState(t,tr),this.logger.verbose(`[SYNC DEBUG] Found listener state for drive: ${t}, listener: ${tr}, status: ${ir.listenerStatus}`)}catch(dr){throw this.logger.error(`[SYNC DEBUG] Failed to find listener state for drive: ${t}, listener: ${tr}. Error: ${dr}`),dr}const lr=[];try{const dr=await this.getListenerSyncUnits(t,tr);this.logger.verbose(`[SYNC DEBUG] Retrieved ${dr.length} sync units for drive: ${t}, listener: ${tr}`);const fr=rr==null?void 0:rr.limit;let hr=0;const mr=dr.map(gr=>async()=>{if(fr&&hr>=fr)return;if(gr.revision<0){this.logger.verbose(`[SYNC DEBUG] Skipping sync unit with negative revision: ${gr.syncId}, revision: ${gr.revision}`);return}const yr=ir.syncUnits.get(gr.syncId);if(yr&&yr.listenerRev>=gr.revision){this.logger.verbose(`[SYNC DEBUG] Skipping sync unit - listener already up to date: ${gr.syncId}, listenerRev: ${yr.listenerRev}, revision: ${gr.revision}`);return}const{documentId:_r,scope:br,branch:wr}=gr;try{this.logger.verbose(`[SYNC DEBUG] Getting operations for syncUnit: ${gr.syncId}, documentId: ${_r}, scope: ${br}, branch: ${wr}`);const vr=await this.syncManager.getOperationData(t,gr.syncId,{since:rr==null?void 0:rr.since,fromRevision:(rr==null?void 0:rr.fromRevision)??(yr==null?void 0:yr.listenerRev),limit:fr?fr-hr:void 0});if(this.logger.verbose(`[SYNC DEBUG] Retrieved ${vr.length} operations for syncUnit: ${gr.syncId}`),!vr.length)return;hr+=vr.length,lr.push({driveId:t,documentId:_r,scope:br,branch:wr,operations:vr}),this.logger.verbose(`[SYNC DEBUG] Added strand with ${vr.length} operations for syncUnit: ${gr.syncId}`)}catch(vr){this.logger.error(`Error getting operations for syncUnit: ${gr.syncId}, error: ${vr}`);return}});if(this.options.sequentialUpdates){this.logger.verbose(`[SYNC DEBUG] Processing ${mr.length} sync units sequentially`);for(const gr of mr)await gr()}else this.logger.verbose(`[SYNC DEBUG] Processing ${mr.length} sync units in parallel`),await Promise.all(mr.map(gr=>gr()))}catch(dr){this.logger.error(`Error in getStrands: ${dr}`)}return this.logger.verbose(`ListenerManager.getStrands returning ${lr.length} strands for drive: ${t}, listener: ${tr}`),lr}getListenerState(t,tr){let rr=this.listenerStateByDriveId.get(t);rr||(rr=new Map,this.listenerStateByDriveId.set(t,rr));const ir=rr.get(tr);if(!ir)throw new Error("Listener not found");return ir}setListenerState(t,tr,rr){let ir=this.listenerStateByDriveId.get(t);ir||(ir=new Map,this.listenerStateByDriveId.set(t,ir)),ir.set(tr,rr)}};Rs(Ec,"LISTENER_UPDATE_DELAY",250);let ListenerManager=Ec;class TransmitterFactory{constructor(t){Rs(this,"listenerManager");this.listenerManager=t}instance(t,tr,rr){var ir;switch(t){case"SwitchboardPush":{if(!((ir=tr.callInfo)!=null&&ir.data))throw new Error("No call info data: "+JSON.stringify(tr));return new SwitchboardPushTransmitter(tr.callInfo.data,this.listenerManager)}case"Internal":throw new Error("Internal transmitter not implemented");default:return new PullResponderTransmitter(tr,this.listenerManager)}}}class SynchronizationManager{constructor(t,tr,rr,ir,lr){Rs(this,"storage");Rs(this,"documentStorage");Rs(this,"cache");Rs(this,"documentModelModules");Rs(this,"eventEmitter");Rs(this,"syncStatus",new Map);Rs(this,"logger",childLogger(["SynchronizationManager"]));this.storage=t,this.documentStorage=tr,this.cache=rr,this.documentModelModules=ir,this.eventEmitter=lr}async getSynchronizationUnits(t,tr,rr,ir,lr){const dr=await this.getSynchronizationUnitsIds(t,tr,rr,ir,lr);return this.logger.verbose(`getSynchronizationUnits query: ${JSON.stringify(dr)}`),this.getSynchronizationUnitsRevision(t,dr)}async getSynchronizationUnitsRevision(t,tr){const rr=await this.getDrive(t),ir=await this.storage.getSynchronizationUnitsRevision(tr);this.logger.verbose(`getSynchronizationUnitsRevision: ${JSON.stringify(ir)}`);const lr=tr.map(dr=>({...dr,lastUpdated:rr.header.createdAtUtcIso,revision:-1}));for(const dr of ir){const fr=lr.find(hr=>dr.documentId===hr.documentId&&dr.scope===hr.scope&&dr.branch===hr.branch);fr&&(fr.revision=dr.revision,fr.lastUpdated=dr.lastUpdated)}return lr}async getSynchronizationUnitsIds(t,tr,rr,ir,lr){const fr=(await this.getDrive(t)).state.global.nodes.filter(mr=>isFileNode(mr)&&(!(tr!=null&&tr.length)||tr.includes(mr.id)||tr.includes("*"))&&(!(lr!=null&&lr.length)||lr.includes(mr.documentType)||lr.includes("*")));(!tr||tr.includes("*")||tr.includes(""))&&(!(lr!=null&&lr.length)||lr.includes("powerhouse/document-drive")||lr.includes("*"))&&fr.unshift({id:t,documentType:"powerhouse/document-drive",synchronizationUnits:[{syncId:"0",scope:"global",branch:"main"}]});const hr=[];for(const mr of fr){const gr=rr!=null&&rr.length||ir!=null&&ir.length?mr.synchronizationUnits.filter(yr=>(!(rr!=null&&rr.length)||rr.includes(yr.scope)||rr.includes("*"))&&(!(ir!=null&&ir.length)||ir.includes(yr.branch)||ir.includes("*"))):mr.synchronizationUnits;gr.length&&hr.push(...gr.map(yr=>({driveId:t,documentId:mr.id,syncId:yr.syncId,documentType:mr.documentType,scope:yr.scope,branch:yr.branch})))}return hr}async getSynchronizationUnitIdInfo(t,tr){const ir=(await this.getDrive(t)).state.global.nodes.find(dr=>isFileNode(dr)&&dr.synchronizationUnits.find(fr=>fr.syncId===tr));if(!ir||!isFileNode(ir))return;const lr=ir.synchronizationUnits.find(dr=>dr.syncId===tr);if(lr)return{syncId:tr,scope:lr.scope,branch:lr.branch,documentId:ir.id,documentType:ir.documentType}}async getSynchronizationUnit(t,tr){const rr=await this.getSynchronizationUnitIdInfo(t,tr);if(!rr)return;const{scope:ir,branch:lr,documentId:dr,documentType:fr}=rr,hr=await this.getDocument(t,dr),mr=hr.operations[ir]??[],gr=mr[mr.length-1];return{syncId:tr,scope:ir,branch:lr,documentId:dr,documentType:fr,lastUpdated:gr.timestamp??hr.header.lastModifiedAtUtcIso,revision:gr.index??0}}async getOperationData(t,tr,rr){this.logger.verbose(`[SYNC DEBUG] SynchronizationManager.getOperationData called for drive: ${t}, syncId: ${tr}, filter: ${JSON.stringify(rr)}`);const ir=tr==="0"?{documentId:"",scope:"global"}:await this.getSynchronizationUnitIdInfo(t,tr);if(!ir)throw this.logger.error(`SYNC DEBUG] Invalid Sync Id ${tr} in drive ${t}`),new Error(`Invalid Sync Id ${tr} in drive ${t}`);this.logger.verbose(`[SYNC DEBUG] Found sync unit: documentId: ${ir.documentId}, scope: ${ir.scope}`);const lr=tr==="0"?await this.getDrive(t):await this.getDocument(t,ir.documentId);this.logger.verbose(`[SYNC DEBUG] Retrieved document ${ir.documentId} with type: ${lr.header.documentType}`);const dr=lr.operations[ir.scope]??[];this.logger.verbose(`[SYNC DEBUG] Found ${dr.length} total operations in scope ${ir.scope}`);const fr=dr.filter(mr=>Object.keys(rr).length===0||(rr.since===void 0||isBefore(rr.since,mr.timestamp))&&(rr.fromRevision===void 0||mr.index>rr.fromRevision));this.logger.verbose(`[SYNC DEBUG] Filtered to ${fr.length} operations based on filter criteria`+(rr.fromRevision!==void 0?` (fromRevision: ${rr.fromRevision})`:""));const hr=rr.limit?fr.slice(0,rr.limit):fr;if(this.logger.verbose(`[SYNC DEBUG] Returning ${hr.length} operations after applying limit`),hr.length>0){const mr=hr[0],gr=hr[hr.length-1];this.logger.verbose(`[SYNC DEBUG] First operation: index=${mr.index}, type=${mr.type}`),this.logger.verbose(`[SYNC DEBUG] Last operation: index=${gr.index}, type=${gr.type}`)}return hr.map(mr=>({hash:mr.hash,index:mr.index,timestamp:mr.timestamp,type:mr.type,input:mr.input,skip:mr.skip,context:mr.context,id:mr.id}))}async getDrive(t){try{const ir=await this.cache.getDrive(t);if(ir&&isDocumentDrive(ir))return ir}catch(ir){this.logger.error("Error getting drive from cache",ir)}const tr=await this.documentStorage.get(t),rr=this._buildDocument(tr);if(!isDocumentDrive(rr))throw new Error(`Document with id ${t} is not a Document Drive`);return rr}async getDocument(t,tr){try{const ir=await this.cache.getDocument(tr);if(ir)return ir}catch(ir){this.logger.error("Error getting document from cache",ir)}const rr=await this.documentStorage.get(tr);return this._buildDocument(rr)}_buildDocument(t){const tr=this.getDocumentModelModule(t.header.documentType),rr=garbageCollectDocumentOperations(t.operations);return replayDocument(t.initialState,rr,tr.reducer,void 0,t.header,void 0,{checkHashes:!0,reuseOperationResultingState:!0})}setDocumentModelModules(t){this.documentModelModules=t}getDocumentModelModule(t){const tr=this.documentModelModules.find(rr=>rr.documentModel.id===t);if(!tr)throw new Error(`Document type ${t} not supported`);return tr}getCombinedSyncUnitStatus(t){if(!t.pull&&!t.push||t.pull==="INITIAL_SYNC")return"INITIAL_SYNC";if(t.push==="INITIAL_SYNC")return t.pull||"INITIAL_SYNC";const tr=["ERROR","MISSING","CONFLICT","SYNCING","SUCCESS"];return Object.values(t).sort((ir,lr)=>tr.indexOf(ir)-tr.indexOf(lr))[0]}getSyncStatus(t){const tr=this.syncStatus.get(t);return tr?this.getCombinedSyncUnitStatus(tr):new SynchronizationUnitNotFoundError(`Sync status not found for syncUnitId: ${t}`,t)}updateSyncStatus(t,tr,rr){if(tr===null){this.syncStatus.delete(t);return}const ir=this.syncStatus.get(t);if(!ir){this.initSyncStatus(t,tr);return}if(Object.entries(tr).some(([dr,fr])=>ir[dr]!==fr)){const dr=Object.entries(tr).reduce((mr,[gr,yr])=>({...mr,[gr]:mr[gr]==="INITIAL_SYNC"&&yr==="SYNCING"?"INITIAL_SYNC":yr}),ir),fr=this.getCombinedSyncUnitStatus(ir),hr=this.getCombinedSyncUnitStatus(dr);this.syncStatus.set(t,dr),fr!==hr&&this.eventEmitter&&this.eventEmitter.emit("syncStatus",t,this.getCombinedSyncUnitStatus(dr),rr,dr)}}initSyncStatus(t,tr){const rr=Object.entries(tr).reduce((ir,[lr,dr])=>({...ir,[lr]:dr!=="SYNCING"?dr:"INITIAL_SYNC"}),{});this.syncStatus.set(t,rr),this.eventEmitter&&this.eventEmitter.emit("syncStatus",t,this.getCombinedSyncUnitStatus(rr),void 0,rr)}async initializeDriveSyncStatus(t,tr){const rr=await this.getSynchronizationUnitsIds(t),ir={pull:tr.state.local.triggers.length>0?"INITIAL_SYNC":void 0,push:tr.state.local.listeners.length>0?"SUCCESS":void 0};if(!ir.pull&&!ir.push)return;const lr=[t,...rr.map(dr=>dr.syncId)];for(const dr of lr)this.initSyncStatus(dr,ir)}}class ReactorBuilder{constructor(t){Rs(this,"documentModelModules",[]);Rs(this,"storage");Rs(this,"cache");Rs(this,"queueManager");Rs(this,"eventEmitter");Rs(this,"options");Rs(this,"synchronizationManager");Rs(this,"listenerManager");Rs(this,"transmitterFactory");this.documentModelModules=t}withStorage(t){return this.storage=t,this}withCache(t){return this.cache=t,this}withQueueManager(t){return this.queueManager=t,this}withEventEmitter(t){return this.eventEmitter=t,this}withSynchronizationManager(t){return this.synchronizationManager=t,this}withListenerManager(t){return this.listenerManager=t,this}withTransmitterFactory(t){return this.transmitterFactory=t,this}withOptions(t){return this.options=t,this}build(){var t;if(this.storage||(this.storage=new MemoryStorage),this.cache||(this.cache=new InMemoryCache),this.queueManager||(this.queueManager=new BaseQueueManager),this.eventEmitter||(this.eventEmitter=new DefaultEventEmitter),this.synchronizationManager||(this.synchronizationManager=new SynchronizationManager(this.storage,this.storage,this.cache,this.documentModelModules,this.eventEmitter)),!this.listenerManager){const tr={...DefaultListenerManagerOptions,...(t=this.options)==null?void 0:t.listenerManager};this.listenerManager=new ListenerManager(this.synchronizationManager,tr)}return this.transmitterFactory||(this.transmitterFactory=new TransmitterFactory(this.listenerManager)),new DocumentDriveServer(this.documentModelModules,this.storage,this.storage,this.cache,this.queueManager,this.eventEmitter,this.synchronizationManager,this.listenerManager,this.options)}}var Sc,Pu;class InternalTransmitter{constructor(t,tr,rr){bs(this,Sc);Rs(this,"drive");Rs(this,"processor");Rs(this,"taskQueueMethod");Rs(this,"transmitQueue");this.drive=t,this.processor=tr,this.taskQueueMethod=rr===void 0?RunAsap.runAsap:rr}async transmit(t,tr){var ir;const rr=async()=>{var dr;const lr=[];for(const fr of t){const hr=await As(this,Sc,Pu).call(this,fr),mr=await(fr.documentId?this.drive.getDocument(fr.driveId,fr.documentId):this.drive.getDrive(fr.driveId)),gr=((dr=hr.at(-1))==null?void 0:dr.state)??{};lr.push({...fr,documentType:mr.header.documentType,operations:hr,state:gr})}try{return await this.processor.onStrands(lr),t.map(({operations:fr,...hr})=>{var mr;return{...hr,status:"SUCCESS",revision:((mr=fr.at(fr.length-1))==null?void 0:mr.index)??-1}})}catch(fr){return logger.error(fr),t.map(({operations:hr,...mr})=>{var gr;return{...mr,status:"ERROR",revision:(((gr=hr.at(0))==null?void 0:gr.index)??0)-1}})}};return this.transmitQueue=((ir=this.transmitQueue)==null?void 0:ir.then(()=>rr()))??rr(),this.transmitQueue}async disconnect(){await this.processor.onDisconnect()}}Sc=new WeakSet,Pu=async function(t){const tr=[],rr=new Map,ir=async lr=>{const dr=rr.get(lr);if(dr)return dr;const fr={revisions:{[t.scope]:lr},checkHashes:!1},hr=await(t.documentId?this.drive.getDocument(t.driveId,t.documentId,fr):this.drive.getDrive(t.driveId,fr));return lr<0?rr.set(lr,hr.initialState.state[t.scope]):rr.set(lr,hr.state[t.scope]),rr.get(lr)};for(const lr of t.operations){const dr=()=>ir(lr.index),fr=await(this.taskQueueMethod?RunAsap.runAsapAsync(dr,this.taskQueueMethod):dr()),hr=()=>ir(lr.index-1),mr=await(this.taskQueueMethod?RunAsap.runAsapAsync(hr,this.taskQueueMethod):hr());tr.push({...lr,state:fr,previousState:mr})}return tr};const createDriveState=utils$1.createState;function useUserPermissions(){return{isAllowedToCreateDocuments:!0,isAllowedToEditDocuments:!0}}function documentToHash(e){return Object.keys(e.operations).map(t=>{var tr;return`${t}:${e.operations[t].length}:${(tr=e.operations[t].at(-1))==null?void 0:tr.hash}`}).join(":")}const __vite_import_meta_env__$2={},isSelfAtom=(e,t)=>e.unstable_is?e.unstable_is(t):t===e,hasInitialValue=e=>"init"in e,isActuallyWritableAtom=e=>!!e.write,isAtomStateInitialized=e=>"v"in e||"e"in e,returnAtomValue=e=>{if("e"in e)throw e.e;if((__vite_import_meta_env__$2?"production":void 0)!=="production"&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v},promiseStateMap=new WeakMap,isPendingPromise=e=>{var t;return isPromiseLike$1(e)&&!!((t=promiseStateMap.get(e))!=null&&t[0])},abortPromise=e=>{const t=promiseStateMap.get(e);t!=null&&t[0]&&(t[0]=!1,t[1].forEach(tr=>tr()))},registerAbortHandler=(e,t)=>{let tr=promiseStateMap.get(e);if(!tr){tr=[!0,new Set],promiseStateMap.set(e,tr);const rr=()=>{tr[0]=!1};e.then(rr,rr)}tr[1].add(t)},isPromiseLike$1=e=>typeof(e==null?void 0:e.then)=="function",addPendingPromiseToDependency=(e,t,tr)=>{tr.p.has(e)||(tr.p.add(e),t.then(()=>{tr.p.delete(e)},()=>{tr.p.delete(e)}))},setAtomStateValueOrPromise=(e,t,tr)=>{const rr=tr(e),ir="v"in rr,lr=rr.v;if(isPromiseLike$1(t))for(const dr of rr.d.keys())addPendingPromiseToDependency(e,t,tr(dr));rr.v=t,delete rr.e,(!ir||!Object.is(lr,rr.v))&&(++rr.n,isPromiseLike$1(lr)&&abortPromise(lr))},getMountedOrPendingDependents=(e,t,tr)=>{var rr;const ir=new Set;for(const lr of((rr=tr.get(e))==null?void 0:rr.t)||[])tr.has(lr)&&ir.add(lr);for(const lr of t.p)ir.add(lr);return ir},createStoreHook=()=>{const e=new Set,t=()=>{e.forEach(tr=>tr())};return t.add=tr=>(e.add(tr),()=>{e.delete(tr)}),t},createStoreHookForAtoms=()=>{const e={},t=new WeakMap,tr=rr=>{var ir,lr;(ir=t.get(e))==null||ir.forEach(dr=>dr(rr)),(lr=t.get(rr))==null||lr.forEach(dr=>dr())};return tr.add=(rr,ir)=>{const lr=rr||e,dr=(t.has(lr)?t:t.set(lr,new Set)).get(lr);return dr.add(ir),()=>{dr==null||dr.delete(ir),dr.size||t.delete(lr)}},tr},initializeStoreHooks=e=>(e.c||(e.c=createStoreHookForAtoms()),e.m||(e.m=createStoreHookForAtoms()),e.u||(e.u=createStoreHookForAtoms()),e.f||(e.f=createStoreHook()),e),BUILDING_BLOCKS=Symbol(),buildStore=(e=new WeakMap,t=new WeakMap,tr=new WeakMap,rr=new Set,ir=new Set,lr=new Set,dr={},fr=(_r,...br)=>_r.read(...br),hr=(_r,...br)=>_r.write(...br),mr=(_r,br)=>{var wr;return(wr=_r.unstable_onInit)==null?void 0:wr.call(_r,br)},gr=(_r,br)=>{var wr;return(wr=_r.onMount)==null?void 0:wr.call(_r,br)},...yr)=>{const _r=yr[0]||($r=>{if((__vite_import_meta_env__$2?"production":void 0)!=="production"&&!$r)throw new Error("Atom is undefined or null");let Fr=e.get($r);return Fr||(Fr={d:new Map,p:new Set,n:0},e.set($r,Fr),mr==null||mr($r,Dr)),Fr}),br=yr[1]||(()=>{const $r=[],Fr=Lr=>{try{Lr()}catch(qn){$r.push(qn)}};do{dr.f&&Fr(dr.f);const Lr=new Set,qn=Lr.add.bind(Lr);rr.forEach(Kn=>{var Gr;return(Gr=t.get(Kn))==null?void 0:Gr.l.forEach(qn)}),rr.clear(),lr.forEach(qn),lr.clear(),ir.forEach(qn),ir.clear(),Lr.forEach(Fr),rr.size&&wr()}while(rr.size||lr.size||ir.size);if($r.length)throw new AggregateError($r)}),wr=yr[2]||(()=>{const $r=[],Fr=new WeakSet,Lr=new WeakSet,qn=Array.from(rr);for(;qn.length;){const Kn=qn[qn.length-1],Gr=_r(Kn);if(Lr.has(Kn)){qn.pop();continue}if(Fr.has(Kn)){if(tr.get(Kn)===Gr.n)$r.push([Kn,Gr]);else if((__vite_import_meta_env__$2?"production":void 0)!=="production"&&tr.has(Kn))throw new Error("[Bug] invalidated atom exists");Lr.add(Kn),qn.pop();continue}Fr.add(Kn);for(const Zn of getMountedOrPendingDependents(Kn,Gr,t))Fr.has(Zn)||qn.push(Zn)}for(let Kn=$r.length-1;Kn>=0;--Kn){const[Gr,Zn]=$r[Kn];let zr=!1;for(const $n of Zn.d.keys())if($n!==Gr&&rr.has($n)){zr=!0;break}zr&&(vr(Gr),Mr(Gr)),tr.delete(Gr)}}),vr=yr[3]||($r=>{var Fr;const Lr=_r($r);if(isAtomStateInitialized(Lr)&&(t.has($r)&&tr.get($r)!==Lr.n||Array.from(Lr.d).every(([Jn,Yn])=>vr(Jn).n===Yn)))return Lr;Lr.d.clear();let qn=!0;const Kn=()=>{t.has($r)&&(Mr($r),wr(),br())},Gr=Jn=>{var Yn;if(isSelfAtom($r,Jn)){const ds=_r(Jn);if(!isAtomStateInitialized(ds))if(hasInitialValue(Jn))setAtomStateValueOrPromise(Jn,Jn.init,_r);else throw new Error("no atom init");return returnAtomValue(ds)}const Xn=vr(Jn);try{return returnAtomValue(Xn)}finally{Lr.d.set(Jn,Xn.n),isPendingPromise(Lr.v)&&addPendingPromiseToDependency($r,Lr.v,Xn),(Yn=t.get(Jn))==null||Yn.t.add($r),qn||Kn()}};let Zn,zr;const $n={get signal(){return Zn||(Zn=new AbortController),Zn.signal},get setSelf(){return(__vite_import_meta_env__$2?"production":void 0)!=="production"&&!isActuallyWritableAtom($r)&&console.warn("setSelf function cannot be used with read-only atom"),!zr&&isActuallyWritableAtom($r)&&(zr=(...Jn)=>{if((__vite_import_meta_env__$2?"production":void 0)!=="production"&&qn&&console.warn("setSelf function cannot be called in sync"),!qn)try{return Ir($r,...Jn)}finally{wr(),br()}}),zr}},Hn=Lr.n;try{const Jn=fr($r,Gr,$n);return setAtomStateValueOrPromise($r,Jn,_r),isPromiseLike$1(Jn)&&(registerAbortHandler(Jn,()=>Zn==null?void 0:Zn.abort()),Jn.then(Kn,Kn)),Lr}catch(Jn){return delete Lr.v,Lr.e=Jn,++Lr.n,Lr}finally{qn=!1,Hn!==Lr.n&&tr.get($r)===Hn&&(tr.set($r,Lr.n),rr.add($r),(Fr=dr.c)==null||Fr.call(dr,$r))}}),Sr=yr[4]||($r=>{const Fr=[$r];for(;Fr.length;){const Lr=Fr.pop(),qn=_r(Lr);for(const Kn of getMountedOrPendingDependents(Lr,qn,t)){const Gr=_r(Kn);tr.set(Kn,Gr.n),Fr.push(Kn)}}}),Ir=yr[5]||(($r,...Fr)=>{let Lr=!0;const qn=Gr=>returnAtomValue(vr(Gr)),Kn=(Gr,...Zn)=>{var zr;const $n=_r(Gr);try{if(isSelfAtom($r,Gr)){if(!hasInitialValue(Gr))throw new Error("atom not writable");const Hn=$n.n,Jn=Zn[0];setAtomStateValueOrPromise(Gr,Jn,_r),Mr(Gr),Hn!==$n.n&&(rr.add(Gr),(zr=dr.c)==null||zr.call(dr,Gr),Sr(Gr));return}else return Ir(Gr,...Zn)}finally{Lr||(wr(),br())}};try{return hr($r,qn,Kn,...Fr)}finally{Lr=!1}}),Mr=yr[6]||($r=>{var Fr;const Lr=_r($r),qn=t.get($r);if(qn&&!isPendingPromise(Lr.v)){for(const[Kn,Gr]of Lr.d)if(!qn.d.has(Kn)){const Zn=_r(Kn);Ar(Kn).t.add($r),qn.d.add(Kn),Gr!==Zn.n&&(rr.add(Kn),(Fr=dr.c)==null||Fr.call(dr,Kn),Sr(Kn))}for(const Kn of qn.d||[])if(!Lr.d.has(Kn)){qn.d.delete(Kn);const Gr=kr(Kn);Gr==null||Gr.t.delete($r)}}}),Ar=yr[7]||($r=>{var Fr;const Lr=_r($r);let qn=t.get($r);if(!qn){vr($r);for(const Kn of Lr.d.keys())Ar(Kn).t.add($r);if(qn={l:new Set,d:new Set(Lr.d.keys()),t:new Set},t.set($r,qn),(Fr=dr.m)==null||Fr.call(dr,$r),isActuallyWritableAtom($r)){const Kn=()=>{let Gr=!0;const Zn=(...zr)=>{try{return Ir($r,...zr)}finally{Gr||(wr(),br())}};try{const zr=gr($r,Zn);zr&&(qn.u=()=>{Gr=!0;try{zr()}finally{Gr=!1}})}finally{Gr=!1}};ir.add(Kn)}}return qn}),kr=yr[8]||($r=>{var Fr;const Lr=_r($r);let qn=t.get($r);if(qn&&!qn.l.size&&!Array.from(qn.t).some(Kn=>{var Gr;return(Gr=t.get(Kn))==null?void 0:Gr.d.has($r)})){qn.u&&lr.add(qn.u),qn=void 0,t.delete($r),(Fr=dr.u)==null||Fr.call(dr,$r);for(const Kn of Lr.d.keys()){const Gr=kr(Kn);Gr==null||Gr.t.delete($r)}return}return qn}),Or=[e,t,tr,rr,ir,lr,dr,fr,hr,mr,gr,_r,br,wr,vr,Sr,Ir,Mr,Ar,kr],Dr={get:$r=>returnAtomValue(vr($r)),set:($r,...Fr)=>{try{return Ir($r,...Fr)}finally{wr(),br()}},sub:($r,Fr)=>{const qn=Ar($r).l;return qn.add(Fr),br(),()=>{qn.delete(Fr),kr($r),br()}}};return Object.defineProperty(Dr,BUILDING_BLOCKS,{value:Or}),Dr},INTERNAL_buildStoreRev1=buildStore,INTERNAL_initializeStoreHooks=initializeStoreHooks,INTERNAL_registerAbortHandler=registerAbortHandler,__vite_import_meta_env__$1={};let keyCount=0;function atom(e,t){const tr=`atom${++keyCount}`,rr={toString(){return(__vite_import_meta_env__$1?"production":void 0)!=="production"&&this.debugLabel?tr+":"+this.debugLabel:tr}};return typeof e=="function"?rr.read=e:(rr.init=e,rr.read=defaultRead,rr.write=defaultWrite),t&&(rr.write=t),rr}function defaultRead(e){return e(this)}function defaultWrite(e,t,tr){return t(this,typeof tr=="function"?tr(e(this)):tr)}const createDevStoreRev4=()=>{let e=0;const t=INTERNAL_initializeStoreHooks({}),tr=new WeakMap,rr=new WeakMap,ir=INTERNAL_buildStoreRev1(tr,rr,void 0,void 0,void 0,void 0,t,void 0,(fr,hr,mr,...gr)=>e?mr(fr,...gr):fr.write(hr,mr,...gr)),lr=new Set;return t.m.add(void 0,fr=>{lr.add(fr);const hr=tr.get(fr);hr.m=rr.get(fr)}),t.u.add(void 0,fr=>{lr.delete(fr);const hr=tr.get(fr);delete hr.m}),Object.assign(ir,{dev4_get_internal_weak_map:()=>(console.log("Deprecated: Use devstore from the devtools library"),tr),dev4_get_mounted_atoms:()=>lr,dev4_restore_atoms:fr=>{const hr={read:()=>null,write:(mr,gr)=>{++e;try{for(const[yr,_r]of fr)"init"in yr&&gr(yr,_r)}finally{--e}}};ir.set(hr)}})};function createStore$2(){return(__vite_import_meta_env__$1?"production":void 0)!=="production"?createDevStoreRev4():INTERNAL_buildStoreRev1()}let defaultStore;function getDefaultStore(){return defaultStore||(defaultStore=createStore$2(),(__vite_import_meta_env__$1?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=defaultStore),globalThis.__JOTAI_DEFAULT_STORE__!==defaultStore&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),defaultStore}const __vite_import_meta_env__={},StoreContext=createContext(void 0);function useStore(e){return useContext(StoreContext)||getDefaultStore()}function Provider({children:e,store:t}){const tr=useRef(void 0);return!t&&!tr.current&&(tr.current=createStore$2()),createElement(StoreContext.Provider,{value:t||tr.current},e)}const isPromiseLike=e=>typeof(e==null?void 0:e.then)=="function",attachPromiseStatus=e=>{e.status||(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}))},use=React__default.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(attachPromiseStatus(e),e)}),continuablePromiseMap=new WeakMap,createContinuablePromise=(e,t)=>{let tr=continuablePromiseMap.get(e);return tr||(tr=new Promise((rr,ir)=>{let lr=e;const dr=mr=>gr=>{lr===mr&&rr(gr)},fr=mr=>gr=>{lr===mr&&ir(gr)},hr=()=>{try{const mr=t();isPromiseLike(mr)?(continuablePromiseMap.set(mr,tr),lr=mr,mr.then(dr(mr),fr(mr)),INTERNAL_registerAbortHandler(mr,hr)):rr(mr)}catch(mr){ir(mr)}};e.then(dr(e),fr(e)),INTERNAL_registerAbortHandler(e,hr)}),continuablePromiseMap.set(e,tr)),tr};function useAtomValue(e,t){const{delay:tr,unstable_promiseStatus:rr=!React__default.use}={},ir=useStore(),[[lr,dr,fr],hr]=useReducer(gr=>{const yr=ir.get(e);return Object.is(gr[0],yr)&&gr[1]===ir&&gr[2]===e?gr:[yr,ir,e]},void 0,()=>[ir.get(e),ir,e]);let mr=lr;if((dr!==ir||fr!==e)&&(hr(),mr=ir.get(e)),useEffect(()=>{const gr=ir.sub(e,()=>{if(rr)try{const yr=ir.get(e);isPromiseLike(yr)&&attachPromiseStatus(createContinuablePromise(yr,()=>ir.get(e)))}catch{}if(typeof tr=="number"){setTimeout(hr,tr);return}hr()});return hr(),gr},[ir,e,tr,rr]),useDebugValue(mr),isPromiseLike(mr)){const gr=createContinuablePromise(mr,()=>ir.get(e));return rr&&attachPromiseStatus(gr),use(gr)}return mr}function useSetAtom(e,t){const tr=useStore();return useCallback((...ir)=>{if((__vite_import_meta_env__?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return tr.set(e,...ir)},[tr,e])}function useAtom(e,t){return[useAtomValue(e),useSetAtom(e)]}function useDocument(e,t={}){const{documentId:tr,documentType:rr,driveId:ir}=t,[lr,dr]=useState(),fr=useCallback(hr=>{if(!e)throw new Error("Reactor is not loaded");return e.on("strandUpdate",hr)},[e]);return useEffect(()=>{e&&(!ir||!tr||!rr||e.getDocument(ir,tr).then(dr).catch(console.error))},[ir,tr,rr,e]),useEffect(()=>!e||!ir||!tr||!rr?void 0:fr(mr=>{mr.driveId===ir&&mr.documentId===tr&&e.getDocument(ir,tr).then(dr).catch(console.error)}),[fr,ir,tr,rr]),lr}const documentDrivesAtom=atom(new Map);documentDrivesAtom.debugLabel="documentDrivesAtomInReactorBrowser";function drivesToHash(e){return e.map(documentToHash).join("&")}const readWriteDocumentDrivesAtom=e=>()=>atom(t=>e?t(documentDrivesAtom).get(e)??[]:[],(t,tr,rr)=>{tr(documentDrivesAtom,ir=>{if(!e)return new Map;const lr=ir.get(e)??[];return lr.length!==rr.length||drivesToHash(lr)!==drivesToHash(rr)?new Map(ir).set(e,rr):ir})}),documentDrivesInitialized=atom("INITIAL");documentDrivesInitialized.debugLabel="documentDrivesInitializedInReactorBrowser";const FETCH_TIMEOUT=250;let timeout;const listeners=new Array;function waitForResult(e,t,tr){timeout&&clearTimeout(timeout),listeners.push(t);const rr=[...listeners];timeout=setTimeout(()=>{e().then(()=>{for(;rr.length;){const ir=rr.shift();if(ir){ir();const lr=listeners.indexOf(ir);lr>-1&&listeners.splice(lr,1)}}}).catch(tr)},FETCH_TIMEOUT)}async function fetchDocumentdrives(e){const t=[],tr=await e.getDrives();for(const rr of tr)try{const ir=await e.getDrive(rr);t.push(ir)}catch(ir){console.error(ir)}return t}function useDocumentDrives(e){const[t,tr]=useAtom(useMemo(readWriteDocumentDrivesAtom(e),[e])),rr=useCallback(async()=>{if(e)return new Promise((fr,hr)=>{waitForResult(()=>fetchDocumentdrives(e).then(mr=>{tr(mr)}).catch(hr),fr,hr)})},[e]),[ir,lr]=useAtom(documentDrivesInitialized);ir==="INITIAL"&&e&&(lr("LOADING"),rr().then(()=>lr("LOADED")).catch(()=>lr("ERROR")));const dr=useCallback(fr=>{if(!e)return;const hr=e.on("strandUpdate",()=>rr()),mr=e.on("syncStatus",async(vr,Sr,Ir)=>{Ir&&console.error(Ir),Ir&&await rr()}),gr=e.on("driveAdded",()=>rr()),yr=e.on("driveDeleted",()=>rr()),_r=e.on("driveOperationsAdded",()=>rr()),br=e.on("clientStrandsError",fr.strandsErrorHandler),wr=e.on("defaultRemoteDrive",()=>rr());return()=>{hr(),mr(),gr(),yr(),_r(),br(),wr()}},[e,rr]);return useMemo(()=>[t,rr,dr,ir],[t,ir])}async function signOperation(e,t,tr,rr,ir,lr){if(!lr||!e.context||!e.context.signer)return e;if(!ir)return console.error(`Document model '${rr.header.documentType}' does not have a reducer`),e;const dr={documentId:tr,signer:e.context.signer};return await buildSignedOperation(e,ir,rr,dr,t)}function addActionContext(e,t,tr){return tr?{context:{signer:{app:{name:"Connect",key:t||""},user:{address:tr.address,networkId:tr.networkId,chainId:tr.chainId},signatures:[]}},...e}:e}function debounceOperations(e,t=50){let tr;const rr=[];return ir=>{tr&&clearTimeout(tr);const lr=rr.findIndex(dr=>dr.scope===ir.scope&&dr.index===ir.index);if(lr>-1){const dr=rr[lr];dr.type===ir.type&&JSON.stringify(ir.input)===JSON.stringify(dr.input)||console.warn("Two conflicting operations were dispatched:",dr,ir),rr[lr]=ir}else rr.push(ir);return new Promise((dr,fr)=>{tr=setTimeout(()=>{e(rr).then(dr).catch(fr)},t)})}}function useAddDebouncedOperations(e,t){const{driveId:tr,documentId:rr}=t,[ir]=useDocumentDrives(e),lr=useRef(ir),{isAllowedToEditDocuments:dr}=useUserPermissions()||{isAllowedToEditDocuments:!1};useEffect(()=>{lr.current=ir},[ir]);const fr=useCallback(async(mr,gr,yr)=>{if(!dr)throw new Error("User is not allowed to edit documents");if(!e)throw new Error("Reactor is not loaded");if(!lr.current.find(wr=>wr.header.id===mr))throw new Error(`Drive with id ${mr} not found`);return(await e.queueOperations(mr,gr,yr)).document},[dr,e]);return useMemo(()=>debounceOperations(mr=>fr(tr,rr,mr)),[fr,tr,rr])}function useDocumentDispatch(e,t,tr=console.error){const[rr,ir]=useState(t),[lr,dr]=useState(),fr=mr=>{dr(mr),tr(mr)};return useEffect(()=>{ir(t)},[t]),[rr,(mr,gr,yr)=>{dr(void 0),ir(_r=>{if(!e||!_r)return _r;try{const br=e(_r,mr),wr=mr.scope??"global",vr=br.operations[wr],Sr=vr[vr.length-1];if(Sr.error){const Ir=new Error(Sr.error);fr(Ir),yr==null||yr(Ir)}return gr==null||gr(Sr,{prevState:{..._r},newState:{...br}}),br}catch(br){return fr(br),yr==null||yr(br),_r}})},lr]}function useDocumentEditorProps(e,t){const{nodeId:tr,driveId:rr,documentModelModule:ir,document:lr,user:dr,connectDid:fr,sign:hr}=t,mr=useAddDebouncedOperations(e,{driveId:rr,documentId:tr}),[gr,yr,_r]=useDocumentDispatch(ir.reducer,lr);function br(wr,vr){const Sr=(Ir,Mr)=>{const{prevState:Ar}=Mr;signOperation(Ir,hr,tr,Ar,ir.reducer,dr).then(kr=>mr(kr)).catch(console.error)};yr(addActionContext(wr,fr,dr),Sr,vr)}return{dispatch:br,document:gr,error:_r}}const generateId=()=>generateId$1().toString();function getNode(e,t){return t.state.global.nodes.find(tr=>tr.id===e)}function createDriveActions(e,t,tr){const rr=e,ir=rr.header.id,{selectedNode:lr}=tr,dr=async(wr,vr,Sr=generateId())=>{t(addFolder({id:Sr,name:wr,parentFolder:vr??null}))},fr=async(wr,vr,Sr,Ir,Mr=generateId())=>{const Ar=generateAddNodeAction(rr.state.global,{id:Mr,name:wr,parentFolder:Ir??null,documentType:vr,document:Sr},["global"]);t(Ar)},hr=async(wr,vr=lr&&isFolderNode(lr)?lr.id:void 0,Sr=wr.name.replace(/\.zip$/gim,""))=>{const Ir=vr?getNode(vr,rr):void 0;if(vr&&!Ir)throw new Error(`Parent folder with id "${vr}" not found`);if(Ir&&!isFolderNode(Ir))throw new Error(`Parent folder with id "${vr}" is not a folder`);await tr.addFile(wr,ir,Sr,vr)},mr=async wr=>{t(deleteNode({id:wr}))},gr=async(wr,vr)=>{t(updateNode({id:wr,name:vr}))},yr=async(wr,vr)=>{t(moveNode({srcFolder:wr,targetParentFolder:vr}))},_r=async(wr,vr)=>{const Sr=vr?getNode(vr,rr):void 0;if(vr&&!Sr&&vr!==ir)throw new Error(`Target node with id "${vr}" not found`);if(Sr&&!isFolderNode(Sr))throw new Error(`Target node with id "${vr}" is not a folder`);const Ir=getNode(wr,rr);if(!Ir)throw new Error(`Source node with id "${wr}" not found`);const Ar=generateNodesCopy({srcId:wr,targetParentFolder:Sr==null?void 0:Sr.id,targetName:Ir.name},generateId,rr.state.global.nodes).map(kr=>copyNode(kr));for(const kr of Ar)t(kr)},br=async wr=>{const vr=getNode(wr,rr);if(!vr)throw new Error(`Node with id "${wr}" not found`);await _r(vr.id,vr.parentFolder||void 0)};return{context:tr,selectNode:tr.selectNode,addFolder:dr,addFile:hr,addDocument:fr,deleteNode:mr,renameNode:gr,moveNode:yr,copyNode:_r,duplicateNode:br}}function useDriveActions(e,t,tr){return useMemo(()=>createDriveActions(e,t,tr),[e,t,tr])}const DRIVE$1="DRIVE",FILE$1="FILE",DriveContext=createContext(void 0),DriveContextProvider=({value:e,children:t})=>jsx$1(DriveContext.Provider,{value:e,children:t});function useDriveContext(){const e=useContext(DriveContext);if(!e)throw new Error("useDriveContext must be used within a DriveContextProvider");return e}const defaultTreeItemContextValue={driveNodes:[],selectedNode:null,selectedNodePath:[],selectedDriveNode:null,selectedParentNode:null,setDriveNodes:()=>{},setSelectedNode:()=>{},getNodeById:()=>null,getParentNode:()=>null,getIsSelected:()=>!1,getIsInSelectedNodePath:()=>!1,getSiblings:()=>[]},UiNodesContext=createContext(defaultTreeItemContextValue),UiNodesContextProvider=({children:e})=>{const[t,tr]=useState([]),[rr,ir]=useState(null),[lr,dr]=useState([]),[fr,hr]=useState(null),[mr,gr]=useState(null),yr=useCallback(($r,Fr)=>{if(!(Fr!=null&&Fr.length))return null;for(const Lr of Fr){if(Lr.id===$r)return Lr;const qn=Lr.nodeMap[$r];if(qn)return qn}return null},[]),_r=useCallback($r=>yr($r,t),[yr,t]),br=useCallback(($r,Fr)=>!$r||!(Fr!=null&&Fr.length)?null:$r.kind===DRIVE$1?$r:Fr.find(Lr=>Lr.id===$r.driveId)??null,[]),wr=useCallback(($r,Fr)=>{if(!(Fr!=null&&Fr.length)||$r.kind===DRIVE$1)return null;const Lr=yr($r.parentFolder,Fr);if(!Lr)return null;if(Lr.kind===FILE$1)throw new Error(`Parent node ${$r.parentFolder} is a file, not a folder`);return Lr},[yr]),vr=useCallback($r=>wr($r,t),[wr,t]),Sr=useCallback(($r,Fr)=>!$r||!(Fr!=null&&Fr.length)?null:$r.kind===FILE$1?wr($r,Fr):$r,[wr]),Ir=useCallback(($r,Fr)=>{const Lr=[],qn=Fr.find(Gr=>Gr.id===$r.driveId);let Kn=$r;for(;Kn;)Lr.push(Kn),Kn=Kn.parentFolder===(qn==null?void 0:qn.id)?qn:Kn.parentFolder?qn==null?void 0:qn.nodeMap[Kn.parentFolder]:void 0;return Lr.reverse()},[]),Mr=useCallback($r=>{if(ir($r),hr(br($r,t)),gr(Sr($r,t)),!$r){dr([]);return}if($r.kind===DRIVE$1){dr([$r]);return}const Fr=Ir($r,t);dr(Fr)},[t,Ir,br,Sr]),Ar=useCallback($r=>rr===$r,[rr]),kr=useCallback($r=>$r.kind===FILE$1?!1:lr.includes($r),[lr]),Or=useCallback($r=>{if($r.kind===DRIVE$1)return console.warn("Drive nodes do not have siblings, as they are top-level nodes"),[];const Fr=wr($r,t);return(Fr==null?void 0:Fr.children)??[]},[wr,t]);useEffect(()=>{if(!rr)return;const $r=yr(rr.id,t);$r&&Mr($r)},[t,yr,rr,Mr]);const Dr=useMemo(()=>({driveNodes:t,selectedNode:rr,selectedNodePath:lr,selectedDriveNode:fr,selectedParentNode:mr,getNodeById:_r,getParentNode:vr,setDriveNodes:tr,setSelectedNode:Mr,getIsSelected:Ar,getIsInSelectedNodePath:kr,getSiblings:Or}),[t,rr,lr,fr,mr,_r,vr,Mr,Ar,kr,Or]);return jsx$1(UiNodesContext.Provider,{value:Dr,children:e})},useUiNodesContext=()=>useContext(UiNodesContext);function toNode(e){if(e.kind==="DRIVE")throw new Error("Cannot convert drive node to regular node");const{id:t,name:tr,parentFolder:rr,kind:ir}=e;if(ir==="FOLDER")return{id:t,name:tr,parentFolder:rr,kind:"folder"};{const lr=e;return{id:t,name:tr,parentFolder:rr,kind:"file",documentType:lr.documentType,synchronizationUnits:lr.synchronizationUnits}}}function createUiNodeAdapter(e){return{...e,addFile:(t,tr)=>e.addFile(t,tr==null?void 0:tr.id),addFolder:(t,tr=void 0)=>e.addFolder(t,tr),renameNode:(t,tr)=>{const rr=toNode(tr);return e.renameNode(rr.id,t)},deleteNode:t=>{const tr=toNode(t);return e.deleteNode(tr.id)},moveNode:async(t,tr)=>{if(tr.kind===FILE$1||t.parentFolder===tr.id)return;const rr=toNode(t),ir=toNode(tr);return e.moveNode(rr.id,ir.id)},copyNode:(t,tr)=>e.copyNode(t.id,tr.id),duplicateNode:t=>{const tr=toNode(t);return e.duplicateNode(tr.id)}}}function useDriveActionsWithUiNodes(e,t){const{selectedNode:tr,selectedDriveNode:rr,setSelectedNode:ir,getNodeById:lr}=useUiNodesContext(),dr=useDriveContext(),fr=useMemo(()=>({...dr,selectedNode:tr,onSelectNode:gr=>{dr.selectNode(gr),ir(lr(gr.id))}}),[tr,rr==null?void 0:rr.driveId,ir,lr]),hr=useDriveActions(e,t,fr);return useMemo(()=>createUiNodeAdapter(hr),[hr])}var p$1=Object.create,i=Object.defineProperty,c$2=Object.getOwnPropertyDescriptor,f$1=Object.getOwnPropertyNames,l$2=Object.getPrototypeOf,s$1=Object.prototype.hasOwnProperty,a=e=>{throw TypeError(e)},_$3=(e,t,tr)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:tr}):e[t]=tr,d$1=(e,t)=>()=>(e&&(t=e(e=0)),t),D$4=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),F$3=(e,t)=>{for(var tr in t)i(e,tr,{get:t[tr],enumerable:!0})},g$5=(e,t,tr,rr)=>{if(t&&typeof t=="object"||typeof t=="function")for(let ir of f$1(t))!s$1.call(e,ir)&&ir!==tr&&i(e,ir,{get:()=>t[ir],enumerable:!(rr=c$2(t,ir))||rr.enumerable});return e},L$4=(e,t,tr)=>(tr=e!=null?p$1(l$2(e)):{},g$5(i(tr,"default",{value:e,enumerable:!0}),e)),P$3=(e,t,tr)=>_$3(e,typeof t!="symbol"?t+"":t,tr),n=(e,t,tr)=>t.has(e)||a("Cannot "+tr),h$2=(e,t,tr)=>(n(e,t,"read from private field"),tr?tr.call(e):t.get(e)),R$3=(e,t,tr)=>t.has(e)?a("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,tr),x$4=(e,t,tr,rr)=>(n(e,t,"write to private field"),t.set(e,tr),tr),T$2=(e,t,tr)=>(n(e,t,"access private method"),tr),U$3=(e,t,tr,rr)=>({set _(ir){x$4(e,t,ir)},get _(){return h$2(e,t,rr)}}),u$2=d$1(()=>{}),hn={};F$3(hn,{ABSTIME:()=>Et,ACLITEM:()=>Vt,BIT:()=>Wt,BOOL:()=>be,BPCHAR:()=>_e$1,BYTEA:()=>ge$1,CHAR:()=>gt,CID:()=>St,CIDR:()=>Tt,CIRCLE:()=>Ut,DATE:()=>He$1,FLOAT4:()=>je$1,FLOAT8:()=>Qe$1,GTSVECTOR:()=>rn,INET:()=>kt,INT2:()=>ve,INT4:()=>Ge,INT8:()=>we,INTERVAL:()=>vt,JSON:()=>Ae$1,JSONB:()=>Ye,MACADDR:()=>Ot,MACADDR8:()=>Nt,MONEY:()=>Lt,NUMERIC:()=>Qt,OID:()=>We$1,PATH:()=>Mt,PG_DEPENDENCIES:()=>en,PG_LSN:()=>Xt,PG_NDISTINCT:()=>Zt,PG_NODE_TREE:()=>Bt,POLYGON:()=>Rt,REFCURSOR:()=>_t,REGCLASS:()=>Yt,REGCONFIG:()=>sn,REGDICTIONARY:()=>an,REGNAMESPACE:()=>on,REGOPER:()=>Ht,REGOPERATOR:()=>qt,REGPROC:()=>wt,REGPROCEDURE:()=>zt,REGROLE:()=>un,REGTYPE:()=>$t,RELTIME:()=>Ct,SMGR:()=>It,TEXT:()=>F$2,TID:()=>At,TIME:()=>Ft,TIMESTAMP:()=>qe$1,TIMESTAMPTZ:()=>xe,TIMETZ:()=>Gt,TINTERVAL:()=>Pt,TSQUERY:()=>nn,TSVECTOR:()=>tn,TXID_SNAPSHOT:()=>Jt,UUID:()=>Kt,VARBIT:()=>jt,VARCHAR:()=>ze,XID:()=>xt,XML:()=>Dt,arrayParser:()=>yn,arraySerializer:()=>Ke$1,parseType:()=>ue,parsers:()=>ln,serializers:()=>cn,types:()=>$e});u$2();var ht=globalThis.JSON.parse,bt=globalThis.JSON.stringify,be=16,ge$1=17,gt=18,we=20,ve=21,Ge=23,wt=24,F$2=25,We$1=26,At=27,xt=28,St=29,Ae$1=114,Dt=142,Bt=194,It=210,Mt=602,Rt=604,Tt=650,je$1=700,Qe$1=701,Et=702,Ct=703,Pt=704,Ut=718,Nt=774,Lt=790,Ot=829,kt=869,Vt=1033,_e$1=1042,ze=1043,He$1=1082,Ft=1083,qe$1=1114,xe=1184,vt=1186,Gt=1266,Wt=1560,jt=1562,Qt=1700,_t=1790,zt=2202,Ht=2203,qt=2204,Yt=2205,$t=2206,Kt=2950,Jt=2970,Xt=3220,Zt=3361,en=3402,tn=3614,nn=3615,rn=3642,sn=3734,an=3769,Ye=3802,on=4089,un=4096,$e={string:{to:F$2,from:[F$2,ze,_e$1],serialize:e=>{if(typeof e=="string")return e;if(typeof e=="number")return e.toString();throw new Error("Invalid input for string type")},parse:e=>e},number:{to:0,from:[ve,Ge,We$1,je$1,Qe$1],serialize:e=>e.toString(),parse:e=>+e},bigint:{to:we,from:[we],serialize:e=>e.toString(),parse:e=>{let t=BigInt(e);return t<Number.MIN_SAFE_INTEGER||t>Number.MAX_SAFE_INTEGER?t:Number(t)}},json:{to:Ae$1,from:[Ae$1,Ye],serialize:e=>typeof e=="string"?e:bt(e),parse:e=>ht(e)},boolean:{to:be,from:[be],serialize:e=>{if(typeof e!="boolean")throw new Error("Invalid input for boolean type");return e?"t":"f"},parse:e=>e==="t"},date:{to:xe,from:[He$1,qe$1,xe],serialize:e=>{if(typeof e=="string")return e;if(typeof e=="number")return new Date(e).toISOString();if(e instanceof Date)return e.toISOString();throw new Error("Invalid input for date type")},parse:e=>new Date(e)},bytea:{to:ge$1,from:[ge$1],serialize:e=>{if(!(e instanceof Uint8Array))throw new Error("Invalid input for bytea type");return"\\x"+Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},parse:e=>{let t=e.slice(2);return Uint8Array.from({length:t.length/2},(tr,rr)=>parseInt(t.substring(rr*2,(rr+1)*2),16))}}},Se=pn($e),ln=Se.parsers,cn=Se.serializers;function ue(e,t,tr){if(e===null)return null;let rr=(tr==null?void 0:tr[t])??Se.parsers[t];return rr?rr(e,t):e}function pn(e){return Object.keys(e).reduce(({parsers:t,serializers:tr},rr)=>{let{to:ir,from:lr,serialize:dr,parse:fr}=e[rr];return tr[ir]=dr,tr[rr]=dr,t[rr]=fr,Array.isArray(lr)?lr.forEach(hr=>{t[hr]=fr,tr[hr]=dr}):(t[lr]=fr,tr[lr]=dr),{parsers:t,serializers:tr}},{parsers:{},serializers:{}})}var dn=/\\/g,fn=/"/g;function mn(e){return e.replace(dn,"\\\\").replace(fn,'\\"')}function Ke$1(e,t,tr){if(Array.isArray(e)===!1)return e;if(!e.length)return"{}";let rr=e[0],ir=tr===1020?";":",";return Array.isArray(rr)?`{${e.map(lr=>Ke$1(lr,t,tr)).join(ir)}}`:`{${e.map(lr=>(lr===void 0&&(lr=null),lr===null?"null":'"'+mn(t?t(lr):lr.toString())+'"')).join(ir)}}`}var he={i:0,char:null,str:"",quoted:!1,last:0,p:null};function yn(e,t,tr){return he.i=he.last=0,Je(he,e,t,tr)[0]}function Je(e,t,tr,rr){let ir=[],lr=rr===1020?";":",";for(;e.i<t.length;e.i++){if(e.char=t[e.i],e.quoted)e.char==="\\"?e.str+=t[++e.i]:e.char==='"'?(ir.push(tr?tr(e.str):e.str),e.str="",e.quoted=t[e.i+1]==='"',e.last=e.i+2):e.str+=e.char;else if(e.char==='"')e.quoted=!0;else if(e.char==="{")e.last=++e.i,ir.push(Je(e,t,tr,rr));else if(e.char==="}"){e.quoted=!1,e.last<e.i&&ir.push(tr?tr(t.slice(e.last,e.i)):t.slice(e.last,e.i)),e.last=e.i+1;break}else e.char===lr&&e.p!=="}"&&e.p!=='"'&&(ir.push(tr?tr(t.slice(e.last,e.i)):t.slice(e.last,e.i)),e.last=e.i+1);e.p=e.char}return e.last<e.i&&ir.push(tr?tr(t.slice(e.last,e.i+1)):t.slice(e.last,e.i+1)),ir}var wn={};F$3(wn,{parseDescribeStatementResults:()=>De,parseResults:()=>bn});u$2();function bn(e,t,tr,rr){let ir=[],lr={rows:[],fields:[]},dr=0,fr={...t,...tr==null?void 0:tr.parsers};return e.forEach(hr=>{switch(hr.name){case"rowDescription":{let mr=hr;lr.fields=mr.fields.map(gr=>({name:gr.name,dataTypeID:gr.dataTypeID}));break}case"dataRow":{if(!lr)break;let mr=hr;(tr==null?void 0:tr.rowMode)==="array"?lr.rows.push(mr.fields.map((gr,yr)=>ue(gr,lr.fields[yr].dataTypeID,fr))):lr.rows.push(Object.fromEntries(mr.fields.map((gr,yr)=>[lr.fields[yr].name,ue(gr,lr.fields[yr].dataTypeID,fr)])));break}case"commandComplete":{dr+=gn(hr),ir.push({...lr,affectedRows:dr,...rr?{blob:rr}:{}}),lr={rows:[],fields:[]};break}}}),ir.length===0&&ir.push({affectedRows:0,rows:[],fields:[]}),ir}function gn(e){let t=e.text.split(" ");switch(t[0]){case"INSERT":return parseInt(t[2],10);case"UPDATE":case"DELETE":case"COPY":return parseInt(t[1],10);default:return 0}}function De(e){let t=e.find(tr=>tr.name==="parameterDescription");return t?t.dataTypeIDs:[]}var Ue$1={};F$3(Ue$1,{AuthenticationCleartextPassword:()=>G$2,AuthenticationMD5Password:()=>W$2,AuthenticationOk:()=>v$2,AuthenticationSASL:()=>j$2,AuthenticationSASLContinue:()=>Q$1,AuthenticationSASLFinal:()=>_$2,BackendKeyDataMessage:()=>J$2,CommandCompleteMessage:()=>ee$1,CopyDataMessage:()=>z$2,CopyResponse:()=>H$4,DataRowMessage:()=>te$1,DatabaseError:()=>E$2,Field:()=>q$3,NoticeMessage:()=>ne,NotificationResponseMessage:()=>X,ParameterDescriptionMessage:()=>$$3,ParameterStatusMessage:()=>K$2,ReadyForQueryMessage:()=>Z$1,RowDescriptionMessage:()=>Y$1,bindComplete:()=>Ie$1,closeComplete:()=>Me,copyDone:()=>Pe$1,emptyQuery:()=>Ce,noData:()=>Re,parseComplete:()=>Be,portalSuspended:()=>Te$1,replicationStart:()=>Ee});u$2();var Be={name:"parseComplete",length:5},Ie$1={name:"bindComplete",length:5},Me={name:"closeComplete",length:5},Re={name:"noData",length:5},Te$1={name:"portalSuspended",length:5},Ee={name:"replicationStart",length:4},Ce={name:"emptyQuery",length:4},Pe$1={name:"copyDone",length:4},v$2=class{constructor(t){this.length=t,this.name="authenticationOk"}},G$2=class{constructor(t){this.length=t,this.name="authenticationCleartextPassword"}},W$2=class{constructor(t,tr){this.length=t,this.salt=tr,this.name="authenticationMD5Password"}},j$2=class{constructor(t,tr){this.length=t,this.mechanisms=tr,this.name="authenticationSASL"}},Q$1=class{constructor(t,tr){this.length=t,this.data=tr,this.name="authenticationSASLContinue"}},_$2=class{constructor(t,tr){this.length=t,this.data=tr,this.name="authenticationSASLFinal"}},E$2=class extends Error{constructor(t,tr,rr){super(t),this.length=tr,this.name=rr}},z$2=class{constructor(t,tr){this.length=t,this.chunk=tr,this.name="copyData"}},H$4=class{constructor(t,tr,rr,ir){this.length=t,this.name=tr,this.binary=rr,this.columnTypes=new Array(ir)}},q$3=class{constructor(t,tr,rr,ir,lr,dr,fr){this.name=t,this.tableID=tr,this.columnID=rr,this.dataTypeID=ir,this.dataTypeSize=lr,this.dataTypeModifier=dr,this.format=fr}},Y$1=class{constructor(t,tr){this.length=t,this.fieldCount=tr,this.name="rowDescription",this.fields=new Array(this.fieldCount)}},$$3=class{constructor(t,tr){this.length=t,this.parameterCount=tr,this.name="parameterDescription",this.dataTypeIDs=new Array(this.parameterCount)}},K$2=class{constructor(t,tr,rr){this.length=t,this.parameterName=tr,this.parameterValue=rr,this.name="parameterStatus"}},J$2=class{constructor(t,tr,rr){this.length=t,this.processID=tr,this.secretKey=rr,this.name="backendKeyData"}},X=class{constructor(e,t,tr,rr){this.length=e,this.processId=t,this.channel=tr,this.payload=rr,this.name="notification"}},Z$1=class{constructor(t,tr){this.length=t,this.status=tr,this.name="readyForQuery"}},ee$1=class{constructor(t,tr){this.length=t,this.text=tr,this.name="commandComplete"}},te$1=class{constructor(t,tr){this.length=t,this.fields=tr,this.name="dataRow",this.fieldCount=tr.length}},ne=class{constructor(e,t){this.length=e,this.message=t,this.name="notice"}},zn={};F$3(zn,{Parser:()=>ye,messages:()=>Ue$1,serialize:()=>O$3});u$2();u$2();u$2();u$2();function C$3(e){let t=e.length;for(let tr=e.length-1;tr>=0;tr--){let rr=e.charCodeAt(tr);rr>127&&rr<=2047?t++:rr>2047&&rr<=65535&&(t+=2),rr>=56320&&rr<=57343&&tr--}return t}var b$3,g$4,U$2,ce$2,N$1,x$3,le,P$2,Xe,R$2=class{constructor(t=256){this.size=t,R$3(this,x$3),R$3(this,b$3),R$3(this,g$4,5),R$3(this,U$2,!1),R$3(this,ce$2,new TextEncoder),R$3(this,N$1,0),x$4(this,b$3,T$2(this,x$3,le).call(this,t))}addInt32(t){return T$2(this,x$3,P$2).call(this,4),h$2(this,b$3).setInt32(h$2(this,g$4),t,h$2(this,U$2)),x$4(this,g$4,h$2(this,g$4)+4),this}addInt16(t){return T$2(this,x$3,P$2).call(this,2),h$2(this,b$3).setInt16(h$2(this,g$4),t,h$2(this,U$2)),x$4(this,g$4,h$2(this,g$4)+2),this}addCString(t){return t&&this.addString(t),T$2(this,x$3,P$2).call(this,1),h$2(this,b$3).setUint8(h$2(this,g$4),0),U$3(this,g$4)._++,this}addString(t=""){let tr=C$3(t);return T$2(this,x$3,P$2).call(this,tr),h$2(this,ce$2).encodeInto(t,new Uint8Array(h$2(this,b$3).buffer,h$2(this,g$4))),x$4(this,g$4,h$2(this,g$4)+tr),this}add(t){return T$2(this,x$3,P$2).call(this,t.byteLength),new Uint8Array(h$2(this,b$3).buffer).set(new Uint8Array(t),h$2(this,g$4)),x$4(this,g$4,h$2(this,g$4)+t.byteLength),this}flush(t){let tr=T$2(this,x$3,Xe).call(this,t);return x$4(this,g$4,5),x$4(this,b$3,T$2(this,x$3,le).call(this,this.size)),new Uint8Array(tr)}};b$3=new WeakMap,g$4=new WeakMap,U$2=new WeakMap,ce$2=new WeakMap,N$1=new WeakMap,x$3=new WeakSet,le=function(e){return new DataView(new ArrayBuffer(e))},P$2=function(e){if(h$2(this,b$3).byteLength-h$2(this,g$4)<e){let t=h$2(this,b$3).buffer,tr=t.byteLength+(t.byteLength>>1)+e;x$4(this,b$3,T$2(this,x$3,le).call(this,tr)),new Uint8Array(h$2(this,b$3).buffer).set(new Uint8Array(t))}},Xe=function(e){if(e){h$2(this,b$3).setUint8(h$2(this,N$1),e);let t=h$2(this,g$4)-(h$2(this,N$1)+1);h$2(this,b$3).setInt32(h$2(this,N$1)+1,t,h$2(this,U$2))}return h$2(this,b$3).buffer.slice(e?0:5,h$2(this,g$4))};var m$2=new R$2,An=e=>{m$2.addInt16(3).addInt16(0);for(let rr of Object.keys(e))m$2.addCString(rr).addCString(e[rr]);m$2.addCString("client_encoding").addCString("UTF8");let t=m$2.addCString("").flush(),tr=t.byteLength+4;return new R$2().addInt32(tr).add(t).flush()},xn=()=>{let e=new DataView(new ArrayBuffer(8));return e.setInt32(0,8,!1),e.setInt32(4,80877103,!1),new Uint8Array(e.buffer)},Sn=e=>m$2.addCString(e).flush(112),Dn=(e,t)=>(m$2.addCString(e).addInt32(C$3(t)).addString(t),m$2.flush(112)),Bn=e=>m$2.addString(e).flush(112),In=e=>m$2.addCString(e).flush(81),Mn=[],Rn=e=>{var rr,ir;let t=e.name??"";t.length>63&&(console.error("Warning! Postgres only supports 63 characters for query names."),console.error("You supplied %s (%s)",t,t.length),console.error("This can cause conflicts and silent errors executing queries"));let tr=m$2.addCString(t).addCString(e.text).addInt16(((rr=e.types)==null?void 0:rr.length)??0);return(ir=e.types)==null||ir.forEach(lr=>tr.addInt32(lr)),m$2.flush(80)},L$3=new R$2,Tn=(e,t)=>{for(let tr=0;tr<e.length;tr++){let rr=t?t(e[tr],tr):e[tr];if(rr===null)m$2.addInt16(0),L$3.addInt32(-1);else if(rr instanceof ArrayBuffer||ArrayBuffer.isView(rr)){let ir=ArrayBuffer.isView(rr)?rr.buffer.slice(rr.byteOffset,rr.byteOffset+rr.byteLength):rr;m$2.addInt16(1),L$3.addInt32(ir.byteLength),L$3.add(ir)}else m$2.addInt16(0),L$3.addInt32(C$3(rr)),L$3.addString(rr)}},En=(e={})=>{let t=e.portal??"",tr=e.statement??"",rr=e.binary??!1,ir=e.values??Mn,lr=ir.length;return m$2.addCString(t).addCString(tr),m$2.addInt16(lr),Tn(ir,e.valueMapper),m$2.addInt16(lr),m$2.add(L$3.flush()),m$2.addInt16(rr?1:0),m$2.flush(66)},Cn=new Uint8Array([69,0,0,0,9,0,0,0,0,0]),Pn=e=>{if(!e||!e.portal&&!e.rows)return Cn;let t=e.portal??"",tr=e.rows??0,rr=C$3(t),ir=4+rr+1+4,lr=new DataView(new ArrayBuffer(1+ir));return lr.setUint8(0,69),lr.setInt32(1,ir,!1),new TextEncoder().encodeInto(t,new Uint8Array(lr.buffer,5)),lr.setUint8(rr+5,0),lr.setUint32(lr.byteLength-4,tr,!1),new Uint8Array(lr.buffer)},Un=(e,t)=>{let tr=new DataView(new ArrayBuffer(16));return tr.setInt32(0,16,!1),tr.setInt16(4,1234,!1),tr.setInt16(6,5678,!1),tr.setInt32(8,e,!1),tr.setInt32(12,t,!1),new Uint8Array(tr.buffer)},Ne=(e,t)=>{let tr=new R$2;return tr.addCString(t),tr.flush(e)},Nn=m$2.addCString("P").flush(68),Ln=m$2.addCString("S").flush(68),On=e=>e.name?Ne(68,`${e.type}${e.name??""}`):e.type==="P"?Nn:Ln,kn=e=>{let t=`${e.type}${e.name??""}`;return Ne(67,t)},Vn=e=>m$2.add(e).flush(100),Fn=e=>Ne(102,e),pe$1=e=>new Uint8Array([e,0,0,0,4]),vn=pe$1(72),Gn=pe$1(83),Wn=pe$1(88),jn=pe$1(99),O$3={startup:An,password:Sn,requestSsl:xn,sendSASLInitialResponseMessage:Dn,sendSCRAMClientFinalMessage:Bn,query:In,parse:Rn,bind:En,execute:Pn,describe:On,close:kn,flush:()=>vn,sync:()=>Gn,end:()=>Wn,copyData:Vn,copyDone:()=>jn,copyFail:Fn,cancel:Un};u$2();u$2();var Le={text:0,binary:1};u$2();var Qn=new ArrayBuffer(0),M$3,w$3,fe,me$1,re$1,de=class{constructor(e=0){R$3(this,M$3,new DataView(Qn)),R$3(this,w$3),R$3(this,fe,"utf-8"),R$3(this,me$1,new TextDecoder(h$2(this,fe))),R$3(this,re$1,!1),x$4(this,w$3,e)}setBuffer(e,t){x$4(this,w$3,e),x$4(this,M$3,new DataView(t))}int16(){let e=h$2(this,M$3).getInt16(h$2(this,w$3),h$2(this,re$1));return x$4(this,w$3,h$2(this,w$3)+2),e}byte(){let e=h$2(this,M$3).getUint8(h$2(this,w$3));return U$3(this,w$3)._++,e}int32(){let e=h$2(this,M$3).getInt32(h$2(this,w$3),h$2(this,re$1));return x$4(this,w$3,h$2(this,w$3)+4),e}string(e){return h$2(this,me$1).decode(this.bytes(e))}cstring(){let e=h$2(this,w$3),t=e;for(;h$2(this,M$3).getUint8(t++)!==0;);let tr=this.string(t-e-1);return x$4(this,w$3,t),tr}bytes(e){let t=h$2(this,M$3).buffer.slice(h$2(this,w$3),h$2(this,w$3)+e);return x$4(this,w$3,h$2(this,w$3)+e),new Uint8Array(t)}};M$3=new WeakMap,w$3=new WeakMap,fe=new WeakMap,me$1=new WeakMap,re$1=new WeakMap;var Oe=1,_n=4,Ze=Oe+_n,et=new ArrayBuffer(0),A$2,S$2,D$3,o$1,l$1,tt,nt,rt,st,it,at,ot,ke$1,ut,lt,ct,pt,dt,ft,mt,yt,Ve$1,ye=class{constructor(){R$3(this,l$1),R$3(this,A$2,new DataView(et)),R$3(this,S$2,0),R$3(this,D$3,0),R$3(this,o$1,new de)}parse(e,t){T$2(this,l$1,tt).call(this,ArrayBuffer.isView(e)?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):e);let tr=h$2(this,D$3)+h$2(this,S$2),rr=h$2(this,D$3);for(;rr+Ze<=tr;){let ir=h$2(this,A$2).getUint8(rr),lr=h$2(this,A$2).getUint32(rr+Oe,!1),dr=Oe+lr;if(dr+rr<=tr){let fr=T$2(this,l$1,nt).call(this,rr+Ze,ir,lr,h$2(this,A$2).buffer);t(fr),rr+=dr}else break}rr===tr?(x$4(this,A$2,new DataView(et)),x$4(this,S$2,0),x$4(this,D$3,0)):(x$4(this,S$2,tr-rr),x$4(this,D$3,rr))}};A$2=new WeakMap,S$2=new WeakMap,D$3=new WeakMap,o$1=new WeakMap,l$1=new WeakSet,tt=function(e){if(h$2(this,S$2)>0){let t=h$2(this,S$2)+e.byteLength;if(t+h$2(this,D$3)>h$2(this,A$2).byteLength){let tr;if(t<=h$2(this,A$2).byteLength&&h$2(this,D$3)>=h$2(this,S$2))tr=h$2(this,A$2).buffer;else{let rr=h$2(this,A$2).byteLength*2;for(;t>=rr;)rr*=2;tr=new ArrayBuffer(rr)}new Uint8Array(tr).set(new Uint8Array(h$2(this,A$2).buffer,h$2(this,D$3),h$2(this,S$2))),x$4(this,A$2,new DataView(tr)),x$4(this,D$3,0)}new Uint8Array(h$2(this,A$2).buffer).set(new Uint8Array(e),h$2(this,D$3)+h$2(this,S$2)),x$4(this,S$2,t)}else x$4(this,A$2,new DataView(e)),x$4(this,D$3,0),x$4(this,S$2,e.byteLength)},nt=function(e,t,tr,rr){switch(t){case 50:return Ie$1;case 49:return Be;case 51:return Me;case 110:return Re;case 115:return Te$1;case 99:return Pe$1;case 87:return Ee;case 73:return Ce;case 68:return T$2(this,l$1,dt).call(this,e,tr,rr);case 67:return T$2(this,l$1,st).call(this,e,tr,rr);case 90:return T$2(this,l$1,rt).call(this,e,tr,rr);case 65:return T$2(this,l$1,ut).call(this,e,tr,rr);case 82:return T$2(this,l$1,yt).call(this,e,tr,rr);case 83:return T$2(this,l$1,ft).call(this,e,tr,rr);case 75:return T$2(this,l$1,mt).call(this,e,tr,rr);case 69:return T$2(this,l$1,Ve$1).call(this,e,tr,rr,"error");case 78:return T$2(this,l$1,Ve$1).call(this,e,tr,rr,"notice");case 84:return T$2(this,l$1,lt).call(this,e,tr,rr);case 116:return T$2(this,l$1,pt).call(this,e,tr,rr);case 71:return T$2(this,l$1,at).call(this,e,tr,rr);case 72:return T$2(this,l$1,ot).call(this,e,tr,rr);case 100:return T$2(this,l$1,it).call(this,e,tr,rr);default:return new E$2("received invalid response: "+t.toString(16),tr,"error")}},rt=function(e,t,tr){h$2(this,o$1).setBuffer(e,tr);let rr=h$2(this,o$1).string(1);return new Z$1(t,rr)},st=function(e,t,tr){h$2(this,o$1).setBuffer(e,tr);let rr=h$2(this,o$1).cstring();return new ee$1(t,rr)},it=function(e,t,tr){let rr=tr.slice(e,e+(t-4));return new z$2(t,new Uint8Array(rr))},at=function(e,t,tr){return T$2(this,l$1,ke$1).call(this,e,t,tr,"copyInResponse")},ot=function(e,t,tr){return T$2(this,l$1,ke$1).call(this,e,t,tr,"copyOutResponse")},ke$1=function(e,t,tr,rr){h$2(this,o$1).setBuffer(e,tr);let ir=h$2(this,o$1).byte()!==0,lr=h$2(this,o$1).int16(),dr=new H$4(t,rr,ir,lr);for(let fr=0;fr<lr;fr++)dr.columnTypes[fr]=h$2(this,o$1).int16();return dr},ut=function(e,t,tr){h$2(this,o$1).setBuffer(e,tr);let rr=h$2(this,o$1).int32(),ir=h$2(this,o$1).cstring(),lr=h$2(this,o$1).cstring();return new X(t,rr,ir,lr)},lt=function(e,t,tr){h$2(this,o$1).setBuffer(e,tr);let rr=h$2(this,o$1).int16(),ir=new Y$1(t,rr);for(let lr=0;lr<rr;lr++)ir.fields[lr]=T$2(this,l$1,ct).call(this);return ir},ct=function(){let e=h$2(this,o$1).cstring(),t=h$2(this,o$1).int32(),tr=h$2(this,o$1).int16(),rr=h$2(this,o$1).int32(),ir=h$2(this,o$1).int16(),lr=h$2(this,o$1).int32(),dr=h$2(this,o$1).int16()===0?Le.text:Le.binary;return new q$3(e,t,tr,rr,ir,lr,dr)},pt=function(e,t,tr){h$2(this,o$1).setBuffer(e,tr);let rr=h$2(this,o$1).int16(),ir=new $$3(t,rr);for(let lr=0;lr<rr;lr++)ir.dataTypeIDs[lr]=h$2(this,o$1).int32();return ir},dt=function(e,t,tr){h$2(this,o$1).setBuffer(e,tr);let rr=h$2(this,o$1).int16(),ir=new Array(rr);for(let lr=0;lr<rr;lr++){let dr=h$2(this,o$1).int32();ir[lr]=dr===-1?null:h$2(this,o$1).string(dr)}return new te$1(t,ir)},ft=function(e,t,tr){h$2(this,o$1).setBuffer(e,tr);let rr=h$2(this,o$1).cstring(),ir=h$2(this,o$1).cstring();return new K$2(t,rr,ir)},mt=function(e,t,tr){h$2(this,o$1).setBuffer(e,tr);let rr=h$2(this,o$1).int32(),ir=h$2(this,o$1).int32();return new J$2(t,rr,ir)},yt=function(e,t,tr){h$2(this,o$1).setBuffer(e,tr);let rr=h$2(this,o$1).int32();switch(rr){case 0:return new v$2(t);case 3:return new G$2(t);case 5:return new W$2(t,h$2(this,o$1).bytes(4));case 10:{let ir=[];for(;;){let lr=h$2(this,o$1).cstring();if(lr.length===0)return new j$2(t,ir);ir.push(lr)}}case 11:return new Q$1(t,h$2(this,o$1).string(t-8));case 12:return new _$2(t,h$2(this,o$1).string(t-8));default:throw new Error("Unknown authenticationOk message type "+rr)}},Ve$1=function(e,t,tr,rr){h$2(this,o$1).setBuffer(e,tr);let ir={},lr=h$2(this,o$1).string(1);for(;lr!=="\0";)ir[lr]=h$2(this,o$1).cstring(),lr=h$2(this,o$1).string(1);let dr=ir.M,fr=rr==="notice"?new ne(t,dr):new E$2(dr,t,rr);return fr.severity=ir.S,fr.code=ir.C,fr.detail=ir.D,fr.hint=ir.H,fr.position=ir.P,fr.internalPosition=ir.p,fr.internalQuery=ir.q,fr.where=ir.W,fr.schema=ir.s,fr.table=ir.t,fr.column=ir.c,fr.dataType=ir.d,fr.constraint=ir.n,fr.file=ir.F,fr.line=ir.L,fr.routine=ir.R,fr};u$2();var Fe$1=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",se$1;async function Rr(){if(Fe$1||se$1)return;let e=new URL(""+new URL("postgres-CyuUVpXN.wasm",import.meta.url).href,import.meta.url);se$1=fetch(e)}var k$3;async function Tr(e,t){if(t||k$3)return WebAssembly.instantiate(t||k$3,e),{instance:await WebAssembly.instantiate(t||k$3,e),module:t||k$3};let tr=new URL(""+new URL("postgres-CyuUVpXN.wasm",import.meta.url).href,import.meta.url);if(Fe$1){let rr=await(await __vitePreload(async()=>{const{readFile:dr}=await Promise.resolve().then(()=>__viteBrowserExternal$1);return{readFile:dr}},void 0,import.meta.url)).readFile(tr),{module:ir,instance:lr}=await WebAssembly.instantiate(rr,e);return k$3=ir,{instance:lr,module:ir}}else{se$1||(se$1=fetch(tr));let rr=await se$1,{module:ir,instance:lr}=await WebAssembly.instantiateStreaming(rr,e);return k$3=ir,{instance:lr,module:ir}}}async function Er(){let e=new URL(""+new URL("postgres-CkP7QCDB.data",import.meta.url).href,import.meta.url);return Fe$1?(await(await __vitePreload(async()=>{const{readFile:t}=await Promise.resolve().then(()=>__viteBrowserExternal$1);return{readFile:t}},void 0,import.meta.url)).readFile(e)).buffer:(await fetch(e)).arrayBuffer()}var Cr=()=>{var tr,rr;if((tr=globalThis.crypto)!=null&&tr.randomUUID)return globalThis.crypto.randomUUID();let e=new Uint8Array(16);if((rr=globalThis.crypto)!=null&&rr.getRandomValues)globalThis.crypto.getRandomValues(e);else for(let ir=0;ir<e.length;ir++)e[ir]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=[];return e.forEach(ir=>{t.push(ir.toString(16).padStart(2,"0"))}),t.slice(0,4).join("")+"-"+t.slice(4,6).join("")+"-"+t.slice(6,8).join("")+"-"+t.slice(8,10).join("")+"-"+t.slice(10).join("")};async function Pr(e,t,tr,rr){if(!tr||tr.length===0)return t;rr=rr??e;let ir;try{await e.execProtocol(O$3.parse({text:t}),{syncToFs:!1}),ir=De((await e.execProtocol(O$3.describe({type:"S"}),{syncToFs:!1})).messages)}finally{await e.execProtocol(O$3.sync(),{syncToFs:!1})}let lr=t.replace(/\$([0-9]+)/g,(dr,fr)=>"%"+fr+"L");return(await rr.query(`SELECT format($1, ${tr.map((dr,fr)=>`$${fr+2}`).join(", ")}) as query`,[lr,...tr],{paramTypes:[F$2,...ir]})).rows[0].query}function Ur(e){let t,tr=!1,rr=async()=>{if(!t){tr=!1;return}tr=!0;let{args:ir,resolve:lr,reject:dr}=t;t=void 0;try{let fr=await e(...ir);lr(fr)}catch(fr){dr(fr)}finally{rr()}};return async(...ir)=>{t&&t.resolve(void 0);let lr=new Promise((dr,fr)=>{t={args:ir,resolve:dr,reject:fr}});return tr||rr(),lr}}function Nr(e){let t;return e.startsWith('"')&&e.endsWith('"')?t=e.substring(1,e.length-1):t=e.toLowerCase(),t}u$2();var o={part:"part",container:"container"};function s(e,t,...tr){let rr=e.length-1,ir=tr.length-1;if(ir!==-1){if(ir===0){e[rr]=e[rr]+tr[0]+t;return}e[rr]=e[rr]+tr[0],e.push(...tr.slice(1,ir)),e.push(tr[ir]+t)}}function y$1(e,...t){let tr=[e[0]];tr.raw=[e.raw[0]];let rr=[];for(let ir=0;ir<t.length;ir++){let lr=t[ir],dr=ir+1;if((lr==null?void 0:lr._templateType)===o.part){s(tr,e[dr],lr.str),s(tr.raw,e.raw[dr],lr.str);continue}if((lr==null?void 0:lr._templateType)===o.container){s(tr,e[dr],...lr.strings),s(tr.raw,e.raw[dr],...lr.strings.raw),rr.push(...lr.values);continue}tr.push(e[dr]),tr.raw.push(e.raw[dr]),rr.push(lr)}return{_templateType:"container",strings:tr,values:rr}}function g$3(e,...t){let{strings:tr,values:rr}=y$1(e,...t);return{query:[tr[0],...rr.flatMap((ir,lr)=>[`$${lr+1}`,tr[lr+1]])].join(""),params:rr}}u$2();var b$2,u$1,r,l,g$2,h$1,R$1,z$1=class{constructor(){R$3(this,r),this.serializers={...cn},this.parsers={...ln},R$3(this,b$2,!1),R$3(this,u$1,!1)}async _initArrayTypes({force:t=!1}={}){if(h$2(this,b$2)&&!t)return;x$4(this,b$2,!0);let tr=await this.query(`
|
|
479
479
|
SELECT b.oid, b.typarray
|
|
480
480
|
FROM pg_catalog.pg_type a
|
|
481
481
|
LEFT JOIN pg_catalog.pg_type b ON b.oid = a.typelem
|
|
482
482
|
WHERE a.typcategory = 'A'
|
|
483
483
|
GROUP BY b.oid, b.typarray
|
|
484
484
|
ORDER BY b.oid
|
|
485
|
-
`);for(let rr of tr.rows)this.serializers[rr.typarray]=ir=>Ke$1(ir,this.serializers[rr.oid],rr.typarray),this.parsers[rr.typarray]=ir=>yn(ir,this.parsers[rr.oid],rr.typarray)}async refreshArrayTypes(){await this._initArrayTypes({force:!0})}async query(t,tr,rr){return await this._checkReady(),await this._runExclusiveTransaction(async()=>await T$2(this,r,g$2).call(this,t,tr,rr))}async sql(t,...tr){let{query:rr,params:ir}=g$3(t,...tr);return await this.query(rr,ir)}async exec(t,tr){return await this._checkReady(),await this._runExclusiveTransaction(async()=>await T$2(this,r,h$1).call(this,t,tr))}async describeQuery(t,tr){try{await T$2(this,r,l).call(this,O$3.parse({text:t,types:tr==null?void 0:tr.paramTypes}),tr);let rr=await T$2(this,r,l).call(this,O$3.describe({type:"S"}),tr),ir=rr.messages.find(hr=>hr.name==="parameterDescription"),lr=rr.messages.find(hr=>hr.name==="rowDescription"),dr=(ir==null?void 0:ir.dataTypeIDs.map(hr=>({dataTypeID:hr,serializer:this.serializers[hr]})))??[],fr=(lr==null?void 0:lr.fields.map(hr=>({name:hr.name,dataTypeID:hr.dataTypeID,parser:this.parsers[hr.dataTypeID]})))??[];return{queryParams:dr,resultFields:fr}}finally{await T$2(this,r,l).call(this,O$3.sync(),tr)}}async transaction(t){return await this._checkReady(),await this._runExclusiveTransaction(async()=>{await T$2(this,r,h$1).call(this,"BEGIN"),x$4(this,u$1,!0);let tr=!1,rr=()=>{if(tr)throw new Error("Transaction is closed")},ir={query:async(lr,dr,fr)=>(rr(),await T$2(this,r,g$2).call(this,lr,dr,fr)),sql:async(lr,...dr)=>{let{query:fr,params:hr}=g$3(lr,...dr);return await T$2(this,r,g$2).call(this,fr,hr)},exec:async(lr,dr)=>(rr(),await T$2(this,r,h$1).call(this,lr,dr)),rollback:async()=>{rr(),await T$2(this,r,h$1).call(this,"ROLLBACK"),tr=!0},get closed(){return tr}};try{let lr=await t(ir);return tr||(tr=!0,await T$2(this,r,h$1).call(this,"COMMIT")),x$4(this,u$1,!1),lr}catch(lr){throw tr||await T$2(this,r,h$1).call(this,"ROLLBACK"),x$4(this,u$1,!1),lr}})}async runExclusive(t){return await this._runExclusiveQuery(t)}};b$2=new WeakMap,u$1=new WeakMap,r=new WeakSet,l=async function(e,t={}){return await this.execProtocol(e,{...t,syncToFs:!1})},g$2=async function(e,t=[],tr){return await this._runExclusiveQuery(async()=>{T$2(this,r,R$1).call(this,"runQuery",e,t,tr),await this._handleBlob(tr==null?void 0:tr.blob);let rr;try{let{messages:lr}=await T$2(this,r,l).call(this,O$3.parse({text:e,types:tr==null?void 0:tr.paramTypes}),tr),dr=De((await T$2(this,r,l).call(this,O$3.describe({type:"S"}),tr)).messages),fr=t.map((hr,mr)=>{var _r;let gr=dr[mr];if(hr==null)return null;let yr=((_r=tr==null?void 0:tr.serializers)==null?void 0:_r[gr])??this.serializers[gr];return yr?yr(hr):hr.toString()});rr=[...lr,...(await T$2(this,r,l).call(this,O$3.bind({values:fr}),tr)).messages,...(await T$2(this,r,l).call(this,O$3.describe({type:"P"}),tr)).messages,...(await T$2(this,r,l).call(this,O$3.execute({}),tr)).messages]}finally{await T$2(this,r,l).call(this,O$3.sync(),tr)}await this._cleanupBlob(),h$2(this,u$1)||await this.syncToFs();let ir=await this._getWrittenBlob();return bn(rr,this.parsers,tr,ir)[0]})},h$1=async function(e,t){return await this._runExclusiveQuery(async()=>{T$2(this,r,R$1).call(this,"runExec",e,t),await this._handleBlob(t==null?void 0:t.blob);let tr;try{tr=(await T$2(this,r,l).call(this,O$3.query(e),t)).messages}finally{await T$2(this,r,l).call(this,O$3.sync(),t)}this._cleanupBlob(),h$2(this,u$1)||await this.syncToFs();let rr=await this._getWrittenBlob();return bn(tr,this.parsers,t,rr)})},R$1=function(...e){this.debug>0&&console.log(...e)};u$2();var W$1,C$2,_$1,M$2,B$1,m$1,L$2,x$2,k$2,T$1,A$1,O$2,E$1,v$1,G$1,P$1,b$1,I$1,$$2,c$1,K$1,D$2,w$2,J$1,F$1=class ku extends z$1{constructor(t,tr){super(),R$3(this,c$1),R$3(this,W$1),R$3(this,C$2,0),R$3(this,_$1,!1),R$3(this,M$2,!1),R$3(this,B$1,!1),R$3(this,m$1,new EventTarget),R$3(this,L$2),R$3(this,x$2,!1),R$3(this,k$2),R$3(this,T$1),R$3(this,A$1),R$3(this,O$2),R$3(this,E$1),R$3(this,v$1),R$3(this,G$1),R$3(this,P$1,new Map),R$3(this,b$1,new Set),R$3(this,I$1),R$3(this,$$2,[]),x$4(this,k$2,t),x$4(this,L$2,Cr()),x$4(this,I$1,(tr==null?void 0:tr.extensions)??{}),x$4(this,A$1,new Promise(rr=>{h$2(this,k$2).addEventListener("message",ir=>{if(ir.data.type==="here")rr();else throw new Error("Invalid message")},{once:!0})})),x$4(this,O$2,new Promise(rr=>{let ir=lr=>{lr.data.type==="ready"&&(x$4(this,T$1,lr.data.id),h$2(this,k$2).removeEventListener("message",ir),rr())};h$2(this,k$2).addEventListener("message",ir)})),x$4(this,W$1,T$2(this,c$1,K$1).call(this,tr))}static async create(t,tr){let rr=new ku(t,tr);return await h$2(rr,W$1),rr}get waitReady(){return new Promise(t=>{h$2(this,W$1).then(()=>{h$2(this,x$2)?t():t(new Promise(tr=>{h$2(this,m$1).addEventListener("connected",()=>{tr()})}))})})}get debug(){return h$2(this,C$2)}get ready(){return h$2(this,_$1)}get closed(){return h$2(this,M$2)}get isLeader(){return h$2(this,B$1)}async close(){var tr,rr;var t;h$2(this,M$2)||(x$4(this,M$2,!0),(tr=h$2(this,E$1))==null||tr.close(),(rr=h$2(this,v$1))==null||rr.close(),(t=h$2(this,G$1))==null||t.call(this),h$2(this,k$2).terminate())}async[Symbol.asyncDispose](){await this.close()}async execProtocolRaw(t){return await T$2(this,c$1,w$2).call(this,"execProtocolRaw",t)}async execProtocol(t){return await T$2(this,c$1,w$2).call(this,"execProtocol",t)}async syncToFs(){await T$2(this,c$1,w$2).call(this,"syncToFs")}async listen(t,tr){let rr=Nr(t);return h$2(this,P$1).has(rr)||h$2(this,P$1).set(rr,new Set),h$2(this,P$1).get(rr).add(tr),await this.exec(`LISTEN ${t}`),async()=>{await this.unlisten(rr,tr)}}async unlisten(t,tr){var rr,ir;await this.waitReady,tr?(rr=h$2(this,P$1).get(t))==null||rr.delete(tr):h$2(this,P$1).delete(t),((ir=h$2(this,P$1).get(t))==null?void 0:ir.size)===0&&await this.exec(`UNLISTEN ${t}`)}onNotification(t){return h$2(this,b$1).add(t),()=>{h$2(this,b$1).delete(t)}}offNotification(t){h$2(this,b$1).delete(t)}async dumpDataDir(){return await T$2(this,c$1,w$2).call(this,"dumpDataDir")}onLeaderChange(t){return h$2(this,m$1).addEventListener("leader-change",t),()=>{h$2(this,m$1).removeEventListener("leader-change",t)}}offLeaderChange(t){h$2(this,m$1).removeEventListener("leader-change",t)}async _handleBlob(t){await T$2(this,c$1,w$2).call(this,"_handleBlob",t)}async _getWrittenBlob(){return await T$2(this,c$1,w$2).call(this,"_getWrittenBlob")}async _cleanupBlob(){await T$2(this,c$1,w$2).call(this,"_cleanupBlob")}async _checkReady(){await this.waitReady}async _runExclusiveQuery(t){await T$2(this,c$1,w$2).call(this,"_acquireQueryLock");try{return await t()}finally{await T$2(this,c$1,w$2).call(this,"_releaseQueryLock")}}async _runExclusiveTransaction(t){await T$2(this,c$1,w$2).call(this,"_acquireTransactionLock");try{return await t()}finally{await T$2(this,c$1,w$2).call(this,"_releaseTransactionLock")}}};W$1=new WeakMap,C$2=new WeakMap,_$1=new WeakMap,M$2=new WeakMap,B$1=new WeakMap,m$1=new WeakMap,L$2=new WeakMap,x$2=new WeakMap,k$2=new WeakMap,T$1=new WeakMap,A$1=new WeakMap,O$2=new WeakMap,E$1=new WeakMap,v$1=new WeakMap,G$1=new WeakMap,P$1=new WeakMap,b$1=new WeakMap,I$1=new WeakMap,$$2=new WeakMap,c$1=new WeakSet,K$1=async function(e={}){for(let[dr,fr]of Object.entries(h$2(this,I$1))){if(fr instanceof URL)throw new Error("URL extensions are not supported on the client side of a worker");{let hr=await fr.setup(this,{},!0);if(hr.emscriptenOpts&&console.warn(`PGlite extension ${dr} returned emscriptenOpts, these are not supported on the client side of a worker`),hr.namespaceObj){let mr=this;mr[dr]=hr.namespaceObj}hr.bundlePath&&console.warn(`PGlite extension ${dr} returned bundlePath, this is not supported on the client side of a worker`),hr.init&&await hr.init(),hr.close&&h$2(this,$$2).push(hr.close)}}await h$2(this,A$1);let{extensions:t,...tr}=e;h$2(this,k$2).postMessage({type:"init",options:tr}),await h$2(this,O$2);let rr=`pglite-tab-close:${h$2(this,L$2)}`;x$4(this,G$1,await q$2(rr));let ir=`pglite-broadcast:${h$2(this,T$1)}`;x$4(this,E$1,new BroadcastChannel(ir));let lr=`pglite-tab:${h$2(this,L$2)}`;x$4(this,v$1,new BroadcastChannel(lr)),h$2(this,E$1).addEventListener("message",async dr=>{dr.data.type==="leader-here"?(x$4(this,x$2,!1),h$2(this,m$1).dispatchEvent(new Event("leader-change")),T$2(this,c$1,D$2).call(this)):dr.data.type==="notify"&&T$2(this,c$1,J$1).call(this,dr.data.channel,dr.data.payload)}),h$2(this,v$1).addEventListener("message",async dr=>{dr.data.type==="connected"&&(x$4(this,x$2,!0),h$2(this,m$1).dispatchEvent(new Event("connected")),x$4(this,C$2,await T$2(this,c$1,w$2).call(this,"getDebugLevel")),x$4(this,_$1,!0))}),h$2(this,k$2).addEventListener("message",async dr=>{dr.data.type==="leader-now"&&(x$4(this,B$1,!0),h$2(this,m$1).dispatchEvent(new Event("leader-change")))}),T$2(this,c$1,D$2).call(this),this._initArrayTypes()},D$2=async function(){h$2(this,x$2)||(h$2(this,E$1).postMessage({type:"tab-here",id:h$2(this,L$2)}),setTimeout(()=>T$2(this,c$1,D$2).call(this),16))},w$2=async function(e,...t){let tr=Cr(),rr={type:"rpc-call",callId:tr,method:e,args:t};return h$2(this,v$1).postMessage(rr),await new Promise((ir,lr)=>{let dr=mr=>{if(mr.data.callId!==tr)return;hr();let gr=mr.data;if(gr.type==="rpc-return")ir(gr.result);else if(gr.type==="rpc-error"){let yr=new Error(gr.error.message);Object.assign(yr,gr.error),lr(yr)}else lr(new Error("Invalid message"))},fr=()=>{hr(),lr(new U$1)},hr=()=>{h$2(this,v$1).removeEventListener("message",dr),h$2(this,m$1).removeEventListener("leader-change",fr)};h$2(this,m$1).addEventListener("leader-change",fr),h$2(this,v$1).addEventListener("message",dr)})},J$1=function(e,t){let tr=h$2(this,P$1).get(e);if(tr)for(let rr of tr)queueMicrotask(()=>rr(t));for(let rr of h$2(this,b$1))queueMicrotask(()=>rr(e,t))};var H$3=F$1,U$1=class extends Error{constructor(){super("Leader changed, pending operation in indeterminate state")}};async function q$2(e){let t;return await new Promise(tr=>{navigator.locks.request(e,()=>new Promise(rr=>{t=rr,tr()}))}),t}var w$1=D$4((e,t)=>{u$2();var tr=9007199254740991,rr=function(Ir){return Ir}();function ir(Ir){return Ir===rr}function lr(Ir){return typeof Ir=="string"||Object.prototype.toString.call(Ir)=="[object String]"}function dr(Ir){return Object.prototype.toString.call(Ir)=="[object Date]"}function fr(Ir){return Ir!==null&&typeof Ir=="object"}function hr(Ir){return typeof Ir=="function"}function mr(Ir){return typeof Ir=="number"&&Ir>-1&&Ir%1==0&&Ir<=tr}function gr(Ir){return Object.prototype.toString.call(Ir)=="[object Array]"}function yr(Ir){return fr(Ir)&&!hr(Ir)&&mr(Ir.length)}function _r(Ir){return Object.prototype.toString.call(Ir)=="[object ArrayBuffer]"}function br(Ir,Mr){return Array.prototype.map.call(Ir,Mr)}function wr(Ir,Mr){var Ar=rr;return hr(Mr)&&Array.prototype.every.call(Ir,function(kr,Or,Dr){var $r=Mr(kr,Or,Dr);return $r&&(Ar=kr),!$r}),Ar}function vr(Ir){return Object.assign.apply(null,arguments)}function Sr(Ir){var Mr,Ar,kr;if(lr(Ir)){for(Ar=Ir.length,kr=new Uint8Array(Ar),Mr=0;Mr<Ar;Mr++)kr[Mr]=Ir.charCodeAt(Mr)&255;return kr}return _r(Ir)?new Uint8Array(Ir):fr(Ir)&&_r(Ir.buffer)?new Uint8Array(Ir.buffer):yr(Ir)?new Uint8Array(Ir):fr(Ir)&&hr(Ir.toString)?Sr(Ir.toString()):new Uint8Array}t.exports.MAX_SAFE_INTEGER=tr,t.exports.isUndefined=ir,t.exports.isString=lr,t.exports.isObject=fr,t.exports.isDateTime=dr,t.exports.isFunction=hr,t.exports.isArray=gr,t.exports.isArrayLike=yr,t.exports.isArrayBuffer=_r,t.exports.map=br,t.exports.find=wr,t.exports.extend=vr,t.exports.toUint8Array=Sr}),x$1=D$4((e,t)=>{u$2();var tr="\0";t.exports={NULL_CHAR:tr,TMAGIC:"ustar"+tr+"00",OLDGNU_MAGIC:"ustar "+tr,REGTYPE:0,LNKTYPE:1,SYMTYPE:2,CHRTYPE:3,BLKTYPE:4,DIRTYPE:5,FIFOTYPE:6,CONTTYPE:7,TSUID:parseInt("4000",8),TSGID:parseInt("2000",8),TSVTX:parseInt("1000",8),TUREAD:parseInt("0400",8),TUWRITE:parseInt("0200",8),TUEXEC:parseInt("0100",8),TGREAD:parseInt("0040",8),TGWRITE:parseInt("0020",8),TGEXEC:parseInt("0010",8),TOREAD:parseInt("0004",8),TOWRITE:parseInt("0002",8),TOEXEC:parseInt("0001",8),TPERMALL:parseInt("0777",8),TPERMMASK:parseInt("0777",8)}}),L$1=D$4((e,t)=>{u$2();var tr=w$1(),rr=x$1(),ir=512,lr=rr.TPERMALL,dr=0,fr=0,hr=[["name",100,0,function(Mr,Ar){return yr(Mr[Ar[0]],Ar[1])},function(Mr,Ar,kr){return wr(Mr.slice(Ar,Ar+kr[1]))}],["mode",8,100,function(Mr,Ar){var kr=Mr[Ar[0]]||lr;return kr=kr&rr.TPERMMASK,_r(kr,Ar[1],lr)},function(Mr,Ar,kr){var Or=vr(Mr.slice(Ar,Ar+kr[1]));return Or&=rr.TPERMMASK,Or}],["uid",8,108,function(Mr,Ar){return _r(Mr[Ar[0]],Ar[1],dr)},function(Mr,Ar,kr){return vr(Mr.slice(Ar,Ar+kr[1]))}],["gid",8,116,function(Mr,Ar){return _r(Mr[Ar[0]],Ar[1],fr)},function(Mr,Ar,kr){return vr(Mr.slice(Ar,Ar+kr[1]))}],["size",12,124,function(Mr,Ar){return _r(Mr.data.length,Ar[1])},function(Mr,Ar,kr){return vr(Mr.slice(Ar,Ar+kr[1]))}],["modifyTime",12,136,function(Mr,Ar){return br(Mr[Ar[0]],Ar[1])},function(Mr,Ar,kr){return Sr(Mr.slice(Ar,Ar+kr[1]))}],["checksum",8,148,function(Mr,Ar){return" "},function(Mr,Ar,kr){return vr(Mr.slice(Ar,Ar+kr[1]))}],["type",1,156,function(Mr,Ar){return""+(parseInt(Mr[Ar[0]],10)||0)%8},function(Mr,Ar,kr){return(parseInt(String.fromCharCode(Mr[Ar]),10)||0)%8}],["linkName",100,157,function(Mr,Ar){return""},function(Mr,Ar,kr){return wr(Mr.slice(Ar,Ar+kr[1]))}],["ustar",8,257,function(Mr,Ar){return rr.TMAGIC},function(Mr,Ar,kr){return gr(wr(Mr.slice(Ar,Ar+kr[1]),!0))},function(Mr,Ar){return Mr[Ar[0]]==rr.TMAGIC||Mr[Ar[0]]==rr.OLDGNU_MAGIC}],["owner",32,265,function(Mr,Ar){return yr(Mr[Ar[0]],Ar[1])},function(Mr,Ar,kr){return wr(Mr.slice(Ar,Ar+kr[1]))}],["group",32,297,function(Mr,Ar){return yr(Mr[Ar[0]],Ar[1])},function(Mr,Ar,kr){return wr(Mr.slice(Ar,Ar+kr[1]))}],["majorNumber",8,329,function(Mr,Ar){return""},function(Mr,Ar,kr){return vr(Mr.slice(Ar,Ar+kr[1]))}],["minorNumber",8,337,function(Mr,Ar){return""},function(Mr,Ar,kr){return vr(Mr.slice(Ar,Ar+kr[1]))}],["prefix",131,345,function(Mr,Ar){return yr(Mr[Ar[0]],Ar[1])},function(Mr,Ar,kr){return wr(Mr.slice(Ar,Ar+kr[1]))}],["accessTime",12,476,function(Mr,Ar){return br(Mr[Ar[0]],Ar[1])},function(Mr,Ar,kr){return Sr(Mr.slice(Ar,Ar+kr[1]))}],["createTime",12,488,function(Mr,Ar){return br(Mr[Ar[0]],Ar[1])},function(Mr,Ar,kr){return Sr(Mr.slice(Ar,Ar+kr[1]))}]],mr=function(Mr){var Ar=Mr[Mr.length-1];return Ar[2]+Ar[1]}(hr);function gr(Mr){if(Mr.length==8){var Ar=Mr.split("");if(Ar[5]==rr.NULL_CHAR)return(Ar[6]==" "||Ar[6]==rr.NULL_CHAR)&&(Ar[6]="0"),(Ar[7]==" "||Ar[7]==rr.NULL_CHAR)&&(Ar[7]="0"),Ar=Ar.join(""),Ar==rr.TMAGIC?Ar:Mr;if(Ar[7]==rr.NULL_CHAR)return Ar[5]==rr.NULL_CHAR&&(Ar[5]=" "),Ar[6]==rr.NULL_CHAR&&(Ar[6]=" "),Ar==rr.OLDGNU_MAGIC?Ar:Mr}return Mr}function yr(Mr,Ar){return Ar-=1,tr.isUndefined(Mr)&&(Mr=""),Mr=(""+Mr).substr(0,Ar),Mr+rr.NULL_CHAR}function _r(Mr,Ar,kr){for(kr=parseInt(kr)||0,Ar-=1,Mr=(parseInt(Mr)||kr).toString(8).substr(-Ar,Ar);Mr.length<Ar;)Mr="0"+Mr;return Mr+rr.NULL_CHAR}function br(Mr,Ar){if(tr.isDateTime(Mr))Mr=Math.floor(1*Mr/1e3);else if(Mr=parseInt(Mr,10),isFinite(Mr)){if(Mr<=0)return""}else Mr=Math.floor(1*new Date/1e3);return _r(Mr,Ar,0)}function wr(Mr,Ar){var kr=String.fromCharCode.apply(null,Mr);if(Ar)return kr;var Or=kr.indexOf(rr.NULL_CHAR);return Or>=0?kr.substr(0,Or):kr}function vr(Mr){var Ar=String.fromCharCode.apply(null,Mr);return parseInt(Ar.replace(/^0+$/g,""),8)||0}function Sr(Mr){return Mr.length==0||Mr[0]==0?null:new Date(1e3*vr(Mr))}function Ir(Mr,Ar,kr){var Or=parseInt(Ar,10)||0,Dr=Math.min(Or+mr,Mr.length),$r=0,Fr=0,Lr=0;kr&&hr.every(function(Zn){return Zn[0]=="checksum"?(Fr=Or+Zn[2],Lr=Fr+Zn[1],!1):!0});for(var qn=32,Kn=Or;Kn<Dr;Kn++){var Gr=Kn>=Fr&&Kn<Lr?qn:Mr[Kn];$r=($r+Gr)%262144}return $r}t.exports.recordSize=ir,t.exports.defaultFileMode=lr,t.exports.defaultUid=dr,t.exports.defaultGid=fr,t.exports.posixHeader=hr,t.exports.effectiveHeaderSize=mr,t.exports.calculateChecksum=Ir,t.exports.formatTarString=yr,t.exports.formatTarNumber=_r,t.exports.formatTarDateTime=br,t.exports.parseTarString=wr,t.exports.parseTarNumber=vr,t.exports.parseTarDateTime=Sr}),er=D$4((e,t)=>{u$2();var tr=x$1(),rr=w$1(),ir=L$1();function lr(yr){return ir.recordSize}function dr(yr){return Math.ceil(yr.data.length/ir.recordSize)*ir.recordSize}function fr(yr){var _r=0;return yr.forEach(function(br){_r+=lr()+dr(br)}),_r+=ir.recordSize*2,new Uint8Array(_r)}function hr(yr,_r,br){br=parseInt(br)||0;var wr=br;ir.posixHeader.forEach(function(Ar){for(var kr=Ar[3](_r,Ar),Or=kr.length,Dr=0;Dr<Or;Dr+=1)yr[wr+Dr]=kr.charCodeAt(Dr)&255;wr+=Ar[1]});var vr=rr.find(ir.posixHeader,function(Ar){return Ar[0]=="checksum"});if(vr){var Sr=ir.calculateChecksum(yr,br,!0),Ir=ir.formatTarNumber(Sr,vr[1]-2)+tr.NULL_CHAR+" ";wr=br+vr[2];for(var Mr=0;Mr<Ir.length;Mr+=1)yr[wr]=Ir.charCodeAt(Mr)&255,wr++}return br+lr()}function mr(yr,_r,br){return br=parseInt(br,10)||0,yr.set(_r.data,br),br+dr(_r)}function gr(yr){yr=rr.map(yr,function(wr){return rr.extend({},wr,{data:rr.toUint8Array(wr.data)})});var _r=fr(yr),br=0;return yr.forEach(function(wr){br=hr(_r,wr,br),br=mr(_r,wr,br)}),_r}t.exports.tar=gr}),nr=D$4((e,t)=>{u$2();var tr=x$1(),rr=w$1(),ir=L$1(),lr={extractData:!0,checkHeader:!0,checkChecksum:!0,checkFileSize:!0},dr={size:!0,checksum:!0,ustar:!0},fr={unexpectedEndOfFile:"Unexpected end of file.",fileCorrupted:"File is corrupted.",checksumCheckFailed:"Checksum check failed."};function hr(vr){return ir.recordSize}function mr(vr){return Math.ceil(vr/ir.recordSize)*ir.recordSize}function gr(vr,Sr){for(var Ir=Sr,Mr=Math.min(vr.length,Sr+ir.recordSize*2),Ar=Ir;Ar<Mr;Ar++)if(vr[Ar]!=0)return!1;return!0}function yr(vr,Sr,Ir){if(vr.length-Sr<ir.recordSize){if(Ir.checkFileSize)throw new Error(fr.unexpectedEndOfFile);return null}Sr=parseInt(Sr)||0;var Mr={},Ar=Sr;if(ir.posixHeader.forEach(function(Dr){Mr[Dr[0]]=Dr[4](vr,Ar,Dr),Ar+=Dr[1]}),Mr.type!=0&&(Mr.size=0),Ir.checkHeader&&ir.posixHeader.forEach(function(Dr){if(rr.isFunction(Dr[5])&&!Dr[5](Mr,Dr)){var $r=new Error(fr.fileCorrupted);throw $r.data={offset:Sr+Dr[2],field:Dr[0]},$r}}),Ir.checkChecksum){var kr=ir.calculateChecksum(vr,Sr,!0);if(kr!=Mr.checksum){var Or=new Error(fr.checksumCheckFailed);throw Or.data={offset:Sr,header:Mr,checksum:kr},Or}}return Mr}function _r(vr,Sr,Ir,Mr){return Mr.extractData?Ir.size<=0?new Uint8Array:vr.slice(Sr,Sr+Ir.size):null}function br(vr,Sr){var Ir={};return ir.posixHeader.forEach(function(Mr){var Ar=Mr[0];dr[Ar]||(Ir[Ar]=vr[Ar])}),Ir.isOldGNUFormat=vr.ustar==tr.OLDGNU_MAGIC,Sr&&(Ir.data=Sr),Ir}function wr(vr,Sr){Sr=rr.extend({},lr,Sr);for(var Ir=[],Mr=0,Ar=vr.length;Ar-Mr>=ir.recordSize;){vr=rr.toUint8Array(vr);var kr=yr(vr,Mr,Sr);if(!kr)break;Mr+=hr();var Or=_r(vr,Mr,kr,Sr);if(Ir.push(br(kr,Or)),Mr+=mr(kr.size),gr(vr,Mr))break}return Ir}t.exports.untar=wr}),or=D$4((e,t)=>{u$2();var tr=w$1(),rr=x$1(),ir=er(),lr=nr();tr.extend(t.exports,ir,lr,rr)});u$2();u$2();var g$1=L$4(or());async function H$2(e,t,tr="pgdata",rr="auto"){let ir=Br(e,t),[lr,dr]=await qr(ir,rr),fr=tr+(dr?".tar.gz":".tar"),hr=dr?"application/x-gzip":"application/x-tar";return typeof File<"u"?new File([lr],fr,{type:hr}):new Blob([lr],{type:hr})}var Hr=["application/x-gtar","application/x-tar+gzip","application/x-gzip","application/gzip"];async function ce$1(e,t,tr){let rr=new Uint8Array(await t.arrayBuffer()),ir=typeof File<"u"&&t instanceof File?t.name:void 0;(Hr.includes(t.type)||ir!=null&&ir.endsWith(".tgz")||ir!=null&&ir.endsWith(".tar.gz"))&&(rr=await ar(rr));let lr;try{lr=(0,g$1.untar)(rr)}catch(dr){if(dr instanceof Error&&dr.message.includes("File is corrupted"))rr=await ar(rr),lr=(0,g$1.untar)(rr);else throw dr}for(let dr of lr){let fr=tr+dr.name,hr=fr.split("/").slice(0,-1);for(let mr=1;mr<=hr.length;mr++){let gr=hr.slice(0,mr).join("/");e.analyzePath(gr).exists||e.mkdir(gr)}dr.type===g$1.REGTYPE?(e.writeFile(fr,dr.data),e.utime(fr,sr(dr.modifyTime),sr(dr.modifyTime))):dr.type===g$1.DIRTYPE&&e.mkdir(fr)}}function jr(e,t){let tr=[],rr=ir=>{e.readdir(ir).forEach(lr=>{if(lr==="."||lr==="..")return;let dr=ir+"/"+lr,fr=e.stat(dr),hr=e.isFile(fr.mode)?e.readFile(dr,{encoding:"binary"}):new Uint8Array(0);tr.push({name:dr.substring(t.length),mode:fr.mode,size:fr.size,type:e.isFile(fr.mode)?g$1.REGTYPE:g$1.DIRTYPE,modifyTime:fr.mtime,data:hr}),e.isDir(fr.mode)&&rr(dr)})};return rr(t),tr}function Br(e,t){let tr=jr(e,t);return(0,g$1.tar)(tr)}async function qr(e,t="auto"){if(t==="none")return[e,!1];if(typeof CompressionStream<"u")return[await Yr(e),!0];if(typeof process<"u"&&process.versions&&process.versions.node)return[await Wr(e),!0];if(t==="auto")return[e,!1];throw new Error("Compression not supported in this environment")}async function Yr(e){let t=new CompressionStream("gzip"),tr=t.writable.getWriter(),rr=t.readable.getReader();tr.write(e),tr.close();let ir=[];for(;;){let{value:fr,done:hr}=await rr.read();if(hr)break;fr&&ir.push(fr)}let lr=new Uint8Array(ir.reduce((fr,hr)=>fr+hr.length,0)),dr=0;return ir.forEach(fr=>{lr.set(fr,dr),dr+=fr.length}),lr}async function Wr(e){let{promisify:t}=await __vitePreload(()=>Promise.resolve().then(()=>__viteBrowserExternal$1),void 0,import.meta.url),{gzip:tr}=await __vitePreload(async()=>{const{gzip:rr}=await Promise.resolve().then(()=>__viteBrowserExternal$1);return{gzip:rr}},void 0,import.meta.url);return await t(tr)(e)}async function ar(e){if(typeof CompressionStream<"u")return await Xr(e);if(typeof process<"u"&&process.versions&&process.versions.node)return await Kr(e);throw new Error("Unsupported environment for decompression")}async function Xr(e){let t=new DecompressionStream("gzip"),tr=t.writable.getWriter(),rr=t.readable.getReader();tr.write(e),tr.close();let ir=[];for(;;){let{value:fr,done:hr}=await rr.read();if(hr)break;fr&&ir.push(fr)}let lr=new Uint8Array(ir.reduce((fr,hr)=>fr+hr.length,0)),dr=0;return ir.forEach(fr=>{lr.set(fr,dr),dr+=fr.length}),lr}async function Kr(e){let{promisify:t}=await __vitePreload(()=>Promise.resolve().then(()=>__viteBrowserExternal$1),void 0,import.meta.url),{gunzip:tr}=await __vitePreload(async()=>{const{gunzip:rr}=await Promise.resolve().then(()=>__viteBrowserExternal$1);return{gunzip:rr}},void 0,import.meta.url);return await t(tr)(e)}function sr(e){return e?typeof e=="number"?e:Math.floor(e.getTime()/1e3):Math.floor(Date.now()/1e3)}var Vr="/tmp/pglite",C$1=Vr+"/base",ur=class{constructor(e){this.dataDir=e}async init(e,t){return this.pg=e,{emscriptenOpts:t}}async syncToFs(e){}async initialSyncFs(){}async closeFs(){}async dumpTar(e,t){return H$2(this.pg.Module.FS,C$1,e,t)}},cr=class{constructor(e,{debug:t=!1}={}){this.dataDir=e,this.debug=t}async syncToFs(e){}async initialSyncFs(){}async closeFs(){}async dumpTar(e,t){return H$2(this.pg.Module.FS,C$1,e,t)}async init(e,t){return this.pg=e,{emscriptenOpts:{...t,preRun:[...t.preRun||[],tr=>{let rr=Zr(tr,this);tr.FS.mkdir(C$1),tr.FS.mount(rr,{},C$1)}]}}}},pr={EBADF:8,EBADFD:127,EEXIST:20,EINVAL:28,EISDIR:31,ENODEV:43,ENOENT:44,ENOTDIR:54,ENOTEMPTY:55},Zr=(e,t)=>{let tr=e.FS,rr=t.debug?console.log:null,ir={tryFSOperation(lr){try{return lr()}catch(dr){throw dr.code?dr.code==="UNKNOWN"?new tr.ErrnoError(pr.EINVAL):new tr.ErrnoError(dr.code):dr}},mount(lr){return ir.createNode(null,"/",16895,0)},syncfs(lr,dr,fr){},createNode(lr,dr,fr,hr){if(!tr.isDir(fr)&&!tr.isFile(fr))throw new tr.ErrnoError(28);let mr=tr.createNode(lr,dr,fr);return mr.node_ops=ir.node_ops,mr.stream_ops=ir.stream_ops,mr},getMode:function(lr){return rr==null||rr("getMode",lr),ir.tryFSOperation(()=>t.lstat(lr).mode)},realPath:function(lr){let dr=[];for(;lr.parent!==lr;)dr.push(lr.name),lr=lr.parent;return dr.push(lr.mount.opts.root),dr.reverse(),dr.join("/")},node_ops:{getattr(lr){rr==null||rr("getattr",ir.realPath(lr));let dr=ir.realPath(lr);return ir.tryFSOperation(()=>{let fr=t.lstat(dr);return{...fr,dev:0,ino:lr.id,nlink:1,rdev:lr.rdev,atime:new Date(fr.atime),mtime:new Date(fr.mtime),ctime:new Date(fr.ctime)}})},setattr(lr,dr){rr==null||rr("setattr",ir.realPath(lr),dr);let fr=ir.realPath(lr);ir.tryFSOperation(()=>{dr.mode!==void 0&&t.chmod(fr,dr.mode),dr.size!==void 0&&t.truncate(fr,dr.size),dr.timestamp!==void 0&&t.utimes(fr,dr.timestamp,dr.timestamp),dr.size!==void 0&&t.truncate(fr,dr.size)})},lookup(lr,dr){rr==null||rr("lookup",ir.realPath(lr),dr);let fr=[ir.realPath(lr),dr].join("/"),hr=ir.getMode(fr);return ir.createNode(lr,dr,hr)},mknod(lr,dr,fr,hr){rr==null||rr("mknod",ir.realPath(lr),dr,fr,hr);let mr=ir.createNode(lr,dr,fr,hr),gr=ir.realPath(mr);return ir.tryFSOperation(()=>(tr.isDir(mr.mode)?t.mkdir(gr,{mode:fr}):t.writeFile(gr,"",{mode:fr}),mr))},rename(lr,dr,fr){rr==null||rr("rename",ir.realPath(lr),ir.realPath(dr),fr);let hr=ir.realPath(lr),mr=[ir.realPath(dr),fr].join("/");ir.tryFSOperation(()=>{t.rename(hr,mr)}),lr.name=fr},unlink(lr,dr){rr==null||rr("unlink",ir.realPath(lr),dr);let fr=[ir.realPath(lr),dr].join("/");try{t.unlink(fr)}catch{}},rmdir(lr,dr){rr==null||rr("rmdir",ir.realPath(lr),dr);let fr=[ir.realPath(lr),dr].join("/");return ir.tryFSOperation(()=>{t.rmdir(fr)})},readdir(lr){rr==null||rr("readdir",ir.realPath(lr));let dr=ir.realPath(lr);return ir.tryFSOperation(()=>t.readdir(dr))},symlink(lr,dr,fr){throw rr==null||rr("symlink",ir.realPath(lr),dr,fr),new tr.ErrnoError(63)},readlink(lr){throw rr==null||rr("readlink",ir.realPath(lr)),new tr.ErrnoError(63)}},stream_ops:{open(lr){rr==null||rr("open stream",ir.realPath(lr.node));let dr=ir.realPath(lr.node);return ir.tryFSOperation(()=>{tr.isFile(lr.node.mode)&&(lr.shared.refcount=1,lr.nfd=t.open(dr))})},close(lr){return rr==null||rr("close stream",ir.realPath(lr.node)),ir.tryFSOperation(()=>{tr.isFile(lr.node.mode)&&lr.nfd&&--lr.shared.refcount===0&&t.close(lr.nfd)})},dup(lr){rr==null||rr("dup stream",ir.realPath(lr.node)),lr.shared.refcount++},read(lr,dr,fr,hr,mr){return rr==null||rr("read stream",ir.realPath(lr.node),fr,hr,mr),hr===0?0:ir.tryFSOperation(()=>t.read(lr.nfd,dr,fr,hr,mr))},write(lr,dr,fr,hr,mr){return rr==null||rr("write stream",ir.realPath(lr.node),fr,hr,mr),ir.tryFSOperation(()=>t.write(lr.nfd,dr.buffer,fr,hr,mr))},llseek(lr,dr,fr){rr==null||rr("llseek stream",ir.realPath(lr.node),dr,fr);let hr=dr;if(fr===1?hr+=lr.position:fr===2&&tr.isFile(lr.node.mode)&&ir.tryFSOperation(()=>{let mr=t.fstat(lr.nfd);hr+=mr.size}),hr<0)throw new tr.ErrnoError(28);return hr},mmap(lr,dr,fr,hr,mr){if(rr==null||rr("mmap stream",ir.realPath(lr.node),dr,fr,hr,mr),!tr.isFile(lr.node.mode))throw new tr.ErrnoError(pr.ENODEV);let gr=e.mmapAlloc(dr);return ir.stream_ops.read(lr,e.HEAP8,gr,dr,fr),{ptr:gr,allocated:!0}},msync(lr,dr,fr,hr,mr){return rr==null||rr("msync stream",ir.realPath(lr.node),fr,hr,mr),ir.stream_ops.write(lr,dr,0,hr,fr),0}}};return ir};u$2();u$2();u$2();var He=new Error("request for lock canceled"),We=function(e,t,tr,rr){function ir(lr){return lr instanceof tr?lr:new tr(function(dr){dr(lr)})}return new(tr||(tr=Promise))(function(lr,dr){function fr(gr){try{mr(rr.next(gr))}catch(yr){dr(yr)}}function hr(gr){try{mr(rr.throw(gr))}catch(yr){dr(yr)}}function mr(gr){gr.done?lr(gr.value):ir(gr.value).then(fr,hr)}mr((rr=rr.apply(e,[])).next())})},ce=class{constructor(e,t=He){this._value=e,this._cancelError=t,this._weightedQueues=[],this._weightedWaiters=[]}acquire(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((t,tr)=>{this._weightedQueues[e-1]||(this._weightedQueues[e-1]=[]),this._weightedQueues[e-1].push({resolve:t,reject:tr}),this._dispatch()})}runExclusive(e,t=1){return We(this,void 0,void 0,function*(){let[tr,rr]=yield this.acquire(t);try{return yield e(tr)}finally{rr()}})}waitForUnlock(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise(t=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),this._weightedWaiters[e-1].push(t),this._dispatch()})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatch()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatch()}cancel(){this._weightedQueues.forEach(e=>e.forEach(t=>t.reject(this._cancelError))),this._weightedQueues=[]}_dispatch(){var e;for(let t=this._value;t>0;t--){let tr=(e=this._weightedQueues[t-1])===null||e===void 0?void 0:e.shift();if(!tr)continue;let rr=this._value,ir=t;this._value-=t,t=this._value+1,tr.resolve([rr,this._newReleaser(ir)])}this._drainUnlockWaiters()}_newReleaser(e){let t=!1;return()=>{t||(t=!0,this.release(e))}}_drainUnlockWaiters(){for(let e=this._value;e>0;e--)this._weightedWaiters[e-1]&&(this._weightedWaiters[e-1].forEach(t=>t()),this._weightedWaiters[e-1]=[])}},je=function(e,t,tr,rr){function ir(lr){return lr instanceof tr?lr:new tr(function(dr){dr(lr)})}return new(tr||(tr=Promise))(function(lr,dr){function fr(gr){try{mr(rr.next(gr))}catch(yr){dr(yr)}}function hr(gr){try{mr(rr.throw(gr))}catch(yr){dr(yr)}}function mr(gr){gr.done?lr(gr.value):ir(gr.value).then(fr,hr)}mr((rr=rr.apply(e,[])).next())})},H$1=class{constructor(t){this._semaphore=new ce(1,t)}acquire(){return je(this,void 0,void 0,function*(){let[,t]=yield this._semaphore.acquire();return t})}runExclusive(t){return this._semaphore.runExclusive(()=>t())}isLocked(){return this._semaphore.isLocked()}waitForUnlock(){return this._semaphore.waitForUnlock()}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}};u$2();var Ie=L$4(or());async function ge(e){if(Fe$1){let t=await __vitePreload(()=>Promise.resolve().then(()=>__viteBrowserExternal$1),void 0,import.meta.url),tr=await __vitePreload(()=>Promise.resolve().then(()=>__viteBrowserExternal$1),void 0,import.meta.url),{Writable:rr}=await __vitePreload(async()=>{const{Writable:fr}=await Promise.resolve().then(()=>__viteBrowserExternal$1);return{Writable:fr}},void 0,import.meta.url),{pipeline:ir}=await __vitePreload(async()=>{const{pipeline:fr}=await Promise.resolve().then(()=>__viteBrowserExternal$1);return{pipeline:fr}},void 0,import.meta.url);if(!t.existsSync(e))throw new Error(`Extension bundle not found: ${e}`);let lr=tr.createGunzip(),dr=[];return await ir(t.createReadStream(e),lr,new rr({write(fr,hr,mr){dr.push(fr),mr()}})),new Blob(dr)}else{let t=await fetch(e.toString());if(!t.ok||!t.body)return null;if(t.headers.get("Content-Encoding")==="gzip")return t.blob();{let tr=new DecompressionStream("gzip");return new Response(t.body.pipeThrough(tr)).blob()}}}async function Pe(e,t){for(let tr in e.pg_extensions){let rr;try{rr=await e.pg_extensions[tr]}catch(ir){console.error("Failed to fetch extension:",tr,ir);continue}if(rr){let ir=new Uint8Array(await rr.arrayBuffer());Ve(e,tr,ir,t)}else console.error("Could not get binary data for extension:",tr)}}function Ve(e,t,tr,rr){Ie.default.untar(tr).forEach(ir=>{if(!ir.name.startsWith(".")){let lr=e.WASM_PREFIX+"/"+ir.name;if(ir.name.endsWith(".so")){let dr=(...hr)=>{rr("pgfs:ext OK",lr,hr)},fr=(...hr)=>{rr("pgfs:ext FAIL",lr,hr)};e.FS.createPreloadedFile(Ke(lr),ir.name.split("/").pop().slice(0,-3),ir.data,!0,!0,dr,fr,!1)}else e.FS.writeFile(lr,ir.data)}})}function Ke(e){let t=e.lastIndexOf("/");return t>0?e.slice(0,t):e}u$2();u$2();var ee=class extends ur{async init(e,t){return this.pg=e,{emscriptenOpts:{...t,preRun:[...t.preRun||[],tr=>{let rr=tr.FS.filesystems.IDBFS;tr.FS.mkdir("/pglite"),tr.FS.mkdir(`/pglite/${this.dataDir}`),tr.FS.mount(rr,{},`/pglite/${this.dataDir}`),tr.FS.symlink(`/pglite/${this.dataDir}`,C$1)}]}}}initialSyncFs(){return new Promise((e,t)=>{this.pg.Module.FS.syncfs(!0,tr=>{tr?t(tr):e()})})}syncToFs(e){return new Promise((t,tr)=>{this.pg.Module.FS.syncfs(!1,rr=>{rr?tr(rr):t()})})}async closeFs(){let e=this.pg.Module.FS.filesystems.IDBFS.dbs[this.dataDir];e&&e.close(),this.pg.Module.FS.quit()}};u$2();var te=class extends ur{async closeFs(){this.pg.Module.FS.quit()}};function Fe(e){let t;if(e!=null&&e.startsWith("file://")){if(e=e.slice(7),!e)throw new Error("Invalid dataDir, must be a valid path");t="nodefs"}else e!=null&&e.startsWith("idb://")?(e=e.slice(6),t="idbfs"):e!=null&&e.startsWith("opfs-ahp://")?(e=e.slice(11),t="opfs-ahp"):!e||e!=null&&e.startsWith("memory://")?t="memoryfs":t="nodefs";return{dataDir:e,fsType:t}}async function Ae(e,t){let tr;if(e&&t==="nodefs"){let{NodeFS:rr}=await __vitePreload(()=>import("./nodefs.BbkfN3E3.js"),[],import.meta.url);tr=new rr(e)}else if(e&&t==="idbfs")tr=new ee(e);else if(e&&t==="opfs-ahp"){let{OpfsAhpFS:rr}=await __vitePreload(()=>import("./opfs-ahp.EtXrzCL2.js"),[],import.meta.url);tr=new rr(e)}else tr=new te;return tr}u$2();u$2();var Qe=(()=>{var _scriptName=import.meta.url;return async function(moduleArg={}){var moduleRtn,Module=moduleArg,readyPromiseResolve,readyPromiseReject,readyPromise=new Promise((e,t)=>{readyPromiseResolve=e,readyPromiseReject=t}),ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof WorkerGlobalScope<"u",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";if(ENVIRONMENT_IS_NODE){let{createRequire:e}=await __vitePreload(()=>Promise.resolve().then(()=>__viteBrowserExternal$1),void 0,import.meta.url),t=import.meta.url;t.startsWith("data:")&&(t="/");var require=e(t)}Module.expectedDataFileDownloads??(Module.expectedDataFileDownloads=0),Module.expectedDataFileDownloads++,(()=>{var e=typeof ENVIRONMENT_IS_PTHREAD<"u"&&ENVIRONMENT_IS_PTHREAD,t=typeof ENVIRONMENT_IS_WASM_WORKER<"u"&&ENVIRONMENT_IS_WASM_WORKER;if(e||t)return;var tr=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";function rr(ir){typeof window=="object"?window.encodeURIComponent(window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/"):typeof process>"u"&&typeof location<"u"&&encodeURIComponent(location.pathname.substring(0,location.pathname.lastIndexOf("/"))+"/");var lr="postgres.data",dr="postgres.data",fr=Module.locateFile?Module.locateFile(dr,""):dr,hr=ir.remote_package_size;function mr(wr,vr,Sr,Ir){if(tr){require("fs").readFile(wr,(Mr,Ar)=>{Mr?Ir(Mr):Sr(Ar.buffer)});return}Module.dataFileDownloads??(Module.dataFileDownloads={}),fetch(wr).catch(Mr=>Promise.reject(new Error(`Network Error: ${wr}`,{cause:Mr}))).then(Mr=>{var qn;if(!Mr.ok)return Promise.reject(new Error(`${Mr.status}: ${Mr.url}`));if(!Mr.body&&Mr.arrayBuffer)return Mr.arrayBuffer().then(Sr);let Ar=Mr.body.getReader(),kr=()=>Ar.read().then(Lr).catch(Kn=>Promise.reject(new Error(`Unexpected error while handling : ${Mr.url} ${Kn}`,{cause:Kn}))),Or=[],Dr=Mr.headers,$r=Number(Dr.get("Content-Length")??vr),Fr=0,Lr=({done:Kn,value:Gr})=>{var Zn;if(Kn){let zr=new Uint8Array(Or.map(Hn=>Hn.length).reduce((Hn,Jn)=>Hn+Jn,0)),$n=0;for(let Hn of Or)zr.set(Hn,$n),$n+=Hn.length;Sr(zr.buffer)}else{Or.push(Gr),Fr+=Gr.length,Module.dataFileDownloads[wr]={loaded:Fr,total:$r};let zr=0,$n=0;for(let Hn of Object.values(Module.dataFileDownloads))zr+=Hn.loaded,$n+=Hn.total;return(Zn=Module.setStatus)==null||Zn.call(Module,`Downloading data... (${zr}/${$n})`),kr()}};return(qn=Module.setStatus)==null||qn.call(Module,"Downloading data..."),kr()})}function gr(wr){console.error("package error:",wr)}var yr=null,_r=Module.getPreloadedPackage?Module.getPreloadedPackage(fr,hr):null;_r||mr(fr,hr,wr=>{yr?(yr(wr),yr=null):_r=wr},gr);function br(wr){function vr(kr,Or){if(!kr)throw Or+new Error().stack}wr.FS_createPath("/","home",!0,!0),wr.FS_createPath("/home","web_user",!0,!0),wr.FS_createPath("/","tmp",!0,!0),wr.FS_createPath("/tmp","pglite",!0,!0),wr.FS_createPath("/tmp/pglite","bin",!0,!0),wr.FS_createPath("/tmp/pglite","lib",!0,!0),wr.FS_createPath("/tmp/pglite/lib","postgresql",!0,!0),wr.FS_createPath("/tmp/pglite/lib/postgresql","pgxs",!0,!0),wr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs","config",!0,!0),wr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs","src",!0,!0),wr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs/src","makefiles",!0,!0),wr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs/src","test",!0,!0),wr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs/src/test","isolation",!0,!0),wr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs/src/test","regress",!0,!0),wr.FS_createPath("/tmp/pglite","share",!0,!0),wr.FS_createPath("/tmp/pglite/share","postgresql",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql","extension",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql","timezone",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Africa",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","America",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone/America","Argentina",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone/America","Indiana",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone/America","Kentucky",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone/America","North_Dakota",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Antarctica",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Arctic",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Asia",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Atlantic",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Australia",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Brazil",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Canada",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Chile",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Etc",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Europe",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Indian",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Mexico",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Pacific",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","US",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql","timezonesets",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql","tsearch_data",!0,!0);function Sr(kr,Or,Dr){this.start=kr,this.end=Or,this.audio=Dr}Sr.prototype={requests:{},open:function(kr,Or){this.name=Or,this.requests[Or]=this,wr.addRunDependency(`fp ${this.name}`)},send:function(){},onload:function(){var kr=this.byteArray.subarray(this.start,this.end);this.finish(kr)},finish:function(kr){var Or=this;wr.FS_createDataFile(this.name,null,kr,!0,!0,!0),wr.removeRunDependency(`fp ${Or.name}`),this.requests[this.name]=null}};for(var Ir=ir.files,Mr=0;Mr<Ir.length;++Mr)new Sr(Ir[Mr].start,Ir[Mr].end,Ir[Mr].audio||0).open("GET",Ir[Mr].filename);function Ar(kr){vr(kr,"Loading data file failed."),vr(kr.constructor.name===ArrayBuffer.name,"bad input to processPackageData");var Or=new Uint8Array(kr);Sr.prototype.byteArray=Or;for(var Dr=ir.files,$r=0;$r<Dr.length;++$r)Sr.prototype.requests[Dr[$r].filename].onload();wr.removeRunDependency("datafile_postgres.data")}wr.addRunDependency("datafile_postgres.data"),wr.preloadResults??(wr.preloadResults={}),wr.preloadResults[lr]={fromCache:!1},_r?(Ar(_r),_r=null):yr=Ar}Module.calledRun?br(Module):(Module.preRun??(Module.preRun=[])).push(br)}rr({files:[{filename:"/home/web_user/.pgpass",start:0,end:204},{filename:"/tmp/pglite/bin/initdb",start:204,end:216},{filename:"/tmp/pglite/bin/postgres",start:216,end:228},{filename:"/tmp/pglite/lib/postgresql/cyrillic_and_mic.so",start:228,end:20397},{filename:"/tmp/pglite/lib/postgresql/dict_snowball.so",start:20397,end:1581299},{filename:"/tmp/pglite/lib/postgresql/euc2004_sjis2004.so",start:1581299,end:1592382},{filename:"/tmp/pglite/lib/postgresql/euc_cn_and_mic.so",start:1592382,end:1599256},{filename:"/tmp/pglite/lib/postgresql/euc_jp_and_sjis.so",start:1599256,end:1622931},{filename:"/tmp/pglite/lib/postgresql/euc_kr_and_mic.so",start:1622931,end:1630057},{filename:"/tmp/pglite/lib/postgresql/euc_tw_and_big5.so",start:1630057,end:1651566},{filename:"/tmp/pglite/lib/postgresql/latin2_and_win1250.so",start:1651566,end:1660345},{filename:"/tmp/pglite/lib/postgresql/latin_and_mic.so",start:1660345,end:1668272},{filename:"/tmp/pglite/lib/postgresql/libpqwalreceiver.so",start:1668272,end:2186522},{filename:"/tmp/pglite/lib/postgresql/pgoutput.so",start:2186522,end:2303364},{filename:"/tmp/pglite/lib/postgresql/pgxs/config/install-sh",start:2303364,end:2317361},{filename:"/tmp/pglite/lib/postgresql/pgxs/config/missing",start:2317361,end:2318709},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/Makefile.global",start:2318709,end:2354956},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/Makefile.port",start:2354956,end:2355232},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/Makefile.shlib",start:2355232,end:2371270},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/makefiles/pgxs.mk",start:2371270,end:2386198},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/nls-global.mk",start:2386198,end:2393083},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/test/isolation/isolationtester.cjs",start:2393083,end:2589770},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/test/isolation/pg_isolation_regress.cjs",start:2589770,end:2742128},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/test/regress/pg_regress.cjs",start:2742128,end:2894476},{filename:"/tmp/pglite/lib/postgresql/plpgsql.so",start:2894476,end:3653241},{filename:"/tmp/pglite/password",start:3653241,end:3653250},{filename:"/tmp/pglite/share/postgresql/errcodes.txt",start:3653250,end:3686708},{filename:"/tmp/pglite/share/postgresql/extension/plpgsql--1.0.sql",start:3686708,end:3687366},{filename:"/tmp/pglite/share/postgresql/extension/plpgsql.control",start:3687366,end:3687559},{filename:"/tmp/pglite/share/postgresql/fix-CVE-2024-4317.sql",start:3687559,end:3693324},{filename:"/tmp/pglite/share/postgresql/information_schema.sql",start:3693324,end:3808299},{filename:"/tmp/pglite/share/postgresql/pg_hba.conf.sample",start:3808299,end:3813924},{filename:"/tmp/pglite/share/postgresql/pg_ident.conf.sample",start:3813924,end:3816564},{filename:"/tmp/pglite/share/postgresql/pg_service.conf.sample",start:3816564,end:3817168},{filename:"/tmp/pglite/share/postgresql/postgres.bki",start:3817168,end:4761272},{filename:"/tmp/pglite/share/postgresql/postgresql.conf.sample",start:4761272,end:4790919},{filename:"/tmp/pglite/share/postgresql/psqlrc.sample",start:4790919,end:4791197},{filename:"/tmp/pglite/share/postgresql/snowball_create.sql",start:4791197,end:4835373},{filename:"/tmp/pglite/share/postgresql/sql_features.txt",start:4835373,end:4871054},{filename:"/tmp/pglite/share/postgresql/system_constraints.sql",start:4871054,end:4879949},{filename:"/tmp/pglite/share/postgresql/system_functions.sql",start:4879949,end:4903264},{filename:"/tmp/pglite/share/postgresql/system_views.sql",start:4903264,end:4953537},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Abidjan",start:4953537,end:4953667},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Accra",start:4953667,end:4953797},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Addis_Ababa",start:4953797,end:4953988},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Algiers",start:4953988,end:4954458},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Asmara",start:4954458,end:4954649},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Asmera",start:4954649,end:4954840},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Bamako",start:4954840,end:4954970},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Bangui",start:4954970,end:4955150},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Banjul",start:4955150,end:4955280},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Bissau",start:4955280,end:4955429},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Blantyre",start:4955429,end:4955560},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Brazzaville",start:4955560,end:4955740},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Bujumbura",start:4955740,end:4955871},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Cairo",start:4955871,end:4957180},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Casablanca",start:4957180,end:4959099},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Ceuta",start:4959099,end:4959661},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Conakry",start:4959661,end:4959791},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Dakar",start:4959791,end:4959921},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Dar_es_Salaam",start:4959921,end:4960112},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Djibouti",start:4960112,end:4960303},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Douala",start:4960303,end:4960483},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/El_Aaiun",start:4960483,end:4962313},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Freetown",start:4962313,end:4962443},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Gaborone",start:4962443,end:4962574},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Harare",start:4962574,end:4962705},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Johannesburg",start:4962705,end:4962895},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Juba",start:4962895,end:4963353},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Kampala",start:4963353,end:4963544},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Khartoum",start:4963544,end:4964002},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Kigali",start:4964002,end:4964133},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Kinshasa",start:4964133,end:4964313},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Lagos",start:4964313,end:4964493},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Libreville",start:4964493,end:4964673},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Lome",start:4964673,end:4964803},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Luanda",start:4964803,end:4964983},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Lubumbashi",start:4964983,end:4965114},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Lusaka",start:4965114,end:4965245},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Malabo",start:4965245,end:4965425},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Maputo",start:4965425,end:4965556},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Maseru",start:4965556,end:4965746},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Mbabane",start:4965746,end:4965936},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Mogadishu",start:4965936,end:4966127},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Monrovia",start:4966127,end:4966291},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Nairobi",start:4966291,end:4966482},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Ndjamena",start:4966482,end:4966642},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Niamey",start:4966642,end:4966822},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Nouakchott",start:4966822,end:4966952},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Ouagadougou",start:4966952,end:4967082},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Porto-Novo",start:4967082,end:4967262},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Sao_Tome",start:4967262,end:4967435},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Timbuktu",start:4967435,end:4967565},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Tripoli",start:4967565,end:4967996},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Tunis",start:4967996,end:4968445},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Windhoek",start:4968445,end:4969083},{filename:"/tmp/pglite/share/postgresql/timezone/America/Adak",start:4969083,end:4970052},{filename:"/tmp/pglite/share/postgresql/timezone/America/Anchorage",start:4970052,end:4971029},{filename:"/tmp/pglite/share/postgresql/timezone/America/Anguilla",start:4971029,end:4971206},{filename:"/tmp/pglite/share/postgresql/timezone/America/Antigua",start:4971206,end:4971383},{filename:"/tmp/pglite/share/postgresql/timezone/America/Araguaina",start:4971383,end:4971975},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Buenos_Aires",start:4971975,end:4972683},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Catamarca",start:4972683,end:4973391},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/ComodRivadavia",start:4973391,end:4974099},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Cordoba",start:4974099,end:4974807},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Jujuy",start:4974807,end:4975497},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/La_Rioja",start:4975497,end:4976214},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Mendoza",start:4976214,end:4976922},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Rio_Gallegos",start:4976922,end:4977630},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Salta",start:4977630,end:4978320},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/San_Juan",start:4978320,end:4979037},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/San_Luis",start:4979037,end:4979754},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Tucuman",start:4979754,end:4980480},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Ushuaia",start:4980480,end:4981188},{filename:"/tmp/pglite/share/postgresql/timezone/America/Aruba",start:4981188,end:4981365},{filename:"/tmp/pglite/share/postgresql/timezone/America/Asuncion",start:4981365,end:4982249},{filename:"/tmp/pglite/share/postgresql/timezone/America/Atikokan",start:4982249,end:4982398},{filename:"/tmp/pglite/share/postgresql/timezone/America/Atka",start:4982398,end:4983367},{filename:"/tmp/pglite/share/postgresql/timezone/America/Bahia",start:4983367,end:4984049},{filename:"/tmp/pglite/share/postgresql/timezone/America/Bahia_Banderas",start:4984049,end:4984777},{filename:"/tmp/pglite/share/postgresql/timezone/America/Barbados",start:4984777,end:4985055},{filename:"/tmp/pglite/share/postgresql/timezone/America/Belem",start:4985055,end:4985449},{filename:"/tmp/pglite/share/postgresql/timezone/America/Belize",start:4985449,end:4986494},{filename:"/tmp/pglite/share/postgresql/timezone/America/Blanc-Sablon",start:4986494,end:4986671},{filename:"/tmp/pglite/share/postgresql/timezone/America/Boa_Vista",start:4986671,end:4987101},{filename:"/tmp/pglite/share/postgresql/timezone/America/Bogota",start:4987101,end:4987280},{filename:"/tmp/pglite/share/postgresql/timezone/America/Boise",start:4987280,end:4988279},{filename:"/tmp/pglite/share/postgresql/timezone/America/Buenos_Aires",start:4988279,end:4988987},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cambridge_Bay",start:4988987,end:4989870},{filename:"/tmp/pglite/share/postgresql/timezone/America/Campo_Grande",start:4989870,end:4990822},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cancun",start:4990822,end:4991351},{filename:"/tmp/pglite/share/postgresql/timezone/America/Caracas",start:4991351,end:4991541},{filename:"/tmp/pglite/share/postgresql/timezone/America/Catamarca",start:4991541,end:4992249},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cayenne",start:4992249,end:4992400},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cayman",start:4992400,end:4992549},{filename:"/tmp/pglite/share/postgresql/timezone/America/Chicago",start:4992549,end:4994303},{filename:"/tmp/pglite/share/postgresql/timezone/America/Chihuahua",start:4994303,end:4994994},{filename:"/tmp/pglite/share/postgresql/timezone/America/Ciudad_Juarez",start:4994994,end:4995712},{filename:"/tmp/pglite/share/postgresql/timezone/America/Coral_Harbour",start:4995712,end:4995861},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cordoba",start:4995861,end:4996569},{filename:"/tmp/pglite/share/postgresql/timezone/America/Costa_Rica",start:4996569,end:4996801},{filename:"/tmp/pglite/share/postgresql/timezone/America/Creston",start:4996801,end:4997041},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cuiaba",start:4997041,end:4997975},{filename:"/tmp/pglite/share/postgresql/timezone/America/Curacao",start:4997975,end:4998152},{filename:"/tmp/pglite/share/postgresql/timezone/America/Danmarkshavn",start:4998152,end:4998599},{filename:"/tmp/pglite/share/postgresql/timezone/America/Dawson",start:4998599,end:4999628},{filename:"/tmp/pglite/share/postgresql/timezone/America/Dawson_Creek",start:4999628,end:5000311},{filename:"/tmp/pglite/share/postgresql/timezone/America/Denver",start:5000311,end:5001353},{filename:"/tmp/pglite/share/postgresql/timezone/America/Detroit",start:5001353,end:5002252},{filename:"/tmp/pglite/share/postgresql/timezone/America/Dominica",start:5002252,end:5002429},{filename:"/tmp/pglite/share/postgresql/timezone/America/Edmonton",start:5002429,end:5003399},{filename:"/tmp/pglite/share/postgresql/timezone/America/Eirunepe",start:5003399,end:5003835},{filename:"/tmp/pglite/share/postgresql/timezone/America/El_Salvador",start:5003835,end:5004011},{filename:"/tmp/pglite/share/postgresql/timezone/America/Ensenada",start:5004011,end:5005036},{filename:"/tmp/pglite/share/postgresql/timezone/America/Fort_Nelson",start:5005036,end:5006484},{filename:"/tmp/pglite/share/postgresql/timezone/America/Fort_Wayne",start:5006484,end:5007015},{filename:"/tmp/pglite/share/postgresql/timezone/America/Fortaleza",start:5007015,end:5007499},{filename:"/tmp/pglite/share/postgresql/timezone/America/Glace_Bay",start:5007499,end:5008379},{filename:"/tmp/pglite/share/postgresql/timezone/America/Godthab",start:5008379,end:5009344},{filename:"/tmp/pglite/share/postgresql/timezone/America/Goose_Bay",start:5009344,end:5010924},{filename:"/tmp/pglite/share/postgresql/timezone/America/Grand_Turk",start:5010924,end:5011777},{filename:"/tmp/pglite/share/postgresql/timezone/America/Grenada",start:5011777,end:5011954},{filename:"/tmp/pglite/share/postgresql/timezone/America/Guadeloupe",start:5011954,end:5012131},{filename:"/tmp/pglite/share/postgresql/timezone/America/Guatemala",start:5012131,end:5012343},{filename:"/tmp/pglite/share/postgresql/timezone/America/Guayaquil",start:5012343,end:5012522},{filename:"/tmp/pglite/share/postgresql/timezone/America/Guyana",start:5012522,end:5012703},{filename:"/tmp/pglite/share/postgresql/timezone/America/Halifax",start:5012703,end:5014375},{filename:"/tmp/pglite/share/postgresql/timezone/America/Havana",start:5014375,end:5015492},{filename:"/tmp/pglite/share/postgresql/timezone/America/Hermosillo",start:5015492,end:5015778},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Indianapolis",start:5015778,end:5016309},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Knox",start:5016309,end:5017325},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Marengo",start:5017325,end:5017892},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Petersburg",start:5017892,end:5018575},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Tell_City",start:5018575,end:5019097},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Vevay",start:5019097,end:5019466},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Vincennes",start:5019466,end:5020024},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Winamac",start:5020024,end:5020636},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indianapolis",start:5020636,end:5021167},{filename:"/tmp/pglite/share/postgresql/timezone/America/Inuvik",start:5021167,end:5021984},{filename:"/tmp/pglite/share/postgresql/timezone/America/Iqaluit",start:5021984,end:5022839},{filename:"/tmp/pglite/share/postgresql/timezone/America/Jamaica",start:5022839,end:5023178},{filename:"/tmp/pglite/share/postgresql/timezone/America/Jujuy",start:5023178,end:5023868},{filename:"/tmp/pglite/share/postgresql/timezone/America/Juneau",start:5023868,end:5024834},{filename:"/tmp/pglite/share/postgresql/timezone/America/Kentucky/Louisville",start:5024834,end:5026076},{filename:"/tmp/pglite/share/postgresql/timezone/America/Kentucky/Monticello",start:5026076,end:5027048},{filename:"/tmp/pglite/share/postgresql/timezone/America/Knox_IN",start:5027048,end:5028064},{filename:"/tmp/pglite/share/postgresql/timezone/America/Kralendijk",start:5028064,end:5028241},{filename:"/tmp/pglite/share/postgresql/timezone/America/La_Paz",start:5028241,end:5028411},{filename:"/tmp/pglite/share/postgresql/timezone/America/Lima",start:5028411,end:5028694},{filename:"/tmp/pglite/share/postgresql/timezone/America/Los_Angeles",start:5028694,end:5029988},{filename:"/tmp/pglite/share/postgresql/timezone/America/Louisville",start:5029988,end:5031230},{filename:"/tmp/pglite/share/postgresql/timezone/America/Lower_Princes",start:5031230,end:5031407},{filename:"/tmp/pglite/share/postgresql/timezone/America/Maceio",start:5031407,end:5031909},{filename:"/tmp/pglite/share/postgresql/timezone/America/Managua",start:5031909,end:5032204},{filename:"/tmp/pglite/share/postgresql/timezone/America/Manaus",start:5032204,end:5032616},{filename:"/tmp/pglite/share/postgresql/timezone/America/Marigot",start:5032616,end:5032793},{filename:"/tmp/pglite/share/postgresql/timezone/America/Martinique",start:5032793,end:5032971},{filename:"/tmp/pglite/share/postgresql/timezone/America/Matamoros",start:5032971,end:5033408},{filename:"/tmp/pglite/share/postgresql/timezone/America/Mazatlan",start:5033408,end:5034126},{filename:"/tmp/pglite/share/postgresql/timezone/America/Mendoza",start:5034126,end:5034834},{filename:"/tmp/pglite/share/postgresql/timezone/America/Menominee",start:5034834,end:5035751},{filename:"/tmp/pglite/share/postgresql/timezone/America/Merida",start:5035751,end:5036405},{filename:"/tmp/pglite/share/postgresql/timezone/America/Metlakatla",start:5036405,end:5037e3},{filename:"/tmp/pglite/share/postgresql/timezone/America/Mexico_City",start:5037e3,end:5037773},{filename:"/tmp/pglite/share/postgresql/timezone/America/Miquelon",start:5037773,end:5038323},{filename:"/tmp/pglite/share/postgresql/timezone/America/Moncton",start:5038323,end:5039816},{filename:"/tmp/pglite/share/postgresql/timezone/America/Monterrey",start:5039816,end:5040460},{filename:"/tmp/pglite/share/postgresql/timezone/America/Montevideo",start:5040460,end:5041429},{filename:"/tmp/pglite/share/postgresql/timezone/America/Montreal",start:5041429,end:5043146},{filename:"/tmp/pglite/share/postgresql/timezone/America/Montserrat",start:5043146,end:5043323},{filename:"/tmp/pglite/share/postgresql/timezone/America/Nassau",start:5043323,end:5045040},{filename:"/tmp/pglite/share/postgresql/timezone/America/New_York",start:5045040,end:5046784},{filename:"/tmp/pglite/share/postgresql/timezone/America/Nipigon",start:5046784,end:5048501},{filename:"/tmp/pglite/share/postgresql/timezone/America/Nome",start:5048501,end:5049476},{filename:"/tmp/pglite/share/postgresql/timezone/America/Noronha",start:5049476,end:5049960},{filename:"/tmp/pglite/share/postgresql/timezone/America/North_Dakota/Beulah",start:5049960,end:5051003},{filename:"/tmp/pglite/share/postgresql/timezone/America/North_Dakota/Center",start:5051003,end:5051993},{filename:"/tmp/pglite/share/postgresql/timezone/America/North_Dakota/New_Salem",start:5051993,end:5052983},{filename:"/tmp/pglite/share/postgresql/timezone/America/Nuuk",start:5052983,end:5053948},{filename:"/tmp/pglite/share/postgresql/timezone/America/Ojinaga",start:5053948,end:5054657},{filename:"/tmp/pglite/share/postgresql/timezone/America/Panama",start:5054657,end:5054806},{filename:"/tmp/pglite/share/postgresql/timezone/America/Pangnirtung",start:5054806,end:5055661},{filename:"/tmp/pglite/share/postgresql/timezone/America/Paramaribo",start:5055661,end:5055848},{filename:"/tmp/pglite/share/postgresql/timezone/America/Phoenix",start:5055848,end:5056088},{filename:"/tmp/pglite/share/postgresql/timezone/America/Port-au-Prince",start:5056088,end:5056653},{filename:"/tmp/pglite/share/postgresql/timezone/America/Port_of_Spain",start:5056653,end:5056830},{filename:"/tmp/pglite/share/postgresql/timezone/America/Porto_Acre",start:5056830,end:5057248},{filename:"/tmp/pglite/share/postgresql/timezone/America/Porto_Velho",start:5057248,end:5057642},{filename:"/tmp/pglite/share/postgresql/timezone/America/Puerto_Rico",start:5057642,end:5057819},{filename:"/tmp/pglite/share/postgresql/timezone/America/Punta_Arenas",start:5057819,end:5059037},{filename:"/tmp/pglite/share/postgresql/timezone/America/Rainy_River",start:5059037,end:5060331},{filename:"/tmp/pglite/share/postgresql/timezone/America/Rankin_Inlet",start:5060331,end:5061138},{filename:"/tmp/pglite/share/postgresql/timezone/America/Recife",start:5061138,end:5061622},{filename:"/tmp/pglite/share/postgresql/timezone/America/Regina",start:5061622,end:5062260},{filename:"/tmp/pglite/share/postgresql/timezone/America/Resolute",start:5062260,end:5063067},{filename:"/tmp/pglite/share/postgresql/timezone/America/Rio_Branco",start:5063067,end:5063485},{filename:"/tmp/pglite/share/postgresql/timezone/America/Rosario",start:5063485,end:5064193},{filename:"/tmp/pglite/share/postgresql/timezone/America/Santa_Isabel",start:5064193,end:5065218},{filename:"/tmp/pglite/share/postgresql/timezone/America/Santarem",start:5065218,end:5065627},{filename:"/tmp/pglite/share/postgresql/timezone/America/Santiago",start:5065627,end:5066981},{filename:"/tmp/pglite/share/postgresql/timezone/America/Santo_Domingo",start:5066981,end:5067298},{filename:"/tmp/pglite/share/postgresql/timezone/America/Sao_Paulo",start:5067298,end:5068250},{filename:"/tmp/pglite/share/postgresql/timezone/America/Scoresbysund",start:5068250,end:5069234},{filename:"/tmp/pglite/share/postgresql/timezone/America/Shiprock",start:5069234,end:5070276},{filename:"/tmp/pglite/share/postgresql/timezone/America/Sitka",start:5070276,end:5071232},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Barthelemy",start:5071232,end:5071409},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Johns",start:5071409,end:5073287},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Kitts",start:5073287,end:5073464},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Lucia",start:5073464,end:5073641},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Thomas",start:5073641,end:5073818},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Vincent",start:5073818,end:5073995},{filename:"/tmp/pglite/share/postgresql/timezone/America/Swift_Current",start:5073995,end:5074363},{filename:"/tmp/pglite/share/postgresql/timezone/America/Tegucigalpa",start:5074363,end:5074557},{filename:"/tmp/pglite/share/postgresql/timezone/America/Thule",start:5074557,end:5075012},{filename:"/tmp/pglite/share/postgresql/timezone/America/Thunder_Bay",start:5075012,end:5076729},{filename:"/tmp/pglite/share/postgresql/timezone/America/Tijuana",start:5076729,end:5077754},{filename:"/tmp/pglite/share/postgresql/timezone/America/Toronto",start:5077754,end:5079471},{filename:"/tmp/pglite/share/postgresql/timezone/America/Tortola",start:5079471,end:5079648},{filename:"/tmp/pglite/share/postgresql/timezone/America/Vancouver",start:5079648,end:5080978},{filename:"/tmp/pglite/share/postgresql/timezone/America/Virgin",start:5080978,end:5081155},{filename:"/tmp/pglite/share/postgresql/timezone/America/Whitehorse",start:5081155,end:5082184},{filename:"/tmp/pglite/share/postgresql/timezone/America/Winnipeg",start:5082184,end:5083478},{filename:"/tmp/pglite/share/postgresql/timezone/America/Yakutat",start:5083478,end:5084424},{filename:"/tmp/pglite/share/postgresql/timezone/America/Yellowknife",start:5084424,end:5085394},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Casey",start:5085394,end:5085681},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Davis",start:5085681,end:5085878},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/DumontDUrville",start:5085878,end:5086032},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Macquarie",start:5086032,end:5087008},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Mawson",start:5087008,end:5087160},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/McMurdo",start:5087160,end:5088203},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Palmer",start:5088203,end:5089090},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Rothera",start:5089090,end:5089222},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/South_Pole",start:5089222,end:5090265},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Syowa",start:5090265,end:5090398},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Troll",start:5090398,end:5090575},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Vostok",start:5090575,end:5090745},{filename:"/tmp/pglite/share/postgresql/timezone/Arctic/Longyearbyen",start:5090745,end:5091450},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Aden",start:5091450,end:5091583},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Almaty",start:5091583,end:5092201},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Amman",start:5092201,end:5093129},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Anadyr",start:5093129,end:5093872},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Aqtau",start:5093872,end:5094478},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Aqtobe",start:5094478,end:5095093},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ashgabat",start:5095093,end:5095468},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ashkhabad",start:5095468,end:5095843},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Atyrau",start:5095843,end:5096459},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Baghdad",start:5096459,end:5097089},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Bahrain",start:5097089,end:5097241},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Baku",start:5097241,end:5097985},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Bangkok",start:5097985,end:5098137},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Barnaul",start:5098137,end:5098890},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Beirut",start:5098890,end:5099622},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Bishkek",start:5099622,end:5100240},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Brunei",start:5100240,end:5100560},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Calcutta",start:5100560,end:5100780},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Chita",start:5100780,end:5101530},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Choibalsan",start:5101530,end:5102149},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Chongqing",start:5102149,end:5102542},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Chungking",start:5102542,end:5102935},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Colombo",start:5102935,end:5103182},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Dacca",start:5103182,end:5103413},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Damascus",start:5103413,end:5104647},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Dhaka",start:5104647,end:5104878},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Dili",start:5104878,end:5105048},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Dubai",start:5105048,end:5105181},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Dushanbe",start:5105181,end:5105547},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Famagusta",start:5105547,end:5106487},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Gaza",start:5106487,end:5108933},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Harbin",start:5108933,end:5109326},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Hebron",start:5109326,end:5111790},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ho_Chi_Minh",start:5111790,end:5112026},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Hong_Kong",start:5112026,end:5112801},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Hovd",start:5112801,end:5113395},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Irkutsk",start:5113395,end:5114155},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Istanbul",start:5114155,end:5115355},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Jakarta",start:5115355,end:5115603},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Jayapura",start:5115603,end:5115774},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Jerusalem",start:5115774,end:5116848},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kabul",start:5116848,end:5117007},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kamchatka",start:5117007,end:5117734},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Karachi",start:5117734,end:5118e3},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kashgar",start:5118e3,end:5118133},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kathmandu",start:5118133,end:5118294},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Katmandu",start:5118294,end:5118455},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Khandyga",start:5118455,end:5119230},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kolkata",start:5119230,end:5119450},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Krasnoyarsk",start:5119450,end:5120191},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kuala_Lumpur",start:5120191,end:5120447},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kuching",start:5120447,end:5120767},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kuwait",start:5120767,end:5120900},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Macao",start:5120900,end:5121691},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Macau",start:5121691,end:5122482},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Magadan",start:5122482,end:5123233},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Makassar",start:5123233,end:5123423},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Manila",start:5123423,end:5123661},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Muscat",start:5123661,end:5123794},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Nicosia",start:5123794,end:5124391},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Novokuznetsk",start:5124391,end:5125117},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Novosibirsk",start:5125117,end:5125870},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Omsk",start:5125870,end:5126611},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Oral",start:5126611,end:5127236},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Phnom_Penh",start:5127236,end:5127388},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Pontianak",start:5127388,end:5127635},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Pyongyang",start:5127635,end:5127818},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Qatar",start:5127818,end:5127970},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Qostanay",start:5127970,end:5128594},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Qyzylorda",start:5128594,end:5129218},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Rangoon",start:5129218,end:5129405},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Riyadh",start:5129405,end:5129538},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Saigon",start:5129538,end:5129774},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Sakhalin",start:5129774,end:5130529},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Samarkand",start:5130529,end:5130895},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Seoul",start:5130895,end:5131310},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Shanghai",start:5131310,end:5131703},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Singapore",start:5131703,end:5131959},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Srednekolymsk",start:5131959,end:5132701},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Taipei",start:5132701,end:5133212},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tashkent",start:5133212,end:5133578},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tbilisi",start:5133578,end:5134207},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tehran",start:5134207,end:5135019},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tel_Aviv",start:5135019,end:5136093},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Thimbu",start:5136093,end:5136247},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Thimphu",start:5136247,end:5136401},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tokyo",start:5136401,end:5136614},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tomsk",start:5136614,end:5137367},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ujung_Pandang",start:5137367,end:5137557},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ulaanbaatar",start:5137557,end:5138151},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ulan_Bator",start:5138151,end:5138745},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Urumqi",start:5138745,end:5138878},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ust-Nera",start:5138878,end:5139649},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Vientiane",start:5139649,end:5139801},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Vladivostok",start:5139801,end:5140543},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Yakutsk",start:5140543,end:5141284},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Yangon",start:5141284,end:5141471},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Yekaterinburg",start:5141471,end:5142231},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Yerevan",start:5142231,end:5142939},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Azores",start:5142939,end:5144392},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Bermuda",start:5144392,end:5145416},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Canary",start:5145416,end:5145894},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Cape_Verde",start:5145894,end:5146069},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Faeroe",start:5146069,end:5146510},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Faroe",start:5146510,end:5146951},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Jan_Mayen",start:5146951,end:5147656},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Madeira",start:5147656,end:5149109},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Reykjavik",start:5149109,end:5149239},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/South_Georgia",start:5149239,end:5149371},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/St_Helena",start:5149371,end:5149501},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Stanley",start:5149501,end:5150290},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/ACT",start:5150290,end:5151194},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Adelaide",start:5151194,end:5152115},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Brisbane",start:5152115,end:5152404},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Broken_Hill",start:5152404,end:5153345},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Canberra",start:5153345,end:5154249},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Currie",start:5154249,end:5155252},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Darwin",start:5155252,end:5155486},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Eucla",start:5155486,end:5155800},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Hobart",start:5155800,end:5156803},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/LHI",start:5156803,end:5157495},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Lindeman",start:5157495,end:5157820},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Lord_Howe",start:5157820,end:5158512},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Melbourne",start:5158512,end:5159416},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/NSW",start:5159416,end:5160320},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/North",start:5160320,end:5160554},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Perth",start:5160554,end:5160860},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Queensland",start:5160860,end:5161149},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/South",start:5161149,end:5162070},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Sydney",start:5162070,end:5162974},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Tasmania",start:5162974,end:5163977},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Victoria",start:5163977,end:5164881},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/West",start:5164881,end:5165187},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Yancowinna",start:5165187,end:5166128},{filename:"/tmp/pglite/share/postgresql/timezone/Brazil/Acre",start:5166128,end:5166546},{filename:"/tmp/pglite/share/postgresql/timezone/Brazil/DeNoronha",start:5166546,end:5167030},{filename:"/tmp/pglite/share/postgresql/timezone/Brazil/East",start:5167030,end:5167982},{filename:"/tmp/pglite/share/postgresql/timezone/Brazil/West",start:5167982,end:5168394},{filename:"/tmp/pglite/share/postgresql/timezone/CET",start:5168394,end:5169015},{filename:"/tmp/pglite/share/postgresql/timezone/CST6CDT",start:5169015,end:5169966},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Atlantic",start:5169966,end:5171638},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Central",start:5171638,end:5172932},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Eastern",start:5172932,end:5174649},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Mountain",start:5174649,end:5175619},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Newfoundland",start:5175619,end:5177497},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Pacific",start:5177497,end:5178827},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Saskatchewan",start:5178827,end:5179465},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Yukon",start:5179465,end:5180494},{filename:"/tmp/pglite/share/postgresql/timezone/Chile/Continental",start:5180494,end:5181848},{filename:"/tmp/pglite/share/postgresql/timezone/Chile/EasterIsland",start:5181848,end:5183022},{filename:"/tmp/pglite/share/postgresql/timezone/Cuba",start:5183022,end:5184139},{filename:"/tmp/pglite/share/postgresql/timezone/EET",start:5184139,end:5184636},{filename:"/tmp/pglite/share/postgresql/timezone/EST",start:5184636,end:5184747},{filename:"/tmp/pglite/share/postgresql/timezone/EST5EDT",start:5184747,end:5185698},{filename:"/tmp/pglite/share/postgresql/timezone/Egypt",start:5185698,end:5187007},{filename:"/tmp/pglite/share/postgresql/timezone/Eire",start:5187007,end:5188503},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT",start:5188503,end:5188614},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+0",start:5188614,end:5188725},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+1",start:5188725,end:5188838},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+10",start:5188838,end:5188952},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+11",start:5188952,end:5189066},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+12",start:5189066,end:5189180},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+2",start:5189180,end:5189293},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+3",start:5189293,end:5189406},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+4",start:5189406,end:5189519},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+5",start:5189519,end:5189632},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+6",start:5189632,end:5189745},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+7",start:5189745,end:5189858},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+8",start:5189858,end:5189971},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+9",start:5189971,end:5190084},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-0",start:5190084,end:5190195},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-1",start:5190195,end:5190309},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-10",start:5190309,end:5190424},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-11",start:5190424,end:5190539},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-12",start:5190539,end:5190654},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-13",start:5190654,end:5190769},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-14",start:5190769,end:5190884},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-2",start:5190884,end:5190998},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-3",start:5190998,end:5191112},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-4",start:5191112,end:5191226},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-5",start:5191226,end:5191340},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-6",start:5191340,end:5191454},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-7",start:5191454,end:5191568},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-8",start:5191568,end:5191682},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-9",start:5191682,end:5191796},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT0",start:5191796,end:5191907},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/Greenwich",start:5191907,end:5192018},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/UCT",start:5192018,end:5192129},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/UTC",start:5192129,end:5192240},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/Universal",start:5192240,end:5192351},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/Zulu",start:5192351,end:5192462},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Amsterdam",start:5192462,end:5193565},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Andorra",start:5193565,end:5193954},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Astrakhan",start:5193954,end:5194680},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Athens",start:5194680,end:5195362},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Belfast",start:5195362,end:5196961},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Belgrade",start:5196961,end:5197439},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Berlin",start:5197439,end:5198144},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Bratislava",start:5198144,end:5198867},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Brussels",start:5198867,end:5199970},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Bucharest",start:5199970,end:5200631},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Budapest",start:5200631,end:5201397},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Busingen",start:5201397,end:5201894},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Chisinau",start:5201894,end:5202649},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Copenhagen",start:5202649,end:5203354},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Dublin",start:5203354,end:5204850},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Gibraltar",start:5204850,end:5206070},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Guernsey",start:5206070,end:5207669},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Helsinki",start:5207669,end:5208150},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Isle_of_Man",start:5208150,end:5209749},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Istanbul",start:5209749,end:5210949},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Jersey",start:5210949,end:5212548},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Kaliningrad",start:5212548,end:5213452},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Kiev",start:5213452,end:5214010},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Kirov",start:5214010,end:5214745},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Kyiv",start:5214745,end:5215303},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Lisbon",start:5215303,end:5216757},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Ljubljana",start:5216757,end:5217235},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/London",start:5217235,end:5218834},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Luxembourg",start:5218834,end:5219937},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Madrid",start:5219937,end:5220834},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Malta",start:5220834,end:5221762},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Mariehamn",start:5221762,end:5222243},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Minsk",start:5222243,end:5223051},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Monaco",start:5223051,end:5224156},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Moscow",start:5224156,end:5225064},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Nicosia",start:5225064,end:5225661},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Oslo",start:5225661,end:5226366},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Paris",start:5226366,end:5227471},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Podgorica",start:5227471,end:5227949},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Prague",start:5227949,end:5228672},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Riga",start:5228672,end:5229366},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Rome",start:5229366,end:5230313},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Samara",start:5230313,end:5231045},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/San_Marino",start:5231045,end:5231992},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Sarajevo",start:5231992,end:5232470},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Saratov",start:5232470,end:5233196},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Simferopol",start:5233196,end:5234061},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Skopje",start:5234061,end:5234539},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Sofia",start:5234539,end:5235131},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Stockholm",start:5235131,end:5235836},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Tallinn",start:5235836,end:5236511},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Tirane",start:5236511,end:5237115},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Tiraspol",start:5237115,end:5237870},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Ulyanovsk",start:5237870,end:5238630},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Uzhgorod",start:5238630,end:5239188},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Vaduz",start:5239188,end:5239685},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Vatican",start:5239685,end:5240632},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Vienna",start:5240632,end:5241290},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Vilnius",start:5241290,end:5241966},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Volgograd",start:5241966,end:5242719},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Warsaw",start:5242719,end:5243642},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Zagreb",start:5243642,end:5244120},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Zaporozhye",start:5244120,end:5244678},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Zurich",start:5244678,end:5245175},{filename:"/tmp/pglite/share/postgresql/timezone/Factory",start:5245175,end:5245288},{filename:"/tmp/pglite/share/postgresql/timezone/GB",start:5245288,end:5246887},{filename:"/tmp/pglite/share/postgresql/timezone/GB-Eire",start:5246887,end:5248486},{filename:"/tmp/pglite/share/postgresql/timezone/GMT",start:5248486,end:5248597},{filename:"/tmp/pglite/share/postgresql/timezone/GMT+0",start:5248597,end:5248708},{filename:"/tmp/pglite/share/postgresql/timezone/GMT-0",start:5248708,end:5248819},{filename:"/tmp/pglite/share/postgresql/timezone/GMT0",start:5248819,end:5248930},{filename:"/tmp/pglite/share/postgresql/timezone/Greenwich",start:5248930,end:5249041},{filename:"/tmp/pglite/share/postgresql/timezone/HST",start:5249041,end:5249153},{filename:"/tmp/pglite/share/postgresql/timezone/Hongkong",start:5249153,end:5249928},{filename:"/tmp/pglite/share/postgresql/timezone/Iceland",start:5249928,end:5250058},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Antananarivo",start:5250058,end:5250249},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Chagos",start:5250249,end:5250401},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Christmas",start:5250401,end:5250553},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Cocos",start:5250553,end:5250740},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Comoro",start:5250740,end:5250931},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Kerguelen",start:5250931,end:5251083},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Mahe",start:5251083,end:5251216},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Maldives",start:5251216,end:5251368},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Mauritius",start:5251368,end:5251547},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Mayotte",start:5251547,end:5251738},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Reunion",start:5251738,end:5251871},{filename:"/tmp/pglite/share/postgresql/timezone/Iran",start:5251871,end:5252683},{filename:"/tmp/pglite/share/postgresql/timezone/Israel",start:5252683,end:5253757},{filename:"/tmp/pglite/share/postgresql/timezone/Jamaica",start:5253757,end:5254096},{filename:"/tmp/pglite/share/postgresql/timezone/Japan",start:5254096,end:5254309},{filename:"/tmp/pglite/share/postgresql/timezone/Kwajalein",start:5254309,end:5254528},{filename:"/tmp/pglite/share/postgresql/timezone/Libya",start:5254528,end:5254959},{filename:"/tmp/pglite/share/postgresql/timezone/MET",start:5254959,end:5255580},{filename:"/tmp/pglite/share/postgresql/timezone/MST",start:5255580,end:5255691},{filename:"/tmp/pglite/share/postgresql/timezone/MST7MDT",start:5255691,end:5256642},{filename:"/tmp/pglite/share/postgresql/timezone/Mexico/BajaNorte",start:5256642,end:5257667},{filename:"/tmp/pglite/share/postgresql/timezone/Mexico/BajaSur",start:5257667,end:5258385},{filename:"/tmp/pglite/share/postgresql/timezone/Mexico/General",start:5258385,end:5259158},{filename:"/tmp/pglite/share/postgresql/timezone/NZ",start:5259158,end:5260201},{filename:"/tmp/pglite/share/postgresql/timezone/NZ-CHAT",start:5260201,end:5261009},{filename:"/tmp/pglite/share/postgresql/timezone/Navajo",start:5261009,end:5262051},{filename:"/tmp/pglite/share/postgresql/timezone/PRC",start:5262051,end:5262444},{filename:"/tmp/pglite/share/postgresql/timezone/PST8PDT",start:5262444,end:5263395},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Apia",start:5263395,end:5263802},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Auckland",start:5263802,end:5264845},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Bougainville",start:5264845,end:5265046},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Chatham",start:5265046,end:5265854},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Chuuk",start:5265854,end:5266008},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Easter",start:5266008,end:5267182},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Efate",start:5267182,end:5267524},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Enderbury",start:5267524,end:5267696},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Fakaofo",start:5267696,end:5267849},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Fiji",start:5267849,end:5268245},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Funafuti",start:5268245,end:5268379},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Galapagos",start:5268379,end:5268554},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Gambier",start:5268554,end:5268686},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Guadalcanal",start:5268686,end:5268820},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Guam",start:5268820,end:5269170},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Honolulu",start:5269170,end:5269391},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Johnston",start:5269391,end:5269612},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Kanton",start:5269612,end:5269784},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Kiritimati",start:5269784,end:5269958},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Kosrae",start:5269958,end:5270200},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Kwajalein",start:5270200,end:5270419},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Majuro",start:5270419,end:5270553},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Marquesas",start:5270553,end:5270692},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Midway",start:5270692,end:5270838},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Nauru",start:5270838,end:5271021},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Niue",start:5271021,end:5271175},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Norfolk",start:5271175,end:5271422},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Noumea",start:5271422,end:5271620},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Pago_Pago",start:5271620,end:5271766},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Palau",start:5271766,end:5271914},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Pitcairn",start:5271914,end:5272067},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Pohnpei",start:5272067,end:5272201},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Ponape",start:5272201,end:5272335},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Port_Moresby",start:5272335,end:5272489},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Rarotonga",start:5272489,end:5272895},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Saipan",start:5272895,end:5273245},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Samoa",start:5273245,end:5273391},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Tahiti",start:5273391,end:5273524},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Tarawa",start:5273524,end:5273658},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Tongatapu",start:5273658,end:5273895},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Truk",start:5273895,end:5274049},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Wake",start:5274049,end:5274183},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Wallis",start:5274183,end:5274317},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Yap",start:5274317,end:5274471},{filename:"/tmp/pglite/share/postgresql/timezone/Poland",start:5274471,end:5275394},{filename:"/tmp/pglite/share/postgresql/timezone/Portugal",start:5275394,end:5276848},{filename:"/tmp/pglite/share/postgresql/timezone/ROC",start:5276848,end:5277359},{filename:"/tmp/pglite/share/postgresql/timezone/ROK",start:5277359,end:5277774},{filename:"/tmp/pglite/share/postgresql/timezone/Singapore",start:5277774,end:5278030},{filename:"/tmp/pglite/share/postgresql/timezone/Turkey",start:5278030,end:5279230},{filename:"/tmp/pglite/share/postgresql/timezone/UCT",start:5279230,end:5279341},{filename:"/tmp/pglite/share/postgresql/timezone/US/Alaska",start:5279341,end:5280318},{filename:"/tmp/pglite/share/postgresql/timezone/US/Aleutian",start:5280318,end:5281287},{filename:"/tmp/pglite/share/postgresql/timezone/US/Arizona",start:5281287,end:5281527},{filename:"/tmp/pglite/share/postgresql/timezone/US/Central",start:5281527,end:5283281},{filename:"/tmp/pglite/share/postgresql/timezone/US/East-Indiana",start:5283281,end:5283812},{filename:"/tmp/pglite/share/postgresql/timezone/US/Eastern",start:5283812,end:5285556},{filename:"/tmp/pglite/share/postgresql/timezone/US/Hawaii",start:5285556,end:5285777},{filename:"/tmp/pglite/share/postgresql/timezone/US/Indiana-Starke",start:5285777,end:5286793},{filename:"/tmp/pglite/share/postgresql/timezone/US/Michigan",start:5286793,end:5287692},{filename:"/tmp/pglite/share/postgresql/timezone/US/Mountain",start:5287692,end:5288734},{filename:"/tmp/pglite/share/postgresql/timezone/US/Pacific",start:5288734,end:5290028},{filename:"/tmp/pglite/share/postgresql/timezone/US/Samoa",start:5290028,end:5290174},{filename:"/tmp/pglite/share/postgresql/timezone/UTC",start:5290174,end:5290285},{filename:"/tmp/pglite/share/postgresql/timezone/Universal",start:5290285,end:5290396},{filename:"/tmp/pglite/share/postgresql/timezone/W-SU",start:5290396,end:5291304},{filename:"/tmp/pglite/share/postgresql/timezone/WET",start:5291304,end:5291798},{filename:"/tmp/pglite/share/postgresql/timezone/Zulu",start:5291798,end:5291909},{filename:"/tmp/pglite/share/postgresql/timezonesets/Africa.txt",start:5291909,end:5298882},{filename:"/tmp/pglite/share/postgresql/timezonesets/America.txt",start:5298882,end:5309889},{filename:"/tmp/pglite/share/postgresql/timezonesets/Antarctica.txt",start:5309889,end:5311023},{filename:"/tmp/pglite/share/postgresql/timezonesets/Asia.txt",start:5311023,end:5319334},{filename:"/tmp/pglite/share/postgresql/timezonesets/Atlantic.txt",start:5319334,end:5322867},{filename:"/tmp/pglite/share/postgresql/timezonesets/Australia",start:5322867,end:5324002},{filename:"/tmp/pglite/share/postgresql/timezonesets/Australia.txt",start:5324002,end:5327386},{filename:"/tmp/pglite/share/postgresql/timezonesets/Default",start:5327386,end:5354636},{filename:"/tmp/pglite/share/postgresql/timezonesets/Etc.txt",start:5354636,end:5355886},{filename:"/tmp/pglite/share/postgresql/timezonesets/Europe.txt",start:5355886,end:5364668},{filename:"/tmp/pglite/share/postgresql/timezonesets/India",start:5364668,end:5365261},{filename:"/tmp/pglite/share/postgresql/timezonesets/Indian.txt",start:5365261,end:5366522},{filename:"/tmp/pglite/share/postgresql/timezonesets/Pacific.txt",start:5366522,end:5370290},{filename:"/tmp/pglite/share/postgresql/tsearch_data/danish.stop",start:5370290,end:5370714},{filename:"/tmp/pglite/share/postgresql/tsearch_data/dutch.stop",start:5370714,end:5371167},{filename:"/tmp/pglite/share/postgresql/tsearch_data/english.stop",start:5371167,end:5371789},{filename:"/tmp/pglite/share/postgresql/tsearch_data/finnish.stop",start:5371789,end:5373368},{filename:"/tmp/pglite/share/postgresql/tsearch_data/french.stop",start:5373368,end:5374173},{filename:"/tmp/pglite/share/postgresql/tsearch_data/german.stop",start:5374173,end:5375522},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hungarian.stop",start:5375522,end:5376749},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hunspell_sample.affix",start:5376749,end:5376992},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hunspell_sample_long.affix",start:5376992,end:5377625},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hunspell_sample_long.dict",start:5377625,end:5377723},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hunspell_sample_num.affix",start:5377723,end:5378185},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hunspell_sample_num.dict",start:5378185,end:5378314},{filename:"/tmp/pglite/share/postgresql/tsearch_data/ispell_sample.affix",start:5378314,end:5378779},{filename:"/tmp/pglite/share/postgresql/tsearch_data/ispell_sample.dict",start:5378779,end:5378860},{filename:"/tmp/pglite/share/postgresql/tsearch_data/italian.stop",start:5378860,end:5380514},{filename:"/tmp/pglite/share/postgresql/tsearch_data/nepali.stop",start:5380514,end:5384775},{filename:"/tmp/pglite/share/postgresql/tsearch_data/norwegian.stop",start:5384775,end:5385626},{filename:"/tmp/pglite/share/postgresql/tsearch_data/portuguese.stop",start:5385626,end:5386893},{filename:"/tmp/pglite/share/postgresql/tsearch_data/russian.stop",start:5386893,end:5388128},{filename:"/tmp/pglite/share/postgresql/tsearch_data/spanish.stop",start:5388128,end:5390306},{filename:"/tmp/pglite/share/postgresql/tsearch_data/swedish.stop",start:5390306,end:5390865},{filename:"/tmp/pglite/share/postgresql/tsearch_data/synonym_sample.syn",start:5390865,end:5390938},{filename:"/tmp/pglite/share/postgresql/tsearch_data/thesaurus_sample.ths",start:5390938,end:5391411},{filename:"/tmp/pglite/share/postgresql/tsearch_data/turkish.stop",start:5391411,end:5391671},{filename:"/tmp/pglite/share/postgresql/tsearch_data/unaccent.rules",start:5391671,end:5401610},{filename:"/tmp/pglite/share/postgresql/tsearch_data/xsyn_sample.rules",start:5401610,end:5401749}],remote_package_size:5401749})})();var moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=(e,t)=>{throw t},scriptDirectory="";function locateFile(e){return Module.locateFile?Module.locateFile(e,scriptDirectory):scriptDirectory+e}var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs"),nodePath=require("path");import.meta.url.startsWith("data:")||(scriptDirectory=nodePath.dirname(require("url").fileURLToPath(import.meta.url))+"/"),readBinary=e=>{e=isFileURI(e)?new URL(e):e;var t=fs.readFileSync(e);return t},readAsync=async(e,t=!0)=>{e=isFileURI(e)?new URL(e):e;var tr=fs.readFileSync(e,t?void 0:"utf8");return tr},!Module.thisProgram&&process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),quit_=(e,t)=>{throw process.exitCode=e,t}}else(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:typeof document<"u"&&document.currentScript&&(scriptDirectory=document.currentScript.src),_scriptName&&(scriptDirectory=_scriptName),scriptDirectory.startsWith("blob:")?scriptDirectory="":scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1),readAsync=async e=>{var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw new Error(t.status+" : "+t.url)});var out=Module.print||console.log.bind(console),err=Module.printErr||console.error.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram);var dynamicLibraries=Module.dynamicLibraries||[],wasmBinary=Module.wasmBinary,wasmMemory,ABORT=!1,EXITSTATUS;function assert(e,t){e||abort(t)}var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAP64,HEAPF64;function updateMemoryViews(){var e=wasmMemory.buffer;Module.HEAP8=HEAP8=new Int8Array(e),Module.HEAP16=HEAP16=new Int16Array(e),Module.HEAPU8=HEAPU8=new Uint8Array(e),Module.HEAPU16=HEAPU16=new Uint16Array(e),Module.HEAP32=HEAP32=new Int32Array(e),Module.HEAPU32=HEAPU32=new Uint32Array(e),Module.HEAPF32=HEAPF32=new Float32Array(e),Module.HEAPF64=HEAPF64=new Float64Array(e),Module.HEAP64=HEAP64=new BigInt64Array(e),Module.HEAPU64=new BigUint64Array(e)}if(Module.wasmMemory)wasmMemory=Module.wasmMemory;else{var INITIAL_MEMORY=Module.INITIAL_MEMORY||134217728;wasmMemory=new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:32768})}updateMemoryViews();var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATPOSTRUN__=[],__RELOC_FUNCS__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),!Module.noFSInit&&!FS.initialized&&FS.init(),FS.ignorePermissions=!1,SOCKFS.root=FS.mount(SOCKFS,{},null),PIPEFS.root=FS.mount(PIPEFS,{},null),callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}var runDependencies=0,dependenciesFulfilled=null;function addRunDependency(e){var t;runDependencies++,(t=Module.monitorRunDependencies)==null||t.call(Module,runDependencies)}function removeRunDependency(e){var tr;if(runDependencies--,(tr=Module.monitorRunDependencies)==null||tr.call(Module,runDependencies),runDependencies==0&&dependenciesFulfilled){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}}function abort(e){var tr;(tr=Module.onAbort)==null||tr.call(Module,e),e="Aborted("+e+")",err(e),ABORT=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw readyPromiseReject(t),t}var dataURIPrefix="data:application/octet-stream;base64,",isDataURI=e=>e.startsWith(dataURIPrefix),isFileURI=e=>e.startsWith("file://");function findWasmBinary(){if(Module.locateFile){var e="postgres.wasm";return isDataURI(e)?e:locateFile(e)}return new URL(""+new URL("postgres-CyuUVpXN.wasm",import.meta.url).href,import.meta.url).href}var wasmBinaryFile;function getBinarySync(e){if(e==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(e);throw"both async and sync fetching of the wasm failed"}async function getWasmBinary(e){if(!wasmBinary)try{var t=await readAsync(e);return new Uint8Array(t)}catch{}return getBinarySync(e)}async function instantiateArrayBuffer(e,t){try{var tr=await getWasmBinary(e),rr=await WebAssembly.instantiate(tr,t);return rr}catch(ir){err(`failed to asynchronously prepare wasm: ${ir}`),abort(ir)}}async function instantiateAsync(e,t,tr){if(!e&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(t)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function")try{var rr=fetch(t,{credentials:"same-origin"}),ir=await WebAssembly.instantiateStreaming(rr,tr);return ir}catch(lr){err(`wasm streaming compile failed: ${lr}`),err("falling back to ArrayBuffer instantiation")}return instantiateArrayBuffer(t,tr)}function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}async function createWasm(){function e(ir,lr){wasmExports=ir.exports,wasmExports=relocateExports(wasmExports,16777216);var dr=getDylinkMetadata(lr);return dr.neededDynlibs&&(dynamicLibraries=dr.neededDynlibs.concat(dynamicLibraries)),mergeLibSymbols(wasmExports),LDSO.init(),loadDylibs(),addOnInit(wasmExports.__wasm_call_ctors),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),removeRunDependency(),wasmExports}addRunDependency();function t(ir){e(ir.instance,ir.module)}var tr=getWasmImports();if(Module.instantiateWasm)try{return Module.instantiateWasm(tr,e)}catch(ir){err(`Module.instantiateWasm callback failed with error: ${ir}`),readyPromiseReject(ir)}wasmBinaryFile??(wasmBinaryFile=findWasmBinary());try{var rr=await instantiateAsync(wasmBinary,wasmBinaryFile,tr);return t(rr),rr}catch(ir){readyPromiseReject(ir);return}}var ASM_CONSTS={18792944:e=>{Module.is_worker=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,Module.FD_BUFFER_MAX=e,Module.emscripten_copy_to=console.warn},18793117:()=>{Module.postMessage=function(e){console.log("# 1252: onCustomMessage:",__FILE__,e)}},18793242:()=>{if(Module.is_worker){let e=function(t){console.log("onCustomMessage:",t)};Module.onCustomMessage=e}else Module.postMessage=function(e){switch(e.type){case"raw":{stringToUTF8(e.data,shm_rawinput,Module.FD_BUFFER_MAX);break}case"stdin":{stringToUTF8(e.data,1,Module.FD_BUFFER_MAX);break}case"rcon":{stringToUTF8(e.data,shm_rcon,Module.FD_BUFFER_MAX);break}default:console.warn("custom_postMessage?",e)}}}};function is_web_env(){try{if(window)return 1}catch{return 0}}is_web_env.sig="i";class ExitStatus{constructor(t){P$3(this,"name","ExitStatus"),this.message=`Program terminated with exit(${t})`,this.status=t}}var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(e,t){var tr=GOT[t];return tr||(tr=GOT[t]=new WebAssembly.Global({value:"i32",mutable:!0})),currentModuleWeakSymbols.has(t)||(tr.required=!0),tr}},callRuntimeCallbacks=e=>{for(;e.length>0;)e.shift()(Module)},UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder:void 0,UTF8ArrayToString=(e,t=0,tr=NaN)=>{for(var rr=t+tr,ir=t;e[ir]&&!(ir>=rr);)++ir;if(ir-t>16&&e.buffer&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,ir));for(var lr="";t<ir;){var dr=e[t++];if(!(dr&128)){lr+=String.fromCharCode(dr);continue}var fr=e[t++]&63;if((dr&224)==192){lr+=String.fromCharCode((dr&31)<<6|fr);continue}var hr=e[t++]&63;if((dr&240)==224?dr=(dr&15)<<12|fr<<6|hr:dr=(dr&7)<<18|fr<<12|hr<<6|e[t++]&63,dr<65536)lr+=String.fromCharCode(dr);else{var mr=dr-65536;lr+=String.fromCharCode(55296|mr>>10,56320|mr&1023)}}return lr},getDylinkMetadata=e=>{var t=0,tr=0;function rr(){return e[t++]}function ir(){for(var Gr=0,Zn=1;;){var zr=e[t++];if(Gr+=(zr&127)*Zn,Zn*=128,!(zr&128))break}return Gr}function lr(){var Gr=ir();return t+=Gr,UTF8ArrayToString(e,t-Gr,Gr)}function dr(Gr,Zn){if(Gr)throw new Error(Zn)}var fr="dylink.0";if(e instanceof WebAssembly.Module){var hr=WebAssembly.Module.customSections(e,fr);hr.length===0&&(fr="dylink",hr=WebAssembly.Module.customSections(e,fr)),dr(hr.length===0,"need dylink section"),e=new Uint8Array(hr[0]),tr=e.length}else{var mr=new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer),gr=mr[0]==1836278016;dr(!gr,"need to see wasm magic number"),dr(e[8]!==0,"need the dylink section to be first"),t=9;var yr=ir();tr=t+yr,fr=lr()}var _r={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(fr=="dylink"){_r.memorySize=ir(),_r.memoryAlign=ir(),_r.tableSize=ir(),_r.tableAlign=ir();for(var br=ir(),wr=0;wr<br;++wr){var vr=lr();_r.neededDynlibs.push(vr)}}else{dr(fr!=="dylink.0");for(var Sr=1,Ir=2,Mr=3,Ar=4,kr=256,Or=3,Dr=1;t<tr;){var $r=rr(),Fr=ir();if($r===Sr)_r.memorySize=ir(),_r.memoryAlign=ir(),_r.tableSize=ir(),_r.tableAlign=ir();else if($r===Ir)for(var br=ir(),wr=0;wr<br;++wr)vr=lr(),_r.neededDynlibs.push(vr);else if($r===Mr)for(var Lr=ir();Lr--;){var qn=lr(),Kn=ir();Kn&kr&&_r.tlsExports.add(qn)}else if($r===Ar)for(var Lr=ir();Lr--;){lr();var qn=lr(),Kn=ir();(Kn&Or)==Dr&&_r.weakImports.add(qn)}else t+=Fr}}return _r};function getValue(e,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":return HEAP8[e];case"i8":return HEAP8[e];case"i16":return HEAP16[e>>1];case"i32":return HEAP32[e>>2];case"i64":return HEAP64[e>>3];case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];case"*":return HEAPU32[e>>2];default:abort(`invalid type for getValue: ${t}`)}}var newDSO=(e,t,tr)=>{var rr={refcount:1/0,name:e,exports:tr,global:!0};return LDSO.loadedLibsByName[e]=rr,t!=null&&(LDSO.loadedLibsByHandle[t]=rr),rr},LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=23144432,alignMemory=(e,t)=>Math.ceil(e/t)*t,getMemory=e=>{if(runtimeInitialized)return _calloc(e,1);var t=___heap_base,tr=t+alignMemory(e,16);return ___heap_base=tr,GOT.__heap_base.value=tr,t},isInternalSym=e=>["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm","__start_em_js","__stop_em_js"].includes(e)||e.startsWith("__em_js__"),uleb128Encode=(e,t)=>{e<128?t.push(e):t.push(e%128|128,e>>7)},sigToWasmTypes=e=>{for(var t={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},tr={parameters:[],results:e[0]=="v"?[]:[t[e[0]]]},rr=1;rr<e.length;++rr)tr.parameters.push(t[e[rr]]);return tr},generateFuncType=(e,t)=>{var tr=e.slice(0,1),rr=e.slice(1),ir={i:127,p:127,j:126,f:125,d:124,e:111};t.push(96),uleb128Encode(rr.length,t);for(var lr=0;lr<rr.length;++lr)t.push(ir[rr[lr]]);tr=="v"?t.push(0):t.push(1,ir[tr])},convertJsFunctionToWasm=(e,t)=>{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(sigToWasmTypes(t),e);var tr=[1];generateFuncType(t,tr);var rr=[0,97,115,109,1,0,0,0,1];uleb128Encode(tr.length,rr),rr.push(...tr),rr.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var ir=new WebAssembly.Module(new Uint8Array(rr)),lr=new WebAssembly.Instance(ir,{e:{f:e}}),dr=lr.exports.f;return dr},wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:5360,element:"anyfunc"}),getWasmTableEntry=e=>{var t=wasmTableMirror[e];return t||(e>=wasmTableMirror.length&&(wasmTableMirror.length=e+1),wasmTableMirror[e]=t=wasmTable.get(e)),t},updateTableMap=(e,t)=>{if(functionsInTableMap)for(var tr=e;tr<e+t;tr++){var rr=getWasmTableEntry(tr);rr&&functionsInTableMap.set(rr,tr)}},functionsInTableMap,getFunctionAddress=e=>(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.get(e)||0),freeTableIndexes=[],getEmptyTableSlot=()=>{if(freeTableIndexes.length)return freeTableIndexes.pop();try{wasmTable.grow(1)}catch(e){throw e instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":e}return wasmTable.length-1},setWasmTableEntry=(e,t)=>{wasmTable.set(e,t),wasmTableMirror[e]=wasmTable.get(e)},addFunction=(e,t)=>{var tr=getFunctionAddress(e);if(tr)return tr;var rr=getEmptyTableSlot();try{setWasmTableEntry(rr,e)}catch(lr){if(!(lr instanceof TypeError))throw lr;var ir=convertJsFunctionToWasm(e,t);setWasmTableEntry(rr,ir)}return functionsInTableMap.set(e,rr),rr},updateGOT=(e,t)=>{for(var tr in e)if(!isInternalSym(tr)){var rr=e[tr];GOT[tr]||(GOT[tr]=new WebAssembly.Global({value:"i32",mutable:!0})),GOT[tr].value==0&&(typeof rr=="function"?GOT[tr].value=addFunction(rr):typeof rr=="number"?GOT[tr].value=rr:err(`unhandled export type for '${tr}': ${typeof rr}`))}},relocateExports=(e,t,tr)=>{var rr={};for(var ir in e){var lr=e[ir];typeof lr=="object"&&(lr=lr.value),typeof lr=="number"&&(lr+=t),rr[ir]=lr}return updateGOT(rr),rr},isSymbolDefined=e=>{var t=wasmImports[e];return!(!t||t.stub)},dynCall=(e,t,tr=[])=>{var rr=getWasmTableEntry(t)(...tr);return rr},stackSave=()=>_emscripten_stack_get_current(),stackRestore=e=>__emscripten_stack_restore(e),createInvokeFunction=e=>(t,...tr)=>{var rr=stackSave();try{return dynCall(e,t,tr)}catch(ir){if(stackRestore(rr),ir!==ir+0)throw ir;if(_setThrew(1,0),e[0]=="j")return 0n}},resolveGlobalSymbol=(e,t=!1)=>{var tr;return isSymbolDefined(e)?tr=wasmImports[e]:e.startsWith("invoke_")&&(tr=wasmImports[e]=createInvokeFunction(e.split("_")[1])),{sym:tr,name:e}},UTF8ToString=(e,t)=>e?UTF8ArrayToString(HEAPU8,e,t):"",loadWebAssemblyModule=(binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);currentModuleWeakSymbols=metadata.weakImports;function loadModule(){var firstLoad=!handle||!HEAP8[handle+8];if(firstLoad){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;handle&&(HEAP8[handle+8]=1,HEAPU32[handle+12>>2]=memoryBase,HEAP32[handle+16>>2]=metadata.memorySize,HEAPU32[handle+20>>2]=tableBase,HEAP32[handle+24>>2]=metadata.tableSize)}else memoryBase=HEAPU32[handle+12>>2],tableBase=HEAPU32[handle+20>>2];var tableGrowthNeeded=tableBase+metadata.tableSize-wasmTable.length;tableGrowthNeeded>0&&wasmTable.grow(tableGrowthNeeded);var moduleExports;function resolveSymbol(e){var t=resolveGlobalSymbol(e).sym;return!t&&localScope&&(t=localScope[e]),t||(t=moduleExports[e]),t}var proxyHandler={get(e,t){switch(t){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(t in wasmImports&&!wasmImports[t].stub)return wasmImports[t];if(!(t in e)){var tr;e[t]=(...rr)=>(tr||(tr=resolveSymbol(t)),tr(...rr))}return e[t]}},proxy=new Proxy({},proxyHandler),info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols();function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if("__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;start<stop;){var jsString=UTF8ToString(start);addEmAsm(start,jsString),start=HEAPU8.indexOf(0,start)+1}function addEmJs(name,cSig,body){var jsArgs=[];if(cSig=cSig.slice(1,-1),cSig!="void"){cSig=cSig.split(",");for(var i in cSig){var jsArg=cSig[i].split(" ").pop();jsArgs.push(jsArg.replaceAll("*",""))}}var func=`(${jsArgs}) => ${body};`;moduleExports[name]=eval(func)}for(var name in moduleExports)if(name.startsWith("__em_js__")){var start=moduleExports[name],jsString=UTF8ToString(start),parts=jsString.split("<::>");addEmJs(name.replace("__em_js__",""),parts[0],parts[1]),delete moduleExports[name]}var applyRelocs=moduleExports.__wasm_apply_data_relocs;applyRelocs&&(runtimeInitialized?applyRelocs():__RELOC_FUNCS__.push(applyRelocs));var init=moduleExports.__wasm_call_ctors;return init&&(runtimeInitialized?init():__ATINIT__.push(init)),moduleExports}if(flags.loadAsync){if(binary instanceof WebAssembly.Module){var instance=new WebAssembly.Instance(binary,info);return Promise.resolve(postInstantiation(binary,instance))}return WebAssembly.instantiate(binary,info).then(e=>postInstantiation(e.module,e.instance))}var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}return flags.loadAsync?metadata.neededDynlibs.reduce((e,t)=>e.then(()=>loadDynamicLibrary(t,flags,localScope)),Promise.resolve()).then(loadModule):(metadata.neededDynlibs.forEach(e=>loadDynamicLibrary(e,flags,localScope)),loadModule())},mergeLibSymbols=(e,t)=>{for(var[tr,rr]of Object.entries(e)){let ir=dr=>{isSymbolDefined(dr)||(wasmImports[dr]=rr)};ir(tr);let lr="__main_argc_argv";tr=="main"&&ir(lr),tr==lr&&ir("main")}},asyncLoad=async e=>{var t=await readAsync(e);return new Uint8Array(t)},preloadPlugins=Module.preloadPlugins||[],registerWasmPlugin=()=>{var e={promiseChainEnd:Promise.resolve(),canHandle:t=>!Module.noWasmDecoding&&t.endsWith(".so"),handle:(t,tr,rr,ir)=>{e.promiseChainEnd=e.promiseChainEnd.then(()=>loadWebAssemblyModule(t,{loadAsync:!0,nodelete:!0},tr,{})).then(lr=>{preloadedWasm[tr]=lr,rr(t)},lr=>{err(`failed to instantiate wasm: ${tr}: ${lr}`),ir()})}};preloadPlugins.push(e)},preloadedWasm={};function loadDynamicLibrary(e,t={global:!0,nodelete:!0},tr,rr){var ir=LDSO.loadedLibsByName[e];if(ir)return t.global?ir.global||(ir.global=!0,mergeLibSymbols(ir.exports)):tr&&Object.assign(tr,ir.exports),t.nodelete&&ir.refcount!==1/0&&(ir.refcount=1/0),ir.refcount++,rr&&(LDSO.loadedLibsByHandle[rr]=ir),t.loadAsync?Promise.resolve(!0):!0;ir=newDSO(e,rr,"loading"),ir.refcount=t.nodelete?1/0:1,ir.global=t.global;function lr(){if(rr){var hr=HEAPU32[rr+28>>2],mr=HEAPU32[rr+32>>2];if(hr&&mr){var gr=HEAP8.slice(hr,hr+mr);return t.loadAsync?Promise.resolve(gr):gr}}var yr=locateFile(e);if(t.loadAsync)return asyncLoad(yr);if(!readBinary)throw new Error(`${yr}: file not found, and synchronous loading of external files is not available`);return readBinary(yr)}function dr(){var hr=preloadedWasm[e];return hr?t.loadAsync?Promise.resolve(hr):hr:t.loadAsync?lr().then(mr=>loadWebAssemblyModule(mr,t,e,tr,rr)):loadWebAssemblyModule(lr(),t,e,tr,rr)}function fr(hr){ir.global?mergeLibSymbols(hr):tr&&Object.assign(tr,hr),ir.exports=hr}return t.loadAsync?dr().then(hr=>(fr(hr),!0)):(fr(dr()),!0)}var reportUndefinedSymbols=()=>{for(var[e,t]of Object.entries(GOT))if(t.value==0){var tr=resolveGlobalSymbol(e,!0).sym;if(!tr&&!t.required)continue;if(typeof tr=="function")t.value=addFunction(tr,tr.sig);else if(typeof tr=="number")t.value=tr;else throw new Error(`bad export type for '${e}': ${typeof tr}`)}},loadDylibs=()=>{if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency(),dynamicLibraries.reduce((e,t)=>e.then(()=>loadDynamicLibrary(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})),Promise.resolve()).then(()=>{reportUndefinedSymbols(),removeRunDependency()})},noExitRuntime=Module.noExitRuntime||!0;function setValue(e,t,tr="i8"){switch(tr.endsWith("*")&&(tr="*"),tr){case"i1":HEAP8[e]=t;break;case"i8":HEAP8[e]=t;break;case"i16":HEAP16[e>>1]=t;break;case"i32":HEAP32[e>>2]=t;break;case"i64":HEAP64[e>>3]=BigInt(t);break;case"float":HEAPF32[e>>2]=t;break;case"double":HEAPF64[e>>3]=t;break;case"*":HEAPU32[e>>2]=t;break;default:abort(`invalid type for setValue: ${tr}`)}}var ___assert_fail=(e,t,tr,rr)=>abort(`Assertion failed: ${UTF8ToString(e)}, at: `+[t?UTF8ToString(t):"unknown filename",tr,rr?UTF8ToString(rr):"unknown function"]);___assert_fail.sig="vppip";var ___call_sighandler=(e,t)=>getWasmTableEntry(e)(t);___call_sighandler.sig="vpi";var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},16777216),___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},23144432),PATH={isAbs:e=>e.charAt(0)==="/",splitPath:e=>{var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return t.exec(e).slice(1)},normalizeArray:(e,t)=>{for(var tr=0,rr=e.length-1;rr>=0;rr--){var ir=e[rr];ir==="."?e.splice(rr,1):ir===".."?(e.splice(rr,1),tr++):tr&&(e.splice(rr,1),tr--)}if(t)for(;tr;tr--)e.unshift("..");return e},normalize:e=>{var t=PATH.isAbs(e),tr=e.substr(-1)==="/";return e=PATH.normalizeArray(e.split("/").filter(rr=>!!rr),!t).join("/"),!e&&!t&&(e="."),e&&tr&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=PATH.splitPath(e),tr=t[0],rr=t[1];return!tr&&!rr?".":(rr&&(rr=rr.substr(0,rr.length-1)),tr+rr)},basename:e=>{if(e==="/")return"/";e=PATH.normalize(e),e=e.replace(/\/$/,"");var t=e.lastIndexOf("/");return t===-1?e:e.substr(t+1)},join:(...e)=>PATH.normalize(e.join("/")),join2:(e,t)=>PATH.normalize(e+"/"+t)},initRandomFill=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return rr=>crypto.getRandomValues(rr);if(ENVIRONMENT_IS_NODE)try{var e=require("crypto"),t=e.randomFillSync;if(t)return rr=>e.randomFillSync(rr);var tr=e.randomBytes;return rr=>(rr.set(tr(rr.byteLength)),rr)}catch{}abort("initRandomDevice")},randomFill=e=>(randomFill=initRandomFill())(e),PATH_FS={resolve:(...e)=>{for(var t="",tr=!1,rr=e.length-1;rr>=-1&&!tr;rr--){var ir=rr>=0?e[rr]:FS.cwd();if(typeof ir!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!ir)return"";t=ir+"/"+t,tr=PATH.isAbs(ir)}return t=PATH.normalizeArray(t.split("/").filter(lr=>!!lr),!tr).join("/"),(tr?"/":"")+t||"."},relative:(e,t)=>{e=PATH_FS.resolve(e).substr(1),t=PATH_FS.resolve(t).substr(1);function tr(mr){for(var gr=0;gr<mr.length&&mr[gr]==="";gr++);for(var yr=mr.length-1;yr>=0&&mr[yr]==="";yr--);return gr>yr?[]:mr.slice(gr,yr-gr+1)}for(var rr=tr(e.split("/")),ir=tr(t.split("/")),lr=Math.min(rr.length,ir.length),dr=lr,fr=0;fr<lr;fr++)if(rr[fr]!==ir[fr]){dr=fr;break}for(var hr=[],fr=dr;fr<rr.length;fr++)hr.push("..");return hr=hr.concat(ir.slice(dr)),hr.join("/")}},FS_stdin_getChar_buffer=[],lengthBytesUTF8=e=>{for(var t=0,tr=0;tr<e.length;++tr){var rr=e.charCodeAt(tr);rr<=127?t++:rr<=2047?t+=2:rr>=55296&&rr<=57343?(t+=4,++tr):t+=3}return t},stringToUTF8Array=(e,t,tr,rr)=>{if(!(rr>0))return 0;for(var ir=tr,lr=tr+rr-1,dr=0;dr<e.length;++dr){var fr=e.charCodeAt(dr);if(fr>=55296&&fr<=57343){var hr=e.charCodeAt(++dr);fr=65536+((fr&1023)<<10)|hr&1023}if(fr<=127){if(tr>=lr)break;t[tr++]=fr}else if(fr<=2047){if(tr+1>=lr)break;t[tr++]=192|fr>>6,t[tr++]=128|fr&63}else if(fr<=65535){if(tr+2>=lr)break;t[tr++]=224|fr>>12,t[tr++]=128|fr>>6&63,t[tr++]=128|fr&63}else{if(tr+3>=lr)break;t[tr++]=240|fr>>18,t[tr++]=128|fr>>12&63,t[tr++]=128|fr>>6&63,t[tr++]=128|fr&63}}return t[tr]=0,tr-ir};function intArrayFromString(e,t,tr){var rr=lengthBytesUTF8(e)+1,ir=new Array(rr),lr=stringToUTF8Array(e,ir,0,ir.length);return ir.length=lr,ir}var FS_stdin_getChar=()=>{if(!FS_stdin_getChar_buffer.length){var e=null;if(ENVIRONMENT_IS_NODE){var t=256,tr=Buffer.alloc(t),rr=0,ir=process.stdin.fd;try{rr=fs.readSync(ir,tr,0,t)}catch(lr){if(lr.toString().includes("EOF"))rr=0;else throw lr}rr>0&&(e=tr.slice(0,rr).toString("utf-8"))}else typeof window<"u"&&typeof window.prompt=="function"&&(e=window.prompt("Input: "),e!==null&&(e+=`
|
|
485
|
+
`);for(let rr of tr.rows)this.serializers[rr.typarray]=ir=>Ke$1(ir,this.serializers[rr.oid],rr.typarray),this.parsers[rr.typarray]=ir=>yn(ir,this.parsers[rr.oid],rr.typarray)}async refreshArrayTypes(){await this._initArrayTypes({force:!0})}async query(t,tr,rr){return await this._checkReady(),await this._runExclusiveTransaction(async()=>await T$2(this,r,g$2).call(this,t,tr,rr))}async sql(t,...tr){let{query:rr,params:ir}=g$3(t,...tr);return await this.query(rr,ir)}async exec(t,tr){return await this._checkReady(),await this._runExclusiveTransaction(async()=>await T$2(this,r,h$1).call(this,t,tr))}async describeQuery(t,tr){try{await T$2(this,r,l).call(this,O$3.parse({text:t,types:tr==null?void 0:tr.paramTypes}),tr);let rr=await T$2(this,r,l).call(this,O$3.describe({type:"S"}),tr),ir=rr.messages.find(hr=>hr.name==="parameterDescription"),lr=rr.messages.find(hr=>hr.name==="rowDescription"),dr=(ir==null?void 0:ir.dataTypeIDs.map(hr=>({dataTypeID:hr,serializer:this.serializers[hr]})))??[],fr=(lr==null?void 0:lr.fields.map(hr=>({name:hr.name,dataTypeID:hr.dataTypeID,parser:this.parsers[hr.dataTypeID]})))??[];return{queryParams:dr,resultFields:fr}}finally{await T$2(this,r,l).call(this,O$3.sync(),tr)}}async transaction(t){return await this._checkReady(),await this._runExclusiveTransaction(async()=>{await T$2(this,r,h$1).call(this,"BEGIN"),x$4(this,u$1,!0);let tr=!1,rr=()=>{if(tr)throw new Error("Transaction is closed")},ir={query:async(lr,dr,fr)=>(rr(),await T$2(this,r,g$2).call(this,lr,dr,fr)),sql:async(lr,...dr)=>{let{query:fr,params:hr}=g$3(lr,...dr);return await T$2(this,r,g$2).call(this,fr,hr)},exec:async(lr,dr)=>(rr(),await T$2(this,r,h$1).call(this,lr,dr)),rollback:async()=>{rr(),await T$2(this,r,h$1).call(this,"ROLLBACK"),tr=!0},get closed(){return tr}};try{let lr=await t(ir);return tr||(tr=!0,await T$2(this,r,h$1).call(this,"COMMIT")),x$4(this,u$1,!1),lr}catch(lr){throw tr||await T$2(this,r,h$1).call(this,"ROLLBACK"),x$4(this,u$1,!1),lr}})}async runExclusive(t){return await this._runExclusiveQuery(t)}};b$2=new WeakMap,u$1=new WeakMap,r=new WeakSet,l=async function(e,t={}){return await this.execProtocol(e,{...t,syncToFs:!1})},g$2=async function(e,t=[],tr){return await this._runExclusiveQuery(async()=>{T$2(this,r,R$1).call(this,"runQuery",e,t,tr),await this._handleBlob(tr==null?void 0:tr.blob);let rr;try{let{messages:lr}=await T$2(this,r,l).call(this,O$3.parse({text:e,types:tr==null?void 0:tr.paramTypes}),tr),dr=De((await T$2(this,r,l).call(this,O$3.describe({type:"S"}),tr)).messages),fr=t.map((hr,mr)=>{var _r;let gr=dr[mr];if(hr==null)return null;let yr=((_r=tr==null?void 0:tr.serializers)==null?void 0:_r[gr])??this.serializers[gr];return yr?yr(hr):hr.toString()});rr=[...lr,...(await T$2(this,r,l).call(this,O$3.bind({values:fr}),tr)).messages,...(await T$2(this,r,l).call(this,O$3.describe({type:"P"}),tr)).messages,...(await T$2(this,r,l).call(this,O$3.execute({}),tr)).messages]}finally{await T$2(this,r,l).call(this,O$3.sync(),tr)}await this._cleanupBlob(),h$2(this,u$1)||await this.syncToFs();let ir=await this._getWrittenBlob();return bn(rr,this.parsers,tr,ir)[0]})},h$1=async function(e,t){return await this._runExclusiveQuery(async()=>{T$2(this,r,R$1).call(this,"runExec",e,t),await this._handleBlob(t==null?void 0:t.blob);let tr;try{tr=(await T$2(this,r,l).call(this,O$3.query(e),t)).messages}finally{await T$2(this,r,l).call(this,O$3.sync(),t)}this._cleanupBlob(),h$2(this,u$1)||await this.syncToFs();let rr=await this._getWrittenBlob();return bn(tr,this.parsers,t,rr)})},R$1=function(...e){this.debug>0&&console.log(...e)};u$2();var W$1,C$2,_$1,M$2,B$1,m$1,L$2,x$2,k$2,T$1,A$1,O$2,E$1,v$1,G$1,P$1,b$1,I$1,$$2,c$1,K$1,D$2,w$2,J$1,F$1=class ku extends z$1{constructor(t,tr){super(),R$3(this,c$1),R$3(this,W$1),R$3(this,C$2,0),R$3(this,_$1,!1),R$3(this,M$2,!1),R$3(this,B$1,!1),R$3(this,m$1,new EventTarget),R$3(this,L$2),R$3(this,x$2,!1),R$3(this,k$2),R$3(this,T$1),R$3(this,A$1),R$3(this,O$2),R$3(this,E$1),R$3(this,v$1),R$3(this,G$1),R$3(this,P$1,new Map),R$3(this,b$1,new Set),R$3(this,I$1),R$3(this,$$2,[]),x$4(this,k$2,t),x$4(this,L$2,Cr()),x$4(this,I$1,(tr==null?void 0:tr.extensions)??{}),x$4(this,A$1,new Promise(rr=>{h$2(this,k$2).addEventListener("message",ir=>{if(ir.data.type==="here")rr();else throw new Error("Invalid message")},{once:!0})})),x$4(this,O$2,new Promise(rr=>{let ir=lr=>{lr.data.type==="ready"&&(x$4(this,T$1,lr.data.id),h$2(this,k$2).removeEventListener("message",ir),rr())};h$2(this,k$2).addEventListener("message",ir)})),x$4(this,W$1,T$2(this,c$1,K$1).call(this,tr))}static async create(t,tr){let rr=new ku(t,tr);return await h$2(rr,W$1),rr}get waitReady(){return new Promise(t=>{h$2(this,W$1).then(()=>{h$2(this,x$2)?t():t(new Promise(tr=>{h$2(this,m$1).addEventListener("connected",()=>{tr()})}))})})}get debug(){return h$2(this,C$2)}get ready(){return h$2(this,_$1)}get closed(){return h$2(this,M$2)}get isLeader(){return h$2(this,B$1)}async close(){var tr,rr;var t;h$2(this,M$2)||(x$4(this,M$2,!0),(tr=h$2(this,E$1))==null||tr.close(),(rr=h$2(this,v$1))==null||rr.close(),(t=h$2(this,G$1))==null||t.call(this),h$2(this,k$2).terminate())}async[Symbol.asyncDispose](){await this.close()}async execProtocolRaw(t){return await T$2(this,c$1,w$2).call(this,"execProtocolRaw",t)}async execProtocol(t){return await T$2(this,c$1,w$2).call(this,"execProtocol",t)}async syncToFs(){await T$2(this,c$1,w$2).call(this,"syncToFs")}async listen(t,tr){let rr=Nr(t);return h$2(this,P$1).has(rr)||h$2(this,P$1).set(rr,new Set),h$2(this,P$1).get(rr).add(tr),await this.exec(`LISTEN ${t}`),async()=>{await this.unlisten(rr,tr)}}async unlisten(t,tr){var rr,ir;await this.waitReady,tr?(rr=h$2(this,P$1).get(t))==null||rr.delete(tr):h$2(this,P$1).delete(t),((ir=h$2(this,P$1).get(t))==null?void 0:ir.size)===0&&await this.exec(`UNLISTEN ${t}`)}onNotification(t){return h$2(this,b$1).add(t),()=>{h$2(this,b$1).delete(t)}}offNotification(t){h$2(this,b$1).delete(t)}async dumpDataDir(){return await T$2(this,c$1,w$2).call(this,"dumpDataDir")}onLeaderChange(t){return h$2(this,m$1).addEventListener("leader-change",t),()=>{h$2(this,m$1).removeEventListener("leader-change",t)}}offLeaderChange(t){h$2(this,m$1).removeEventListener("leader-change",t)}async _handleBlob(t){await T$2(this,c$1,w$2).call(this,"_handleBlob",t)}async _getWrittenBlob(){return await T$2(this,c$1,w$2).call(this,"_getWrittenBlob")}async _cleanupBlob(){await T$2(this,c$1,w$2).call(this,"_cleanupBlob")}async _checkReady(){await this.waitReady}async _runExclusiveQuery(t){await T$2(this,c$1,w$2).call(this,"_acquireQueryLock");try{return await t()}finally{await T$2(this,c$1,w$2).call(this,"_releaseQueryLock")}}async _runExclusiveTransaction(t){await T$2(this,c$1,w$2).call(this,"_acquireTransactionLock");try{return await t()}finally{await T$2(this,c$1,w$2).call(this,"_releaseTransactionLock")}}};W$1=new WeakMap,C$2=new WeakMap,_$1=new WeakMap,M$2=new WeakMap,B$1=new WeakMap,m$1=new WeakMap,L$2=new WeakMap,x$2=new WeakMap,k$2=new WeakMap,T$1=new WeakMap,A$1=new WeakMap,O$2=new WeakMap,E$1=new WeakMap,v$1=new WeakMap,G$1=new WeakMap,P$1=new WeakMap,b$1=new WeakMap,I$1=new WeakMap,$$2=new WeakMap,c$1=new WeakSet,K$1=async function(e={}){for(let[dr,fr]of Object.entries(h$2(this,I$1))){if(fr instanceof URL)throw new Error("URL extensions are not supported on the client side of a worker");{let hr=await fr.setup(this,{},!0);if(hr.emscriptenOpts&&console.warn(`PGlite extension ${dr} returned emscriptenOpts, these are not supported on the client side of a worker`),hr.namespaceObj){let mr=this;mr[dr]=hr.namespaceObj}hr.bundlePath&&console.warn(`PGlite extension ${dr} returned bundlePath, this is not supported on the client side of a worker`),hr.init&&await hr.init(),hr.close&&h$2(this,$$2).push(hr.close)}}await h$2(this,A$1);let{extensions:t,...tr}=e;h$2(this,k$2).postMessage({type:"init",options:tr}),await h$2(this,O$2);let rr=`pglite-tab-close:${h$2(this,L$2)}`;x$4(this,G$1,await q$2(rr));let ir=`pglite-broadcast:${h$2(this,T$1)}`;x$4(this,E$1,new BroadcastChannel(ir));let lr=`pglite-tab:${h$2(this,L$2)}`;x$4(this,v$1,new BroadcastChannel(lr)),h$2(this,E$1).addEventListener("message",async dr=>{dr.data.type==="leader-here"?(x$4(this,x$2,!1),h$2(this,m$1).dispatchEvent(new Event("leader-change")),T$2(this,c$1,D$2).call(this)):dr.data.type==="notify"&&T$2(this,c$1,J$1).call(this,dr.data.channel,dr.data.payload)}),h$2(this,v$1).addEventListener("message",async dr=>{dr.data.type==="connected"&&(x$4(this,x$2,!0),h$2(this,m$1).dispatchEvent(new Event("connected")),x$4(this,C$2,await T$2(this,c$1,w$2).call(this,"getDebugLevel")),x$4(this,_$1,!0))}),h$2(this,k$2).addEventListener("message",async dr=>{dr.data.type==="leader-now"&&(x$4(this,B$1,!0),h$2(this,m$1).dispatchEvent(new Event("leader-change")))}),T$2(this,c$1,D$2).call(this),this._initArrayTypes()},D$2=async function(){h$2(this,x$2)||(h$2(this,E$1).postMessage({type:"tab-here",id:h$2(this,L$2)}),setTimeout(()=>T$2(this,c$1,D$2).call(this),16))},w$2=async function(e,...t){let tr=Cr(),rr={type:"rpc-call",callId:tr,method:e,args:t};return h$2(this,v$1).postMessage(rr),await new Promise((ir,lr)=>{let dr=mr=>{if(mr.data.callId!==tr)return;hr();let gr=mr.data;if(gr.type==="rpc-return")ir(gr.result);else if(gr.type==="rpc-error"){let yr=new Error(gr.error.message);Object.assign(yr,gr.error),lr(yr)}else lr(new Error("Invalid message"))},fr=()=>{hr(),lr(new U$1)},hr=()=>{h$2(this,v$1).removeEventListener("message",dr),h$2(this,m$1).removeEventListener("leader-change",fr)};h$2(this,m$1).addEventListener("leader-change",fr),h$2(this,v$1).addEventListener("message",dr)})},J$1=function(e,t){let tr=h$2(this,P$1).get(e);if(tr)for(let rr of tr)queueMicrotask(()=>rr(t));for(let rr of h$2(this,b$1))queueMicrotask(()=>rr(e,t))};var H$3=F$1,U$1=class extends Error{constructor(){super("Leader changed, pending operation in indeterminate state")}};async function q$2(e){let t;return await new Promise(tr=>{navigator.locks.request(e,()=>new Promise(rr=>{t=rr,tr()}))}),t}var w$1=D$4((e,t)=>{u$2();var tr=9007199254740991,rr=function(Ir){return Ir}();function ir(Ir){return Ir===rr}function lr(Ir){return typeof Ir=="string"||Object.prototype.toString.call(Ir)=="[object String]"}function dr(Ir){return Object.prototype.toString.call(Ir)=="[object Date]"}function fr(Ir){return Ir!==null&&typeof Ir=="object"}function hr(Ir){return typeof Ir=="function"}function mr(Ir){return typeof Ir=="number"&&Ir>-1&&Ir%1==0&&Ir<=tr}function gr(Ir){return Object.prototype.toString.call(Ir)=="[object Array]"}function yr(Ir){return fr(Ir)&&!hr(Ir)&&mr(Ir.length)}function _r(Ir){return Object.prototype.toString.call(Ir)=="[object ArrayBuffer]"}function br(Ir,Mr){return Array.prototype.map.call(Ir,Mr)}function wr(Ir,Mr){var Ar=rr;return hr(Mr)&&Array.prototype.every.call(Ir,function(kr,Or,Dr){var $r=Mr(kr,Or,Dr);return $r&&(Ar=kr),!$r}),Ar}function vr(Ir){return Object.assign.apply(null,arguments)}function Sr(Ir){var Mr,Ar,kr;if(lr(Ir)){for(Ar=Ir.length,kr=new Uint8Array(Ar),Mr=0;Mr<Ar;Mr++)kr[Mr]=Ir.charCodeAt(Mr)&255;return kr}return _r(Ir)?new Uint8Array(Ir):fr(Ir)&&_r(Ir.buffer)?new Uint8Array(Ir.buffer):yr(Ir)?new Uint8Array(Ir):fr(Ir)&&hr(Ir.toString)?Sr(Ir.toString()):new Uint8Array}t.exports.MAX_SAFE_INTEGER=tr,t.exports.isUndefined=ir,t.exports.isString=lr,t.exports.isObject=fr,t.exports.isDateTime=dr,t.exports.isFunction=hr,t.exports.isArray=gr,t.exports.isArrayLike=yr,t.exports.isArrayBuffer=_r,t.exports.map=br,t.exports.find=wr,t.exports.extend=vr,t.exports.toUint8Array=Sr}),x$1=D$4((e,t)=>{u$2();var tr="\0";t.exports={NULL_CHAR:tr,TMAGIC:"ustar"+tr+"00",OLDGNU_MAGIC:"ustar "+tr,REGTYPE:0,LNKTYPE:1,SYMTYPE:2,CHRTYPE:3,BLKTYPE:4,DIRTYPE:5,FIFOTYPE:6,CONTTYPE:7,TSUID:parseInt("4000",8),TSGID:parseInt("2000",8),TSVTX:parseInt("1000",8),TUREAD:parseInt("0400",8),TUWRITE:parseInt("0200",8),TUEXEC:parseInt("0100",8),TGREAD:parseInt("0040",8),TGWRITE:parseInt("0020",8),TGEXEC:parseInt("0010",8),TOREAD:parseInt("0004",8),TOWRITE:parseInt("0002",8),TOEXEC:parseInt("0001",8),TPERMALL:parseInt("0777",8),TPERMMASK:parseInt("0777",8)}}),L$1=D$4((e,t)=>{u$2();var tr=w$1(),rr=x$1(),ir=512,lr=rr.TPERMALL,dr=0,fr=0,hr=[["name",100,0,function(Mr,Ar){return yr(Mr[Ar[0]],Ar[1])},function(Mr,Ar,kr){return wr(Mr.slice(Ar,Ar+kr[1]))}],["mode",8,100,function(Mr,Ar){var kr=Mr[Ar[0]]||lr;return kr=kr&rr.TPERMMASK,_r(kr,Ar[1],lr)},function(Mr,Ar,kr){var Or=vr(Mr.slice(Ar,Ar+kr[1]));return Or&=rr.TPERMMASK,Or}],["uid",8,108,function(Mr,Ar){return _r(Mr[Ar[0]],Ar[1],dr)},function(Mr,Ar,kr){return vr(Mr.slice(Ar,Ar+kr[1]))}],["gid",8,116,function(Mr,Ar){return _r(Mr[Ar[0]],Ar[1],fr)},function(Mr,Ar,kr){return vr(Mr.slice(Ar,Ar+kr[1]))}],["size",12,124,function(Mr,Ar){return _r(Mr.data.length,Ar[1])},function(Mr,Ar,kr){return vr(Mr.slice(Ar,Ar+kr[1]))}],["modifyTime",12,136,function(Mr,Ar){return br(Mr[Ar[0]],Ar[1])},function(Mr,Ar,kr){return Sr(Mr.slice(Ar,Ar+kr[1]))}],["checksum",8,148,function(Mr,Ar){return" "},function(Mr,Ar,kr){return vr(Mr.slice(Ar,Ar+kr[1]))}],["type",1,156,function(Mr,Ar){return""+(parseInt(Mr[Ar[0]],10)||0)%8},function(Mr,Ar,kr){return(parseInt(String.fromCharCode(Mr[Ar]),10)||0)%8}],["linkName",100,157,function(Mr,Ar){return""},function(Mr,Ar,kr){return wr(Mr.slice(Ar,Ar+kr[1]))}],["ustar",8,257,function(Mr,Ar){return rr.TMAGIC},function(Mr,Ar,kr){return gr(wr(Mr.slice(Ar,Ar+kr[1]),!0))},function(Mr,Ar){return Mr[Ar[0]]==rr.TMAGIC||Mr[Ar[0]]==rr.OLDGNU_MAGIC}],["owner",32,265,function(Mr,Ar){return yr(Mr[Ar[0]],Ar[1])},function(Mr,Ar,kr){return wr(Mr.slice(Ar,Ar+kr[1]))}],["group",32,297,function(Mr,Ar){return yr(Mr[Ar[0]],Ar[1])},function(Mr,Ar,kr){return wr(Mr.slice(Ar,Ar+kr[1]))}],["majorNumber",8,329,function(Mr,Ar){return""},function(Mr,Ar,kr){return vr(Mr.slice(Ar,Ar+kr[1]))}],["minorNumber",8,337,function(Mr,Ar){return""},function(Mr,Ar,kr){return vr(Mr.slice(Ar,Ar+kr[1]))}],["prefix",131,345,function(Mr,Ar){return yr(Mr[Ar[0]],Ar[1])},function(Mr,Ar,kr){return wr(Mr.slice(Ar,Ar+kr[1]))}],["accessTime",12,476,function(Mr,Ar){return br(Mr[Ar[0]],Ar[1])},function(Mr,Ar,kr){return Sr(Mr.slice(Ar,Ar+kr[1]))}],["createTime",12,488,function(Mr,Ar){return br(Mr[Ar[0]],Ar[1])},function(Mr,Ar,kr){return Sr(Mr.slice(Ar,Ar+kr[1]))}]],mr=function(Mr){var Ar=Mr[Mr.length-1];return Ar[2]+Ar[1]}(hr);function gr(Mr){if(Mr.length==8){var Ar=Mr.split("");if(Ar[5]==rr.NULL_CHAR)return(Ar[6]==" "||Ar[6]==rr.NULL_CHAR)&&(Ar[6]="0"),(Ar[7]==" "||Ar[7]==rr.NULL_CHAR)&&(Ar[7]="0"),Ar=Ar.join(""),Ar==rr.TMAGIC?Ar:Mr;if(Ar[7]==rr.NULL_CHAR)return Ar[5]==rr.NULL_CHAR&&(Ar[5]=" "),Ar[6]==rr.NULL_CHAR&&(Ar[6]=" "),Ar==rr.OLDGNU_MAGIC?Ar:Mr}return Mr}function yr(Mr,Ar){return Ar-=1,tr.isUndefined(Mr)&&(Mr=""),Mr=(""+Mr).substr(0,Ar),Mr+rr.NULL_CHAR}function _r(Mr,Ar,kr){for(kr=parseInt(kr)||0,Ar-=1,Mr=(parseInt(Mr)||kr).toString(8).substr(-Ar,Ar);Mr.length<Ar;)Mr="0"+Mr;return Mr+rr.NULL_CHAR}function br(Mr,Ar){if(tr.isDateTime(Mr))Mr=Math.floor(1*Mr/1e3);else if(Mr=parseInt(Mr,10),isFinite(Mr)){if(Mr<=0)return""}else Mr=Math.floor(1*new Date/1e3);return _r(Mr,Ar,0)}function wr(Mr,Ar){var kr=String.fromCharCode.apply(null,Mr);if(Ar)return kr;var Or=kr.indexOf(rr.NULL_CHAR);return Or>=0?kr.substr(0,Or):kr}function vr(Mr){var Ar=String.fromCharCode.apply(null,Mr);return parseInt(Ar.replace(/^0+$/g,""),8)||0}function Sr(Mr){return Mr.length==0||Mr[0]==0?null:new Date(1e3*vr(Mr))}function Ir(Mr,Ar,kr){var Or=parseInt(Ar,10)||0,Dr=Math.min(Or+mr,Mr.length),$r=0,Fr=0,Lr=0;kr&&hr.every(function(Zn){return Zn[0]=="checksum"?(Fr=Or+Zn[2],Lr=Fr+Zn[1],!1):!0});for(var qn=32,Kn=Or;Kn<Dr;Kn++){var Gr=Kn>=Fr&&Kn<Lr?qn:Mr[Kn];$r=($r+Gr)%262144}return $r}t.exports.recordSize=ir,t.exports.defaultFileMode=lr,t.exports.defaultUid=dr,t.exports.defaultGid=fr,t.exports.posixHeader=hr,t.exports.effectiveHeaderSize=mr,t.exports.calculateChecksum=Ir,t.exports.formatTarString=yr,t.exports.formatTarNumber=_r,t.exports.formatTarDateTime=br,t.exports.parseTarString=wr,t.exports.parseTarNumber=vr,t.exports.parseTarDateTime=Sr}),er=D$4((e,t)=>{u$2();var tr=x$1(),rr=w$1(),ir=L$1();function lr(yr){return ir.recordSize}function dr(yr){return Math.ceil(yr.data.length/ir.recordSize)*ir.recordSize}function fr(yr){var _r=0;return yr.forEach(function(br){_r+=lr()+dr(br)}),_r+=ir.recordSize*2,new Uint8Array(_r)}function hr(yr,_r,br){br=parseInt(br)||0;var wr=br;ir.posixHeader.forEach(function(Ar){for(var kr=Ar[3](_r,Ar),Or=kr.length,Dr=0;Dr<Or;Dr+=1)yr[wr+Dr]=kr.charCodeAt(Dr)&255;wr+=Ar[1]});var vr=rr.find(ir.posixHeader,function(Ar){return Ar[0]=="checksum"});if(vr){var Sr=ir.calculateChecksum(yr,br,!0),Ir=ir.formatTarNumber(Sr,vr[1]-2)+tr.NULL_CHAR+" ";wr=br+vr[2];for(var Mr=0;Mr<Ir.length;Mr+=1)yr[wr]=Ir.charCodeAt(Mr)&255,wr++}return br+lr()}function mr(yr,_r,br){return br=parseInt(br,10)||0,yr.set(_r.data,br),br+dr(_r)}function gr(yr){yr=rr.map(yr,function(wr){return rr.extend({},wr,{data:rr.toUint8Array(wr.data)})});var _r=fr(yr),br=0;return yr.forEach(function(wr){br=hr(_r,wr,br),br=mr(_r,wr,br)}),_r}t.exports.tar=gr}),nr=D$4((e,t)=>{u$2();var tr=x$1(),rr=w$1(),ir=L$1(),lr={extractData:!0,checkHeader:!0,checkChecksum:!0,checkFileSize:!0},dr={size:!0,checksum:!0,ustar:!0},fr={unexpectedEndOfFile:"Unexpected end of file.",fileCorrupted:"File is corrupted.",checksumCheckFailed:"Checksum check failed."};function hr(vr){return ir.recordSize}function mr(vr){return Math.ceil(vr/ir.recordSize)*ir.recordSize}function gr(vr,Sr){for(var Ir=Sr,Mr=Math.min(vr.length,Sr+ir.recordSize*2),Ar=Ir;Ar<Mr;Ar++)if(vr[Ar]!=0)return!1;return!0}function yr(vr,Sr,Ir){if(vr.length-Sr<ir.recordSize){if(Ir.checkFileSize)throw new Error(fr.unexpectedEndOfFile);return null}Sr=parseInt(Sr)||0;var Mr={},Ar=Sr;if(ir.posixHeader.forEach(function(Dr){Mr[Dr[0]]=Dr[4](vr,Ar,Dr),Ar+=Dr[1]}),Mr.type!=0&&(Mr.size=0),Ir.checkHeader&&ir.posixHeader.forEach(function(Dr){if(rr.isFunction(Dr[5])&&!Dr[5](Mr,Dr)){var $r=new Error(fr.fileCorrupted);throw $r.data={offset:Sr+Dr[2],field:Dr[0]},$r}}),Ir.checkChecksum){var kr=ir.calculateChecksum(vr,Sr,!0);if(kr!=Mr.checksum){var Or=new Error(fr.checksumCheckFailed);throw Or.data={offset:Sr,header:Mr,checksum:kr},Or}}return Mr}function _r(vr,Sr,Ir,Mr){return Mr.extractData?Ir.size<=0?new Uint8Array:vr.slice(Sr,Sr+Ir.size):null}function br(vr,Sr){var Ir={};return ir.posixHeader.forEach(function(Mr){var Ar=Mr[0];dr[Ar]||(Ir[Ar]=vr[Ar])}),Ir.isOldGNUFormat=vr.ustar==tr.OLDGNU_MAGIC,Sr&&(Ir.data=Sr),Ir}function wr(vr,Sr){Sr=rr.extend({},lr,Sr);for(var Ir=[],Mr=0,Ar=vr.length;Ar-Mr>=ir.recordSize;){vr=rr.toUint8Array(vr);var kr=yr(vr,Mr,Sr);if(!kr)break;Mr+=hr();var Or=_r(vr,Mr,kr,Sr);if(Ir.push(br(kr,Or)),Mr+=mr(kr.size),gr(vr,Mr))break}return Ir}t.exports.untar=wr}),or=D$4((e,t)=>{u$2();var tr=w$1(),rr=x$1(),ir=er(),lr=nr();tr.extend(t.exports,ir,lr,rr)});u$2();u$2();var g$1=L$4(or());async function H$2(e,t,tr="pgdata",rr="auto"){let ir=Br(e,t),[lr,dr]=await qr(ir,rr),fr=tr+(dr?".tar.gz":".tar"),hr=dr?"application/x-gzip":"application/x-tar";return typeof File<"u"?new File([lr],fr,{type:hr}):new Blob([lr],{type:hr})}var Hr=["application/x-gtar","application/x-tar+gzip","application/x-gzip","application/gzip"];async function ce$1(e,t,tr){let rr=new Uint8Array(await t.arrayBuffer()),ir=typeof File<"u"&&t instanceof File?t.name:void 0;(Hr.includes(t.type)||ir!=null&&ir.endsWith(".tgz")||ir!=null&&ir.endsWith(".tar.gz"))&&(rr=await ar(rr));let lr;try{lr=(0,g$1.untar)(rr)}catch(dr){if(dr instanceof Error&&dr.message.includes("File is corrupted"))rr=await ar(rr),lr=(0,g$1.untar)(rr);else throw dr}for(let dr of lr){let fr=tr+dr.name,hr=fr.split("/").slice(0,-1);for(let mr=1;mr<=hr.length;mr++){let gr=hr.slice(0,mr).join("/");e.analyzePath(gr).exists||e.mkdir(gr)}dr.type===g$1.REGTYPE?(e.writeFile(fr,dr.data),e.utime(fr,sr(dr.modifyTime),sr(dr.modifyTime))):dr.type===g$1.DIRTYPE&&e.mkdir(fr)}}function jr(e,t){let tr=[],rr=ir=>{e.readdir(ir).forEach(lr=>{if(lr==="."||lr==="..")return;let dr=ir+"/"+lr,fr=e.stat(dr),hr=e.isFile(fr.mode)?e.readFile(dr,{encoding:"binary"}):new Uint8Array(0);tr.push({name:dr.substring(t.length),mode:fr.mode,size:fr.size,type:e.isFile(fr.mode)?g$1.REGTYPE:g$1.DIRTYPE,modifyTime:fr.mtime,data:hr}),e.isDir(fr.mode)&&rr(dr)})};return rr(t),tr}function Br(e,t){let tr=jr(e,t);return(0,g$1.tar)(tr)}async function qr(e,t="auto"){if(t==="none")return[e,!1];if(typeof CompressionStream<"u")return[await Yr(e),!0];if(typeof process<"u"&&process.versions&&process.versions.node)return[await Wr(e),!0];if(t==="auto")return[e,!1];throw new Error("Compression not supported in this environment")}async function Yr(e){let t=new CompressionStream("gzip"),tr=t.writable.getWriter(),rr=t.readable.getReader();tr.write(e),tr.close();let ir=[];for(;;){let{value:fr,done:hr}=await rr.read();if(hr)break;fr&&ir.push(fr)}let lr=new Uint8Array(ir.reduce((fr,hr)=>fr+hr.length,0)),dr=0;return ir.forEach(fr=>{lr.set(fr,dr),dr+=fr.length}),lr}async function Wr(e){let{promisify:t}=await __vitePreload(()=>Promise.resolve().then(()=>__viteBrowserExternal$1),void 0,import.meta.url),{gzip:tr}=await __vitePreload(async()=>{const{gzip:rr}=await Promise.resolve().then(()=>__viteBrowserExternal$1);return{gzip:rr}},void 0,import.meta.url);return await t(tr)(e)}async function ar(e){if(typeof CompressionStream<"u")return await Xr(e);if(typeof process<"u"&&process.versions&&process.versions.node)return await Kr(e);throw new Error("Unsupported environment for decompression")}async function Xr(e){let t=new DecompressionStream("gzip"),tr=t.writable.getWriter(),rr=t.readable.getReader();tr.write(e),tr.close();let ir=[];for(;;){let{value:fr,done:hr}=await rr.read();if(hr)break;fr&&ir.push(fr)}let lr=new Uint8Array(ir.reduce((fr,hr)=>fr+hr.length,0)),dr=0;return ir.forEach(fr=>{lr.set(fr,dr),dr+=fr.length}),lr}async function Kr(e){let{promisify:t}=await __vitePreload(()=>Promise.resolve().then(()=>__viteBrowserExternal$1),void 0,import.meta.url),{gunzip:tr}=await __vitePreload(async()=>{const{gunzip:rr}=await Promise.resolve().then(()=>__viteBrowserExternal$1);return{gunzip:rr}},void 0,import.meta.url);return await t(tr)(e)}function sr(e){return e?typeof e=="number"?e:Math.floor(e.getTime()/1e3):Math.floor(Date.now()/1e3)}var Vr="/tmp/pglite",C$1=Vr+"/base",ur=class{constructor(e){this.dataDir=e}async init(e,t){return this.pg=e,{emscriptenOpts:t}}async syncToFs(e){}async initialSyncFs(){}async closeFs(){}async dumpTar(e,t){return H$2(this.pg.Module.FS,C$1,e,t)}},cr=class{constructor(e,{debug:t=!1}={}){this.dataDir=e,this.debug=t}async syncToFs(e){}async initialSyncFs(){}async closeFs(){}async dumpTar(e,t){return H$2(this.pg.Module.FS,C$1,e,t)}async init(e,t){return this.pg=e,{emscriptenOpts:{...t,preRun:[...t.preRun||[],tr=>{let rr=Zr(tr,this);tr.FS.mkdir(C$1),tr.FS.mount(rr,{},C$1)}]}}}},pr={EBADF:8,EBADFD:127,EEXIST:20,EINVAL:28,EISDIR:31,ENODEV:43,ENOENT:44,ENOTDIR:54,ENOTEMPTY:55},Zr=(e,t)=>{let tr=e.FS,rr=t.debug?console.log:null,ir={tryFSOperation(lr){try{return lr()}catch(dr){throw dr.code?dr.code==="UNKNOWN"?new tr.ErrnoError(pr.EINVAL):new tr.ErrnoError(dr.code):dr}},mount(lr){return ir.createNode(null,"/",16895,0)},syncfs(lr,dr,fr){},createNode(lr,dr,fr,hr){if(!tr.isDir(fr)&&!tr.isFile(fr))throw new tr.ErrnoError(28);let mr=tr.createNode(lr,dr,fr);return mr.node_ops=ir.node_ops,mr.stream_ops=ir.stream_ops,mr},getMode:function(lr){return rr==null||rr("getMode",lr),ir.tryFSOperation(()=>t.lstat(lr).mode)},realPath:function(lr){let dr=[];for(;lr.parent!==lr;)dr.push(lr.name),lr=lr.parent;return dr.push(lr.mount.opts.root),dr.reverse(),dr.join("/")},node_ops:{getattr(lr){rr==null||rr("getattr",ir.realPath(lr));let dr=ir.realPath(lr);return ir.tryFSOperation(()=>{let fr=t.lstat(dr);return{...fr,dev:0,ino:lr.id,nlink:1,rdev:lr.rdev,atime:new Date(fr.atime),mtime:new Date(fr.mtime),ctime:new Date(fr.ctime)}})},setattr(lr,dr){rr==null||rr("setattr",ir.realPath(lr),dr);let fr=ir.realPath(lr);ir.tryFSOperation(()=>{dr.mode!==void 0&&t.chmod(fr,dr.mode),dr.size!==void 0&&t.truncate(fr,dr.size),dr.timestamp!==void 0&&t.utimes(fr,dr.timestamp,dr.timestamp),dr.size!==void 0&&t.truncate(fr,dr.size)})},lookup(lr,dr){rr==null||rr("lookup",ir.realPath(lr),dr);let fr=[ir.realPath(lr),dr].join("/"),hr=ir.getMode(fr);return ir.createNode(lr,dr,hr)},mknod(lr,dr,fr,hr){rr==null||rr("mknod",ir.realPath(lr),dr,fr,hr);let mr=ir.createNode(lr,dr,fr,hr),gr=ir.realPath(mr);return ir.tryFSOperation(()=>(tr.isDir(mr.mode)?t.mkdir(gr,{mode:fr}):t.writeFile(gr,"",{mode:fr}),mr))},rename(lr,dr,fr){rr==null||rr("rename",ir.realPath(lr),ir.realPath(dr),fr);let hr=ir.realPath(lr),mr=[ir.realPath(dr),fr].join("/");ir.tryFSOperation(()=>{t.rename(hr,mr)}),lr.name=fr},unlink(lr,dr){rr==null||rr("unlink",ir.realPath(lr),dr);let fr=[ir.realPath(lr),dr].join("/");try{t.unlink(fr)}catch{}},rmdir(lr,dr){rr==null||rr("rmdir",ir.realPath(lr),dr);let fr=[ir.realPath(lr),dr].join("/");return ir.tryFSOperation(()=>{t.rmdir(fr)})},readdir(lr){rr==null||rr("readdir",ir.realPath(lr));let dr=ir.realPath(lr);return ir.tryFSOperation(()=>t.readdir(dr))},symlink(lr,dr,fr){throw rr==null||rr("symlink",ir.realPath(lr),dr,fr),new tr.ErrnoError(63)},readlink(lr){throw rr==null||rr("readlink",ir.realPath(lr)),new tr.ErrnoError(63)}},stream_ops:{open(lr){rr==null||rr("open stream",ir.realPath(lr.node));let dr=ir.realPath(lr.node);return ir.tryFSOperation(()=>{tr.isFile(lr.node.mode)&&(lr.shared.refcount=1,lr.nfd=t.open(dr))})},close(lr){return rr==null||rr("close stream",ir.realPath(lr.node)),ir.tryFSOperation(()=>{tr.isFile(lr.node.mode)&&lr.nfd&&--lr.shared.refcount===0&&t.close(lr.nfd)})},dup(lr){rr==null||rr("dup stream",ir.realPath(lr.node)),lr.shared.refcount++},read(lr,dr,fr,hr,mr){return rr==null||rr("read stream",ir.realPath(lr.node),fr,hr,mr),hr===0?0:ir.tryFSOperation(()=>t.read(lr.nfd,dr,fr,hr,mr))},write(lr,dr,fr,hr,mr){return rr==null||rr("write stream",ir.realPath(lr.node),fr,hr,mr),ir.tryFSOperation(()=>t.write(lr.nfd,dr.buffer,fr,hr,mr))},llseek(lr,dr,fr){rr==null||rr("llseek stream",ir.realPath(lr.node),dr,fr);let hr=dr;if(fr===1?hr+=lr.position:fr===2&&tr.isFile(lr.node.mode)&&ir.tryFSOperation(()=>{let mr=t.fstat(lr.nfd);hr+=mr.size}),hr<0)throw new tr.ErrnoError(28);return hr},mmap(lr,dr,fr,hr,mr){if(rr==null||rr("mmap stream",ir.realPath(lr.node),dr,fr,hr,mr),!tr.isFile(lr.node.mode))throw new tr.ErrnoError(pr.ENODEV);let gr=e.mmapAlloc(dr);return ir.stream_ops.read(lr,e.HEAP8,gr,dr,fr),{ptr:gr,allocated:!0}},msync(lr,dr,fr,hr,mr){return rr==null||rr("msync stream",ir.realPath(lr.node),fr,hr,mr),ir.stream_ops.write(lr,dr,0,hr,fr),0}}};return ir};u$2();u$2();u$2();var He=new Error("request for lock canceled"),We=function(e,t,tr,rr){function ir(lr){return lr instanceof tr?lr:new tr(function(dr){dr(lr)})}return new(tr||(tr=Promise))(function(lr,dr){function fr(gr){try{mr(rr.next(gr))}catch(yr){dr(yr)}}function hr(gr){try{mr(rr.throw(gr))}catch(yr){dr(yr)}}function mr(gr){gr.done?lr(gr.value):ir(gr.value).then(fr,hr)}mr((rr=rr.apply(e,[])).next())})},ce=class{constructor(e,t=He){this._value=e,this._cancelError=t,this._weightedQueues=[],this._weightedWaiters=[]}acquire(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((t,tr)=>{this._weightedQueues[e-1]||(this._weightedQueues[e-1]=[]),this._weightedQueues[e-1].push({resolve:t,reject:tr}),this._dispatch()})}runExclusive(e,t=1){return We(this,void 0,void 0,function*(){let[tr,rr]=yield this.acquire(t);try{return yield e(tr)}finally{rr()}})}waitForUnlock(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise(t=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),this._weightedWaiters[e-1].push(t),this._dispatch()})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatch()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatch()}cancel(){this._weightedQueues.forEach(e=>e.forEach(t=>t.reject(this._cancelError))),this._weightedQueues=[]}_dispatch(){var e;for(let t=this._value;t>0;t--){let tr=(e=this._weightedQueues[t-1])===null||e===void 0?void 0:e.shift();if(!tr)continue;let rr=this._value,ir=t;this._value-=t,t=this._value+1,tr.resolve([rr,this._newReleaser(ir)])}this._drainUnlockWaiters()}_newReleaser(e){let t=!1;return()=>{t||(t=!0,this.release(e))}}_drainUnlockWaiters(){for(let e=this._value;e>0;e--)this._weightedWaiters[e-1]&&(this._weightedWaiters[e-1].forEach(t=>t()),this._weightedWaiters[e-1]=[])}},je=function(e,t,tr,rr){function ir(lr){return lr instanceof tr?lr:new tr(function(dr){dr(lr)})}return new(tr||(tr=Promise))(function(lr,dr){function fr(gr){try{mr(rr.next(gr))}catch(yr){dr(yr)}}function hr(gr){try{mr(rr.throw(gr))}catch(yr){dr(yr)}}function mr(gr){gr.done?lr(gr.value):ir(gr.value).then(fr,hr)}mr((rr=rr.apply(e,[])).next())})},H$1=class{constructor(t){this._semaphore=new ce(1,t)}acquire(){return je(this,void 0,void 0,function*(){let[,t]=yield this._semaphore.acquire();return t})}runExclusive(t){return this._semaphore.runExclusive(()=>t())}isLocked(){return this._semaphore.isLocked()}waitForUnlock(){return this._semaphore.waitForUnlock()}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}};u$2();var Ie=L$4(or());async function ge(e){if(Fe$1){let t=await __vitePreload(()=>Promise.resolve().then(()=>__viteBrowserExternal$1),void 0,import.meta.url),tr=await __vitePreload(()=>Promise.resolve().then(()=>__viteBrowserExternal$1),void 0,import.meta.url),{Writable:rr}=await __vitePreload(async()=>{const{Writable:fr}=await Promise.resolve().then(()=>__viteBrowserExternal$1);return{Writable:fr}},void 0,import.meta.url),{pipeline:ir}=await __vitePreload(async()=>{const{pipeline:fr}=await Promise.resolve().then(()=>__viteBrowserExternal$1);return{pipeline:fr}},void 0,import.meta.url);if(!t.existsSync(e))throw new Error(`Extension bundle not found: ${e}`);let lr=tr.createGunzip(),dr=[];return await ir(t.createReadStream(e),lr,new rr({write(fr,hr,mr){dr.push(fr),mr()}})),new Blob(dr)}else{let t=await fetch(e.toString());if(!t.ok||!t.body)return null;if(t.headers.get("Content-Encoding")==="gzip")return t.blob();{let tr=new DecompressionStream("gzip");return new Response(t.body.pipeThrough(tr)).blob()}}}async function Pe(e,t){for(let tr in e.pg_extensions){let rr;try{rr=await e.pg_extensions[tr]}catch(ir){console.error("Failed to fetch extension:",tr,ir);continue}if(rr){let ir=new Uint8Array(await rr.arrayBuffer());Ve(e,tr,ir,t)}else console.error("Could not get binary data for extension:",tr)}}function Ve(e,t,tr,rr){Ie.default.untar(tr).forEach(ir=>{if(!ir.name.startsWith(".")){let lr=e.WASM_PREFIX+"/"+ir.name;if(ir.name.endsWith(".so")){let dr=(...hr)=>{rr("pgfs:ext OK",lr,hr)},fr=(...hr)=>{rr("pgfs:ext FAIL",lr,hr)};e.FS.createPreloadedFile(Ke(lr),ir.name.split("/").pop().slice(0,-3),ir.data,!0,!0,dr,fr,!1)}else e.FS.writeFile(lr,ir.data)}})}function Ke(e){let t=e.lastIndexOf("/");return t>0?e.slice(0,t):e}u$2();u$2();var ee=class extends ur{async init(e,t){return this.pg=e,{emscriptenOpts:{...t,preRun:[...t.preRun||[],tr=>{let rr=tr.FS.filesystems.IDBFS;tr.FS.mkdir("/pglite"),tr.FS.mkdir(`/pglite/${this.dataDir}`),tr.FS.mount(rr,{},`/pglite/${this.dataDir}`),tr.FS.symlink(`/pglite/${this.dataDir}`,C$1)}]}}}initialSyncFs(){return new Promise((e,t)=>{this.pg.Module.FS.syncfs(!0,tr=>{tr?t(tr):e()})})}syncToFs(e){return new Promise((t,tr)=>{this.pg.Module.FS.syncfs(!1,rr=>{rr?tr(rr):t()})})}async closeFs(){let e=this.pg.Module.FS.filesystems.IDBFS.dbs[this.dataDir];e&&e.close(),this.pg.Module.FS.quit()}};u$2();var te=class extends ur{async closeFs(){this.pg.Module.FS.quit()}};function Fe(e){let t;if(e!=null&&e.startsWith("file://")){if(e=e.slice(7),!e)throw new Error("Invalid dataDir, must be a valid path");t="nodefs"}else e!=null&&e.startsWith("idb://")?(e=e.slice(6),t="idbfs"):e!=null&&e.startsWith("opfs-ahp://")?(e=e.slice(11),t="opfs-ahp"):!e||e!=null&&e.startsWith("memory://")?t="memoryfs":t="nodefs";return{dataDir:e,fsType:t}}async function Ae(e,t){let tr;if(e&&t==="nodefs"){let{NodeFS:rr}=await __vitePreload(()=>import("./nodefs.Ckv3nYAO.js"),[],import.meta.url);tr=new rr(e)}else if(e&&t==="idbfs")tr=new ee(e);else if(e&&t==="opfs-ahp"){let{OpfsAhpFS:rr}=await __vitePreload(()=>import("./opfs-ahp.js-oMwzH.js"),[],import.meta.url);tr=new rr(e)}else tr=new te;return tr}u$2();u$2();var Qe=(()=>{var _scriptName=import.meta.url;return async function(moduleArg={}){var moduleRtn,Module=moduleArg,readyPromiseResolve,readyPromiseReject,readyPromise=new Promise((e,t)=>{readyPromiseResolve=e,readyPromiseReject=t}),ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof WorkerGlobalScope<"u",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";if(ENVIRONMENT_IS_NODE){let{createRequire:e}=await __vitePreload(()=>Promise.resolve().then(()=>__viteBrowserExternal$1),void 0,import.meta.url),t=import.meta.url;t.startsWith("data:")&&(t="/");var require=e(t)}Module.expectedDataFileDownloads??(Module.expectedDataFileDownloads=0),Module.expectedDataFileDownloads++,(()=>{var e=typeof ENVIRONMENT_IS_PTHREAD<"u"&&ENVIRONMENT_IS_PTHREAD,t=typeof ENVIRONMENT_IS_WASM_WORKER<"u"&&ENVIRONMENT_IS_WASM_WORKER;if(e||t)return;var tr=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";function rr(ir){typeof window=="object"?window.encodeURIComponent(window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/"):typeof process>"u"&&typeof location<"u"&&encodeURIComponent(location.pathname.substring(0,location.pathname.lastIndexOf("/"))+"/");var lr="postgres.data",dr="postgres.data",fr=Module.locateFile?Module.locateFile(dr,""):dr,hr=ir.remote_package_size;function mr(wr,vr,Sr,Ir){if(tr){require("fs").readFile(wr,(Mr,Ar)=>{Mr?Ir(Mr):Sr(Ar.buffer)});return}Module.dataFileDownloads??(Module.dataFileDownloads={}),fetch(wr).catch(Mr=>Promise.reject(new Error(`Network Error: ${wr}`,{cause:Mr}))).then(Mr=>{var qn;if(!Mr.ok)return Promise.reject(new Error(`${Mr.status}: ${Mr.url}`));if(!Mr.body&&Mr.arrayBuffer)return Mr.arrayBuffer().then(Sr);let Ar=Mr.body.getReader(),kr=()=>Ar.read().then(Lr).catch(Kn=>Promise.reject(new Error(`Unexpected error while handling : ${Mr.url} ${Kn}`,{cause:Kn}))),Or=[],Dr=Mr.headers,$r=Number(Dr.get("Content-Length")??vr),Fr=0,Lr=({done:Kn,value:Gr})=>{var Zn;if(Kn){let zr=new Uint8Array(Or.map(Hn=>Hn.length).reduce((Hn,Jn)=>Hn+Jn,0)),$n=0;for(let Hn of Or)zr.set(Hn,$n),$n+=Hn.length;Sr(zr.buffer)}else{Or.push(Gr),Fr+=Gr.length,Module.dataFileDownloads[wr]={loaded:Fr,total:$r};let zr=0,$n=0;for(let Hn of Object.values(Module.dataFileDownloads))zr+=Hn.loaded,$n+=Hn.total;return(Zn=Module.setStatus)==null||Zn.call(Module,`Downloading data... (${zr}/${$n})`),kr()}};return(qn=Module.setStatus)==null||qn.call(Module,"Downloading data..."),kr()})}function gr(wr){console.error("package error:",wr)}var yr=null,_r=Module.getPreloadedPackage?Module.getPreloadedPackage(fr,hr):null;_r||mr(fr,hr,wr=>{yr?(yr(wr),yr=null):_r=wr},gr);function br(wr){function vr(kr,Or){if(!kr)throw Or+new Error().stack}wr.FS_createPath("/","home",!0,!0),wr.FS_createPath("/home","web_user",!0,!0),wr.FS_createPath("/","tmp",!0,!0),wr.FS_createPath("/tmp","pglite",!0,!0),wr.FS_createPath("/tmp/pglite","bin",!0,!0),wr.FS_createPath("/tmp/pglite","lib",!0,!0),wr.FS_createPath("/tmp/pglite/lib","postgresql",!0,!0),wr.FS_createPath("/tmp/pglite/lib/postgresql","pgxs",!0,!0),wr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs","config",!0,!0),wr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs","src",!0,!0),wr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs/src","makefiles",!0,!0),wr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs/src","test",!0,!0),wr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs/src/test","isolation",!0,!0),wr.FS_createPath("/tmp/pglite/lib/postgresql/pgxs/src/test","regress",!0,!0),wr.FS_createPath("/tmp/pglite","share",!0,!0),wr.FS_createPath("/tmp/pglite/share","postgresql",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql","extension",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql","timezone",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Africa",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","America",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone/America","Argentina",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone/America","Indiana",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone/America","Kentucky",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone/America","North_Dakota",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Antarctica",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Arctic",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Asia",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Atlantic",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Australia",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Brazil",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Canada",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Chile",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Etc",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Europe",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Indian",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Mexico",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","Pacific",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql/timezone","US",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql","timezonesets",!0,!0),wr.FS_createPath("/tmp/pglite/share/postgresql","tsearch_data",!0,!0);function Sr(kr,Or,Dr){this.start=kr,this.end=Or,this.audio=Dr}Sr.prototype={requests:{},open:function(kr,Or){this.name=Or,this.requests[Or]=this,wr.addRunDependency(`fp ${this.name}`)},send:function(){},onload:function(){var kr=this.byteArray.subarray(this.start,this.end);this.finish(kr)},finish:function(kr){var Or=this;wr.FS_createDataFile(this.name,null,kr,!0,!0,!0),wr.removeRunDependency(`fp ${Or.name}`),this.requests[this.name]=null}};for(var Ir=ir.files,Mr=0;Mr<Ir.length;++Mr)new Sr(Ir[Mr].start,Ir[Mr].end,Ir[Mr].audio||0).open("GET",Ir[Mr].filename);function Ar(kr){vr(kr,"Loading data file failed."),vr(kr.constructor.name===ArrayBuffer.name,"bad input to processPackageData");var Or=new Uint8Array(kr);Sr.prototype.byteArray=Or;for(var Dr=ir.files,$r=0;$r<Dr.length;++$r)Sr.prototype.requests[Dr[$r].filename].onload();wr.removeRunDependency("datafile_postgres.data")}wr.addRunDependency("datafile_postgres.data"),wr.preloadResults??(wr.preloadResults={}),wr.preloadResults[lr]={fromCache:!1},_r?(Ar(_r),_r=null):yr=Ar}Module.calledRun?br(Module):(Module.preRun??(Module.preRun=[])).push(br)}rr({files:[{filename:"/home/web_user/.pgpass",start:0,end:204},{filename:"/tmp/pglite/bin/initdb",start:204,end:216},{filename:"/tmp/pglite/bin/postgres",start:216,end:228},{filename:"/tmp/pglite/lib/postgresql/cyrillic_and_mic.so",start:228,end:20397},{filename:"/tmp/pglite/lib/postgresql/dict_snowball.so",start:20397,end:1581299},{filename:"/tmp/pglite/lib/postgresql/euc2004_sjis2004.so",start:1581299,end:1592382},{filename:"/tmp/pglite/lib/postgresql/euc_cn_and_mic.so",start:1592382,end:1599256},{filename:"/tmp/pglite/lib/postgresql/euc_jp_and_sjis.so",start:1599256,end:1622931},{filename:"/tmp/pglite/lib/postgresql/euc_kr_and_mic.so",start:1622931,end:1630057},{filename:"/tmp/pglite/lib/postgresql/euc_tw_and_big5.so",start:1630057,end:1651566},{filename:"/tmp/pglite/lib/postgresql/latin2_and_win1250.so",start:1651566,end:1660345},{filename:"/tmp/pglite/lib/postgresql/latin_and_mic.so",start:1660345,end:1668272},{filename:"/tmp/pglite/lib/postgresql/libpqwalreceiver.so",start:1668272,end:2186522},{filename:"/tmp/pglite/lib/postgresql/pgoutput.so",start:2186522,end:2303364},{filename:"/tmp/pglite/lib/postgresql/pgxs/config/install-sh",start:2303364,end:2317361},{filename:"/tmp/pglite/lib/postgresql/pgxs/config/missing",start:2317361,end:2318709},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/Makefile.global",start:2318709,end:2354956},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/Makefile.port",start:2354956,end:2355232},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/Makefile.shlib",start:2355232,end:2371270},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/makefiles/pgxs.mk",start:2371270,end:2386198},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/nls-global.mk",start:2386198,end:2393083},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/test/isolation/isolationtester.cjs",start:2393083,end:2589770},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/test/isolation/pg_isolation_regress.cjs",start:2589770,end:2742128},{filename:"/tmp/pglite/lib/postgresql/pgxs/src/test/regress/pg_regress.cjs",start:2742128,end:2894476},{filename:"/tmp/pglite/lib/postgresql/plpgsql.so",start:2894476,end:3653241},{filename:"/tmp/pglite/password",start:3653241,end:3653250},{filename:"/tmp/pglite/share/postgresql/errcodes.txt",start:3653250,end:3686708},{filename:"/tmp/pglite/share/postgresql/extension/plpgsql--1.0.sql",start:3686708,end:3687366},{filename:"/tmp/pglite/share/postgresql/extension/plpgsql.control",start:3687366,end:3687559},{filename:"/tmp/pglite/share/postgresql/fix-CVE-2024-4317.sql",start:3687559,end:3693324},{filename:"/tmp/pglite/share/postgresql/information_schema.sql",start:3693324,end:3808299},{filename:"/tmp/pglite/share/postgresql/pg_hba.conf.sample",start:3808299,end:3813924},{filename:"/tmp/pglite/share/postgresql/pg_ident.conf.sample",start:3813924,end:3816564},{filename:"/tmp/pglite/share/postgresql/pg_service.conf.sample",start:3816564,end:3817168},{filename:"/tmp/pglite/share/postgresql/postgres.bki",start:3817168,end:4761272},{filename:"/tmp/pglite/share/postgresql/postgresql.conf.sample",start:4761272,end:4790919},{filename:"/tmp/pglite/share/postgresql/psqlrc.sample",start:4790919,end:4791197},{filename:"/tmp/pglite/share/postgresql/snowball_create.sql",start:4791197,end:4835373},{filename:"/tmp/pglite/share/postgresql/sql_features.txt",start:4835373,end:4871054},{filename:"/tmp/pglite/share/postgresql/system_constraints.sql",start:4871054,end:4879949},{filename:"/tmp/pglite/share/postgresql/system_functions.sql",start:4879949,end:4903264},{filename:"/tmp/pglite/share/postgresql/system_views.sql",start:4903264,end:4953537},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Abidjan",start:4953537,end:4953667},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Accra",start:4953667,end:4953797},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Addis_Ababa",start:4953797,end:4953988},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Algiers",start:4953988,end:4954458},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Asmara",start:4954458,end:4954649},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Asmera",start:4954649,end:4954840},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Bamako",start:4954840,end:4954970},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Bangui",start:4954970,end:4955150},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Banjul",start:4955150,end:4955280},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Bissau",start:4955280,end:4955429},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Blantyre",start:4955429,end:4955560},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Brazzaville",start:4955560,end:4955740},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Bujumbura",start:4955740,end:4955871},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Cairo",start:4955871,end:4957180},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Casablanca",start:4957180,end:4959099},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Ceuta",start:4959099,end:4959661},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Conakry",start:4959661,end:4959791},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Dakar",start:4959791,end:4959921},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Dar_es_Salaam",start:4959921,end:4960112},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Djibouti",start:4960112,end:4960303},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Douala",start:4960303,end:4960483},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/El_Aaiun",start:4960483,end:4962313},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Freetown",start:4962313,end:4962443},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Gaborone",start:4962443,end:4962574},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Harare",start:4962574,end:4962705},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Johannesburg",start:4962705,end:4962895},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Juba",start:4962895,end:4963353},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Kampala",start:4963353,end:4963544},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Khartoum",start:4963544,end:4964002},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Kigali",start:4964002,end:4964133},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Kinshasa",start:4964133,end:4964313},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Lagos",start:4964313,end:4964493},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Libreville",start:4964493,end:4964673},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Lome",start:4964673,end:4964803},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Luanda",start:4964803,end:4964983},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Lubumbashi",start:4964983,end:4965114},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Lusaka",start:4965114,end:4965245},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Malabo",start:4965245,end:4965425},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Maputo",start:4965425,end:4965556},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Maseru",start:4965556,end:4965746},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Mbabane",start:4965746,end:4965936},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Mogadishu",start:4965936,end:4966127},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Monrovia",start:4966127,end:4966291},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Nairobi",start:4966291,end:4966482},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Ndjamena",start:4966482,end:4966642},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Niamey",start:4966642,end:4966822},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Nouakchott",start:4966822,end:4966952},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Ouagadougou",start:4966952,end:4967082},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Porto-Novo",start:4967082,end:4967262},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Sao_Tome",start:4967262,end:4967435},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Timbuktu",start:4967435,end:4967565},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Tripoli",start:4967565,end:4967996},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Tunis",start:4967996,end:4968445},{filename:"/tmp/pglite/share/postgresql/timezone/Africa/Windhoek",start:4968445,end:4969083},{filename:"/tmp/pglite/share/postgresql/timezone/America/Adak",start:4969083,end:4970052},{filename:"/tmp/pglite/share/postgresql/timezone/America/Anchorage",start:4970052,end:4971029},{filename:"/tmp/pglite/share/postgresql/timezone/America/Anguilla",start:4971029,end:4971206},{filename:"/tmp/pglite/share/postgresql/timezone/America/Antigua",start:4971206,end:4971383},{filename:"/tmp/pglite/share/postgresql/timezone/America/Araguaina",start:4971383,end:4971975},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Buenos_Aires",start:4971975,end:4972683},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Catamarca",start:4972683,end:4973391},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/ComodRivadavia",start:4973391,end:4974099},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Cordoba",start:4974099,end:4974807},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Jujuy",start:4974807,end:4975497},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/La_Rioja",start:4975497,end:4976214},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Mendoza",start:4976214,end:4976922},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Rio_Gallegos",start:4976922,end:4977630},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Salta",start:4977630,end:4978320},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/San_Juan",start:4978320,end:4979037},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/San_Luis",start:4979037,end:4979754},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Tucuman",start:4979754,end:4980480},{filename:"/tmp/pglite/share/postgresql/timezone/America/Argentina/Ushuaia",start:4980480,end:4981188},{filename:"/tmp/pglite/share/postgresql/timezone/America/Aruba",start:4981188,end:4981365},{filename:"/tmp/pglite/share/postgresql/timezone/America/Asuncion",start:4981365,end:4982249},{filename:"/tmp/pglite/share/postgresql/timezone/America/Atikokan",start:4982249,end:4982398},{filename:"/tmp/pglite/share/postgresql/timezone/America/Atka",start:4982398,end:4983367},{filename:"/tmp/pglite/share/postgresql/timezone/America/Bahia",start:4983367,end:4984049},{filename:"/tmp/pglite/share/postgresql/timezone/America/Bahia_Banderas",start:4984049,end:4984777},{filename:"/tmp/pglite/share/postgresql/timezone/America/Barbados",start:4984777,end:4985055},{filename:"/tmp/pglite/share/postgresql/timezone/America/Belem",start:4985055,end:4985449},{filename:"/tmp/pglite/share/postgresql/timezone/America/Belize",start:4985449,end:4986494},{filename:"/tmp/pglite/share/postgresql/timezone/America/Blanc-Sablon",start:4986494,end:4986671},{filename:"/tmp/pglite/share/postgresql/timezone/America/Boa_Vista",start:4986671,end:4987101},{filename:"/tmp/pglite/share/postgresql/timezone/America/Bogota",start:4987101,end:4987280},{filename:"/tmp/pglite/share/postgresql/timezone/America/Boise",start:4987280,end:4988279},{filename:"/tmp/pglite/share/postgresql/timezone/America/Buenos_Aires",start:4988279,end:4988987},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cambridge_Bay",start:4988987,end:4989870},{filename:"/tmp/pglite/share/postgresql/timezone/America/Campo_Grande",start:4989870,end:4990822},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cancun",start:4990822,end:4991351},{filename:"/tmp/pglite/share/postgresql/timezone/America/Caracas",start:4991351,end:4991541},{filename:"/tmp/pglite/share/postgresql/timezone/America/Catamarca",start:4991541,end:4992249},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cayenne",start:4992249,end:4992400},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cayman",start:4992400,end:4992549},{filename:"/tmp/pglite/share/postgresql/timezone/America/Chicago",start:4992549,end:4994303},{filename:"/tmp/pglite/share/postgresql/timezone/America/Chihuahua",start:4994303,end:4994994},{filename:"/tmp/pglite/share/postgresql/timezone/America/Ciudad_Juarez",start:4994994,end:4995712},{filename:"/tmp/pglite/share/postgresql/timezone/America/Coral_Harbour",start:4995712,end:4995861},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cordoba",start:4995861,end:4996569},{filename:"/tmp/pglite/share/postgresql/timezone/America/Costa_Rica",start:4996569,end:4996801},{filename:"/tmp/pglite/share/postgresql/timezone/America/Creston",start:4996801,end:4997041},{filename:"/tmp/pglite/share/postgresql/timezone/America/Cuiaba",start:4997041,end:4997975},{filename:"/tmp/pglite/share/postgresql/timezone/America/Curacao",start:4997975,end:4998152},{filename:"/tmp/pglite/share/postgresql/timezone/America/Danmarkshavn",start:4998152,end:4998599},{filename:"/tmp/pglite/share/postgresql/timezone/America/Dawson",start:4998599,end:4999628},{filename:"/tmp/pglite/share/postgresql/timezone/America/Dawson_Creek",start:4999628,end:5000311},{filename:"/tmp/pglite/share/postgresql/timezone/America/Denver",start:5000311,end:5001353},{filename:"/tmp/pglite/share/postgresql/timezone/America/Detroit",start:5001353,end:5002252},{filename:"/tmp/pglite/share/postgresql/timezone/America/Dominica",start:5002252,end:5002429},{filename:"/tmp/pglite/share/postgresql/timezone/America/Edmonton",start:5002429,end:5003399},{filename:"/tmp/pglite/share/postgresql/timezone/America/Eirunepe",start:5003399,end:5003835},{filename:"/tmp/pglite/share/postgresql/timezone/America/El_Salvador",start:5003835,end:5004011},{filename:"/tmp/pglite/share/postgresql/timezone/America/Ensenada",start:5004011,end:5005036},{filename:"/tmp/pglite/share/postgresql/timezone/America/Fort_Nelson",start:5005036,end:5006484},{filename:"/tmp/pglite/share/postgresql/timezone/America/Fort_Wayne",start:5006484,end:5007015},{filename:"/tmp/pglite/share/postgresql/timezone/America/Fortaleza",start:5007015,end:5007499},{filename:"/tmp/pglite/share/postgresql/timezone/America/Glace_Bay",start:5007499,end:5008379},{filename:"/tmp/pglite/share/postgresql/timezone/America/Godthab",start:5008379,end:5009344},{filename:"/tmp/pglite/share/postgresql/timezone/America/Goose_Bay",start:5009344,end:5010924},{filename:"/tmp/pglite/share/postgresql/timezone/America/Grand_Turk",start:5010924,end:5011777},{filename:"/tmp/pglite/share/postgresql/timezone/America/Grenada",start:5011777,end:5011954},{filename:"/tmp/pglite/share/postgresql/timezone/America/Guadeloupe",start:5011954,end:5012131},{filename:"/tmp/pglite/share/postgresql/timezone/America/Guatemala",start:5012131,end:5012343},{filename:"/tmp/pglite/share/postgresql/timezone/America/Guayaquil",start:5012343,end:5012522},{filename:"/tmp/pglite/share/postgresql/timezone/America/Guyana",start:5012522,end:5012703},{filename:"/tmp/pglite/share/postgresql/timezone/America/Halifax",start:5012703,end:5014375},{filename:"/tmp/pglite/share/postgresql/timezone/America/Havana",start:5014375,end:5015492},{filename:"/tmp/pglite/share/postgresql/timezone/America/Hermosillo",start:5015492,end:5015778},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Indianapolis",start:5015778,end:5016309},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Knox",start:5016309,end:5017325},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Marengo",start:5017325,end:5017892},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Petersburg",start:5017892,end:5018575},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Tell_City",start:5018575,end:5019097},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Vevay",start:5019097,end:5019466},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Vincennes",start:5019466,end:5020024},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indiana/Winamac",start:5020024,end:5020636},{filename:"/tmp/pglite/share/postgresql/timezone/America/Indianapolis",start:5020636,end:5021167},{filename:"/tmp/pglite/share/postgresql/timezone/America/Inuvik",start:5021167,end:5021984},{filename:"/tmp/pglite/share/postgresql/timezone/America/Iqaluit",start:5021984,end:5022839},{filename:"/tmp/pglite/share/postgresql/timezone/America/Jamaica",start:5022839,end:5023178},{filename:"/tmp/pglite/share/postgresql/timezone/America/Jujuy",start:5023178,end:5023868},{filename:"/tmp/pglite/share/postgresql/timezone/America/Juneau",start:5023868,end:5024834},{filename:"/tmp/pglite/share/postgresql/timezone/America/Kentucky/Louisville",start:5024834,end:5026076},{filename:"/tmp/pglite/share/postgresql/timezone/America/Kentucky/Monticello",start:5026076,end:5027048},{filename:"/tmp/pglite/share/postgresql/timezone/America/Knox_IN",start:5027048,end:5028064},{filename:"/tmp/pglite/share/postgresql/timezone/America/Kralendijk",start:5028064,end:5028241},{filename:"/tmp/pglite/share/postgresql/timezone/America/La_Paz",start:5028241,end:5028411},{filename:"/tmp/pglite/share/postgresql/timezone/America/Lima",start:5028411,end:5028694},{filename:"/tmp/pglite/share/postgresql/timezone/America/Los_Angeles",start:5028694,end:5029988},{filename:"/tmp/pglite/share/postgresql/timezone/America/Louisville",start:5029988,end:5031230},{filename:"/tmp/pglite/share/postgresql/timezone/America/Lower_Princes",start:5031230,end:5031407},{filename:"/tmp/pglite/share/postgresql/timezone/America/Maceio",start:5031407,end:5031909},{filename:"/tmp/pglite/share/postgresql/timezone/America/Managua",start:5031909,end:5032204},{filename:"/tmp/pglite/share/postgresql/timezone/America/Manaus",start:5032204,end:5032616},{filename:"/tmp/pglite/share/postgresql/timezone/America/Marigot",start:5032616,end:5032793},{filename:"/tmp/pglite/share/postgresql/timezone/America/Martinique",start:5032793,end:5032971},{filename:"/tmp/pglite/share/postgresql/timezone/America/Matamoros",start:5032971,end:5033408},{filename:"/tmp/pglite/share/postgresql/timezone/America/Mazatlan",start:5033408,end:5034126},{filename:"/tmp/pglite/share/postgresql/timezone/America/Mendoza",start:5034126,end:5034834},{filename:"/tmp/pglite/share/postgresql/timezone/America/Menominee",start:5034834,end:5035751},{filename:"/tmp/pglite/share/postgresql/timezone/America/Merida",start:5035751,end:5036405},{filename:"/tmp/pglite/share/postgresql/timezone/America/Metlakatla",start:5036405,end:5037e3},{filename:"/tmp/pglite/share/postgresql/timezone/America/Mexico_City",start:5037e3,end:5037773},{filename:"/tmp/pglite/share/postgresql/timezone/America/Miquelon",start:5037773,end:5038323},{filename:"/tmp/pglite/share/postgresql/timezone/America/Moncton",start:5038323,end:5039816},{filename:"/tmp/pglite/share/postgresql/timezone/America/Monterrey",start:5039816,end:5040460},{filename:"/tmp/pglite/share/postgresql/timezone/America/Montevideo",start:5040460,end:5041429},{filename:"/tmp/pglite/share/postgresql/timezone/America/Montreal",start:5041429,end:5043146},{filename:"/tmp/pglite/share/postgresql/timezone/America/Montserrat",start:5043146,end:5043323},{filename:"/tmp/pglite/share/postgresql/timezone/America/Nassau",start:5043323,end:5045040},{filename:"/tmp/pglite/share/postgresql/timezone/America/New_York",start:5045040,end:5046784},{filename:"/tmp/pglite/share/postgresql/timezone/America/Nipigon",start:5046784,end:5048501},{filename:"/tmp/pglite/share/postgresql/timezone/America/Nome",start:5048501,end:5049476},{filename:"/tmp/pglite/share/postgresql/timezone/America/Noronha",start:5049476,end:5049960},{filename:"/tmp/pglite/share/postgresql/timezone/America/North_Dakota/Beulah",start:5049960,end:5051003},{filename:"/tmp/pglite/share/postgresql/timezone/America/North_Dakota/Center",start:5051003,end:5051993},{filename:"/tmp/pglite/share/postgresql/timezone/America/North_Dakota/New_Salem",start:5051993,end:5052983},{filename:"/tmp/pglite/share/postgresql/timezone/America/Nuuk",start:5052983,end:5053948},{filename:"/tmp/pglite/share/postgresql/timezone/America/Ojinaga",start:5053948,end:5054657},{filename:"/tmp/pglite/share/postgresql/timezone/America/Panama",start:5054657,end:5054806},{filename:"/tmp/pglite/share/postgresql/timezone/America/Pangnirtung",start:5054806,end:5055661},{filename:"/tmp/pglite/share/postgresql/timezone/America/Paramaribo",start:5055661,end:5055848},{filename:"/tmp/pglite/share/postgresql/timezone/America/Phoenix",start:5055848,end:5056088},{filename:"/tmp/pglite/share/postgresql/timezone/America/Port-au-Prince",start:5056088,end:5056653},{filename:"/tmp/pglite/share/postgresql/timezone/America/Port_of_Spain",start:5056653,end:5056830},{filename:"/tmp/pglite/share/postgresql/timezone/America/Porto_Acre",start:5056830,end:5057248},{filename:"/tmp/pglite/share/postgresql/timezone/America/Porto_Velho",start:5057248,end:5057642},{filename:"/tmp/pglite/share/postgresql/timezone/America/Puerto_Rico",start:5057642,end:5057819},{filename:"/tmp/pglite/share/postgresql/timezone/America/Punta_Arenas",start:5057819,end:5059037},{filename:"/tmp/pglite/share/postgresql/timezone/America/Rainy_River",start:5059037,end:5060331},{filename:"/tmp/pglite/share/postgresql/timezone/America/Rankin_Inlet",start:5060331,end:5061138},{filename:"/tmp/pglite/share/postgresql/timezone/America/Recife",start:5061138,end:5061622},{filename:"/tmp/pglite/share/postgresql/timezone/America/Regina",start:5061622,end:5062260},{filename:"/tmp/pglite/share/postgresql/timezone/America/Resolute",start:5062260,end:5063067},{filename:"/tmp/pglite/share/postgresql/timezone/America/Rio_Branco",start:5063067,end:5063485},{filename:"/tmp/pglite/share/postgresql/timezone/America/Rosario",start:5063485,end:5064193},{filename:"/tmp/pglite/share/postgresql/timezone/America/Santa_Isabel",start:5064193,end:5065218},{filename:"/tmp/pglite/share/postgresql/timezone/America/Santarem",start:5065218,end:5065627},{filename:"/tmp/pglite/share/postgresql/timezone/America/Santiago",start:5065627,end:5066981},{filename:"/tmp/pglite/share/postgresql/timezone/America/Santo_Domingo",start:5066981,end:5067298},{filename:"/tmp/pglite/share/postgresql/timezone/America/Sao_Paulo",start:5067298,end:5068250},{filename:"/tmp/pglite/share/postgresql/timezone/America/Scoresbysund",start:5068250,end:5069234},{filename:"/tmp/pglite/share/postgresql/timezone/America/Shiprock",start:5069234,end:5070276},{filename:"/tmp/pglite/share/postgresql/timezone/America/Sitka",start:5070276,end:5071232},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Barthelemy",start:5071232,end:5071409},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Johns",start:5071409,end:5073287},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Kitts",start:5073287,end:5073464},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Lucia",start:5073464,end:5073641},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Thomas",start:5073641,end:5073818},{filename:"/tmp/pglite/share/postgresql/timezone/America/St_Vincent",start:5073818,end:5073995},{filename:"/tmp/pglite/share/postgresql/timezone/America/Swift_Current",start:5073995,end:5074363},{filename:"/tmp/pglite/share/postgresql/timezone/America/Tegucigalpa",start:5074363,end:5074557},{filename:"/tmp/pglite/share/postgresql/timezone/America/Thule",start:5074557,end:5075012},{filename:"/tmp/pglite/share/postgresql/timezone/America/Thunder_Bay",start:5075012,end:5076729},{filename:"/tmp/pglite/share/postgresql/timezone/America/Tijuana",start:5076729,end:5077754},{filename:"/tmp/pglite/share/postgresql/timezone/America/Toronto",start:5077754,end:5079471},{filename:"/tmp/pglite/share/postgresql/timezone/America/Tortola",start:5079471,end:5079648},{filename:"/tmp/pglite/share/postgresql/timezone/America/Vancouver",start:5079648,end:5080978},{filename:"/tmp/pglite/share/postgresql/timezone/America/Virgin",start:5080978,end:5081155},{filename:"/tmp/pglite/share/postgresql/timezone/America/Whitehorse",start:5081155,end:5082184},{filename:"/tmp/pglite/share/postgresql/timezone/America/Winnipeg",start:5082184,end:5083478},{filename:"/tmp/pglite/share/postgresql/timezone/America/Yakutat",start:5083478,end:5084424},{filename:"/tmp/pglite/share/postgresql/timezone/America/Yellowknife",start:5084424,end:5085394},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Casey",start:5085394,end:5085681},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Davis",start:5085681,end:5085878},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/DumontDUrville",start:5085878,end:5086032},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Macquarie",start:5086032,end:5087008},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Mawson",start:5087008,end:5087160},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/McMurdo",start:5087160,end:5088203},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Palmer",start:5088203,end:5089090},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Rothera",start:5089090,end:5089222},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/South_Pole",start:5089222,end:5090265},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Syowa",start:5090265,end:5090398},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Troll",start:5090398,end:5090575},{filename:"/tmp/pglite/share/postgresql/timezone/Antarctica/Vostok",start:5090575,end:5090745},{filename:"/tmp/pglite/share/postgresql/timezone/Arctic/Longyearbyen",start:5090745,end:5091450},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Aden",start:5091450,end:5091583},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Almaty",start:5091583,end:5092201},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Amman",start:5092201,end:5093129},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Anadyr",start:5093129,end:5093872},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Aqtau",start:5093872,end:5094478},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Aqtobe",start:5094478,end:5095093},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ashgabat",start:5095093,end:5095468},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ashkhabad",start:5095468,end:5095843},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Atyrau",start:5095843,end:5096459},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Baghdad",start:5096459,end:5097089},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Bahrain",start:5097089,end:5097241},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Baku",start:5097241,end:5097985},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Bangkok",start:5097985,end:5098137},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Barnaul",start:5098137,end:5098890},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Beirut",start:5098890,end:5099622},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Bishkek",start:5099622,end:5100240},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Brunei",start:5100240,end:5100560},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Calcutta",start:5100560,end:5100780},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Chita",start:5100780,end:5101530},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Choibalsan",start:5101530,end:5102149},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Chongqing",start:5102149,end:5102542},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Chungking",start:5102542,end:5102935},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Colombo",start:5102935,end:5103182},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Dacca",start:5103182,end:5103413},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Damascus",start:5103413,end:5104647},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Dhaka",start:5104647,end:5104878},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Dili",start:5104878,end:5105048},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Dubai",start:5105048,end:5105181},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Dushanbe",start:5105181,end:5105547},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Famagusta",start:5105547,end:5106487},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Gaza",start:5106487,end:5108933},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Harbin",start:5108933,end:5109326},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Hebron",start:5109326,end:5111790},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ho_Chi_Minh",start:5111790,end:5112026},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Hong_Kong",start:5112026,end:5112801},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Hovd",start:5112801,end:5113395},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Irkutsk",start:5113395,end:5114155},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Istanbul",start:5114155,end:5115355},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Jakarta",start:5115355,end:5115603},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Jayapura",start:5115603,end:5115774},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Jerusalem",start:5115774,end:5116848},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kabul",start:5116848,end:5117007},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kamchatka",start:5117007,end:5117734},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Karachi",start:5117734,end:5118e3},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kashgar",start:5118e3,end:5118133},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kathmandu",start:5118133,end:5118294},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Katmandu",start:5118294,end:5118455},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Khandyga",start:5118455,end:5119230},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kolkata",start:5119230,end:5119450},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Krasnoyarsk",start:5119450,end:5120191},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kuala_Lumpur",start:5120191,end:5120447},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kuching",start:5120447,end:5120767},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Kuwait",start:5120767,end:5120900},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Macao",start:5120900,end:5121691},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Macau",start:5121691,end:5122482},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Magadan",start:5122482,end:5123233},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Makassar",start:5123233,end:5123423},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Manila",start:5123423,end:5123661},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Muscat",start:5123661,end:5123794},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Nicosia",start:5123794,end:5124391},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Novokuznetsk",start:5124391,end:5125117},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Novosibirsk",start:5125117,end:5125870},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Omsk",start:5125870,end:5126611},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Oral",start:5126611,end:5127236},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Phnom_Penh",start:5127236,end:5127388},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Pontianak",start:5127388,end:5127635},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Pyongyang",start:5127635,end:5127818},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Qatar",start:5127818,end:5127970},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Qostanay",start:5127970,end:5128594},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Qyzylorda",start:5128594,end:5129218},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Rangoon",start:5129218,end:5129405},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Riyadh",start:5129405,end:5129538},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Saigon",start:5129538,end:5129774},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Sakhalin",start:5129774,end:5130529},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Samarkand",start:5130529,end:5130895},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Seoul",start:5130895,end:5131310},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Shanghai",start:5131310,end:5131703},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Singapore",start:5131703,end:5131959},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Srednekolymsk",start:5131959,end:5132701},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Taipei",start:5132701,end:5133212},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tashkent",start:5133212,end:5133578},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tbilisi",start:5133578,end:5134207},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tehran",start:5134207,end:5135019},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tel_Aviv",start:5135019,end:5136093},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Thimbu",start:5136093,end:5136247},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Thimphu",start:5136247,end:5136401},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tokyo",start:5136401,end:5136614},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Tomsk",start:5136614,end:5137367},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ujung_Pandang",start:5137367,end:5137557},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ulaanbaatar",start:5137557,end:5138151},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ulan_Bator",start:5138151,end:5138745},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Urumqi",start:5138745,end:5138878},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Ust-Nera",start:5138878,end:5139649},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Vientiane",start:5139649,end:5139801},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Vladivostok",start:5139801,end:5140543},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Yakutsk",start:5140543,end:5141284},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Yangon",start:5141284,end:5141471},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Yekaterinburg",start:5141471,end:5142231},{filename:"/tmp/pglite/share/postgresql/timezone/Asia/Yerevan",start:5142231,end:5142939},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Azores",start:5142939,end:5144392},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Bermuda",start:5144392,end:5145416},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Canary",start:5145416,end:5145894},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Cape_Verde",start:5145894,end:5146069},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Faeroe",start:5146069,end:5146510},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Faroe",start:5146510,end:5146951},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Jan_Mayen",start:5146951,end:5147656},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Madeira",start:5147656,end:5149109},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Reykjavik",start:5149109,end:5149239},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/South_Georgia",start:5149239,end:5149371},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/St_Helena",start:5149371,end:5149501},{filename:"/tmp/pglite/share/postgresql/timezone/Atlantic/Stanley",start:5149501,end:5150290},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/ACT",start:5150290,end:5151194},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Adelaide",start:5151194,end:5152115},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Brisbane",start:5152115,end:5152404},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Broken_Hill",start:5152404,end:5153345},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Canberra",start:5153345,end:5154249},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Currie",start:5154249,end:5155252},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Darwin",start:5155252,end:5155486},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Eucla",start:5155486,end:5155800},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Hobart",start:5155800,end:5156803},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/LHI",start:5156803,end:5157495},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Lindeman",start:5157495,end:5157820},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Lord_Howe",start:5157820,end:5158512},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Melbourne",start:5158512,end:5159416},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/NSW",start:5159416,end:5160320},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/North",start:5160320,end:5160554},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Perth",start:5160554,end:5160860},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Queensland",start:5160860,end:5161149},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/South",start:5161149,end:5162070},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Sydney",start:5162070,end:5162974},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Tasmania",start:5162974,end:5163977},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Victoria",start:5163977,end:5164881},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/West",start:5164881,end:5165187},{filename:"/tmp/pglite/share/postgresql/timezone/Australia/Yancowinna",start:5165187,end:5166128},{filename:"/tmp/pglite/share/postgresql/timezone/Brazil/Acre",start:5166128,end:5166546},{filename:"/tmp/pglite/share/postgresql/timezone/Brazil/DeNoronha",start:5166546,end:5167030},{filename:"/tmp/pglite/share/postgresql/timezone/Brazil/East",start:5167030,end:5167982},{filename:"/tmp/pglite/share/postgresql/timezone/Brazil/West",start:5167982,end:5168394},{filename:"/tmp/pglite/share/postgresql/timezone/CET",start:5168394,end:5169015},{filename:"/tmp/pglite/share/postgresql/timezone/CST6CDT",start:5169015,end:5169966},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Atlantic",start:5169966,end:5171638},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Central",start:5171638,end:5172932},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Eastern",start:5172932,end:5174649},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Mountain",start:5174649,end:5175619},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Newfoundland",start:5175619,end:5177497},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Pacific",start:5177497,end:5178827},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Saskatchewan",start:5178827,end:5179465},{filename:"/tmp/pglite/share/postgresql/timezone/Canada/Yukon",start:5179465,end:5180494},{filename:"/tmp/pglite/share/postgresql/timezone/Chile/Continental",start:5180494,end:5181848},{filename:"/tmp/pglite/share/postgresql/timezone/Chile/EasterIsland",start:5181848,end:5183022},{filename:"/tmp/pglite/share/postgresql/timezone/Cuba",start:5183022,end:5184139},{filename:"/tmp/pglite/share/postgresql/timezone/EET",start:5184139,end:5184636},{filename:"/tmp/pglite/share/postgresql/timezone/EST",start:5184636,end:5184747},{filename:"/tmp/pglite/share/postgresql/timezone/EST5EDT",start:5184747,end:5185698},{filename:"/tmp/pglite/share/postgresql/timezone/Egypt",start:5185698,end:5187007},{filename:"/tmp/pglite/share/postgresql/timezone/Eire",start:5187007,end:5188503},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT",start:5188503,end:5188614},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+0",start:5188614,end:5188725},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+1",start:5188725,end:5188838},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+10",start:5188838,end:5188952},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+11",start:5188952,end:5189066},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+12",start:5189066,end:5189180},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+2",start:5189180,end:5189293},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+3",start:5189293,end:5189406},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+4",start:5189406,end:5189519},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+5",start:5189519,end:5189632},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+6",start:5189632,end:5189745},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+7",start:5189745,end:5189858},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+8",start:5189858,end:5189971},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT+9",start:5189971,end:5190084},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-0",start:5190084,end:5190195},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-1",start:5190195,end:5190309},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-10",start:5190309,end:5190424},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-11",start:5190424,end:5190539},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-12",start:5190539,end:5190654},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-13",start:5190654,end:5190769},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-14",start:5190769,end:5190884},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-2",start:5190884,end:5190998},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-3",start:5190998,end:5191112},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-4",start:5191112,end:5191226},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-5",start:5191226,end:5191340},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-6",start:5191340,end:5191454},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-7",start:5191454,end:5191568},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-8",start:5191568,end:5191682},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT-9",start:5191682,end:5191796},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/GMT0",start:5191796,end:5191907},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/Greenwich",start:5191907,end:5192018},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/UCT",start:5192018,end:5192129},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/UTC",start:5192129,end:5192240},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/Universal",start:5192240,end:5192351},{filename:"/tmp/pglite/share/postgresql/timezone/Etc/Zulu",start:5192351,end:5192462},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Amsterdam",start:5192462,end:5193565},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Andorra",start:5193565,end:5193954},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Astrakhan",start:5193954,end:5194680},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Athens",start:5194680,end:5195362},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Belfast",start:5195362,end:5196961},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Belgrade",start:5196961,end:5197439},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Berlin",start:5197439,end:5198144},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Bratislava",start:5198144,end:5198867},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Brussels",start:5198867,end:5199970},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Bucharest",start:5199970,end:5200631},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Budapest",start:5200631,end:5201397},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Busingen",start:5201397,end:5201894},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Chisinau",start:5201894,end:5202649},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Copenhagen",start:5202649,end:5203354},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Dublin",start:5203354,end:5204850},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Gibraltar",start:5204850,end:5206070},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Guernsey",start:5206070,end:5207669},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Helsinki",start:5207669,end:5208150},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Isle_of_Man",start:5208150,end:5209749},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Istanbul",start:5209749,end:5210949},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Jersey",start:5210949,end:5212548},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Kaliningrad",start:5212548,end:5213452},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Kiev",start:5213452,end:5214010},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Kirov",start:5214010,end:5214745},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Kyiv",start:5214745,end:5215303},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Lisbon",start:5215303,end:5216757},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Ljubljana",start:5216757,end:5217235},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/London",start:5217235,end:5218834},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Luxembourg",start:5218834,end:5219937},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Madrid",start:5219937,end:5220834},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Malta",start:5220834,end:5221762},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Mariehamn",start:5221762,end:5222243},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Minsk",start:5222243,end:5223051},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Monaco",start:5223051,end:5224156},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Moscow",start:5224156,end:5225064},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Nicosia",start:5225064,end:5225661},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Oslo",start:5225661,end:5226366},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Paris",start:5226366,end:5227471},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Podgorica",start:5227471,end:5227949},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Prague",start:5227949,end:5228672},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Riga",start:5228672,end:5229366},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Rome",start:5229366,end:5230313},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Samara",start:5230313,end:5231045},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/San_Marino",start:5231045,end:5231992},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Sarajevo",start:5231992,end:5232470},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Saratov",start:5232470,end:5233196},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Simferopol",start:5233196,end:5234061},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Skopje",start:5234061,end:5234539},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Sofia",start:5234539,end:5235131},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Stockholm",start:5235131,end:5235836},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Tallinn",start:5235836,end:5236511},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Tirane",start:5236511,end:5237115},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Tiraspol",start:5237115,end:5237870},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Ulyanovsk",start:5237870,end:5238630},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Uzhgorod",start:5238630,end:5239188},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Vaduz",start:5239188,end:5239685},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Vatican",start:5239685,end:5240632},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Vienna",start:5240632,end:5241290},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Vilnius",start:5241290,end:5241966},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Volgograd",start:5241966,end:5242719},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Warsaw",start:5242719,end:5243642},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Zagreb",start:5243642,end:5244120},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Zaporozhye",start:5244120,end:5244678},{filename:"/tmp/pglite/share/postgresql/timezone/Europe/Zurich",start:5244678,end:5245175},{filename:"/tmp/pglite/share/postgresql/timezone/Factory",start:5245175,end:5245288},{filename:"/tmp/pglite/share/postgresql/timezone/GB",start:5245288,end:5246887},{filename:"/tmp/pglite/share/postgresql/timezone/GB-Eire",start:5246887,end:5248486},{filename:"/tmp/pglite/share/postgresql/timezone/GMT",start:5248486,end:5248597},{filename:"/tmp/pglite/share/postgresql/timezone/GMT+0",start:5248597,end:5248708},{filename:"/tmp/pglite/share/postgresql/timezone/GMT-0",start:5248708,end:5248819},{filename:"/tmp/pglite/share/postgresql/timezone/GMT0",start:5248819,end:5248930},{filename:"/tmp/pglite/share/postgresql/timezone/Greenwich",start:5248930,end:5249041},{filename:"/tmp/pglite/share/postgresql/timezone/HST",start:5249041,end:5249153},{filename:"/tmp/pglite/share/postgresql/timezone/Hongkong",start:5249153,end:5249928},{filename:"/tmp/pglite/share/postgresql/timezone/Iceland",start:5249928,end:5250058},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Antananarivo",start:5250058,end:5250249},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Chagos",start:5250249,end:5250401},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Christmas",start:5250401,end:5250553},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Cocos",start:5250553,end:5250740},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Comoro",start:5250740,end:5250931},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Kerguelen",start:5250931,end:5251083},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Mahe",start:5251083,end:5251216},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Maldives",start:5251216,end:5251368},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Mauritius",start:5251368,end:5251547},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Mayotte",start:5251547,end:5251738},{filename:"/tmp/pglite/share/postgresql/timezone/Indian/Reunion",start:5251738,end:5251871},{filename:"/tmp/pglite/share/postgresql/timezone/Iran",start:5251871,end:5252683},{filename:"/tmp/pglite/share/postgresql/timezone/Israel",start:5252683,end:5253757},{filename:"/tmp/pglite/share/postgresql/timezone/Jamaica",start:5253757,end:5254096},{filename:"/tmp/pglite/share/postgresql/timezone/Japan",start:5254096,end:5254309},{filename:"/tmp/pglite/share/postgresql/timezone/Kwajalein",start:5254309,end:5254528},{filename:"/tmp/pglite/share/postgresql/timezone/Libya",start:5254528,end:5254959},{filename:"/tmp/pglite/share/postgresql/timezone/MET",start:5254959,end:5255580},{filename:"/tmp/pglite/share/postgresql/timezone/MST",start:5255580,end:5255691},{filename:"/tmp/pglite/share/postgresql/timezone/MST7MDT",start:5255691,end:5256642},{filename:"/tmp/pglite/share/postgresql/timezone/Mexico/BajaNorte",start:5256642,end:5257667},{filename:"/tmp/pglite/share/postgresql/timezone/Mexico/BajaSur",start:5257667,end:5258385},{filename:"/tmp/pglite/share/postgresql/timezone/Mexico/General",start:5258385,end:5259158},{filename:"/tmp/pglite/share/postgresql/timezone/NZ",start:5259158,end:5260201},{filename:"/tmp/pglite/share/postgresql/timezone/NZ-CHAT",start:5260201,end:5261009},{filename:"/tmp/pglite/share/postgresql/timezone/Navajo",start:5261009,end:5262051},{filename:"/tmp/pglite/share/postgresql/timezone/PRC",start:5262051,end:5262444},{filename:"/tmp/pglite/share/postgresql/timezone/PST8PDT",start:5262444,end:5263395},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Apia",start:5263395,end:5263802},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Auckland",start:5263802,end:5264845},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Bougainville",start:5264845,end:5265046},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Chatham",start:5265046,end:5265854},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Chuuk",start:5265854,end:5266008},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Easter",start:5266008,end:5267182},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Efate",start:5267182,end:5267524},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Enderbury",start:5267524,end:5267696},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Fakaofo",start:5267696,end:5267849},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Fiji",start:5267849,end:5268245},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Funafuti",start:5268245,end:5268379},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Galapagos",start:5268379,end:5268554},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Gambier",start:5268554,end:5268686},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Guadalcanal",start:5268686,end:5268820},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Guam",start:5268820,end:5269170},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Honolulu",start:5269170,end:5269391},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Johnston",start:5269391,end:5269612},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Kanton",start:5269612,end:5269784},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Kiritimati",start:5269784,end:5269958},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Kosrae",start:5269958,end:5270200},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Kwajalein",start:5270200,end:5270419},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Majuro",start:5270419,end:5270553},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Marquesas",start:5270553,end:5270692},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Midway",start:5270692,end:5270838},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Nauru",start:5270838,end:5271021},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Niue",start:5271021,end:5271175},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Norfolk",start:5271175,end:5271422},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Noumea",start:5271422,end:5271620},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Pago_Pago",start:5271620,end:5271766},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Palau",start:5271766,end:5271914},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Pitcairn",start:5271914,end:5272067},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Pohnpei",start:5272067,end:5272201},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Ponape",start:5272201,end:5272335},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Port_Moresby",start:5272335,end:5272489},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Rarotonga",start:5272489,end:5272895},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Saipan",start:5272895,end:5273245},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Samoa",start:5273245,end:5273391},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Tahiti",start:5273391,end:5273524},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Tarawa",start:5273524,end:5273658},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Tongatapu",start:5273658,end:5273895},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Truk",start:5273895,end:5274049},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Wake",start:5274049,end:5274183},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Wallis",start:5274183,end:5274317},{filename:"/tmp/pglite/share/postgresql/timezone/Pacific/Yap",start:5274317,end:5274471},{filename:"/tmp/pglite/share/postgresql/timezone/Poland",start:5274471,end:5275394},{filename:"/tmp/pglite/share/postgresql/timezone/Portugal",start:5275394,end:5276848},{filename:"/tmp/pglite/share/postgresql/timezone/ROC",start:5276848,end:5277359},{filename:"/tmp/pglite/share/postgresql/timezone/ROK",start:5277359,end:5277774},{filename:"/tmp/pglite/share/postgresql/timezone/Singapore",start:5277774,end:5278030},{filename:"/tmp/pglite/share/postgresql/timezone/Turkey",start:5278030,end:5279230},{filename:"/tmp/pglite/share/postgresql/timezone/UCT",start:5279230,end:5279341},{filename:"/tmp/pglite/share/postgresql/timezone/US/Alaska",start:5279341,end:5280318},{filename:"/tmp/pglite/share/postgresql/timezone/US/Aleutian",start:5280318,end:5281287},{filename:"/tmp/pglite/share/postgresql/timezone/US/Arizona",start:5281287,end:5281527},{filename:"/tmp/pglite/share/postgresql/timezone/US/Central",start:5281527,end:5283281},{filename:"/tmp/pglite/share/postgresql/timezone/US/East-Indiana",start:5283281,end:5283812},{filename:"/tmp/pglite/share/postgresql/timezone/US/Eastern",start:5283812,end:5285556},{filename:"/tmp/pglite/share/postgresql/timezone/US/Hawaii",start:5285556,end:5285777},{filename:"/tmp/pglite/share/postgresql/timezone/US/Indiana-Starke",start:5285777,end:5286793},{filename:"/tmp/pglite/share/postgresql/timezone/US/Michigan",start:5286793,end:5287692},{filename:"/tmp/pglite/share/postgresql/timezone/US/Mountain",start:5287692,end:5288734},{filename:"/tmp/pglite/share/postgresql/timezone/US/Pacific",start:5288734,end:5290028},{filename:"/tmp/pglite/share/postgresql/timezone/US/Samoa",start:5290028,end:5290174},{filename:"/tmp/pglite/share/postgresql/timezone/UTC",start:5290174,end:5290285},{filename:"/tmp/pglite/share/postgresql/timezone/Universal",start:5290285,end:5290396},{filename:"/tmp/pglite/share/postgresql/timezone/W-SU",start:5290396,end:5291304},{filename:"/tmp/pglite/share/postgresql/timezone/WET",start:5291304,end:5291798},{filename:"/tmp/pglite/share/postgresql/timezone/Zulu",start:5291798,end:5291909},{filename:"/tmp/pglite/share/postgresql/timezonesets/Africa.txt",start:5291909,end:5298882},{filename:"/tmp/pglite/share/postgresql/timezonesets/America.txt",start:5298882,end:5309889},{filename:"/tmp/pglite/share/postgresql/timezonesets/Antarctica.txt",start:5309889,end:5311023},{filename:"/tmp/pglite/share/postgresql/timezonesets/Asia.txt",start:5311023,end:5319334},{filename:"/tmp/pglite/share/postgresql/timezonesets/Atlantic.txt",start:5319334,end:5322867},{filename:"/tmp/pglite/share/postgresql/timezonesets/Australia",start:5322867,end:5324002},{filename:"/tmp/pglite/share/postgresql/timezonesets/Australia.txt",start:5324002,end:5327386},{filename:"/tmp/pglite/share/postgresql/timezonesets/Default",start:5327386,end:5354636},{filename:"/tmp/pglite/share/postgresql/timezonesets/Etc.txt",start:5354636,end:5355886},{filename:"/tmp/pglite/share/postgresql/timezonesets/Europe.txt",start:5355886,end:5364668},{filename:"/tmp/pglite/share/postgresql/timezonesets/India",start:5364668,end:5365261},{filename:"/tmp/pglite/share/postgresql/timezonesets/Indian.txt",start:5365261,end:5366522},{filename:"/tmp/pglite/share/postgresql/timezonesets/Pacific.txt",start:5366522,end:5370290},{filename:"/tmp/pglite/share/postgresql/tsearch_data/danish.stop",start:5370290,end:5370714},{filename:"/tmp/pglite/share/postgresql/tsearch_data/dutch.stop",start:5370714,end:5371167},{filename:"/tmp/pglite/share/postgresql/tsearch_data/english.stop",start:5371167,end:5371789},{filename:"/tmp/pglite/share/postgresql/tsearch_data/finnish.stop",start:5371789,end:5373368},{filename:"/tmp/pglite/share/postgresql/tsearch_data/french.stop",start:5373368,end:5374173},{filename:"/tmp/pglite/share/postgresql/tsearch_data/german.stop",start:5374173,end:5375522},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hungarian.stop",start:5375522,end:5376749},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hunspell_sample.affix",start:5376749,end:5376992},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hunspell_sample_long.affix",start:5376992,end:5377625},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hunspell_sample_long.dict",start:5377625,end:5377723},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hunspell_sample_num.affix",start:5377723,end:5378185},{filename:"/tmp/pglite/share/postgresql/tsearch_data/hunspell_sample_num.dict",start:5378185,end:5378314},{filename:"/tmp/pglite/share/postgresql/tsearch_data/ispell_sample.affix",start:5378314,end:5378779},{filename:"/tmp/pglite/share/postgresql/tsearch_data/ispell_sample.dict",start:5378779,end:5378860},{filename:"/tmp/pglite/share/postgresql/tsearch_data/italian.stop",start:5378860,end:5380514},{filename:"/tmp/pglite/share/postgresql/tsearch_data/nepali.stop",start:5380514,end:5384775},{filename:"/tmp/pglite/share/postgresql/tsearch_data/norwegian.stop",start:5384775,end:5385626},{filename:"/tmp/pglite/share/postgresql/tsearch_data/portuguese.stop",start:5385626,end:5386893},{filename:"/tmp/pglite/share/postgresql/tsearch_data/russian.stop",start:5386893,end:5388128},{filename:"/tmp/pglite/share/postgresql/tsearch_data/spanish.stop",start:5388128,end:5390306},{filename:"/tmp/pglite/share/postgresql/tsearch_data/swedish.stop",start:5390306,end:5390865},{filename:"/tmp/pglite/share/postgresql/tsearch_data/synonym_sample.syn",start:5390865,end:5390938},{filename:"/tmp/pglite/share/postgresql/tsearch_data/thesaurus_sample.ths",start:5390938,end:5391411},{filename:"/tmp/pglite/share/postgresql/tsearch_data/turkish.stop",start:5391411,end:5391671},{filename:"/tmp/pglite/share/postgresql/tsearch_data/unaccent.rules",start:5391671,end:5401610},{filename:"/tmp/pglite/share/postgresql/tsearch_data/xsyn_sample.rules",start:5401610,end:5401749}],remote_package_size:5401749})})();var moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=(e,t)=>{throw t},scriptDirectory="";function locateFile(e){return Module.locateFile?Module.locateFile(e,scriptDirectory):scriptDirectory+e}var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs"),nodePath=require("path");import.meta.url.startsWith("data:")||(scriptDirectory=nodePath.dirname(require("url").fileURLToPath(import.meta.url))+"/"),readBinary=e=>{e=isFileURI(e)?new URL(e):e;var t=fs.readFileSync(e);return t},readAsync=async(e,t=!0)=>{e=isFileURI(e)?new URL(e):e;var tr=fs.readFileSync(e,t?void 0:"utf8");return tr},!Module.thisProgram&&process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),quit_=(e,t)=>{throw process.exitCode=e,t}}else(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:typeof document<"u"&&document.currentScript&&(scriptDirectory=document.currentScript.src),_scriptName&&(scriptDirectory=_scriptName),scriptDirectory.startsWith("blob:")?scriptDirectory="":scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1),readAsync=async e=>{var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw new Error(t.status+" : "+t.url)});var out=Module.print||console.log.bind(console),err=Module.printErr||console.error.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram);var dynamicLibraries=Module.dynamicLibraries||[],wasmBinary=Module.wasmBinary,wasmMemory,ABORT=!1,EXITSTATUS;function assert(e,t){e||abort(t)}var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAP64,HEAPF64;function updateMemoryViews(){var e=wasmMemory.buffer;Module.HEAP8=HEAP8=new Int8Array(e),Module.HEAP16=HEAP16=new Int16Array(e),Module.HEAPU8=HEAPU8=new Uint8Array(e),Module.HEAPU16=HEAPU16=new Uint16Array(e),Module.HEAP32=HEAP32=new Int32Array(e),Module.HEAPU32=HEAPU32=new Uint32Array(e),Module.HEAPF32=HEAPF32=new Float32Array(e),Module.HEAPF64=HEAPF64=new Float64Array(e),Module.HEAP64=HEAP64=new BigInt64Array(e),Module.HEAPU64=new BigUint64Array(e)}if(Module.wasmMemory)wasmMemory=Module.wasmMemory;else{var INITIAL_MEMORY=Module.INITIAL_MEMORY||134217728;wasmMemory=new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:32768})}updateMemoryViews();var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATPOSTRUN__=[],__RELOC_FUNCS__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),!Module.noFSInit&&!FS.initialized&&FS.init(),FS.ignorePermissions=!1,SOCKFS.root=FS.mount(SOCKFS,{},null),PIPEFS.root=FS.mount(PIPEFS,{},null),callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}var runDependencies=0,dependenciesFulfilled=null;function addRunDependency(e){var t;runDependencies++,(t=Module.monitorRunDependencies)==null||t.call(Module,runDependencies)}function removeRunDependency(e){var tr;if(runDependencies--,(tr=Module.monitorRunDependencies)==null||tr.call(Module,runDependencies),runDependencies==0&&dependenciesFulfilled){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}}function abort(e){var tr;(tr=Module.onAbort)==null||tr.call(Module,e),e="Aborted("+e+")",err(e),ABORT=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw readyPromiseReject(t),t}var dataURIPrefix="data:application/octet-stream;base64,",isDataURI=e=>e.startsWith(dataURIPrefix),isFileURI=e=>e.startsWith("file://");function findWasmBinary(){if(Module.locateFile){var e="postgres.wasm";return isDataURI(e)?e:locateFile(e)}return new URL(""+new URL("postgres-CyuUVpXN.wasm",import.meta.url).href,import.meta.url).href}var wasmBinaryFile;function getBinarySync(e){if(e==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(e);throw"both async and sync fetching of the wasm failed"}async function getWasmBinary(e){if(!wasmBinary)try{var t=await readAsync(e);return new Uint8Array(t)}catch{}return getBinarySync(e)}async function instantiateArrayBuffer(e,t){try{var tr=await getWasmBinary(e),rr=await WebAssembly.instantiate(tr,t);return rr}catch(ir){err(`failed to asynchronously prepare wasm: ${ir}`),abort(ir)}}async function instantiateAsync(e,t,tr){if(!e&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(t)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function")try{var rr=fetch(t,{credentials:"same-origin"}),ir=await WebAssembly.instantiateStreaming(rr,tr);return ir}catch(lr){err(`wasm streaming compile failed: ${lr}`),err("falling back to ArrayBuffer instantiation")}return instantiateArrayBuffer(t,tr)}function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}async function createWasm(){function e(ir,lr){wasmExports=ir.exports,wasmExports=relocateExports(wasmExports,16777216);var dr=getDylinkMetadata(lr);return dr.neededDynlibs&&(dynamicLibraries=dr.neededDynlibs.concat(dynamicLibraries)),mergeLibSymbols(wasmExports),LDSO.init(),loadDylibs(),addOnInit(wasmExports.__wasm_call_ctors),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),removeRunDependency(),wasmExports}addRunDependency();function t(ir){e(ir.instance,ir.module)}var tr=getWasmImports();if(Module.instantiateWasm)try{return Module.instantiateWasm(tr,e)}catch(ir){err(`Module.instantiateWasm callback failed with error: ${ir}`),readyPromiseReject(ir)}wasmBinaryFile??(wasmBinaryFile=findWasmBinary());try{var rr=await instantiateAsync(wasmBinary,wasmBinaryFile,tr);return t(rr),rr}catch(ir){readyPromiseReject(ir);return}}var ASM_CONSTS={18792944:e=>{Module.is_worker=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,Module.FD_BUFFER_MAX=e,Module.emscripten_copy_to=console.warn},18793117:()=>{Module.postMessage=function(e){console.log("# 1252: onCustomMessage:",__FILE__,e)}},18793242:()=>{if(Module.is_worker){let e=function(t){console.log("onCustomMessage:",t)};Module.onCustomMessage=e}else Module.postMessage=function(e){switch(e.type){case"raw":{stringToUTF8(e.data,shm_rawinput,Module.FD_BUFFER_MAX);break}case"stdin":{stringToUTF8(e.data,1,Module.FD_BUFFER_MAX);break}case"rcon":{stringToUTF8(e.data,shm_rcon,Module.FD_BUFFER_MAX);break}default:console.warn("custom_postMessage?",e)}}}};function is_web_env(){try{if(window)return 1}catch{return 0}}is_web_env.sig="i";class ExitStatus{constructor(t){P$3(this,"name","ExitStatus"),this.message=`Program terminated with exit(${t})`,this.status=t}}var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(e,t){var tr=GOT[t];return tr||(tr=GOT[t]=new WebAssembly.Global({value:"i32",mutable:!0})),currentModuleWeakSymbols.has(t)||(tr.required=!0),tr}},callRuntimeCallbacks=e=>{for(;e.length>0;)e.shift()(Module)},UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder:void 0,UTF8ArrayToString=(e,t=0,tr=NaN)=>{for(var rr=t+tr,ir=t;e[ir]&&!(ir>=rr);)++ir;if(ir-t>16&&e.buffer&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,ir));for(var lr="";t<ir;){var dr=e[t++];if(!(dr&128)){lr+=String.fromCharCode(dr);continue}var fr=e[t++]&63;if((dr&224)==192){lr+=String.fromCharCode((dr&31)<<6|fr);continue}var hr=e[t++]&63;if((dr&240)==224?dr=(dr&15)<<12|fr<<6|hr:dr=(dr&7)<<18|fr<<12|hr<<6|e[t++]&63,dr<65536)lr+=String.fromCharCode(dr);else{var mr=dr-65536;lr+=String.fromCharCode(55296|mr>>10,56320|mr&1023)}}return lr},getDylinkMetadata=e=>{var t=0,tr=0;function rr(){return e[t++]}function ir(){for(var Gr=0,Zn=1;;){var zr=e[t++];if(Gr+=(zr&127)*Zn,Zn*=128,!(zr&128))break}return Gr}function lr(){var Gr=ir();return t+=Gr,UTF8ArrayToString(e,t-Gr,Gr)}function dr(Gr,Zn){if(Gr)throw new Error(Zn)}var fr="dylink.0";if(e instanceof WebAssembly.Module){var hr=WebAssembly.Module.customSections(e,fr);hr.length===0&&(fr="dylink",hr=WebAssembly.Module.customSections(e,fr)),dr(hr.length===0,"need dylink section"),e=new Uint8Array(hr[0]),tr=e.length}else{var mr=new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer),gr=mr[0]==1836278016;dr(!gr,"need to see wasm magic number"),dr(e[8]!==0,"need the dylink section to be first"),t=9;var yr=ir();tr=t+yr,fr=lr()}var _r={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(fr=="dylink"){_r.memorySize=ir(),_r.memoryAlign=ir(),_r.tableSize=ir(),_r.tableAlign=ir();for(var br=ir(),wr=0;wr<br;++wr){var vr=lr();_r.neededDynlibs.push(vr)}}else{dr(fr!=="dylink.0");for(var Sr=1,Ir=2,Mr=3,Ar=4,kr=256,Or=3,Dr=1;t<tr;){var $r=rr(),Fr=ir();if($r===Sr)_r.memorySize=ir(),_r.memoryAlign=ir(),_r.tableSize=ir(),_r.tableAlign=ir();else if($r===Ir)for(var br=ir(),wr=0;wr<br;++wr)vr=lr(),_r.neededDynlibs.push(vr);else if($r===Mr)for(var Lr=ir();Lr--;){var qn=lr(),Kn=ir();Kn&kr&&_r.tlsExports.add(qn)}else if($r===Ar)for(var Lr=ir();Lr--;){lr();var qn=lr(),Kn=ir();(Kn&Or)==Dr&&_r.weakImports.add(qn)}else t+=Fr}}return _r};function getValue(e,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":return HEAP8[e];case"i8":return HEAP8[e];case"i16":return HEAP16[e>>1];case"i32":return HEAP32[e>>2];case"i64":return HEAP64[e>>3];case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];case"*":return HEAPU32[e>>2];default:abort(`invalid type for getValue: ${t}`)}}var newDSO=(e,t,tr)=>{var rr={refcount:1/0,name:e,exports:tr,global:!0};return LDSO.loadedLibsByName[e]=rr,t!=null&&(LDSO.loadedLibsByHandle[t]=rr),rr},LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=23144432,alignMemory=(e,t)=>Math.ceil(e/t)*t,getMemory=e=>{if(runtimeInitialized)return _calloc(e,1);var t=___heap_base,tr=t+alignMemory(e,16);return ___heap_base=tr,GOT.__heap_base.value=tr,t},isInternalSym=e=>["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm","__start_em_js","__stop_em_js"].includes(e)||e.startsWith("__em_js__"),uleb128Encode=(e,t)=>{e<128?t.push(e):t.push(e%128|128,e>>7)},sigToWasmTypes=e=>{for(var t={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},tr={parameters:[],results:e[0]=="v"?[]:[t[e[0]]]},rr=1;rr<e.length;++rr)tr.parameters.push(t[e[rr]]);return tr},generateFuncType=(e,t)=>{var tr=e.slice(0,1),rr=e.slice(1),ir={i:127,p:127,j:126,f:125,d:124,e:111};t.push(96),uleb128Encode(rr.length,t);for(var lr=0;lr<rr.length;++lr)t.push(ir[rr[lr]]);tr=="v"?t.push(0):t.push(1,ir[tr])},convertJsFunctionToWasm=(e,t)=>{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(sigToWasmTypes(t),e);var tr=[1];generateFuncType(t,tr);var rr=[0,97,115,109,1,0,0,0,1];uleb128Encode(tr.length,rr),rr.push(...tr),rr.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var ir=new WebAssembly.Module(new Uint8Array(rr)),lr=new WebAssembly.Instance(ir,{e:{f:e}}),dr=lr.exports.f;return dr},wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:5360,element:"anyfunc"}),getWasmTableEntry=e=>{var t=wasmTableMirror[e];return t||(e>=wasmTableMirror.length&&(wasmTableMirror.length=e+1),wasmTableMirror[e]=t=wasmTable.get(e)),t},updateTableMap=(e,t)=>{if(functionsInTableMap)for(var tr=e;tr<e+t;tr++){var rr=getWasmTableEntry(tr);rr&&functionsInTableMap.set(rr,tr)}},functionsInTableMap,getFunctionAddress=e=>(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.get(e)||0),freeTableIndexes=[],getEmptyTableSlot=()=>{if(freeTableIndexes.length)return freeTableIndexes.pop();try{wasmTable.grow(1)}catch(e){throw e instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":e}return wasmTable.length-1},setWasmTableEntry=(e,t)=>{wasmTable.set(e,t),wasmTableMirror[e]=wasmTable.get(e)},addFunction=(e,t)=>{var tr=getFunctionAddress(e);if(tr)return tr;var rr=getEmptyTableSlot();try{setWasmTableEntry(rr,e)}catch(lr){if(!(lr instanceof TypeError))throw lr;var ir=convertJsFunctionToWasm(e,t);setWasmTableEntry(rr,ir)}return functionsInTableMap.set(e,rr),rr},updateGOT=(e,t)=>{for(var tr in e)if(!isInternalSym(tr)){var rr=e[tr];GOT[tr]||(GOT[tr]=new WebAssembly.Global({value:"i32",mutable:!0})),GOT[tr].value==0&&(typeof rr=="function"?GOT[tr].value=addFunction(rr):typeof rr=="number"?GOT[tr].value=rr:err(`unhandled export type for '${tr}': ${typeof rr}`))}},relocateExports=(e,t,tr)=>{var rr={};for(var ir in e){var lr=e[ir];typeof lr=="object"&&(lr=lr.value),typeof lr=="number"&&(lr+=t),rr[ir]=lr}return updateGOT(rr),rr},isSymbolDefined=e=>{var t=wasmImports[e];return!(!t||t.stub)},dynCall=(e,t,tr=[])=>{var rr=getWasmTableEntry(t)(...tr);return rr},stackSave=()=>_emscripten_stack_get_current(),stackRestore=e=>__emscripten_stack_restore(e),createInvokeFunction=e=>(t,...tr)=>{var rr=stackSave();try{return dynCall(e,t,tr)}catch(ir){if(stackRestore(rr),ir!==ir+0)throw ir;if(_setThrew(1,0),e[0]=="j")return 0n}},resolveGlobalSymbol=(e,t=!1)=>{var tr;return isSymbolDefined(e)?tr=wasmImports[e]:e.startsWith("invoke_")&&(tr=wasmImports[e]=createInvokeFunction(e.split("_")[1])),{sym:tr,name:e}},UTF8ToString=(e,t)=>e?UTF8ArrayToString(HEAPU8,e,t):"",loadWebAssemblyModule=(binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);currentModuleWeakSymbols=metadata.weakImports;function loadModule(){var firstLoad=!handle||!HEAP8[handle+8];if(firstLoad){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;handle&&(HEAP8[handle+8]=1,HEAPU32[handle+12>>2]=memoryBase,HEAP32[handle+16>>2]=metadata.memorySize,HEAPU32[handle+20>>2]=tableBase,HEAP32[handle+24>>2]=metadata.tableSize)}else memoryBase=HEAPU32[handle+12>>2],tableBase=HEAPU32[handle+20>>2];var tableGrowthNeeded=tableBase+metadata.tableSize-wasmTable.length;tableGrowthNeeded>0&&wasmTable.grow(tableGrowthNeeded);var moduleExports;function resolveSymbol(e){var t=resolveGlobalSymbol(e).sym;return!t&&localScope&&(t=localScope[e]),t||(t=moduleExports[e]),t}var proxyHandler={get(e,t){switch(t){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(t in wasmImports&&!wasmImports[t].stub)return wasmImports[t];if(!(t in e)){var tr;e[t]=(...rr)=>(tr||(tr=resolveSymbol(t)),tr(...rr))}return e[t]}},proxy=new Proxy({},proxyHandler),info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols();function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if("__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;start<stop;){var jsString=UTF8ToString(start);addEmAsm(start,jsString),start=HEAPU8.indexOf(0,start)+1}function addEmJs(name,cSig,body){var jsArgs=[];if(cSig=cSig.slice(1,-1),cSig!="void"){cSig=cSig.split(",");for(var i in cSig){var jsArg=cSig[i].split(" ").pop();jsArgs.push(jsArg.replaceAll("*",""))}}var func=`(${jsArgs}) => ${body};`;moduleExports[name]=eval(func)}for(var name in moduleExports)if(name.startsWith("__em_js__")){var start=moduleExports[name],jsString=UTF8ToString(start),parts=jsString.split("<::>");addEmJs(name.replace("__em_js__",""),parts[0],parts[1]),delete moduleExports[name]}var applyRelocs=moduleExports.__wasm_apply_data_relocs;applyRelocs&&(runtimeInitialized?applyRelocs():__RELOC_FUNCS__.push(applyRelocs));var init=moduleExports.__wasm_call_ctors;return init&&(runtimeInitialized?init():__ATINIT__.push(init)),moduleExports}if(flags.loadAsync){if(binary instanceof WebAssembly.Module){var instance=new WebAssembly.Instance(binary,info);return Promise.resolve(postInstantiation(binary,instance))}return WebAssembly.instantiate(binary,info).then(e=>postInstantiation(e.module,e.instance))}var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}return flags.loadAsync?metadata.neededDynlibs.reduce((e,t)=>e.then(()=>loadDynamicLibrary(t,flags,localScope)),Promise.resolve()).then(loadModule):(metadata.neededDynlibs.forEach(e=>loadDynamicLibrary(e,flags,localScope)),loadModule())},mergeLibSymbols=(e,t)=>{for(var[tr,rr]of Object.entries(e)){let ir=dr=>{isSymbolDefined(dr)||(wasmImports[dr]=rr)};ir(tr);let lr="__main_argc_argv";tr=="main"&&ir(lr),tr==lr&&ir("main")}},asyncLoad=async e=>{var t=await readAsync(e);return new Uint8Array(t)},preloadPlugins=Module.preloadPlugins||[],registerWasmPlugin=()=>{var e={promiseChainEnd:Promise.resolve(),canHandle:t=>!Module.noWasmDecoding&&t.endsWith(".so"),handle:(t,tr,rr,ir)=>{e.promiseChainEnd=e.promiseChainEnd.then(()=>loadWebAssemblyModule(t,{loadAsync:!0,nodelete:!0},tr,{})).then(lr=>{preloadedWasm[tr]=lr,rr(t)},lr=>{err(`failed to instantiate wasm: ${tr}: ${lr}`),ir()})}};preloadPlugins.push(e)},preloadedWasm={};function loadDynamicLibrary(e,t={global:!0,nodelete:!0},tr,rr){var ir=LDSO.loadedLibsByName[e];if(ir)return t.global?ir.global||(ir.global=!0,mergeLibSymbols(ir.exports)):tr&&Object.assign(tr,ir.exports),t.nodelete&&ir.refcount!==1/0&&(ir.refcount=1/0),ir.refcount++,rr&&(LDSO.loadedLibsByHandle[rr]=ir),t.loadAsync?Promise.resolve(!0):!0;ir=newDSO(e,rr,"loading"),ir.refcount=t.nodelete?1/0:1,ir.global=t.global;function lr(){if(rr){var hr=HEAPU32[rr+28>>2],mr=HEAPU32[rr+32>>2];if(hr&&mr){var gr=HEAP8.slice(hr,hr+mr);return t.loadAsync?Promise.resolve(gr):gr}}var yr=locateFile(e);if(t.loadAsync)return asyncLoad(yr);if(!readBinary)throw new Error(`${yr}: file not found, and synchronous loading of external files is not available`);return readBinary(yr)}function dr(){var hr=preloadedWasm[e];return hr?t.loadAsync?Promise.resolve(hr):hr:t.loadAsync?lr().then(mr=>loadWebAssemblyModule(mr,t,e,tr,rr)):loadWebAssemblyModule(lr(),t,e,tr,rr)}function fr(hr){ir.global?mergeLibSymbols(hr):tr&&Object.assign(tr,hr),ir.exports=hr}return t.loadAsync?dr().then(hr=>(fr(hr),!0)):(fr(dr()),!0)}var reportUndefinedSymbols=()=>{for(var[e,t]of Object.entries(GOT))if(t.value==0){var tr=resolveGlobalSymbol(e,!0).sym;if(!tr&&!t.required)continue;if(typeof tr=="function")t.value=addFunction(tr,tr.sig);else if(typeof tr=="number")t.value=tr;else throw new Error(`bad export type for '${e}': ${typeof tr}`)}},loadDylibs=()=>{if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency(),dynamicLibraries.reduce((e,t)=>e.then(()=>loadDynamicLibrary(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})),Promise.resolve()).then(()=>{reportUndefinedSymbols(),removeRunDependency()})},noExitRuntime=Module.noExitRuntime||!0;function setValue(e,t,tr="i8"){switch(tr.endsWith("*")&&(tr="*"),tr){case"i1":HEAP8[e]=t;break;case"i8":HEAP8[e]=t;break;case"i16":HEAP16[e>>1]=t;break;case"i32":HEAP32[e>>2]=t;break;case"i64":HEAP64[e>>3]=BigInt(t);break;case"float":HEAPF32[e>>2]=t;break;case"double":HEAPF64[e>>3]=t;break;case"*":HEAPU32[e>>2]=t;break;default:abort(`invalid type for setValue: ${tr}`)}}var ___assert_fail=(e,t,tr,rr)=>abort(`Assertion failed: ${UTF8ToString(e)}, at: `+[t?UTF8ToString(t):"unknown filename",tr,rr?UTF8ToString(rr):"unknown function"]);___assert_fail.sig="vppip";var ___call_sighandler=(e,t)=>getWasmTableEntry(e)(t);___call_sighandler.sig="vpi";var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},16777216),___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},23144432),PATH={isAbs:e=>e.charAt(0)==="/",splitPath:e=>{var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return t.exec(e).slice(1)},normalizeArray:(e,t)=>{for(var tr=0,rr=e.length-1;rr>=0;rr--){var ir=e[rr];ir==="."?e.splice(rr,1):ir===".."?(e.splice(rr,1),tr++):tr&&(e.splice(rr,1),tr--)}if(t)for(;tr;tr--)e.unshift("..");return e},normalize:e=>{var t=PATH.isAbs(e),tr=e.substr(-1)==="/";return e=PATH.normalizeArray(e.split("/").filter(rr=>!!rr),!t).join("/"),!e&&!t&&(e="."),e&&tr&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=PATH.splitPath(e),tr=t[0],rr=t[1];return!tr&&!rr?".":(rr&&(rr=rr.substr(0,rr.length-1)),tr+rr)},basename:e=>{if(e==="/")return"/";e=PATH.normalize(e),e=e.replace(/\/$/,"");var t=e.lastIndexOf("/");return t===-1?e:e.substr(t+1)},join:(...e)=>PATH.normalize(e.join("/")),join2:(e,t)=>PATH.normalize(e+"/"+t)},initRandomFill=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return rr=>crypto.getRandomValues(rr);if(ENVIRONMENT_IS_NODE)try{var e=require("crypto"),t=e.randomFillSync;if(t)return rr=>e.randomFillSync(rr);var tr=e.randomBytes;return rr=>(rr.set(tr(rr.byteLength)),rr)}catch{}abort("initRandomDevice")},randomFill=e=>(randomFill=initRandomFill())(e),PATH_FS={resolve:(...e)=>{for(var t="",tr=!1,rr=e.length-1;rr>=-1&&!tr;rr--){var ir=rr>=0?e[rr]:FS.cwd();if(typeof ir!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!ir)return"";t=ir+"/"+t,tr=PATH.isAbs(ir)}return t=PATH.normalizeArray(t.split("/").filter(lr=>!!lr),!tr).join("/"),(tr?"/":"")+t||"."},relative:(e,t)=>{e=PATH_FS.resolve(e).substr(1),t=PATH_FS.resolve(t).substr(1);function tr(mr){for(var gr=0;gr<mr.length&&mr[gr]==="";gr++);for(var yr=mr.length-1;yr>=0&&mr[yr]==="";yr--);return gr>yr?[]:mr.slice(gr,yr-gr+1)}for(var rr=tr(e.split("/")),ir=tr(t.split("/")),lr=Math.min(rr.length,ir.length),dr=lr,fr=0;fr<lr;fr++)if(rr[fr]!==ir[fr]){dr=fr;break}for(var hr=[],fr=dr;fr<rr.length;fr++)hr.push("..");return hr=hr.concat(ir.slice(dr)),hr.join("/")}},FS_stdin_getChar_buffer=[],lengthBytesUTF8=e=>{for(var t=0,tr=0;tr<e.length;++tr){var rr=e.charCodeAt(tr);rr<=127?t++:rr<=2047?t+=2:rr>=55296&&rr<=57343?(t+=4,++tr):t+=3}return t},stringToUTF8Array=(e,t,tr,rr)=>{if(!(rr>0))return 0;for(var ir=tr,lr=tr+rr-1,dr=0;dr<e.length;++dr){var fr=e.charCodeAt(dr);if(fr>=55296&&fr<=57343){var hr=e.charCodeAt(++dr);fr=65536+((fr&1023)<<10)|hr&1023}if(fr<=127){if(tr>=lr)break;t[tr++]=fr}else if(fr<=2047){if(tr+1>=lr)break;t[tr++]=192|fr>>6,t[tr++]=128|fr&63}else if(fr<=65535){if(tr+2>=lr)break;t[tr++]=224|fr>>12,t[tr++]=128|fr>>6&63,t[tr++]=128|fr&63}else{if(tr+3>=lr)break;t[tr++]=240|fr>>18,t[tr++]=128|fr>>12&63,t[tr++]=128|fr>>6&63,t[tr++]=128|fr&63}}return t[tr]=0,tr-ir};function intArrayFromString(e,t,tr){var rr=lengthBytesUTF8(e)+1,ir=new Array(rr),lr=stringToUTF8Array(e,ir,0,ir.length);return ir.length=lr,ir}var FS_stdin_getChar=()=>{if(!FS_stdin_getChar_buffer.length){var e=null;if(ENVIRONMENT_IS_NODE){var t=256,tr=Buffer.alloc(t),rr=0,ir=process.stdin.fd;try{rr=fs.readSync(ir,tr,0,t)}catch(lr){if(lr.toString().includes("EOF"))rr=0;else throw lr}rr>0&&(e=tr.slice(0,rr).toString("utf-8"))}else typeof window<"u"&&typeof window.prompt=="function"&&(e=window.prompt("Input: "),e!==null&&(e+=`
|
|
486
486
|
`));if(!e)return null;FS_stdin_getChar_buffer=intArrayFromString(e)}return FS_stdin_getChar_buffer.shift()},TTY={ttys:[],init(){},shutdown(){},register(e,t){TTY.ttys[e]={input:[],output:[],ops:t},FS.registerDevice(e,TTY.stream_ops)},stream_ops:{open(e){var t=TTY.ttys[e.node.rdev];if(!t)throw new FS.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,tr,rr,ir){if(!e.tty||!e.tty.ops.get_char)throw new FS.ErrnoError(60);for(var lr=0,dr=0;dr<rr;dr++){var fr;try{fr=e.tty.ops.get_char(e.tty)}catch{throw new FS.ErrnoError(29)}if(fr===void 0&&lr===0)throw new FS.ErrnoError(6);if(fr==null)break;lr++,t[tr+dr]=fr}return lr&&(e.node.atime=Date.now()),lr},write(e,t,tr,rr,ir){if(!e.tty||!e.tty.ops.put_char)throw new FS.ErrnoError(60);try{for(var lr=0;lr<rr;lr++)e.tty.ops.put_char(e.tty,t[tr+lr])}catch{throw new FS.ErrnoError(29)}return rr&&(e.node.mtime=e.node.ctime=Date.now()),lr}},default_tty_ops:{get_char(e){return FS_stdin_getChar()},put_char(e,t){t===null||t===10?(out(UTF8ArrayToString(e.output)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(out(UTF8ArrayToString(e.output)),e.output=[])},ioctl_tcgets(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(e,t,tr){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,t){t===null||t===10?(err(UTF8ArrayToString(e.output)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(err(UTF8ArrayToString(e.output)),e.output=[])}}},zeroMemory=(e,t)=>{HEAPU8.fill(0,e,e+t)},mmapAlloc=e=>{e=alignMemory(e,65536);var t=_emscripten_builtin_memalign(65536,e);return t&&zeroMemory(t,e),t},MEMFS={ops_table:null,mount(e){return MEMFS.createNode(null,"/",16895,0)},createNode(e,t,tr,rr){if(FS.isBlkdev(tr)||FS.isFIFO(tr))throw new FS.ErrnoError(63);MEMFS.ops_table||(MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}});var ir=FS.createNode(e,t,tr,rr);return FS.isDir(ir.mode)?(ir.node_ops=MEMFS.ops_table.dir.node,ir.stream_ops=MEMFS.ops_table.dir.stream,ir.contents={}):FS.isFile(ir.mode)?(ir.node_ops=MEMFS.ops_table.file.node,ir.stream_ops=MEMFS.ops_table.file.stream,ir.usedBytes=0,ir.contents=null):FS.isLink(ir.mode)?(ir.node_ops=MEMFS.ops_table.link.node,ir.stream_ops=MEMFS.ops_table.link.stream):FS.isChrdev(ir.mode)&&(ir.node_ops=MEMFS.ops_table.chrdev.node,ir.stream_ops=MEMFS.ops_table.chrdev.stream),ir.atime=ir.mtime=ir.ctime=Date.now(),e&&(e.contents[t]=ir,e.atime=e.mtime=e.ctime=ir.atime),ir},getFileDataAsTypedArray(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage(e,t){var tr=e.contents?e.contents.length:0;if(!(tr>=t)){var rr=1048576;t=Math.max(t,tr*(tr<rr?2:1.125)>>>0),tr!=0&&(t=Math.max(t,256));var ir=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(ir.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(t==0)e.contents=null,e.usedBytes=0;else{var tr=e.contents;e.contents=new Uint8Array(t),tr&&e.contents.set(tr.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=FS.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,FS.isDir(e.mode)?t.size=4096:FS.isFile(e.mode)?t.size=e.usedBytes:FS.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.atime),t.mtime=new Date(e.mtime),t.ctime=new Date(e.ctime),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){for(let tr of["mode","atime","mtime","ctime"])t[tr]&&(e[tr]=t[tr]);t.size!==void 0&&MEMFS.resizeFileStorage(e,t.size)},lookup(e,t){throw MEMFS.doesNotExistError},mknod(e,t,tr,rr){return MEMFS.createNode(e,t,tr,rr)},rename(e,t,tr){var rr;try{rr=FS.lookupNode(t,tr)}catch{}if(rr){if(FS.isDir(e.mode))for(var ir in rr.contents)throw new FS.ErrnoError(55);FS.hashRemoveNode(rr)}delete e.parent.contents[e.name],t.contents[tr]=e,e.name=tr,t.ctime=t.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,t){delete e.contents[t],e.ctime=e.mtime=Date.now()},rmdir(e,t){var tr=FS.lookupNode(e,t);for(var rr in tr.contents)throw new FS.ErrnoError(55);delete e.contents[t],e.ctime=e.mtime=Date.now()},readdir(e){return[".","..",...Object.keys(e.contents)]},symlink(e,t,tr){var rr=MEMFS.createNode(e,t,41471,0);return rr.link=tr,rr},readlink(e){if(!FS.isLink(e.mode))throw new FS.ErrnoError(28);return e.link}},stream_ops:{read(e,t,tr,rr,ir){var lr=e.node.contents;if(ir>=e.node.usedBytes)return 0;var dr=Math.min(e.node.usedBytes-ir,rr);if(dr>8&&lr.subarray)t.set(lr.subarray(ir,ir+dr),tr);else for(var fr=0;fr<dr;fr++)t[tr+fr]=lr[ir+fr];return dr},write(e,t,tr,rr,ir,lr){if(t.buffer===HEAP8.buffer&&(lr=!1),!rr)return 0;var dr=e.node;if(dr.mtime=dr.ctime=Date.now(),t.subarray&&(!dr.contents||dr.contents.subarray)){if(lr)return dr.contents=t.subarray(tr,tr+rr),dr.usedBytes=rr,rr;if(dr.usedBytes===0&&ir===0)return dr.contents=t.slice(tr,tr+rr),dr.usedBytes=rr,rr;if(ir+rr<=dr.usedBytes)return dr.contents.set(t.subarray(tr,tr+rr),ir),rr}if(MEMFS.expandFileStorage(dr,ir+rr),dr.contents.subarray&&t.subarray)dr.contents.set(t.subarray(tr,tr+rr),ir);else for(var fr=0;fr<rr;fr++)dr.contents[ir+fr]=t[tr+fr];return dr.usedBytes=Math.max(dr.usedBytes,ir+rr),rr},llseek(e,t,tr){var rr=t;if(tr===1?rr+=e.position:tr===2&&FS.isFile(e.node.mode)&&(rr+=e.node.usedBytes),rr<0)throw new FS.ErrnoError(28);return rr},allocate(e,t,tr){MEMFS.expandFileStorage(e.node,t+tr),e.node.usedBytes=Math.max(e.node.usedBytes,t+tr)},mmap(e,t,tr,rr,ir){if(!FS.isFile(e.node.mode))throw new FS.ErrnoError(43);var lr,dr,fr=e.node.contents;if(!(ir&2)&&fr&&fr.buffer===HEAP8.buffer)dr=!1,lr=fr.byteOffset;else{if(dr=!0,lr=mmapAlloc(t),!lr)throw new FS.ErrnoError(48);fr&&((tr>0||tr+t<fr.length)&&(fr.subarray?fr=fr.subarray(tr,tr+t):fr=Array.prototype.slice.call(fr,tr,tr+t)),HEAP8.set(fr,lr))}return{ptr:lr,allocated:dr}},msync(e,t,tr,rr,ir){return MEMFS.stream_ops.write(e,t,0,rr,tr,!1),0}}},FS_createDataFile=(e,t,tr,rr,ir,lr)=>{FS.createDataFile(e,t,tr,rr,ir,lr)},FS_handledByPreloadPlugin=(e,t,tr,rr)=>{typeof Browser<"u"&&Browser.init();var ir=!1;return preloadPlugins.forEach(lr=>{ir||lr.canHandle(t)&&(lr.handle(e,t,tr,rr),ir=!0)}),ir},FS_createPreloadedFile=(e,t,tr,rr,ir,lr,dr,fr,hr,mr)=>{var gr=t?PATH_FS.resolve(PATH.join2(e,t)):e;function yr(_r){function br(wr){mr==null||mr(),fr||FS_createDataFile(e,t,wr,rr,ir,hr),lr==null||lr(),removeRunDependency()}FS_handledByPreloadPlugin(_r,gr,br,()=>{dr==null||dr(),removeRunDependency()})||br(_r)}addRunDependency(),typeof tr=="string"?asyncLoad(tr).then(yr,dr):yr(tr)},FS_modeStringToFlags=e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},tr=t[e];if(typeof tr>"u")throw new Error(`Unknown file open mode: ${e}`);return tr},FS_getMode=(e,t)=>{var tr=0;return e&&(tr|=365),t&&(tr|=146),tr},IDBFS={dbs:{},indexedDB:()=>{if(typeof indexedDB<"u")return indexedDB;var e=null;return typeof window=="object"&&(e=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),e},DB_VERSION:21,DB_STORE_NAME:"FILE_DATA",queuePersist:e=>{function t(){e.idbPersistState==="again"?tr():e.idbPersistState=0}function tr(){e.idbPersistState="idb",IDBFS.syncfs(e,!1,t)}e.idbPersistState?e.idbPersistState==="idb"&&(e.idbPersistState="again"):e.idbPersistState=setTimeout(tr,0)},mount:e=>{var rr;var t=MEMFS.mount(e);if((rr=e==null?void 0:e.opts)!=null&&rr.autoPersist){t.idbPersistState=0;var tr=t.node_ops;t.node_ops=Object.assign({},t.node_ops),t.node_ops.mknod=(ir,lr,dr,fr)=>{var hr=tr.mknod(ir,lr,dr,fr);return hr.node_ops=t.node_ops,hr.idbfs_mount=t.mount,hr.memfs_stream_ops=hr.stream_ops,hr.stream_ops=Object.assign({},hr.stream_ops),hr.stream_ops.write=(mr,gr,yr,_r,br,wr)=>(mr.node.isModified=!0,hr.memfs_stream_ops.write(mr,gr,yr,_r,br,wr)),hr.stream_ops.close=mr=>{var gr=mr.node;if(gr.isModified&&(IDBFS.queuePersist(gr.idbfs_mount),gr.isModified=!1),gr.memfs_stream_ops.close)return gr.memfs_stream_ops.close(mr)},hr},t.node_ops.mkdir=(...ir)=>(IDBFS.queuePersist(t.mount),tr.mkdir(...ir)),t.node_ops.rmdir=(...ir)=>(IDBFS.queuePersist(t.mount),tr.rmdir(...ir)),t.node_ops.symlink=(...ir)=>(IDBFS.queuePersist(t.mount),tr.symlink(...ir)),t.node_ops.unlink=(...ir)=>(IDBFS.queuePersist(t.mount),tr.unlink(...ir)),t.node_ops.rename=(...ir)=>(IDBFS.queuePersist(t.mount),tr.rename(...ir))}return t},syncfs:(e,t,tr)=>{IDBFS.getLocalSet(e,(rr,ir)=>{if(rr)return tr(rr);IDBFS.getRemoteSet(e,(lr,dr)=>{if(lr)return tr(lr);var fr=t?dr:ir,hr=t?ir:dr;IDBFS.reconcile(fr,hr,tr)})})},quit:()=>{Object.values(IDBFS.dbs).forEach(e=>e.close()),IDBFS.dbs={}},getDB:(e,t)=>{var tr=IDBFS.dbs[e];if(tr)return t(null,tr);var rr;try{rr=IDBFS.indexedDB().open(e,IDBFS.DB_VERSION)}catch(ir){return t(ir)}if(!rr)return t("Unable to connect to IndexedDB");rr.onupgradeneeded=ir=>{var lr=ir.target.result,dr=ir.target.transaction,fr;lr.objectStoreNames.contains(IDBFS.DB_STORE_NAME)?fr=dr.objectStore(IDBFS.DB_STORE_NAME):fr=lr.createObjectStore(IDBFS.DB_STORE_NAME),fr.indexNames.contains("timestamp")||fr.createIndex("timestamp","timestamp",{unique:!1})},rr.onsuccess=()=>{tr=rr.result,IDBFS.dbs[e]=tr,t(null,tr)},rr.onerror=ir=>{t(ir.target.error),ir.preventDefault()}},getLocalSet:(e,t)=>{var tr={};function rr(hr){return hr!=="."&&hr!==".."}function ir(hr){return mr=>PATH.join2(hr,mr)}for(var lr=FS.readdir(e.mountpoint).filter(rr).map(ir(e.mountpoint));lr.length;){var dr=lr.pop(),fr;try{fr=FS.stat(dr)}catch(hr){return t(hr)}FS.isDir(fr.mode)&&lr.push(...FS.readdir(dr).filter(rr).map(ir(dr))),tr[dr]={timestamp:fr.mtime}}return t(null,{type:"local",entries:tr})},getRemoteSet:(e,t)=>{var tr={};IDBFS.getDB(e.mountpoint,(rr,ir)=>{if(rr)return t(rr);try{var lr=ir.transaction([IDBFS.DB_STORE_NAME],"readonly");lr.onerror=hr=>{t(hr.target.error),hr.preventDefault()};var dr=lr.objectStore(IDBFS.DB_STORE_NAME),fr=dr.index("timestamp");fr.openKeyCursor().onsuccess=hr=>{var mr=hr.target.result;if(!mr)return t(null,{type:"remote",db:ir,entries:tr});tr[mr.primaryKey]={timestamp:mr.key},mr.continue()}}catch(hr){return t(hr)}})},loadLocalEntry:(e,t)=>{var tr,rr;try{var ir=FS.lookupPath(e);rr=ir.node,tr=FS.stat(e)}catch(lr){return t(lr)}return FS.isDir(tr.mode)?t(null,{timestamp:tr.mtime,mode:tr.mode}):FS.isFile(tr.mode)?(rr.contents=MEMFS.getFileDataAsTypedArray(rr),t(null,{timestamp:tr.mtime,mode:tr.mode,contents:rr.contents})):t(new Error("node type not supported"))},storeLocalEntry:(e,t,tr)=>{try{if(FS.isDir(t.mode))FS.mkdirTree(e,t.mode);else if(FS.isFile(t.mode))FS.writeFile(e,t.contents,{canOwn:!0});else return tr(new Error("node type not supported"));FS.chmod(e,t.mode),FS.utime(e,t.timestamp,t.timestamp)}catch(rr){return tr(rr)}tr(null)},removeLocalEntry:(e,t)=>{try{var tr=FS.stat(e);FS.isDir(tr.mode)?FS.rmdir(e):FS.isFile(tr.mode)&&FS.unlink(e)}catch(rr){return t(rr)}t(null)},loadRemoteEntry:(e,t,tr)=>{var rr=e.get(t);rr.onsuccess=ir=>tr(null,ir.target.result),rr.onerror=ir=>{tr(ir.target.error),ir.preventDefault()}},storeRemoteEntry:(e,t,tr,rr)=>{try{var ir=e.put(tr,t)}catch(lr){rr(lr);return}ir.onsuccess=lr=>rr(),ir.onerror=lr=>{rr(lr.target.error),lr.preventDefault()}},removeRemoteEntry:(e,t,tr)=>{var rr=e.delete(t);rr.onsuccess=ir=>tr(),rr.onerror=ir=>{tr(ir.target.error),ir.preventDefault()}},reconcile:(e,t,tr)=>{var rr=0,ir=[];Object.keys(e.entries).forEach(yr=>{var _r=e.entries[yr],br=t.entries[yr];(!br||_r.timestamp.getTime()!=br.timestamp.getTime())&&(ir.push(yr),rr++)});var lr=[];if(Object.keys(t.entries).forEach(yr=>{e.entries[yr]||(lr.push(yr),rr++)}),!rr)return tr(null);var dr=!1,fr=e.type==="remote"?e.db:t.db,hr=fr.transaction([IDBFS.DB_STORE_NAME],"readwrite"),mr=hr.objectStore(IDBFS.DB_STORE_NAME);function gr(yr){if(yr&&!dr)return dr=!0,tr(yr)}hr.onerror=hr.onabort=yr=>{gr(yr.target.error),yr.preventDefault()},hr.oncomplete=yr=>{dr||tr(null)},ir.sort().forEach(yr=>{t.type==="local"?IDBFS.loadRemoteEntry(mr,yr,(_r,br)=>{if(_r)return gr(_r);IDBFS.storeLocalEntry(yr,br,gr)}):IDBFS.loadLocalEntry(yr,(_r,br)=>{if(_r)return gr(_r);IDBFS.storeRemoteEntry(mr,yr,br,gr)})}),lr.sort().reverse().forEach(yr=>{t.type==="local"?IDBFS.removeLocalEntry(yr,gr):IDBFS.removeRemoteEntry(mr,yr,gr)})}},ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135},NODEFS={isWindows:!1,staticInit(){NODEFS.isWindows=!!process.platform.match(/^win/);var e=process.binding("constants");e.fs&&(e=e.fs),NODEFS.flagsForNodeMap={1024:e.O_APPEND,64:e.O_CREAT,128:e.O_EXCL,256:e.O_NOCTTY,0:e.O_RDONLY,2:e.O_RDWR,4096:e.O_SYNC,512:e.O_TRUNC,1:e.O_WRONLY,131072:e.O_NOFOLLOW}},convertNodeCode(e){var t=e.code;return ERRNO_CODES[t]},tryFSOperation(e){try{return e()}catch(t){throw t.code?t.code==="UNKNOWN"?new FS.ErrnoError(28):new FS.ErrnoError(NODEFS.convertNodeCode(t)):t}},mount(e){return NODEFS.createNode(null,"/",NODEFS.getMode(e.opts.root),0)},createNode(e,t,tr,rr){if(!FS.isDir(tr)&&!FS.isFile(tr)&&!FS.isLink(tr))throw new FS.ErrnoError(28);var ir=FS.createNode(e,t,tr);return ir.node_ops=NODEFS.node_ops,ir.stream_ops=NODEFS.stream_ops,ir},getMode(e){return NODEFS.tryFSOperation(()=>{var t=fs.lstatSync(e).mode;return NODEFS.isWindows&&(t|=(t&292)>>2),t})},realPath(e){for(var t=[];e.parent!==e;)t.push(e.name),e=e.parent;return t.push(e.mount.opts.root),t.reverse(),PATH.join(...t)},flagsForNode(e){e&=-2097153,e&=-2049,e&=-32769,e&=-524289,e&=-65537;var t=0;for(var tr in NODEFS.flagsForNodeMap)e&tr&&(t|=NODEFS.flagsForNodeMap[tr],e^=tr);if(e)throw new FS.ErrnoError(28);return t},node_ops:{getattr(e){var t=NODEFS.realPath(e),tr;return NODEFS.tryFSOperation(()=>tr=fs.lstatSync(t)),NODEFS.isWindows&&(tr.blksize||(tr.blksize=4096),tr.blocks||(tr.blocks=(tr.size+tr.blksize-1)/tr.blksize|0),tr.mode|=(tr.mode&292)>>2),{dev:tr.dev,ino:tr.ino,mode:tr.mode,nlink:tr.nlink,uid:tr.uid,gid:tr.gid,rdev:tr.rdev,size:tr.size,atime:tr.atime,mtime:tr.mtime,ctime:tr.ctime,blksize:tr.blksize,blocks:tr.blocks}},setattr(e,t){var tr=NODEFS.realPath(e);NODEFS.tryFSOperation(()=>{if(t.mode!==void 0){var rr=t.mode;NODEFS.isWindows&&(rr&=384),fs.chmodSync(tr,rr),e.mode=t.mode}if(t.atime||t.mtime){var ir=t.atime&&new Date(t.atime),lr=t.mtime&&new Date(t.mtime);fs.utimesSync(tr,ir,lr)}t.size!==void 0&&fs.truncateSync(tr,t.size)})},lookup(e,t){var tr=PATH.join2(NODEFS.realPath(e),t),rr=NODEFS.getMode(tr);return NODEFS.createNode(e,t,rr)},mknod(e,t,tr,rr){var ir=NODEFS.createNode(e,t,tr,rr),lr=NODEFS.realPath(ir);return NODEFS.tryFSOperation(()=>{FS.isDir(ir.mode)?fs.mkdirSync(lr,ir.mode):fs.writeFileSync(lr,"",{mode:ir.mode})}),ir},rename(e,t,tr){var rr=NODEFS.realPath(e),ir=PATH.join2(NODEFS.realPath(t),tr);try{FS.unlink(ir)}catch{}NODEFS.tryFSOperation(()=>fs.renameSync(rr,ir)),e.name=tr},unlink(e,t){var tr=PATH.join2(NODEFS.realPath(e),t);NODEFS.tryFSOperation(()=>fs.unlinkSync(tr))},rmdir(e,t){var tr=PATH.join2(NODEFS.realPath(e),t);NODEFS.tryFSOperation(()=>fs.rmdirSync(tr))},readdir(e){var t=NODEFS.realPath(e);return NODEFS.tryFSOperation(()=>fs.readdirSync(t))},symlink(e,t,tr){var rr=PATH.join2(NODEFS.realPath(e),t);NODEFS.tryFSOperation(()=>fs.symlinkSync(tr,rr))},readlink(e){var t=NODEFS.realPath(e);return NODEFS.tryFSOperation(()=>fs.readlinkSync(t))},statfs(e){var t=NODEFS.tryFSOperation(()=>fs.statfsSync(e));return t.frsize=t.bsize,t}},stream_ops:{open(e){var t=NODEFS.realPath(e.node);NODEFS.tryFSOperation(()=>{FS.isFile(e.node.mode)&&(e.shared.refcount=1,e.nfd=fs.openSync(t,NODEFS.flagsForNode(e.flags)))})},close(e){NODEFS.tryFSOperation(()=>{FS.isFile(e.node.mode)&&e.nfd&&--e.shared.refcount===0&&fs.closeSync(e.nfd)})},dup(e){e.shared.refcount++},read(e,t,tr,rr,ir){return rr===0?0:NODEFS.tryFSOperation(()=>fs.readSync(e.nfd,new Int8Array(t.buffer,tr,rr),0,rr,ir))},write(e,t,tr,rr,ir){return NODEFS.tryFSOperation(()=>fs.writeSync(e.nfd,new Int8Array(t.buffer,tr,rr),0,rr,ir))},llseek(e,t,tr){var rr=t;if(tr===1?rr+=e.position:tr===2&&FS.isFile(e.node.mode)&&NODEFS.tryFSOperation(()=>{var ir=fs.fstatSync(e.nfd);rr+=ir.size}),rr<0)throw new FS.ErrnoError(28);return rr},mmap(e,t,tr,rr,ir){if(!FS.isFile(e.node.mode))throw new FS.ErrnoError(43);var lr=mmapAlloc(t);return NODEFS.stream_ops.read(e,HEAP8,lr,t,tr),{ptr:lr,allocated:!0}},msync(e,t,tr,rr,ir){return NODEFS.stream_ops.write(e,t,0,rr,tr,!1),0}}},FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(e){P$3(this,"name","ErrnoError"),this.errno=e}},filesystems:null,syncFSRequests:0,readFiles:{},FSStream:class{constructor(){P$3(this,"shared",{})}get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{constructor(e,t,tr,rr){P$3(this,"node_ops",{}),P$3(this,"stream_ops",{}),P$3(this,"readMode",365),P$3(this,"writeMode",146),P$3(this,"mounted",null),e||(e=this),this.parent=e,this.mount=e.mount,this.id=FS.nextInode++,this.name=t,this.mode=tr,this.rdev=rr,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return FS.isDir(this.mode)}get isDevice(){return FS.isChrdev(this.mode)}},lookupPath(e,t={}){if(!e)return{path:"",node:null};t.follow_mount??(t.follow_mount=!0),PATH.isAbs(e)||(e=FS.cwd()+"/"+e);e:for(var tr=0;tr<40;tr++){for(var rr=e.split("/").filter(mr=>!!mr&&mr!=="."),ir=FS.root,lr="/",dr=0;dr<rr.length;dr++){var fr=dr===rr.length-1;if(fr&&t.parent)break;if(rr[dr]===".."){lr=PATH.dirname(lr),ir=ir.parent;continue}lr=PATH.join2(lr,rr[dr]);try{ir=FS.lookupNode(ir,rr[dr])}catch(mr){if((mr==null?void 0:mr.errno)===44&&fr&&t.noent_okay)return{path:lr};throw mr}if(FS.isMountpoint(ir)&&(!fr||t.follow_mount)&&(ir=ir.mounted.root),FS.isLink(ir.mode)&&(!fr||t.follow)){if(!ir.node_ops.readlink)throw new FS.ErrnoError(52);var hr=ir.node_ops.readlink(ir);PATH.isAbs(hr)||(hr=PATH.dirname(lr)+"/"+hr),e=hr+"/"+rr.slice(dr+1).join("/");continue e}}return{path:lr,node:ir}}throw new FS.ErrnoError(32)},getPath(e){for(var t;;){if(FS.isRoot(e)){var tr=e.mount.mountpoint;return t?tr[tr.length-1]!=="/"?`${tr}/${t}`:tr+t:tr}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var tr=0,rr=0;rr<t.length;rr++)tr=(tr<<5)-tr+t.charCodeAt(rr)|0;return(e+tr>>>0)%FS.nameTable.length},hashAddNode(e){var t=FS.hashName(e.parent.id,e.name);e.name_next=FS.nameTable[t],FS.nameTable[t]=e},hashRemoveNode(e){var t=FS.hashName(e.parent.id,e.name);if(FS.nameTable[t]===e)FS.nameTable[t]=e.name_next;else for(var tr=FS.nameTable[t];tr;){if(tr.name_next===e){tr.name_next=e.name_next;break}tr=tr.name_next}},lookupNode(e,t){var tr=FS.mayLookup(e);if(tr)throw new FS.ErrnoError(tr);for(var rr=FS.hashName(e.id,t),ir=FS.nameTable[rr];ir;ir=ir.name_next){var lr=ir.name;if(ir.parent.id===e.id&&lr===t)return ir}return FS.lookup(e,t)},createNode(e,t,tr,rr){var ir=new FS.FSNode(e,t,tr,rr);return FS.hashAddNode(ir),ir},destroyNode(e){FS.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)===32768},isDir(e){return(e&61440)===16384},isLink(e){return(e&61440)===40960},isChrdev(e){return(e&61440)===8192},isBlkdev(e){return(e&61440)===24576},isFIFO(e){return(e&61440)===4096},isSocket(e){return(e&49152)===49152},flagsToPermissionString(e){var t=["r","w","rw"][e&3];return e&512&&(t+="w"),t},nodePermissions(e,t){return FS.ignorePermissions?0:t.includes("r")&&!(e.mode&292)||t.includes("w")&&!(e.mode&146)||t.includes("x")&&!(e.mode&73)?2:0},mayLookup(e){if(!FS.isDir(e.mode))return 54;var t=FS.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){if(!FS.isDir(e.mode))return 54;try{return FS.lookupNode(e,t),20}catch{}return FS.nodePermissions(e,"wx")},mayDelete(e,t,tr){var rr;try{rr=FS.lookupNode(e,t)}catch(lr){return lr.errno}var ir=FS.nodePermissions(e,"wx");if(ir)return ir;if(tr){if(!FS.isDir(rr.mode))return 54;if(FS.isRoot(rr)||FS.getPath(rr)===FS.cwd())return 10}else if(FS.isDir(rr.mode))return 31;return 0},mayOpen(e,t){return e?FS.isLink(e.mode)?32:FS.isDir(e.mode)&&(FS.flagsToPermissionString(t)!=="r"||t&512)?31:FS.nodePermissions(e,FS.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=FS.MAX_OPEN_FDS;e++)if(!FS.streams[e])return e;throw new FS.ErrnoError(33)},getStreamChecked(e){var t=FS.getStream(e);if(!t)throw new FS.ErrnoError(8);return t},getStream:e=>FS.streams[e],createStream(e,t=-1){return e=Object.assign(new FS.FSStream,e),t==-1&&(t=FS.nextfd()),e.fd=t,FS.streams[t]=e,e},closeStream(e){FS.streams[e]=null},dupStream(e,t=-1){var rr,ir;var tr=FS.createStream(e,t);return(ir=(rr=tr.stream_ops)==null?void 0:rr.dup)==null||ir.call(rr,tr),tr},chrdev_stream_ops:{open(e){var tr,rr;var t=FS.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,(rr=(tr=e.stream_ops).open)==null||rr.call(tr,e)},llseek(){throw new FS.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,t)=>e<<8|t,registerDevice(e,t){FS.devices[e]={stream_ops:t}},getDevice:e=>FS.devices[e],getMounts(e){for(var t=[],tr=[e];tr.length;){var rr=tr.pop();t.push(rr),tr.push(...rr.mounts)}return t},syncfs(e,t){typeof e=="function"&&(t=e,e=!1),FS.syncFSRequests++,FS.syncFSRequests>1&&err(`warning: ${FS.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var tr=FS.getMounts(FS.root.mount),rr=0;function ir(dr){return FS.syncFSRequests--,t(dr)}function lr(dr){if(dr)return lr.errored?void 0:(lr.errored=!0,ir(dr));++rr>=tr.length&&ir(null)}tr.forEach(dr=>{if(!dr.type.syncfs)return lr(null);dr.type.syncfs(dr,e,lr)})},mount(e,t,tr){var rr=tr==="/",ir=!tr,lr;if(rr&&FS.root)throw new FS.ErrnoError(10);if(!rr&&!ir){var dr=FS.lookupPath(tr,{follow_mount:!1});if(tr=dr.path,lr=dr.node,FS.isMountpoint(lr))throw new FS.ErrnoError(10);if(!FS.isDir(lr.mode))throw new FS.ErrnoError(54)}var fr={type:e,opts:t,mountpoint:tr,mounts:[]},hr=e.mount(fr);return hr.mount=fr,fr.root=hr,rr?FS.root=hr:lr&&(lr.mounted=fr,lr.mount&&lr.mount.mounts.push(fr)),hr},unmount(e){var t=FS.lookupPath(e,{follow_mount:!1});if(!FS.isMountpoint(t.node))throw new FS.ErrnoError(28);var tr=t.node,rr=tr.mounted,ir=FS.getMounts(rr);Object.keys(FS.nameTable).forEach(dr=>{for(var fr=FS.nameTable[dr];fr;){var hr=fr.name_next;ir.includes(fr.mount)&&FS.destroyNode(fr),fr=hr}}),tr.mounted=null;var lr=tr.mount.mounts.indexOf(rr);tr.mount.mounts.splice(lr,1)},lookup(e,t){return e.node_ops.lookup(e,t)},mknod(e,t,tr){var rr=FS.lookupPath(e,{parent:!0}),ir=rr.node,lr=PATH.basename(e);if(!lr||lr==="."||lr==="..")throw new FS.ErrnoError(28);var dr=FS.mayCreate(ir,lr);if(dr)throw new FS.ErrnoError(dr);if(!ir.node_ops.mknod)throw new FS.ErrnoError(63);return ir.node_ops.mknod(ir,lr,t,tr)},statfs(e){var t={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:FS.nextInode,ffree:FS.nextInode-1,fsid:42,flags:2,namelen:255},tr=FS.lookupPath(e,{follow:!0}).node;return tr!=null&&tr.node_ops.statfs&&Object.assign(t,tr.node_ops.statfs(tr.mount.opts.root)),t},create(e,t=438){return t&=4095,t|=32768,FS.mknod(e,t,0)},mkdir(e,t=511){return t&=1023,t|=16384,FS.mknod(e,t,0)},mkdirTree(e,t){for(var tr=e.split("/"),rr="",ir=0;ir<tr.length;++ir)if(tr[ir]){rr+="/"+tr[ir];try{FS.mkdir(rr,t)}catch(lr){if(lr.errno!=20)throw lr}}},mkdev(e,t,tr){return typeof tr>"u"&&(tr=t,t=438),t|=8192,FS.mknod(e,t,tr)},symlink(e,t){if(!PATH_FS.resolve(e))throw new FS.ErrnoError(44);var tr=FS.lookupPath(t,{parent:!0}),rr=tr.node;if(!rr)throw new FS.ErrnoError(44);var ir=PATH.basename(t),lr=FS.mayCreate(rr,ir);if(lr)throw new FS.ErrnoError(lr);if(!rr.node_ops.symlink)throw new FS.ErrnoError(63);return rr.node_ops.symlink(rr,ir,e)},rename(e,t){var tr=PATH.dirname(e),rr=PATH.dirname(t),ir=PATH.basename(e),lr=PATH.basename(t),dr,fr,hr;if(dr=FS.lookupPath(e,{parent:!0}),fr=dr.node,dr=FS.lookupPath(t,{parent:!0}),hr=dr.node,!fr||!hr)throw new FS.ErrnoError(44);if(fr.mount!==hr.mount)throw new FS.ErrnoError(75);var mr=FS.lookupNode(fr,ir),gr=PATH_FS.relative(e,rr);if(gr.charAt(0)!==".")throw new FS.ErrnoError(28);if(gr=PATH_FS.relative(t,tr),gr.charAt(0)!==".")throw new FS.ErrnoError(55);var yr;try{yr=FS.lookupNode(hr,lr)}catch{}if(mr!==yr){var _r=FS.isDir(mr.mode),br=FS.mayDelete(fr,ir,_r);if(br)throw new FS.ErrnoError(br);if(br=yr?FS.mayDelete(hr,lr,_r):FS.mayCreate(hr,lr),br)throw new FS.ErrnoError(br);if(!fr.node_ops.rename)throw new FS.ErrnoError(63);if(FS.isMountpoint(mr)||yr&&FS.isMountpoint(yr))throw new FS.ErrnoError(10);if(hr!==fr&&(br=FS.nodePermissions(fr,"w"),br))throw new FS.ErrnoError(br);FS.hashRemoveNode(mr);try{fr.node_ops.rename(mr,hr,lr),mr.parent=hr}catch(wr){throw wr}finally{FS.hashAddNode(mr)}}},rmdir(e){var t=FS.lookupPath(e,{parent:!0}),tr=t.node,rr=PATH.basename(e),ir=FS.lookupNode(tr,rr),lr=FS.mayDelete(tr,rr,!0);if(lr)throw new FS.ErrnoError(lr);if(!tr.node_ops.rmdir)throw new FS.ErrnoError(63);if(FS.isMountpoint(ir))throw new FS.ErrnoError(10);tr.node_ops.rmdir(tr,rr),FS.destroyNode(ir)},readdir(e){var t=FS.lookupPath(e,{follow:!0}),tr=t.node;if(!tr.node_ops.readdir)throw new FS.ErrnoError(54);return tr.node_ops.readdir(tr)},unlink(e){var t=FS.lookupPath(e,{parent:!0}),tr=t.node;if(!tr)throw new FS.ErrnoError(44);var rr=PATH.basename(e),ir=FS.lookupNode(tr,rr),lr=FS.mayDelete(tr,rr,!1);if(lr)throw new FS.ErrnoError(lr);if(!tr.node_ops.unlink)throw new FS.ErrnoError(63);if(FS.isMountpoint(ir))throw new FS.ErrnoError(10);tr.node_ops.unlink(tr,rr),FS.destroyNode(ir)},readlink(e){var t=FS.lookupPath(e),tr=t.node;if(!tr)throw new FS.ErrnoError(44);if(!tr.node_ops.readlink)throw new FS.ErrnoError(28);return tr.node_ops.readlink(tr)},stat(e,t){var tr=FS.lookupPath(e,{follow:!t}),rr=tr.node;if(!rr)throw new FS.ErrnoError(44);if(!rr.node_ops.getattr)throw new FS.ErrnoError(63);return rr.node_ops.getattr(rr)},lstat(e){return FS.stat(e,!0)},chmod(e,t,tr){var rr;if(typeof e=="string"){var ir=FS.lookupPath(e,{follow:!tr});rr=ir.node}else rr=e;if(!rr.node_ops.setattr)throw new FS.ErrnoError(63);rr.node_ops.setattr(rr,{mode:t&4095|rr.mode&-4096,ctime:Date.now()})},lchmod(e,t){FS.chmod(e,t,!0)},fchmod(e,t){var tr=FS.getStreamChecked(e);FS.chmod(tr.node,t)},chown(e,t,tr,rr){var ir;if(typeof e=="string"){var lr=FS.lookupPath(e,{follow:!rr});ir=lr.node}else ir=e;if(!ir.node_ops.setattr)throw new FS.ErrnoError(63);ir.node_ops.setattr(ir,{timestamp:Date.now()})},lchown(e,t,tr){FS.chown(e,t,tr,!0)},fchown(e,t,tr){var rr=FS.getStreamChecked(e);FS.chown(rr.node,t,tr)},truncate(e,t){if(t<0)throw new FS.ErrnoError(28);var tr;if(typeof e=="string"){var rr=FS.lookupPath(e,{follow:!0});tr=rr.node}else tr=e;if(!tr.node_ops.setattr)throw new FS.ErrnoError(63);if(FS.isDir(tr.mode))throw new FS.ErrnoError(31);if(!FS.isFile(tr.mode))throw new FS.ErrnoError(28);var ir=FS.nodePermissions(tr,"w");if(ir)throw new FS.ErrnoError(ir);tr.node_ops.setattr(tr,{size:t,timestamp:Date.now()})},ftruncate(e,t){var tr=FS.getStreamChecked(e);if(!(tr.flags&2097155))throw new FS.ErrnoError(28);FS.truncate(tr.node,t)},utime(e,t,tr){var rr=FS.lookupPath(e,{follow:!0}),ir=rr.node;ir.node_ops.setattr(ir,{atime:t,mtime:tr})},open(e,t,tr=438){if(e==="")throw new FS.ErrnoError(44);t=typeof t=="string"?FS_modeStringToFlags(t):t,t&64?tr=tr&4095|32768:tr=0;var rr;if(typeof e=="object")rr=e;else{var ir=FS.lookupPath(e,{follow:!(t&131072),noent_okay:!0});rr=ir.node,e=ir.path}var lr=!1;if(t&64)if(rr){if(t&128)throw new FS.ErrnoError(20)}else rr=FS.mknod(e,tr,0),lr=!0;if(!rr)throw new FS.ErrnoError(44);if(FS.isChrdev(rr.mode)&&(t&=-513),t&65536&&!FS.isDir(rr.mode))throw new FS.ErrnoError(54);if(!lr){var dr=FS.mayOpen(rr,t);if(dr)throw new FS.ErrnoError(dr)}t&512&&!lr&&FS.truncate(rr,0),t&=-131713;var fr=FS.createStream({node:rr,path:FS.getPath(rr),flags:t,seekable:!0,position:0,stream_ops:rr.stream_ops,ungotten:[],error:!1});return fr.stream_ops.open&&fr.stream_ops.open(fr),Module.logReadFiles&&!(t&1)&&(e in FS.readFiles||(FS.readFiles[e]=1)),fr},close(e){if(FS.isClosed(e))throw new FS.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(t){throw t}finally{FS.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,t,tr){if(FS.isClosed(e))throw new FS.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new FS.ErrnoError(70);if(tr!=0&&tr!=1&&tr!=2)throw new FS.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,tr),e.ungotten=[],e.position},read(e,t,tr,rr,ir){if(rr<0||ir<0)throw new FS.ErrnoError(28);if(FS.isClosed(e))throw new FS.ErrnoError(8);if((e.flags&2097155)===1)throw new FS.ErrnoError(8);if(FS.isDir(e.node.mode))throw new FS.ErrnoError(31);if(!e.stream_ops.read)throw new FS.ErrnoError(28);var lr=typeof ir<"u";if(!lr)ir=e.position;else if(!e.seekable)throw new FS.ErrnoError(70);var dr=e.stream_ops.read(e,t,tr,rr,ir);return lr||(e.position+=dr),dr},write(e,t,tr,rr,ir,lr){if(rr<0||ir<0)throw new FS.ErrnoError(28);if(FS.isClosed(e))throw new FS.ErrnoError(8);if(!(e.flags&2097155))throw new FS.ErrnoError(8);if(FS.isDir(e.node.mode))throw new FS.ErrnoError(31);if(!e.stream_ops.write)throw new FS.ErrnoError(28);e.seekable&&e.flags&1024&&FS.llseek(e,0,2);var dr=typeof ir<"u";if(!dr)ir=e.position;else if(!e.seekable)throw new FS.ErrnoError(70);var fr=e.stream_ops.write(e,t,tr,rr,ir,lr);return dr||(e.position+=fr),fr},allocate(e,t,tr){if(FS.isClosed(e))throw new FS.ErrnoError(8);if(t<0||tr<=0)throw new FS.ErrnoError(28);if(!(e.flags&2097155))throw new FS.ErrnoError(8);if(!FS.isFile(e.node.mode)&&!FS.isDir(e.node.mode))throw new FS.ErrnoError(43);if(!e.stream_ops.allocate)throw new FS.ErrnoError(138);e.stream_ops.allocate(e,t,tr)},mmap(e,t,tr,rr,ir){if(rr&2&&!(ir&2)&&(e.flags&2097155)!==2)throw new FS.ErrnoError(2);if((e.flags&2097155)===1)throw new FS.ErrnoError(2);if(!e.stream_ops.mmap)throw new FS.ErrnoError(43);if(!t)throw new FS.ErrnoError(28);return e.stream_ops.mmap(e,t,tr,rr,ir)},msync(e,t,tr,rr,ir){return e.stream_ops.msync?e.stream_ops.msync(e,t,tr,rr,ir):0},ioctl(e,t,tr){if(!e.stream_ops.ioctl)throw new FS.ErrnoError(59);return e.stream_ops.ioctl(e,t,tr)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||"binary",t.encoding!=="utf8"&&t.encoding!=="binary")throw new Error(`Invalid encoding type "${t.encoding}"`);var tr,rr=FS.open(e,t.flags),ir=FS.stat(e),lr=ir.size,dr=new Uint8Array(lr);return FS.read(rr,dr,0,lr,0),t.encoding==="utf8"?tr=UTF8ArrayToString(dr):t.encoding==="binary"&&(tr=dr),FS.close(rr),tr},writeFile(e,t,tr={}){tr.flags=tr.flags||577;var rr=FS.open(e,tr.flags,tr.mode);if(typeof t=="string"){var ir=new Uint8Array(lengthBytesUTF8(t)+1),lr=stringToUTF8Array(t,ir,0,ir.length);FS.write(rr,ir,0,lr,void 0,tr.canOwn)}else if(ArrayBuffer.isView(t))FS.write(rr,t,0,t.byteLength,void 0,tr.canOwn);else throw new Error("Unsupported data type");FS.close(rr)},cwd:()=>FS.currentPath,chdir(e){var t=FS.lookupPath(e,{follow:!0});if(t.node===null)throw new FS.ErrnoError(44);if(!FS.isDir(t.node.mode))throw new FS.ErrnoError(54);var tr=FS.nodePermissions(t.node,"x");if(tr)throw new FS.ErrnoError(tr);FS.currentPath=t.path},createDefaultDirectories(){FS.mkdir("/tmp"),FS.mkdir("/home"),FS.mkdir("/home/web_user")},createDefaultDevices(){FS.mkdir("/dev"),FS.registerDevice(FS.makedev(1,3),{read:()=>0,write:(rr,ir,lr,dr,fr)=>dr,llseek:()=>0}),FS.mkdev("/dev/null",FS.makedev(1,3)),TTY.register(FS.makedev(5,0),TTY.default_tty_ops),TTY.register(FS.makedev(6,0),TTY.default_tty1_ops),FS.mkdev("/dev/tty",FS.makedev(5,0)),FS.mkdev("/dev/tty1",FS.makedev(6,0));var e=new Uint8Array(1024),t=0,tr=()=>(t===0&&(t=randomFill(e).byteLength),e[--t]);FS.createDevice("/dev","random",tr),FS.createDevice("/dev","urandom",tr),FS.mkdir("/dev/shm"),FS.mkdir("/dev/shm/tmp")},createSpecialDirectories(){FS.mkdir("/proc");var e=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd"),FS.mount({mount(){var t=FS.createNode(e,"fd",16895,73);return t.stream_ops={llseek:MEMFS.stream_ops.llseek},t.node_ops={lookup(tr,rr){var ir=+rr,lr=FS.getStreamChecked(ir),dr={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>lr.path},id:ir+1};return dr.parent=dr,dr},readdir(){return Array.from(FS.streams.entries()).filter(([tr,rr])=>rr).map(([tr,rr])=>tr.toString())}},t}},{},"/proc/self/fd")},createStandardStreams(e,t,tr){e?FS.createDevice("/dev","stdin",e):FS.symlink("/dev/tty","/dev/stdin"),t?FS.createDevice("/dev","stdout",null,t):FS.symlink("/dev/tty","/dev/stdout"),tr?FS.createDevice("/dev","stderr",null,tr):FS.symlink("/dev/tty1","/dev/stderr"),FS.open("/dev/stdin",0),FS.open("/dev/stdout",1),FS.open("/dev/stderr",1)},staticInit(){FS.nameTable=new Array(4096),FS.mount(MEMFS,{},"/"),FS.createDefaultDirectories(),FS.createDefaultDevices(),FS.createSpecialDirectories(),FS.filesystems={MEMFS,IDBFS,NODEFS}},init(e,t,tr){FS.initialized=!0,e??(e=Module.stdin),t??(t=Module.stdout),tr??(tr=Module.stderr),FS.createStandardStreams(e,t,tr)},quit(){FS.initialized=!1,_fflush(0);for(var e=0;e<FS.streams.length;e++){var t=FS.streams[e];t&&FS.close(t)}},findObject(e,t){var tr=FS.analyzePath(e,t);return tr.exists?tr.object:null},analyzePath(e,t){try{var tr=FS.lookupPath(e,{follow:!t});e=tr.path}catch{}var rr={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var tr=FS.lookupPath(e,{parent:!0});rr.parentExists=!0,rr.parentPath=tr.path,rr.parentObject=tr.node,rr.name=PATH.basename(e),tr=FS.lookupPath(e,{follow:!t}),rr.exists=!0,rr.path=tr.path,rr.object=tr.node,rr.name=tr.node.name,rr.isRoot=tr.path==="/"}catch(ir){rr.error=ir.errno}return rr},createPath(e,t,tr,rr){e=typeof e=="string"?e:FS.getPath(e);for(var ir=t.split("/").reverse();ir.length;){var lr=ir.pop();if(lr){var dr=PATH.join2(e,lr);try{FS.mkdir(dr)}catch{}e=dr}}return dr},createFile(e,t,tr,rr,ir){var lr=PATH.join2(typeof e=="string"?e:FS.getPath(e),t),dr=FS_getMode(rr,ir);return FS.create(lr,dr)},createDataFile(e,t,tr,rr,ir,lr){var dr=t;e&&(e=typeof e=="string"?e:FS.getPath(e),dr=t?PATH.join2(e,t):e);var fr=FS_getMode(rr,ir),hr=FS.create(dr,fr);if(tr){if(typeof tr=="string"){for(var mr=new Array(tr.length),gr=0,yr=tr.length;gr<yr;++gr)mr[gr]=tr.charCodeAt(gr);tr=mr}FS.chmod(hr,fr|146);var _r=FS.open(hr,577);FS.write(_r,tr,0,tr.length,0,lr),FS.close(_r),FS.chmod(hr,fr)}},createDevice(e,t,tr,rr){var ir,lr=PATH.join2(typeof e=="string"?e:FS.getPath(e),t),dr=FS_getMode(!!tr,!!rr);(ir=FS.createDevice).major??(ir.major=64);var fr=FS.makedev(FS.createDevice.major++,0);return FS.registerDevice(fr,{open(hr){hr.seekable=!1},close(hr){var mr;(mr=rr==null?void 0:rr.buffer)!=null&&mr.length&&rr(10)},read(hr,mr,gr,yr,_r){for(var br=0,wr=0;wr<yr;wr++){var vr;try{vr=tr()}catch{throw new FS.ErrnoError(29)}if(vr===void 0&&br===0)throw new FS.ErrnoError(6);if(vr==null)break;br++,mr[gr+wr]=vr}return br&&(hr.node.atime=Date.now()),br},write(hr,mr,gr,yr,_r){for(var br=0;br<yr;br++)try{rr(mr[gr+br])}catch{throw new FS.ErrnoError(29)}return yr&&(hr.node.mtime=hr.node.ctime=Date.now()),br}}),FS.mkdev(lr,dr,fr)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(typeof XMLHttpRequest<"u")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");try{e.contents=readBinary(e.url),e.usedBytes=e.contents.length}catch{throw new FS.ErrnoError(29)}},createLazyFile(e,t,tr,rr,ir){class lr{constructor(){P$3(this,"lengthKnown",!1),P$3(this,"chunks",[])}get(br){if(!(br>this.length-1||br<0)){var wr=br%this.chunkSize,vr=br/this.chunkSize|0;return this.getter(vr)[wr]}}setDataGetter(br){this.getter=br}cacheLength(){var br=new XMLHttpRequest;if(br.open("HEAD",tr,!1),br.send(null),!(br.status>=200&&br.status<300||br.status===304))throw new Error("Couldn't load "+tr+". Status: "+br.status);var wr=Number(br.getResponseHeader("Content-length")),vr,Sr=(vr=br.getResponseHeader("Accept-Ranges"))&&vr==="bytes",Ir=(vr=br.getResponseHeader("Content-Encoding"))&&vr==="gzip",Mr=1024*1024;Sr||(Mr=wr);var Ar=(Or,Dr)=>{if(Or>Dr)throw new Error("invalid range ("+Or+", "+Dr+") or no bytes requested!");if(Dr>wr-1)throw new Error("only "+wr+" bytes available! programmer error!");var $r=new XMLHttpRequest;if($r.open("GET",tr,!1),wr!==Mr&&$r.setRequestHeader("Range","bytes="+Or+"-"+Dr),$r.responseType="arraybuffer",$r.overrideMimeType&&$r.overrideMimeType("text/plain; charset=x-user-defined"),$r.send(null),!($r.status>=200&&$r.status<300||$r.status===304))throw new Error("Couldn't load "+tr+". Status: "+$r.status);return $r.response!==void 0?new Uint8Array($r.response||[]):intArrayFromString($r.responseText||"")},kr=this;kr.setDataGetter(Or=>{var Dr=Or*Mr,$r=(Or+1)*Mr-1;if($r=Math.min($r,wr-1),typeof kr.chunks[Or]>"u"&&(kr.chunks[Or]=Ar(Dr,$r)),typeof kr.chunks[Or]>"u")throw new Error("doXHR failed!");return kr.chunks[Or]}),(Ir||!wr)&&(Mr=wr=1,wr=this.getter(0).length,Mr=wr,out("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=wr,this._chunkSize=Mr,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest<"u"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var dr=new lr,fr={isDevice:!1,contents:dr}}else var fr={isDevice:!1,url:tr};var hr=FS.createFile(e,t,fr,rr,ir);fr.contents?hr.contents=fr.contents:fr.url&&(hr.contents=null,hr.url=fr.url),Object.defineProperties(hr,{usedBytes:{get:function(){return this.contents.length}}});var mr={},gr=Object.keys(hr.stream_ops);gr.forEach(_r=>{var br=hr.stream_ops[_r];mr[_r]=(...wr)=>(FS.forceLoadFile(hr),br(...wr))});function yr(_r,br,wr,vr,Sr){var Ir=_r.node.contents;if(Sr>=Ir.length)return 0;var Mr=Math.min(Ir.length-Sr,vr);if(Ir.slice)for(var Ar=0;Ar<Mr;Ar++)br[wr+Ar]=Ir[Sr+Ar];else for(var Ar=0;Ar<Mr;Ar++)br[wr+Ar]=Ir.get(Sr+Ar);return Mr}return mr.read=(_r,br,wr,vr,Sr)=>(FS.forceLoadFile(hr),yr(_r,br,wr,vr,Sr)),mr.mmap=(_r,br,wr,vr,Sr)=>{FS.forceLoadFile(hr);var Ir=mmapAlloc(br);if(!Ir)throw new FS.ErrnoError(48);return yr(_r,HEAP8,Ir,br,wr),{ptr:Ir,allocated:!0}},hr.stream_ops=mr,hr}},SYSCALLS={DEFAULT_POLLMASK:5,calculateAt(e,t,tr){if(PATH.isAbs(t))return t;var rr;if(e===-100)rr=FS.cwd();else{var ir=SYSCALLS.getStreamFromFD(e);rr=ir.path}if(t.length==0){if(!tr)throw new FS.ErrnoError(44);return rr}return rr+"/"+t},doStat(e,t,tr){var rr=e(t);HEAP32[tr>>2]=rr.dev,HEAP32[tr+4>>2]=rr.mode,HEAPU32[tr+8>>2]=rr.nlink,HEAP32[tr+12>>2]=rr.uid,HEAP32[tr+16>>2]=rr.gid,HEAP32[tr+20>>2]=rr.rdev,HEAP64[tr+24>>3]=BigInt(rr.size),HEAP32[tr+32>>2]=4096,HEAP32[tr+36>>2]=rr.blocks;var ir=rr.atime.getTime(),lr=rr.mtime.getTime(),dr=rr.ctime.getTime();return HEAP64[tr+40>>3]=BigInt(Math.floor(ir/1e3)),HEAPU32[tr+48>>2]=ir%1e3*1e3*1e3,HEAP64[tr+56>>3]=BigInt(Math.floor(lr/1e3)),HEAPU32[tr+64>>2]=lr%1e3*1e3*1e3,HEAP64[tr+72>>3]=BigInt(Math.floor(dr/1e3)),HEAPU32[tr+80>>2]=dr%1e3*1e3*1e3,HEAP64[tr+88>>3]=BigInt(rr.ino),0},doMsync(e,t,tr,rr,ir){if(!FS.isFile(t.node.mode))throw new FS.ErrnoError(43);if(rr&2)return 0;var lr=HEAPU8.slice(e,e+tr);FS.msync(t,lr,ir,tr,rr)},getStreamFromFD(e){var t=FS.getStreamChecked(e);return t},varargs:void 0,getStr(e){var t=UTF8ToString(e);return t}},___syscall__newselect=function(e,t,tr,rr,ir){try{for(var lr=0,dr=t?HEAP32[t>>2]:0,fr=t?HEAP32[t+4>>2]:0,hr=tr?HEAP32[tr>>2]:0,mr=tr?HEAP32[tr+4>>2]:0,gr=rr?HEAP32[rr>>2]:0,yr=rr?HEAP32[rr+4>>2]:0,_r=0,br=0,wr=0,vr=0,Sr=0,Ir=0,Mr=(t?HEAP32[t>>2]:0)|(tr?HEAP32[tr>>2]:0)|(rr?HEAP32[rr>>2]:0),Ar=(t?HEAP32[t+4>>2]:0)|(tr?HEAP32[tr+4>>2]:0)|(rr?HEAP32[rr+4>>2]:0),kr=(Gr,Zn,zr,$n)=>Gr<32?Zn&$n:zr&$n,Or=0;Or<e;Or++){var Dr=1<<Or%32;if(kr(Or,Mr,Ar,Dr)){var $r=SYSCALLS.getStreamFromFD(Or),Fr=SYSCALLS.DEFAULT_POLLMASK;if($r.stream_ops.poll){var Lr=-1;if(ir){var qn=t?HEAP32[ir>>2]:0,Kn=t?HEAP32[ir+4>>2]:0;Lr=(qn+Kn/1e6)*1e3}Fr=$r.stream_ops.poll($r,Lr)}Fr&1&&kr(Or,dr,fr,Dr)&&(Or<32?_r=_r|Dr:br=br|Dr,lr++),Fr&4&&kr(Or,hr,mr,Dr)&&(Or<32?wr=wr|Dr:vr=vr|Dr,lr++),Fr&2&&kr(Or,gr,yr,Dr)&&(Or<32?Sr=Sr|Dr:Ir=Ir|Dr,lr++)}}return t&&(HEAP32[t>>2]=_r,HEAP32[t+4>>2]=br),tr&&(HEAP32[tr>>2]=wr,HEAP32[tr+4>>2]=vr),rr&&(HEAP32[rr>>2]=Sr,HEAP32[rr+4>>2]=Ir),lr}catch(Gr){if(typeof FS>"u"||Gr.name!=="ErrnoError")throw Gr;return-Gr.errno}};___syscall__newselect.sig="iipppp";var SOCKFS={websocketArgs:{},callbacks:{},on(e,t){SOCKFS.callbacks[e]=t},emit(e,t){var tr,rr;(rr=(tr=SOCKFS.callbacks)[e])==null||rr.call(tr,t)},mount(e){return SOCKFS.websocketArgs=Module.websocket||{},(Module.websocket??(Module.websocket={})).on=SOCKFS.on,FS.createNode(null,"/",16895,0)},createSocket(e,t,tr){t&=-526337;var rr=t==1;if(rr&&tr&&tr!=6)throw new FS.ErrnoError(66);var ir={family:e,type:t,protocol:tr,server:null,error:null,peers:{},pending:[],recv_queue:[],sock_ops:SOCKFS.websocket_sock_ops},lr=SOCKFS.nextname(),dr=FS.createNode(SOCKFS.root,lr,49152,0);dr.sock=ir;var fr=FS.createStream({path:lr,node:dr,flags:2,seekable:!1,stream_ops:SOCKFS.stream_ops});return ir.stream=fr,ir},getSocket(e){var t=FS.getStream(e);return!t||!FS.isSocket(t.node.mode)?null:t.node.sock},stream_ops:{poll(e){var t=e.node.sock;return t.sock_ops.poll(t)},ioctl(e,t,tr){var rr=e.node.sock;return rr.sock_ops.ioctl(rr,t,tr)},read(e,t,tr,rr,ir){var lr=e.node.sock,dr=lr.sock_ops.recvmsg(lr,rr);return dr?(t.set(dr.buffer,tr),dr.buffer.length):0},write(e,t,tr,rr,ir){var lr=e.node.sock;return lr.sock_ops.sendmsg(lr,t,tr,rr)},close(e){var t=e.node.sock;t.sock_ops.close(t)}},nextname(){return SOCKFS.nextname.current||(SOCKFS.nextname.current=0),`socket[${SOCKFS.nextname.current++}]`},websocket_sock_ops:{createPeer(e,t,tr){var rr;if(typeof t=="object"&&(rr=t,t=null,tr=null),rr)if(rr._socket)t=rr._socket.remoteAddress,tr=rr._socket.remotePort;else{var ir=/ws[s]?:\/\/([^:]+):(\d+)/.exec(rr.url);if(!ir)throw new Error("WebSocket URL must be in the format ws(s)://address:port");t=ir[1],tr=parseInt(ir[2],10)}else try{var lr="ws:#".replace("#","//"),dr="binary",fr=void 0;if(SOCKFS.websocketArgs.url&&(lr=SOCKFS.websocketArgs.url),SOCKFS.websocketArgs.subprotocol?dr=SOCKFS.websocketArgs.subprotocol:SOCKFS.websocketArgs.subprotocol===null&&(dr="null"),lr==="ws://"||lr==="wss://"){var hr=t.split("/");lr=lr+hr[0]+":"+tr+"/"+hr.slice(1).join("/")}dr!=="null"&&(dr=dr.replace(/^ +| +$/g,"").split(/ *, */),fr=dr);var mr;ENVIRONMENT_IS_NODE?mr=require("ws"):mr=WebSocket,rr=new mr(lr,fr),rr.binaryType="arraybuffer"}catch{throw new FS.ErrnoError(23)}var gr={addr:t,port:tr,socket:rr,msg_send_queue:[]};return SOCKFS.websocket_sock_ops.addPeer(e,gr),SOCKFS.websocket_sock_ops.handlePeerEvents(e,gr),e.type===2&&typeof e.sport<"u"&&gr.msg_send_queue.push(new Uint8Array([255,255,255,255,112,111,114,116,(e.sport&65280)>>8,e.sport&255])),gr},getPeer(e,t,tr){return e.peers[t+":"+tr]},addPeer(e,t){e.peers[t.addr+":"+t.port]=t},removePeer(e,t){delete e.peers[t.addr+":"+t.port]},handlePeerEvents(e,t){var tr=!0,rr=function(){e.connecting=!1,SOCKFS.emit("open",e.stream.fd);try{for(var lr=t.msg_send_queue.shift();lr;)t.socket.send(lr),lr=t.msg_send_queue.shift()}catch{t.socket.close()}};function ir(lr){if(typeof lr=="string"){var dr=new TextEncoder;lr=dr.encode(lr)}else{if(assert(lr.byteLength!==void 0),lr.byteLength==0)return;lr=new Uint8Array(lr)}var fr=tr;if(tr=!1,fr&&lr.length===10&&lr[0]===255&&lr[1]===255&&lr[2]===255&&lr[3]===255&&lr[4]===112&&lr[5]===111&&lr[6]===114&&lr[7]===116){var hr=lr[8]<<8|lr[9];SOCKFS.websocket_sock_ops.removePeer(e,t),t.port=hr,SOCKFS.websocket_sock_ops.addPeer(e,t);return}e.recv_queue.push({addr:t.addr,port:t.port,data:lr}),SOCKFS.emit("message",e.stream.fd)}ENVIRONMENT_IS_NODE?(t.socket.on("open",rr),t.socket.on("message",function(lr,dr){dr&&ir(new Uint8Array(lr).buffer)}),t.socket.on("close",function(){SOCKFS.emit("close",e.stream.fd)}),t.socket.on("error",function(lr){e.error=14,SOCKFS.emit("error",[e.stream.fd,e.error,"ECONNREFUSED: Connection refused"])})):(t.socket.onopen=rr,t.socket.onclose=function(){SOCKFS.emit("close",e.stream.fd)},t.socket.onmessage=function(lr){ir(lr.data)},t.socket.onerror=function(lr){e.error=14,SOCKFS.emit("error",[e.stream.fd,e.error,"ECONNREFUSED: Connection refused"])})},poll(e){if(e.type===1&&e.server)return e.pending.length?65:0;var t=0,tr=e.type===1?SOCKFS.websocket_sock_ops.getPeer(e,e.daddr,e.dport):null;return(e.recv_queue.length||!tr||tr&&tr.socket.readyState===tr.socket.CLOSING||tr&&tr.socket.readyState===tr.socket.CLOSED)&&(t|=65),(!tr||tr&&tr.socket.readyState===tr.socket.OPEN)&&(t|=4),(tr&&tr.socket.readyState===tr.socket.CLOSING||tr&&tr.socket.readyState===tr.socket.CLOSED)&&(e.connecting?t|=4:t|=16),t},ioctl(e,t,tr){switch(t){case 21531:var rr=0;return e.recv_queue.length&&(rr=e.recv_queue[0].data.length),HEAP32[tr>>2]=rr,0;default:return 28}},close(e){if(e.server){try{e.server.close()}catch{}e.server=null}for(var t=Object.keys(e.peers),tr=0;tr<t.length;tr++){var rr=e.peers[t[tr]];try{rr.socket.close()}catch{}SOCKFS.websocket_sock_ops.removePeer(e,rr)}return 0},bind(e,t,tr){if(typeof e.saddr<"u"||typeof e.sport<"u")throw new FS.ErrnoError(28);if(e.saddr=t,e.sport=tr,e.type===2){e.server&&(e.server.close(),e.server=null);try{e.sock_ops.listen(e,0)}catch(rr){if(rr.name!=="ErrnoError"||rr.errno!==138)throw rr}}},connect(e,t,tr){if(e.server)throw new FS.ErrnoError(138);if(typeof e.daddr<"u"&&typeof e.dport<"u"){var rr=SOCKFS.websocket_sock_ops.getPeer(e,e.daddr,e.dport);if(rr)throw rr.socket.readyState===rr.socket.CONNECTING?new FS.ErrnoError(7):new FS.ErrnoError(30)}var ir=SOCKFS.websocket_sock_ops.createPeer(e,t,tr);e.daddr=ir.addr,e.dport=ir.port,e.connecting=!0},listen(e,t){if(!ENVIRONMENT_IS_NODE)throw new FS.ErrnoError(138);if(e.server)throw new FS.ErrnoError(28);var tr=require("ws").Server,rr=e.saddr;e.server=new tr({host:rr,port:e.sport}),SOCKFS.emit("listen",e.stream.fd),e.server.on("connection",function(ir){if(e.type===1){var lr=SOCKFS.createSocket(e.family,e.type,e.protocol),dr=SOCKFS.websocket_sock_ops.createPeer(lr,ir);lr.daddr=dr.addr,lr.dport=dr.port,e.pending.push(lr),SOCKFS.emit("connection",lr.stream.fd)}else SOCKFS.websocket_sock_ops.createPeer(e,ir),SOCKFS.emit("connection",e.stream.fd)}),e.server.on("close",function(){SOCKFS.emit("close",e.stream.fd),e.server=null}),e.server.on("error",function(ir){e.error=23,SOCKFS.emit("error",[e.stream.fd,e.error,"EHOSTUNREACH: Host is unreachable"])})},accept(e){if(!e.server||!e.pending.length)throw new FS.ErrnoError(28);var t=e.pending.shift();return t.stream.flags=e.stream.flags,t},getname(e,t){var tr,rr;if(t){if(e.daddr===void 0||e.dport===void 0)throw new FS.ErrnoError(53);tr=e.daddr,rr=e.dport}else tr=e.saddr||0,rr=e.sport||0;return{addr:tr,port:rr}},sendmsg(e,t,tr,rr,ir,lr){if(e.type===2){if((ir===void 0||lr===void 0)&&(ir=e.daddr,lr=e.dport),ir===void 0||lr===void 0)throw new FS.ErrnoError(17)}else ir=e.daddr,lr=e.dport;var dr=SOCKFS.websocket_sock_ops.getPeer(e,ir,lr);if(e.type===1&&(!dr||dr.socket.readyState===dr.socket.CLOSING||dr.socket.readyState===dr.socket.CLOSED))throw new FS.ErrnoError(53);ArrayBuffer.isView(t)&&(tr+=t.byteOffset,t=t.buffer);var fr=t.slice(tr,tr+rr);if(!dr||dr.socket.readyState!==dr.socket.OPEN)return e.type===2&&(!dr||dr.socket.readyState===dr.socket.CLOSING||dr.socket.readyState===dr.socket.CLOSED)&&(dr=SOCKFS.websocket_sock_ops.createPeer(e,ir,lr)),dr.msg_send_queue.push(fr),rr;try{return dr.socket.send(fr),rr}catch{throw new FS.ErrnoError(28)}},recvmsg(e,t){if(e.type===1&&e.server)throw new FS.ErrnoError(53);var tr=e.recv_queue.shift();if(!tr){if(e.type===1){var rr=SOCKFS.websocket_sock_ops.getPeer(e,e.daddr,e.dport);if(!rr)throw new FS.ErrnoError(53);if(rr.socket.readyState===rr.socket.CLOSING||rr.socket.readyState===rr.socket.CLOSED)return null;throw new FS.ErrnoError(6)}throw new FS.ErrnoError(6)}var ir=tr.data.byteLength||tr.data.length,lr=tr.data.byteOffset||0,dr=tr.data.buffer||tr.data,fr=Math.min(t,ir),hr={buffer:new Uint8Array(dr,lr,fr),addr:tr.addr,port:tr.port};if(e.type===1&&fr<ir){var mr=ir-fr;tr.data=new Uint8Array(dr,lr+fr,mr),e.recv_queue.unshift(tr)}return hr}}},getSocketFromFD=e=>{var t=SOCKFS.getSocket(e);if(!t)throw new FS.ErrnoError(8);return t},inetNtop4=e=>(e&255)+"."+(e>>8&255)+"."+(e>>16&255)+"."+(e>>24&255),inetNtop6=e=>{var t="",tr=0,rr=0,ir=0,lr=0,dr=0,fr=0,hr=[e[0]&65535,e[0]>>16,e[1]&65535,e[1]>>16,e[2]&65535,e[2]>>16,e[3]&65535,e[3]>>16],mr=!0,gr="";for(fr=0;fr<5;fr++)if(hr[fr]!==0){mr=!1;break}if(mr){if(gr=inetNtop4(hr[6]|hr[7]<<16),hr[5]===-1)return t="::ffff:",t+=gr,t;if(hr[5]===0)return t="::",gr==="0.0.0.0"&&(gr=""),gr==="0.0.0.1"&&(gr="1"),t+=gr,t}for(tr=0;tr<8;tr++)hr[tr]===0&&(tr-ir>1&&(dr=0),ir=tr,dr++),dr>rr&&(rr=dr,lr=tr-rr+1);for(tr=0;tr<8;tr++){if(rr>1&&hr[tr]===0&&tr>=lr&&tr<lr+rr){tr===lr&&(t+=":",lr===0&&(t+=":"));continue}t+=Number(_ntohs(hr[tr]&65535)).toString(16),t+=tr<7?":":""}return t},readSockaddr=(e,t)=>{var tr=HEAP16[e>>1],rr=_ntohs(HEAPU16[e+2>>1]),ir;switch(tr){case 2:if(t!==16)return{errno:28};ir=HEAP32[e+4>>2],ir=inetNtop4(ir);break;case 10:if(t!==28)return{errno:28};ir=[HEAP32[e+8>>2],HEAP32[e+12>>2],HEAP32[e+16>>2],HEAP32[e+20>>2]],ir=inetNtop6(ir);break;default:return{errno:5}}return{family:tr,addr:ir,port:rr}},inetPton4=e=>{for(var t=e.split("."),tr=0;tr<4;tr++){var rr=Number(t[tr]);if(isNaN(rr))return null;t[tr]=rr}return(t[0]|t[1]<<8|t[2]<<16|t[3]<<24)>>>0},jstoi_q=e=>parseInt(e),inetPton6=e=>{var t,tr,rr,ir,lr=/^((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\3)::|:\b|$))|(?!\2\3)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})$/i,dr=[];if(!lr.test(e))return null;if(e==="::")return[0,0,0,0,0,0,0,0];for(e.startsWith("::")?e=e.replace("::","Z:"):e=e.replace("::",":Z:"),e.indexOf(".")>0?(e=e.replace(new RegExp("[.]","g"),":"),t=e.split(":"),t[t.length-4]=jstoi_q(t[t.length-4])+jstoi_q(t[t.length-3])*256,t[t.length-3]=jstoi_q(t[t.length-2])+jstoi_q(t[t.length-1])*256,t=t.slice(0,t.length-2)):t=e.split(":"),rr=0,ir=0,tr=0;tr<t.length;tr++)if(typeof t[tr]=="string")if(t[tr]==="Z"){for(ir=0;ir<8-t.length+1;ir++)dr[tr+ir]=0;rr=ir-1}else dr[tr+rr]=_htons(parseInt(t[tr],16));else dr[tr+rr]=t[tr];return[dr[1]<<16|dr[0],dr[3]<<16|dr[2],dr[5]<<16|dr[4],dr[7]<<16|dr[6]]},DNS={address_map:{id:1,addrs:{},names:{}},lookup_name(e){var t=inetPton4(e);if(t!==null||(t=inetPton6(e),t!==null))return e;var tr;if(DNS.address_map.addrs[e])tr=DNS.address_map.addrs[e];else{var rr=DNS.address_map.id++;assert(rr<65535,"exceeded max address mappings of 65535"),tr="172.29."+(rr&255)+"."+(rr&65280),DNS.address_map.names[tr]=e,DNS.address_map.addrs[e]=tr}return tr},lookup_addr(e){return DNS.address_map.names[e]?DNS.address_map.names[e]:null}},getSocketAddress=(e,t)=>{var tr=readSockaddr(e,t);if(tr.errno)throw new FS.ErrnoError(tr.errno);return tr.addr=DNS.lookup_addr(tr.addr)||tr.addr,tr};function ___syscall_bind(e,t,tr,rr,ir,lr){try{var dr=getSocketFromFD(e),fr=getSocketAddress(t,tr);return dr.sock_ops.bind(dr,fr.addr,fr.port),0}catch(hr){if(typeof FS>"u"||hr.name!=="ErrnoError")throw hr;return-hr.errno}}___syscall_bind.sig="iippiii";function ___syscall_chdir(e){try{return e=SYSCALLS.getStr(e),FS.chdir(e),0}catch(t){if(typeof FS>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}___syscall_chdir.sig="ip";function ___syscall_chmod(e,t){try{return e=SYSCALLS.getStr(e),FS.chmod(e,t),0}catch(tr){if(typeof FS>"u"||tr.name!=="ErrnoError")throw tr;return-tr.errno}}___syscall_chmod.sig="ipi";function ___syscall_connect(e,t,tr,rr,ir,lr){try{var dr=getSocketFromFD(e),fr=getSocketAddress(t,tr);return dr.sock_ops.connect(dr,fr.addr,fr.port),0}catch(hr){if(typeof FS>"u"||hr.name!=="ErrnoError")throw hr;return-hr.errno}}___syscall_connect.sig="iippiii";function ___syscall_dup(e){try{var t=SYSCALLS.getStreamFromFD(e);return FS.dupStream(t).fd}catch(tr){if(typeof FS>"u"||tr.name!=="ErrnoError")throw tr;return-tr.errno}}___syscall_dup.sig="ii";function ___syscall_dup3(e,t,tr){try{var rr=SYSCALLS.getStreamFromFD(e);if(rr.fd===t)return-28;if(t<0||t>=FS.MAX_OPEN_FDS)return-8;var ir=FS.getStream(t);return ir&&FS.close(ir),FS.dupStream(rr,t).fd}catch(lr){if(typeof FS>"u"||lr.name!=="ErrnoError")throw lr;return-lr.errno}}___syscall_dup3.sig="iiii";function ___syscall_faccessat(e,t,tr,rr){try{if(t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),tr&-8)return-28;var ir=FS.lookupPath(t,{follow:!0}),lr=ir.node;if(!lr)return-44;var dr="";return tr&4&&(dr+="r"),tr&2&&(dr+="w"),tr&1&&(dr+="x"),dr&&FS.nodePermissions(lr,dr)?-2:0}catch(fr){if(typeof FS>"u"||fr.name!=="ErrnoError")throw fr;return-fr.errno}}___syscall_faccessat.sig="iipii";var ___syscall_fadvise64=(e,t,tr,rr)=>0;___syscall_fadvise64.sig="iijji";var INT53_MAX=9007199254740992,INT53_MIN=-9007199254740992,bigintToI53Checked=e=>e<INT53_MIN||e>INT53_MAX?NaN:Number(e);function ___syscall_fallocate(e,t,tr,rr){tr=bigintToI53Checked(tr),rr=bigintToI53Checked(rr);try{if(isNaN(tr))return 61;var ir=SYSCALLS.getStreamFromFD(e);return FS.allocate(ir,tr,rr),0}catch(lr){if(typeof FS>"u"||lr.name!=="ErrnoError")throw lr;return-lr.errno}}___syscall_fallocate.sig="iiijj";var syscallGetVarargI=()=>{var e=HEAP32[+SYSCALLS.varargs>>2];return SYSCALLS.varargs+=4,e},syscallGetVarargP=syscallGetVarargI;function ___syscall_fcntl64(e,t,tr){SYSCALLS.varargs=tr;try{var rr=SYSCALLS.getStreamFromFD(e);switch(t){case 0:{var ir=syscallGetVarargI();if(ir<0)return-28;for(;FS.streams[ir];)ir++;var lr;return lr=FS.dupStream(rr,ir),lr.fd}case 1:case 2:return 0;case 3:return rr.flags;case 4:{var ir=syscallGetVarargI();return rr.flags|=ir,0}case 12:{var ir=syscallGetVarargP(),dr=0;return HEAP16[ir+dr>>1]=2,0}case 13:case 14:return 0}return-28}catch(fr){if(typeof FS>"u"||fr.name!=="ErrnoError")throw fr;return-fr.errno}}___syscall_fcntl64.sig="iiip";function ___syscall_fdatasync(e){try{return SYSCALLS.getStreamFromFD(e),0}catch(t){if(typeof FS>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}___syscall_fdatasync.sig="ii";function ___syscall_fstat64(e,t){try{var tr=SYSCALLS.getStreamFromFD(e);return SYSCALLS.doStat(FS.stat,tr.path,t)}catch(rr){if(typeof FS>"u"||rr.name!=="ErrnoError")throw rr;return-rr.errno}}___syscall_fstat64.sig="iip";function ___syscall_ftruncate64(e,t){t=bigintToI53Checked(t);try{return isNaN(t)?61:(FS.ftruncate(e,t),0)}catch(tr){if(typeof FS>"u"||tr.name!=="ErrnoError")throw tr;return-tr.errno}}___syscall_ftruncate64.sig="iij";var stringToUTF8=(e,t,tr)=>stringToUTF8Array(e,HEAPU8,t,tr);function ___syscall_getcwd(e,t){try{if(t===0)return-28;var tr=FS.cwd(),rr=lengthBytesUTF8(tr)+1;return t<rr?-68:(stringToUTF8(tr,e,t),rr)}catch(ir){if(typeof FS>"u"||ir.name!=="ErrnoError")throw ir;return-ir.errno}}___syscall_getcwd.sig="ipp";function ___syscall_getdents64(e,t,tr){try{var rr=SYSCALLS.getStreamFromFD(e);rr.getdents||(rr.getdents=FS.readdir(rr.path));for(var ir=280,lr=0,dr=FS.llseek(rr,0,1),fr=Math.floor(dr/ir),hr=Math.min(rr.getdents.length,fr+Math.floor(tr/ir)),mr=fr;mr<hr;mr++){var gr,yr,_r=rr.getdents[mr];if(_r===".")gr=rr.node.id,yr=4;else if(_r===".."){var br=FS.lookupPath(rr.path,{parent:!0});gr=br.node.id,yr=4}else{var wr;try{wr=FS.lookupNode(rr.node,_r)}catch(vr){if((vr==null?void 0:vr.errno)===28)continue;throw vr}gr=wr.id,yr=FS.isChrdev(wr.mode)?2:FS.isDir(wr.mode)?4:FS.isLink(wr.mode)?10:8}HEAP64[t+lr>>3]=BigInt(gr),HEAP64[t+lr+8>>3]=BigInt((mr+1)*ir),HEAP16[t+lr+16>>1]=280,HEAP8[t+lr+18]=yr,stringToUTF8(_r,t+lr+19,256),lr+=ir}return FS.llseek(rr,mr*ir,0),lr}catch(vr){if(typeof FS>"u"||vr.name!=="ErrnoError")throw vr;return-vr.errno}}___syscall_getdents64.sig="iipp";var writeSockaddr=(e,t,tr,rr,ir)=>{switch(t){case 2:tr=inetPton4(tr),zeroMemory(e,16),ir&&(HEAP32[ir>>2]=16),HEAP16[e>>1]=t,HEAP32[e+4>>2]=tr,HEAP16[e+2>>1]=_htons(rr);break;case 10:tr=inetPton6(tr),zeroMemory(e,28),ir&&(HEAP32[ir>>2]=28),HEAP32[e>>2]=t,HEAP32[e+8>>2]=tr[0],HEAP32[e+12>>2]=tr[1],HEAP32[e+16>>2]=tr[2],HEAP32[e+20>>2]=tr[3],HEAP16[e+2>>1]=_htons(rr);break;default:return 5}return 0};function ___syscall_getsockname(e,t,tr,rr,ir,lr){try{var dr=getSocketFromFD(e);return writeSockaddr(t,dr.family,DNS.lookup_name(dr.saddr||"0.0.0.0"),dr.sport,tr),0}catch(fr){if(typeof FS>"u"||fr.name!=="ErrnoError")throw fr;return-fr.errno}}___syscall_getsockname.sig="iippiii";function ___syscall_getsockopt(e,t,tr,rr,ir,lr){try{var dr=getSocketFromFD(e);return t===1&&tr===4?(HEAP32[rr>>2]=dr.error,HEAP32[ir>>2]=4,dr.error=null,0):-50}catch(fr){if(typeof FS>"u"||fr.name!=="ErrnoError")throw fr;return-fr.errno}}___syscall_getsockopt.sig="iiiippi";function ___syscall_ioctl(e,t,tr){SYSCALLS.varargs=tr;try{var rr=SYSCALLS.getStreamFromFD(e);switch(t){case 21509:return rr.tty?0:-59;case 21505:{if(!rr.tty)return-59;if(rr.tty.ops.ioctl_tcgets){var ir=rr.tty.ops.ioctl_tcgets(rr),lr=syscallGetVarargP();HEAP32[lr>>2]=ir.c_iflag||0,HEAP32[lr+4>>2]=ir.c_oflag||0,HEAP32[lr+8>>2]=ir.c_cflag||0,HEAP32[lr+12>>2]=ir.c_lflag||0;for(var dr=0;dr<32;dr++)HEAP8[lr+dr+17]=ir.c_cc[dr]||0;return 0}return 0}case 21510:case 21511:case 21512:return rr.tty?0:-59;case 21506:case 21507:case 21508:{if(!rr.tty)return-59;if(rr.tty.ops.ioctl_tcsets){for(var lr=syscallGetVarargP(),fr=HEAP32[lr>>2],hr=HEAP32[lr+4>>2],mr=HEAP32[lr+8>>2],gr=HEAP32[lr+12>>2],yr=[],dr=0;dr<32;dr++)yr.push(HEAP8[lr+dr+17]);return rr.tty.ops.ioctl_tcsets(rr.tty,t,{c_iflag:fr,c_oflag:hr,c_cflag:mr,c_lflag:gr,c_cc:yr})}return 0}case 21519:{if(!rr.tty)return-59;var lr=syscallGetVarargP();return HEAP32[lr>>2]=0,0}case 21520:return rr.tty?-28:-59;case 21531:{var lr=syscallGetVarargP();return FS.ioctl(rr,t,lr)}case 21523:{if(!rr.tty)return-59;if(rr.tty.ops.ioctl_tiocgwinsz){var _r=rr.tty.ops.ioctl_tiocgwinsz(rr.tty),lr=syscallGetVarargP();HEAP16[lr>>1]=_r[0],HEAP16[lr+2>>1]=_r[1]}return 0}case 21524:return rr.tty?0:-59;case 21515:return rr.tty?0:-59;default:return-28}}catch(br){if(typeof FS>"u"||br.name!=="ErrnoError")throw br;return-br.errno}}___syscall_ioctl.sig="iiip";function ___syscall_lstat64(e,t){try{return e=SYSCALLS.getStr(e),SYSCALLS.doStat(FS.lstat,e,t)}catch(tr){if(typeof FS>"u"||tr.name!=="ErrnoError")throw tr;return-tr.errno}}___syscall_lstat64.sig="ipp";function ___syscall_mkdirat(e,t,tr){try{return t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),FS.mkdir(t,tr,0),0}catch(rr){if(typeof FS>"u"||rr.name!=="ErrnoError")throw rr;return-rr.errno}}___syscall_mkdirat.sig="iipi";function ___syscall_newfstatat(e,t,tr,rr){try{t=SYSCALLS.getStr(t);var ir=rr&256,lr=rr&4096;return rr=rr&-6401,t=SYSCALLS.calculateAt(e,t,lr),SYSCALLS.doStat(ir?FS.lstat:FS.stat,t,tr)}catch(dr){if(typeof FS>"u"||dr.name!=="ErrnoError")throw dr;return-dr.errno}}___syscall_newfstatat.sig="iippi";function ___syscall_openat(e,t,tr,rr){SYSCALLS.varargs=rr;try{t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t);var ir=rr?syscallGetVarargI():0;return FS.open(t,tr,ir).fd}catch(lr){if(typeof FS>"u"||lr.name!=="ErrnoError")throw lr;return-lr.errno}}___syscall_openat.sig="iipip";var PIPEFS={BUCKET_BUFFER_SIZE:8192,mount(e){return FS.createNode(null,"/",16895,0)},createPipe(){var e={buckets:[],refcnt:2};e.buckets.push({buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var t=PIPEFS.nextname(),tr=PIPEFS.nextname(),rr=FS.createNode(PIPEFS.root,t,4096,0),ir=FS.createNode(PIPEFS.root,tr,4096,0);rr.pipe=e,ir.pipe=e;var lr=FS.createStream({path:t,node:rr,flags:0,seekable:!1,stream_ops:PIPEFS.stream_ops});rr.stream=lr;var dr=FS.createStream({path:tr,node:ir,flags:1,seekable:!1,stream_ops:PIPEFS.stream_ops});return ir.stream=dr,{readable_fd:lr.fd,writable_fd:dr.fd}},stream_ops:{poll(e){var t=e.node.pipe;if((e.flags&2097155)===1)return 260;if(t.buckets.length>0)for(var tr=0;tr<t.buckets.length;tr++){var rr=t.buckets[tr];if(rr.offset-rr.roffset>0)return 65}return 0},ioctl(e,t,tr){return 28},fsync(e){return 28},read(e,t,tr,rr,ir){for(var lr=e.node.pipe,dr=0,fr=0;fr<lr.buckets.length;fr++){var hr=lr.buckets[fr];dr+=hr.offset-hr.roffset}var mr=t.subarray(tr,tr+rr);if(rr<=0)return 0;if(dr==0)throw new FS.ErrnoError(6);for(var gr=Math.min(dr,rr),yr=gr,_r=0,fr=0;fr<lr.buckets.length;fr++){var br=lr.buckets[fr],wr=br.offset-br.roffset;if(gr<=wr){var vr=br.buffer.subarray(br.roffset,br.offset);gr<wr?(vr=vr.subarray(0,gr),br.roffset+=gr):_r++,mr.set(vr);break}else{var vr=br.buffer.subarray(br.roffset,br.offset);mr.set(vr),mr=mr.subarray(vr.byteLength),gr-=vr.byteLength,_r++}}return _r&&_r==lr.buckets.length&&(_r--,lr.buckets[_r].offset=0,lr.buckets[_r].roffset=0),lr.buckets.splice(0,_r),yr},write(e,t,tr,rr,ir){var lr=e.node.pipe,dr=t.subarray(tr,tr+rr),fr=dr.byteLength;if(fr<=0)return 0;var hr=null;lr.buckets.length==0?(hr={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:0,roffset:0},lr.buckets.push(hr)):hr=lr.buckets[lr.buckets.length-1],assert(hr.offset<=PIPEFS.BUCKET_BUFFER_SIZE);var mr=PIPEFS.BUCKET_BUFFER_SIZE-hr.offset;if(mr>=fr)return hr.buffer.set(dr,hr.offset),hr.offset+=fr,fr;mr>0&&(hr.buffer.set(dr.subarray(0,mr),hr.offset),hr.offset+=mr,dr=dr.subarray(mr,dr.byteLength));for(var gr=dr.byteLength/PIPEFS.BUCKET_BUFFER_SIZE|0,yr=dr.byteLength%PIPEFS.BUCKET_BUFFER_SIZE,_r=0;_r<gr;_r++){var br={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:PIPEFS.BUCKET_BUFFER_SIZE,roffset:0};lr.buckets.push(br),br.buffer.set(dr.subarray(0,PIPEFS.BUCKET_BUFFER_SIZE)),dr=dr.subarray(PIPEFS.BUCKET_BUFFER_SIZE,dr.byteLength)}if(yr>0){var br={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:dr.byteLength,roffset:0};lr.buckets.push(br),br.buffer.set(dr)}return fr},close(e){var t=e.node.pipe;t.refcnt--,t.refcnt===0&&(t.buckets=null)}},nextname(){return PIPEFS.nextname.current||(PIPEFS.nextname.current=0),"pipe["+PIPEFS.nextname.current+++"]"}};function ___syscall_pipe(e){try{if(e==0)throw new FS.ErrnoError(21);var t=PIPEFS.createPipe();return HEAP32[e>>2]=t.readable_fd,HEAP32[e+4>>2]=t.writable_fd,0}catch(tr){if(typeof FS>"u"||tr.name!=="ErrnoError")throw tr;return-tr.errno}}___syscall_pipe.sig="ip";function ___syscall_poll(e,t,tr){try{for(var rr=0,ir=0;ir<t;ir++){var lr=e+8*ir,dr=HEAP32[lr>>2],fr=HEAP16[lr+4>>1],hr=32,mr=FS.getStream(dr);mr&&(hr=SYSCALLS.DEFAULT_POLLMASK,mr.stream_ops.poll&&(hr=mr.stream_ops.poll(mr,-1))),hr&=fr|8|16,hr&&rr++,HEAP16[lr+6>>1]=hr}return rr}catch(gr){if(typeof FS>"u"||gr.name!=="ErrnoError")throw gr;return-gr.errno}}___syscall_poll.sig="ipii";function ___syscall_readlinkat(e,t,tr,rr){try{if(t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),rr<=0)return-28;var ir=FS.readlink(t),lr=Math.min(rr,lengthBytesUTF8(ir)),dr=HEAP8[tr+lr];return stringToUTF8(ir,tr,rr+1),HEAP8[tr+lr]=dr,lr}catch(fr){if(typeof FS>"u"||fr.name!=="ErrnoError")throw fr;return-fr.errno}}___syscall_readlinkat.sig="iippp";function ___syscall_recvfrom(e,t,tr,rr,ir,lr){try{var dr=getSocketFromFD(e),fr=dr.sock_ops.recvmsg(dr,tr);if(!fr)return 0;if(ir)var hr=writeSockaddr(ir,dr.family,DNS.lookup_name(fr.addr),fr.port,lr);return HEAPU8.set(fr.buffer,t),fr.buffer.byteLength}catch(mr){if(typeof FS>"u"||mr.name!=="ErrnoError")throw mr;return-mr.errno}}___syscall_recvfrom.sig="iippipp";function ___syscall_renameat(e,t,tr,rr){try{return t=SYSCALLS.getStr(t),rr=SYSCALLS.getStr(rr),t=SYSCALLS.calculateAt(e,t),rr=SYSCALLS.calculateAt(tr,rr),FS.rename(t,rr),0}catch(ir){if(typeof FS>"u"||ir.name!=="ErrnoError")throw ir;return-ir.errno}}___syscall_renameat.sig="iipip";function ___syscall_rmdir(e){try{return e=SYSCALLS.getStr(e),FS.rmdir(e),0}catch(t){if(typeof FS>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}___syscall_rmdir.sig="ip";function ___syscall_sendto(e,t,tr,rr,ir,lr){try{var dr=getSocketFromFD(e);if(!ir)return FS.write(dr.stream,HEAP8,t,tr);var fr=getSocketAddress(ir,lr);return dr.sock_ops.sendmsg(dr,HEAP8,t,tr,fr.addr,fr.port)}catch(hr){if(typeof FS>"u"||hr.name!=="ErrnoError")throw hr;return-hr.errno}}___syscall_sendto.sig="iippipp";function ___syscall_socket(e,t,tr){try{var rr=SOCKFS.createSocket(e,t,tr);return rr.stream.fd}catch(ir){if(typeof FS>"u"||ir.name!=="ErrnoError")throw ir;return-ir.errno}}___syscall_socket.sig="iiiiiii";function ___syscall_stat64(e,t){try{return e=SYSCALLS.getStr(e),SYSCALLS.doStat(FS.stat,e,t)}catch(tr){if(typeof FS>"u"||tr.name!=="ErrnoError")throw tr;return-tr.errno}}___syscall_stat64.sig="ipp";function ___syscall_symlinkat(e,t,tr){try{return e=SYSCALLS.getStr(e),tr=SYSCALLS.getStr(tr),tr=SYSCALLS.calculateAt(t,tr),FS.symlink(e,tr),0}catch(rr){if(typeof FS>"u"||rr.name!=="ErrnoError")throw rr;return-rr.errno}}___syscall_symlinkat.sig="ipip";function ___syscall_truncate64(e,t){t=bigintToI53Checked(t);try{return isNaN(t)?61:(e=SYSCALLS.getStr(e),FS.truncate(e,t),0)}catch(tr){if(typeof FS>"u"||tr.name!=="ErrnoError")throw tr;return-tr.errno}}___syscall_truncate64.sig="ipj";function ___syscall_unlinkat(e,t,tr){try{return t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),tr===0?FS.unlink(t):tr===512?FS.rmdir(t):abort("Invalid flags passed to unlinkat"),0}catch(rr){if(typeof FS>"u"||rr.name!=="ErrnoError")throw rr;return-rr.errno}}___syscall_unlinkat.sig="iipi";var ___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),__abort_js=()=>abort("");__abort_js.sig="v";var ENV={},stackAlloc=e=>__emscripten_stack_alloc(e),stringToUTF8OnStack=e=>{var t=lengthBytesUTF8(e)+1,tr=stackAlloc(t);return stringToUTF8(e,tr,t),tr},dlSetError=e=>{var t=stackSave(),tr=stringToUTF8OnStack(e);___dl_seterr(tr,0),stackRestore(t)},dlopenInternal=(e,t)=>{var tr=UTF8ToString(e+36),rr=HEAP32[e+4>>2];tr=PATH.normalize(tr);var ir=!!(rr&256),lr=ir?null:{},dr={global:ir,nodelete:!!(rr&4096),loadAsync:t.loadAsync};try{return loadDynamicLibrary(tr,dr,lr,e)}catch(fr){return dlSetError(`Could not load dynamic lib: ${tr}
|
|
487
487
|
${fr}`),0}},__dlopen_js=e=>dlopenInternal(e,{loadAsync:!1});__dlopen_js.sig="pp";var __dlsym_js=(e,t,tr)=>{t=UTF8ToString(t);var rr,ir,lr=LDSO.loadedLibsByHandle[e];if(!lr.exports.hasOwnProperty(t)||lr.exports[t].stub)return dlSetError(`Tried to lookup unknown symbol "${t}" in dynamic lib: ${lr.name}`),0;if(ir=Object.keys(lr.exports).indexOf(t),rr=lr.exports[t],typeof rr=="function"){var dr=getFunctionAddress(rr);dr?rr=dr:(rr=addFunction(rr,rr.sig),HEAPU32[tr>>2]=ir)}return rr};__dlsym_js.sig="pppp";var __emscripten_memcpy_js=(e,t,tr)=>HEAPU8.copyWithin(e,t,t+tr);__emscripten_memcpy_js.sig="vppp";var runtimeKeepaliveCounter=0,__emscripten_runtime_keepalive_clear=()=>{noExitRuntime=!1,runtimeKeepaliveCounter=0};__emscripten_runtime_keepalive_clear.sig="v";var __emscripten_system=e=>{if(ENVIRONMENT_IS_NODE){if(!e)return 1;var t=UTF8ToString(e);if(!t.length)return 0;var tr=require("child_process"),rr=tr.spawnSync(t,[],{shell:!0,stdio:"inherit"}),ir=(dr,fr)=>dr<<8|fr;if(rr.status===null){var lr=dr=>{switch(dr){case"SIGHUP":return 1;case"SIGQUIT":return 3;case"SIGFPE":return 8;case"SIGKILL":return 9;case"SIGALRM":return 14;case"SIGTERM":return 15;default:return 2}};return ir(0,lr(rr.signal))}return ir(rr.status,0)}return e?-52:0};__emscripten_system.sig="ip";var __emscripten_throw_longjmp=()=>{throw 1/0};__emscripten_throw_longjmp.sig="v";function __gmtime_js(e,t){e=bigintToI53Checked(e);var tr=new Date(e*1e3);HEAP32[t>>2]=tr.getUTCSeconds(),HEAP32[t+4>>2]=tr.getUTCMinutes(),HEAP32[t+8>>2]=tr.getUTCHours(),HEAP32[t+12>>2]=tr.getUTCDate(),HEAP32[t+16>>2]=tr.getUTCMonth(),HEAP32[t+20>>2]=tr.getUTCFullYear()-1900,HEAP32[t+24>>2]=tr.getUTCDay();var rr=Date.UTC(tr.getUTCFullYear(),0,1,0,0,0,0),ir=(tr.getTime()-rr)/(1e3*60*60*24)|0;HEAP32[t+28>>2]=ir}__gmtime_js.sig="vjp";var isLeapYear=e=>e%4===0&&(e%100!==0||e%400===0),MONTH_DAYS_LEAP_CUMULATIVE=[0,31,60,91,121,152,182,213,244,274,305,335],MONTH_DAYS_REGULAR_CUMULATIVE=[0,31,59,90,120,151,181,212,243,273,304,334],ydayFromDate=e=>{var t=isLeapYear(e.getFullYear()),tr=t?MONTH_DAYS_LEAP_CUMULATIVE:MONTH_DAYS_REGULAR_CUMULATIVE,rr=tr[e.getMonth()]+e.getDate()-1;return rr};function __localtime_js(e,t){e=bigintToI53Checked(e);var tr=new Date(e*1e3);HEAP32[t>>2]=tr.getSeconds(),HEAP32[t+4>>2]=tr.getMinutes(),HEAP32[t+8>>2]=tr.getHours(),HEAP32[t+12>>2]=tr.getDate(),HEAP32[t+16>>2]=tr.getMonth(),HEAP32[t+20>>2]=tr.getFullYear()-1900,HEAP32[t+24>>2]=tr.getDay();var rr=ydayFromDate(tr)|0;HEAP32[t+28>>2]=rr,HEAP32[t+36>>2]=-(tr.getTimezoneOffset()*60);var ir=new Date(tr.getFullYear(),0,1),lr=new Date(tr.getFullYear(),6,1).getTimezoneOffset(),dr=ir.getTimezoneOffset(),fr=(lr!=dr&&tr.getTimezoneOffset()==Math.min(dr,lr))|0;HEAP32[t+32>>2]=fr}__localtime_js.sig="vjp";function __mmap_js(e,t,tr,rr,ir,lr,dr){ir=bigintToI53Checked(ir);try{if(isNaN(ir))return 61;var fr=SYSCALLS.getStreamFromFD(rr),hr=FS.mmap(fr,e,ir,t,tr),mr=hr.ptr;return HEAP32[lr>>2]=hr.allocated,HEAPU32[dr>>2]=mr,0}catch(gr){if(typeof FS>"u"||gr.name!=="ErrnoError")throw gr;return-gr.errno}}__mmap_js.sig="ipiiijpp";function __munmap_js(e,t,tr,rr,ir,lr){lr=bigintToI53Checked(lr);try{var dr=SYSCALLS.getStreamFromFD(ir);tr&2&&SYSCALLS.doMsync(e,dr,t,rr,lr)}catch(fr){if(typeof FS>"u"||fr.name!=="ErrnoError")throw fr;return-fr.errno}}__munmap_js.sig="ippiiij";var timers={},handleException=e=>{if(e instanceof ExitStatus||e=="unwind")return EXITSTATUS;quit_(1,e)},keepRuntimeAlive=()=>noExitRuntime||runtimeKeepaliveCounter>0,_proc_exit=e=>{var t;EXITSTATUS=e,keepRuntimeAlive()||((t=Module.onExit)==null||t.call(Module,e),ABORT=!0),quit_(e,new ExitStatus(e))};_proc_exit.sig="vi";var exitJS=(e,t)=>{EXITSTATUS=e,_proc_exit(e)},_exit=exitJS;_exit.sig="vi";var maybeExit=()=>{if(!keepRuntimeAlive())try{_exit(EXITSTATUS)}catch(e){handleException(e)}},callUserCallback=e=>{if(!ABORT)try{e(),maybeExit()}catch(t){handleException(t)}},_emscripten_get_now=()=>performance.now();_emscripten_get_now.sig="d";var __setitimer_js=(e,t)=>{if(timers[e]&&(clearTimeout(timers[e].id),delete timers[e]),!t)return 0;var tr=setTimeout(()=>{delete timers[e],callUserCallback(()=>__emscripten_timeout(e,_emscripten_get_now()))},t);return timers[e]={id:tr,timeout_ms:t},0};__setitimer_js.sig="iid";var __tzset_js=(e,t,tr,rr)=>{var ir=new Date().getFullYear(),lr=new Date(ir,0,1),dr=new Date(ir,6,1),fr=lr.getTimezoneOffset(),hr=dr.getTimezoneOffset(),mr=Math.max(fr,hr);HEAPU32[e>>2]=mr*60,HEAP32[t>>2]=+(fr!=hr);var gr=br=>{var wr=br>=0?"-":"+",vr=Math.abs(br),Sr=String(Math.floor(vr/60)).padStart(2,"0"),Ir=String(vr%60).padStart(2,"0");return`UTC${wr}${Sr}${Ir}`},yr=gr(fr),_r=gr(hr);hr<fr?(stringToUTF8(yr,tr,17),stringToUTF8(_r,rr,17)):(stringToUTF8(yr,rr,17),stringToUTF8(_r,tr,17))};__tzset_js.sig="vpppp";var _emscripten_date_now=()=>Date.now();_emscripten_date_now.sig="d";var checkWasiClock=e=>e>=0&&e<=3;function _clock_time_get(e,t,tr){if(!checkWasiClock(e))return 28;var rr;e===0?rr=_emscripten_date_now():rr=_emscripten_get_now();var ir=Math.round(rr*1e3*1e3);return HEAP64[tr>>3]=BigInt(ir),0}_clock_time_get.sig="iijp";var readEmAsmArgsArray=[],readEmAsmArgs=(e,t)=>{readEmAsmArgsArray.length=0;for(var tr;tr=HEAPU8[e++];){var rr=tr!=105;rr&=tr!=112,t+=rr&&t%8?4:0,readEmAsmArgsArray.push(tr==112?HEAPU32[t>>2]:tr==106?HEAP64[t>>3]:tr==105?HEAP32[t>>2]:HEAPF64[t>>3]),t+=rr?8:4}return readEmAsmArgsArray},runEmAsmFunction=(e,t,tr)=>{var rr=readEmAsmArgs(t,tr);return ASM_CONSTS[e](...rr)},_emscripten_asm_const_int=(e,t,tr)=>runEmAsmFunction(e,t,tr);_emscripten_asm_const_int.sig="ippp";var _emscripten_force_exit=e=>{__emscripten_runtime_keepalive_clear(),_exit(e)};_emscripten_force_exit.sig="vi";var getHeapMax=()=>2147483648,growMemory=e=>{var t=wasmMemory.buffer,tr=(e-t.byteLength+65535)/65536|0;try{return wasmMemory.grow(tr),updateMemoryViews(),1}catch{}},_emscripten_resize_heap=e=>{var t=HEAPU8.length;e>>>=0;var tr=getHeapMax();if(e>tr)return!1;for(var rr=1;rr<=4;rr*=2){var ir=t*(1+.2/rr);ir=Math.min(ir,e+100663296);var lr=Math.min(tr,alignMemory(Math.max(e,ir),65536)),dr=growMemory(lr);if(dr)return!0}return!1};_emscripten_resize_heap.sig="ip";var _emscripten_set_main_loop_timing=(e,t)=>{if(MainLoop.timingMode=e,MainLoop.timingValue=t,!MainLoop.func)return 1;if(MainLoop.running||(MainLoop.running=!0),e==0)MainLoop.scheduler=function(){var lr=Math.max(0,MainLoop.tickStartTime+t-_emscripten_get_now())|0;setTimeout(MainLoop.runner,lr)},MainLoop.method="timeout";else if(e==1)MainLoop.scheduler=function(){MainLoop.requestAnimationFrame(MainLoop.runner)},MainLoop.method="rAF";else if(e==2){if(typeof MainLoop.setImmediate>"u")if(typeof setImmediate>"u"){var tr=[],rr="setimmediate",ir=lr=>{(lr.data===rr||lr.data.target===rr)&&(lr.stopPropagation(),tr.shift()())};addEventListener("message",ir,!0),MainLoop.setImmediate=lr=>{tr.push(lr),ENVIRONMENT_IS_WORKER?(Module.setImmediates??(Module.setImmediates=[]),Module.setImmediates.push(lr),postMessage({target:rr})):postMessage(rr,"*")}}else MainLoop.setImmediate=setImmediate;MainLoop.scheduler=function(){MainLoop.setImmediate(MainLoop.runner)},MainLoop.method="immediate"}return 0};_emscripten_set_main_loop_timing.sig="iii";var MainLoop={running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],preMainLoop:[],postMainLoop:[],pause(){MainLoop.scheduler=null,MainLoop.currentlyRunningMainloop++},resume(){MainLoop.currentlyRunningMainloop++;var e=MainLoop.timingMode,t=MainLoop.timingValue,tr=MainLoop.func;MainLoop.func=null,setMainLoop(tr,0,!1,MainLoop.arg,!0),_emscripten_set_main_loop_timing(e,t),MainLoop.scheduler()},updateStatus(){if(Module.setStatus){var e=Module.statusMessage||"Please wait...",t=MainLoop.remainingBlockers??0,tr=MainLoop.expectedBlockers??0;t?t<tr?Module.setStatus("{message} ({expected - remaining}/{expected})"):Module.setStatus(e):Module.setStatus("")}},init(){Module.preMainLoop&&MainLoop.preMainLoop.push(Module.preMainLoop),Module.postMainLoop&&MainLoop.postMainLoop.push(Module.postMainLoop)},runIter(e){if(!ABORT){for(var t of MainLoop.preMainLoop)if(t()===!1)return;callUserCallback(e);for(var tr of MainLoop.postMainLoop)tr()}},nextRAF:0,fakeRequestAnimationFrame(e){var t=Date.now();if(MainLoop.nextRAF===0)MainLoop.nextRAF=t+1e3/60;else for(;t+2>=MainLoop.nextRAF;)MainLoop.nextRAF+=1e3/60;var tr=Math.max(MainLoop.nextRAF-t,0);setTimeout(e,tr)},requestAnimationFrame(e){if(typeof requestAnimationFrame=="function"){requestAnimationFrame(e);return}var t=MainLoop.fakeRequestAnimationFrame;t(e)}},setMainLoop=(e,t,tr,rr,ir)=>{MainLoop.func=e,MainLoop.arg=rr;var lr=MainLoop.currentlyRunningMainloop;function dr(){return lr<MainLoop.currentlyRunningMainloop?(maybeExit(),!1):!0}if(MainLoop.running=!1,MainLoop.runner=function(){if(!ABORT){if(MainLoop.queue.length>0){var fr=MainLoop.queue.shift();if(fr.func(fr.arg),MainLoop.remainingBlockers){var hr=MainLoop.remainingBlockers,mr=hr%1==0?hr-1:Math.floor(hr);fr.counted?MainLoop.remainingBlockers=mr:(mr=mr+.5,MainLoop.remainingBlockers=(8*hr+mr)/9)}if(MainLoop.updateStatus(),!dr())return;setTimeout(MainLoop.runner,0);return}if(dr()){if(MainLoop.currentFrameNumber=MainLoop.currentFrameNumber+1|0,MainLoop.timingMode==1&&MainLoop.timingValue>1&&MainLoop.currentFrameNumber%MainLoop.timingValue!=0){MainLoop.scheduler();return}else MainLoop.timingMode==0&&(MainLoop.tickStartTime=_emscripten_get_now());MainLoop.runIter(e),dr()&&MainLoop.scheduler()}}},ir||(t&&t>0?_emscripten_set_main_loop_timing(0,1e3/t):_emscripten_set_main_loop_timing(1,1),MainLoop.scheduler()),tr)throw"unwind"},_emscripten_set_main_loop=(e,t,tr)=>{var rr=getWasmTableEntry(e);setMainLoop(rr,t,tr)};_emscripten_set_main_loop.sig="vpii";var getExecutableName=()=>thisProgram||"./this.program",getEnvStrings=()=>{if(!getEnvStrings.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:getExecutableName()};for(var tr in ENV)ENV[tr]===void 0?delete t[tr]:t[tr]=ENV[tr];var rr=[];for(var tr in t)rr.push(`${tr}=${t[tr]}`);getEnvStrings.strings=rr}return getEnvStrings.strings},stringToAscii=(e,t)=>{for(var tr=0;tr<e.length;++tr)HEAP8[t++]=e.charCodeAt(tr);HEAP8[t]=0},_environ_get=(e,t)=>{var tr=0;return getEnvStrings().forEach((rr,ir)=>{var lr=t+tr;HEAPU32[e+ir*4>>2]=lr,stringToAscii(rr,lr),tr+=rr.length+1}),0};_environ_get.sig="ipp";var _environ_sizes_get=(e,t)=>{var tr=getEnvStrings();HEAPU32[e>>2]=tr.length;var rr=0;return tr.forEach(ir=>rr+=ir.length+1),HEAPU32[t>>2]=rr,0};_environ_sizes_get.sig="ipp";function _fd_close(e){try{var t=SYSCALLS.getStreamFromFD(e);return FS.close(t),0}catch(tr){if(typeof FS>"u"||tr.name!=="ErrnoError")throw tr;return tr.errno}}_fd_close.sig="ii";function _fd_fdstat_get(e,t){try{var tr=0,rr=0,ir=0,lr=SYSCALLS.getStreamFromFD(e),dr=lr.tty?2:FS.isDir(lr.mode)?3:FS.isLink(lr.mode)?7:4;return HEAP8[t]=dr,HEAP16[t+2>>1]=ir,HEAP64[t+8>>3]=BigInt(tr),HEAP64[t+16>>3]=BigInt(rr),0}catch(fr){if(typeof FS>"u"||fr.name!=="ErrnoError")throw fr;return fr.errno}}_fd_fdstat_get.sig="iip";var doReadv=(e,t,tr,rr)=>{for(var ir=0,lr=0;lr<tr;lr++){var dr=HEAPU32[t>>2],fr=HEAPU32[t+4>>2];t+=8;var hr=FS.read(e,HEAP8,dr,fr,rr);if(hr<0)return-1;if(ir+=hr,hr<fr)break;typeof rr<"u"&&(rr+=hr)}return ir};function _fd_pread(e,t,tr,rr,ir){rr=bigintToI53Checked(rr);try{if(isNaN(rr))return 61;var lr=SYSCALLS.getStreamFromFD(e),dr=doReadv(lr,t,tr,rr);return HEAPU32[ir>>2]=dr,0}catch(fr){if(typeof FS>"u"||fr.name!=="ErrnoError")throw fr;return fr.errno}}_fd_pread.sig="iippjp";var doWritev=(e,t,tr,rr)=>{for(var ir=0,lr=0;lr<tr;lr++){var dr=HEAPU32[t>>2],fr=HEAPU32[t+4>>2];t+=8;var hr=FS.write(e,HEAP8,dr,fr,rr);if(hr<0)return-1;if(ir+=hr,hr<fr)break;typeof rr<"u"&&(rr+=hr)}return ir};function _fd_pwrite(e,t,tr,rr,ir){rr=bigintToI53Checked(rr);try{if(isNaN(rr))return 61;var lr=SYSCALLS.getStreamFromFD(e),dr=doWritev(lr,t,tr,rr);return HEAPU32[ir>>2]=dr,0}catch(fr){if(typeof FS>"u"||fr.name!=="ErrnoError")throw fr;return fr.errno}}_fd_pwrite.sig="iippjp";function _fd_read(e,t,tr,rr){try{var ir=SYSCALLS.getStreamFromFD(e),lr=doReadv(ir,t,tr);return HEAPU32[rr>>2]=lr,0}catch(dr){if(typeof FS>"u"||dr.name!=="ErrnoError")throw dr;return dr.errno}}_fd_read.sig="iippp";function _fd_seek(e,t,tr,rr){t=bigintToI53Checked(t);try{if(isNaN(t))return 61;var ir=SYSCALLS.getStreamFromFD(e);return FS.llseek(ir,t,tr),HEAP64[rr>>3]=BigInt(ir.position),ir.getdents&&t===0&&tr===0&&(ir.getdents=null),0}catch(lr){if(typeof FS>"u"||lr.name!=="ErrnoError")throw lr;return lr.errno}}_fd_seek.sig="iijip";function _fd_sync(e){var tr;try{var t=SYSCALLS.getStreamFromFD(e);return(tr=t.stream_ops)!=null&&tr.fsync?t.stream_ops.fsync(t):0}catch(rr){if(typeof FS>"u"||rr.name!=="ErrnoError")throw rr;return rr.errno}}_fd_sync.sig="ii";function _fd_write(e,t,tr,rr){try{var ir=SYSCALLS.getStreamFromFD(e),lr=doWritev(ir,t,tr);return HEAPU32[rr>>2]=lr,0}catch(dr){if(typeof FS>"u"||dr.name!=="ErrnoError")throw dr;return dr.errno}}_fd_write.sig="iippp";var _getaddrinfo=(e,t,tr,rr)=>{var ir=0,lr=0,dr=0,fr=0,hr=0,mr=0,gr;function yr(_r,br,wr,vr,Sr,Ir){var Mr,Ar,kr,Or;return Ar=_r===10?28:16,Sr=_r===10?inetNtop6(Sr):inetNtop4(Sr),Mr=_malloc(Ar),Or=writeSockaddr(Mr,_r,Sr,Ir),assert(!Or),kr=_malloc(32),HEAP32[kr+4>>2]=_r,HEAP32[kr+8>>2]=br,HEAP32[kr+12>>2]=wr,HEAPU32[kr+24>>2]=vr,HEAPU32[kr+20>>2]=Mr,_r===10?HEAP32[kr+16>>2]=28:HEAP32[kr+16>>2]=16,HEAP32[kr+28>>2]=0,kr}if(tr&&(dr=HEAP32[tr>>2],fr=HEAP32[tr+4>>2],hr=HEAP32[tr+8>>2],mr=HEAP32[tr+12>>2]),hr&&!mr&&(mr=hr===2?17:6),!hr&&mr&&(hr=mr===17?2:1),mr===0&&(mr=6),hr===0&&(hr=1),!e&&!t)return-2;if(dr&-1088||tr!==0&&HEAP32[tr>>2]&2&&!e)return-1;if(dr&32)return-2;if(hr!==0&&hr!==1&&hr!==2)return-7;if(fr!==0&&fr!==2&&fr!==10)return-6;if(t&&(t=UTF8ToString(t),lr=parseInt(t,10),isNaN(lr)))return dr&1024?-2:-8;if(!e)return fr===0&&(fr=2),dr&1||(fr===2?ir=_htonl(2130706433):ir=[0,0,0,_htonl(1)]),gr=yr(fr,hr,mr,null,ir,lr),HEAPU32[rr>>2]=gr,0;if(e=UTF8ToString(e),ir=inetPton4(e),ir!==null)if(fr===0||fr===2)fr=2;else if(fr===10&&dr&8)ir=[0,0,_htonl(65535),ir],fr=10;else return-2;else if(ir=inetPton6(e),ir!==null)if(fr===0||fr===10)fr=10;else return-2;return ir!=null?(gr=yr(fr,hr,mr,e,ir,lr),HEAPU32[rr>>2]=gr,0):dr&4?-2:(e=DNS.lookup_name(e),ir=inetPton4(e),fr===0?fr=2:fr===10&&(ir=[0,0,_htonl(65535),ir]),gr=yr(fr,hr,mr,null,ir,lr),HEAPU32[rr>>2]=gr,0)};_getaddrinfo.sig="ipppp";var _getnameinfo=(e,t,tr,rr,ir,lr,dr)=>{var fr=readSockaddr(e,t);if(fr.errno)return-6;var hr=fr.port,mr=fr.addr,gr=!1;if(tr&&rr){var yr;if(dr&1||!(yr=DNS.lookup_addr(mr))){if(dr&8)return-2}else mr=yr;var _r=stringToUTF8(mr,tr,rr);_r+1>=rr&&(gr=!0)}if(ir&&lr){hr=""+hr;var _r=stringToUTF8(hr,ir,lr);_r+1>=lr&&(gr=!0)}return gr?-12:0};_getnameinfo.sig="ipipipii";var stringToNewUTF8=e=>{var t=lengthBytesUTF8(e)+1,tr=_malloc(t);return tr&&stringToUTF8(e,tr,t),tr},getCFunc=e=>{var t=Module["_"+e];return t},writeArrayToMemory=(e,t)=>{HEAP8.set(e,t)},ccall=(e,t,tr,rr,ir)=>{var lr={string:wr=>{var vr=0;return wr!=null&&wr!==0&&(vr=stringToUTF8OnStack(wr)),vr},array:wr=>{var vr=stackAlloc(wr.length);return writeArrayToMemory(wr,vr),vr}};function dr(wr){return t==="string"?UTF8ToString(wr):t==="boolean"?!!wr:wr}var fr=getCFunc(e),hr=[],mr=0;if(rr)for(var gr=0;gr<rr.length;gr++){var yr=lr[tr[gr]];yr?(mr===0&&(mr=stackSave()),hr[gr]=yr(rr[gr])):hr[gr]=rr[gr]}var _r=fr(...hr);function br(wr){return mr!==0&&stackRestore(mr),dr(wr)}return _r=br(_r),_r},cwrap=(e,t,tr,rr)=>{var ir=!tr||tr.every(dr=>dr==="number"||dr==="boolean"),lr=t!=="string";return lr&&ir&&!rr?getCFunc(e):(...dr)=>ccall(e,t,tr,dr)},FS_createPath=FS.createPath,FS_unlink=e=>FS.unlink(e),FS_createLazyFile=FS.createLazyFile,FS_createDevice=FS.createDevice,setTempRet0=e=>__emscripten_tempret_set(e),_setTempRet0=setTempRet0;Module._setTempRet0=_setTempRet0;var getTempRet0=e=>__emscripten_tempret_get(),_getTempRet0=getTempRet0;Module._getTempRet0=_getTempRet0,registerWasmPlugin(),FS.createPreloadedFile=FS_createPreloadedFile,FS.staticInit(),Module.FS_createPath=FS.createPath,Module.FS_createDataFile=FS.createDataFile,Module.FS_createPreloadedFile=FS.createPreloadedFile,Module.FS_unlink=FS.unlink,Module.FS_createLazyFile=FS.createLazyFile,Module.FS_createDevice=FS.createDevice,MEMFS.doesNotExistError=new FS.ErrnoError(44),MEMFS.doesNotExistError.stack="<generic error, no stack>",ENVIRONMENT_IS_NODE&&NODEFS.staticInit(),Module.requestAnimationFrame=MainLoop.requestAnimationFrame,Module.pauseMainLoop=MainLoop.pause,Module.resumeMainLoop=MainLoop.resume,MainLoop.init();var wasmImports={__assert_fail:___assert_fail,__call_sighandler:___call_sighandler,__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_pointer:___stack_pointer,__syscall__newselect:___syscall__newselect,__syscall_bind:___syscall_bind,__syscall_chdir:___syscall_chdir,__syscall_chmod:___syscall_chmod,__syscall_connect:___syscall_connect,__syscall_dup:___syscall_dup,__syscall_dup3:___syscall_dup3,__syscall_faccessat:___syscall_faccessat,__syscall_fadvise64:___syscall_fadvise64,__syscall_fallocate:___syscall_fallocate,__syscall_fcntl64:___syscall_fcntl64,__syscall_fdatasync:___syscall_fdatasync,__syscall_fstat64:___syscall_fstat64,__syscall_ftruncate64:___syscall_ftruncate64,__syscall_getcwd:___syscall_getcwd,__syscall_getdents64:___syscall_getdents64,__syscall_getsockname:___syscall_getsockname,__syscall_getsockopt:___syscall_getsockopt,__syscall_ioctl:___syscall_ioctl,__syscall_lstat64:___syscall_lstat64,__syscall_mkdirat:___syscall_mkdirat,__syscall_newfstatat:___syscall_newfstatat,__syscall_openat:___syscall_openat,__syscall_pipe:___syscall_pipe,__syscall_poll:___syscall_poll,__syscall_readlinkat:___syscall_readlinkat,__syscall_recvfrom:___syscall_recvfrom,__syscall_renameat:___syscall_renameat,__syscall_rmdir:___syscall_rmdir,__syscall_sendto:___syscall_sendto,__syscall_socket:___syscall_socket,__syscall_stat64:___syscall_stat64,__syscall_symlinkat:___syscall_symlinkat,__syscall_truncate64:___syscall_truncate64,__syscall_unlinkat:___syscall_unlinkat,__table_base:___table_base,_abort_js:__abort_js,_dlopen_js:__dlopen_js,_dlsym_js:__dlsym_js,_emscripten_memcpy_js:__emscripten_memcpy_js,_emscripten_runtime_keepalive_clear:__emscripten_runtime_keepalive_clear,_emscripten_system:__emscripten_system,_emscripten_throw_longjmp:__emscripten_throw_longjmp,_gmtime_js:__gmtime_js,_localtime_js:__localtime_js,_mmap_js:__mmap_js,_munmap_js:__munmap_js,_setitimer_js:__setitimer_js,_tzset_js:__tzset_js,clock_time_get:_clock_time_get,emscripten_asm_const_int:_emscripten_asm_const_int,emscripten_date_now:_emscripten_date_now,emscripten_force_exit:_emscripten_force_exit,emscripten_get_now:_emscripten_get_now,emscripten_resize_heap:_emscripten_resize_heap,emscripten_set_main_loop:_emscripten_set_main_loop,environ_get:_environ_get,environ_sizes_get:_environ_sizes_get,exit:_exit,fd_close:_fd_close,fd_fdstat_get:_fd_fdstat_get,fd_pread:_fd_pread,fd_pwrite:_fd_pwrite,fd_read:_fd_read,fd_seek:_fd_seek,fd_sync:_fd_sync,fd_write:_fd_write,getTempRet0:_getTempRet0,getaddrinfo:_getaddrinfo,getnameinfo:_getnameinfo,invoke_di,invoke_i,invoke_id,invoke_ii,invoke_iii,invoke_iiii,invoke_iiiii,invoke_iiiiii,invoke_iiiiiii,invoke_iiiiiiii,invoke_iiiiiiiii,invoke_iiiiiiiiii,invoke_iiiiiiiiiiiiiiiii,invoke_iiiiiji,invoke_iiiij,invoke_iiiijii,invoke_iiij,invoke_iiji,invoke_ij,invoke_ijiiiii,invoke_ijiiiiii,invoke_ji,invoke_jii,invoke_jiiii,invoke_jiiiii,invoke_jiiiiiiii,invoke_v,invoke_vi,invoke_vid,invoke_vii,invoke_viii,invoke_viiii,invoke_viiiii,invoke_viiiiii,invoke_viiiiiii,invoke_viiiiiiii,invoke_viiiiiiiii,invoke_viiiiiiiiiiii,invoke_viiij,invoke_viij,invoke_viiji,invoke_viijii,invoke_viijiiii,invoke_vij,invoke_viji,invoke_vijiji,invoke_vj,invoke_vji,is_web_env,memory:wasmMemory,proc_exit:_proc_exit,setTempRet0:_setTempRet0},wasmExports;createWasm(),Module._ScanKeywordLookup=(e,t)=>(Module._ScanKeywordLookup=wasmExports.ScanKeywordLookup)(e,t),Module._pg_snprintf=(e,t,tr,rr)=>(Module._pg_snprintf=wasmExports.pg_snprintf)(e,t,tr,rr),Module._strlen=e=>(Module._strlen=wasmExports.strlen)(e),Module._memset=(e,t,tr)=>(Module._memset=wasmExports.memset)(e,t,tr),Module._strchr=(e,t)=>(Module._strchr=wasmExports.strchr)(e,t),Module._PQserverVersion=e=>(Module._PQserverVersion=wasmExports.PQserverVersion)(e),Module._strstr=(e,t)=>(Module._strstr=wasmExports.strstr)(e,t),Module._pg_fprintf=(e,t,tr)=>(Module._pg_fprintf=wasmExports.pg_fprintf)(e,t,tr),Module._strspn=(e,t)=>(Module._strspn=wasmExports.strspn)(e,t);var _malloc=Module._malloc=e=>(_malloc=Module._malloc=wasmExports.malloc)(e);Module._pg_strcasecmp=(e,t)=>(Module._pg_strcasecmp=wasmExports.pg_strcasecmp)(e,t),Module._strcmp=(e,t)=>(Module._strcmp=wasmExports.strcmp)(e,t),Module._free=e=>(Module._free=wasmExports.free)(e),Module._pg_tolower=e=>(Module._pg_tolower=wasmExports.pg_tolower)(e),Module._memchr=(e,t,tr)=>(Module._memchr=wasmExports.memchr)(e,t,tr),Module._getenv=e=>(Module._getenv=wasmExports.getenv)(e),Module._fileno=e=>(Module._fileno=wasmExports.fileno)(e),Module._isatty=e=>(Module._isatty=wasmExports.isatty)(e),Module._strdup=e=>(Module._strdup=wasmExports.strdup)(e),Module.___errno_location=()=>(Module.___errno_location=wasmExports.__errno_location)();var _fflush=Module._fflush=e=>(_fflush=Module._fflush=wasmExports.fflush)(e);Module._pg_vsnprintf=(e,t,tr,rr)=>(Module._pg_vsnprintf=wasmExports.pg_vsnprintf)(e,t,tr,rr),Module._pg_malloc_extended=(e,t)=>(Module._pg_malloc_extended=wasmExports.pg_malloc_extended)(e,t),Module._PageInit=(e,t,tr)=>(Module._PageInit=wasmExports.PageInit)(e,t,tr),Module._pg_checksum_page=(e,t)=>(Module._pg_checksum_page=wasmExports.pg_checksum_page)(e,t),Module._errstart=(e,t)=>(Module._errstart=wasmExports.errstart)(e,t),Module._errcode=e=>(Module._errcode=wasmExports.errcode)(e),Module._errmsg=(e,t)=>(Module._errmsg=wasmExports.errmsg)(e,t),Module._errfinish=(e,t,tr)=>(Module._errfinish=wasmExports.errfinish)(e,t,tr),Module._PageAddItemExtended=(e,t,tr,rr,ir)=>(Module._PageAddItemExtended=wasmExports.PageAddItemExtended)(e,t,tr,rr,ir),Module._errstart_cold=(e,t)=>(Module._errstart_cold=wasmExports.errstart_cold)(e,t),Module._puts=e=>(Module._puts=wasmExports.puts)(e),Module._errmsg_internal=(e,t)=>(Module._errmsg_internal=wasmExports.errmsg_internal)(e,t),Module._memmove=(e,t,tr)=>(Module._memmove=wasmExports.memmove)(e,t,tr),Module._memcpy=(e,t,tr)=>(Module._memcpy=wasmExports.memcpy)(e,t,tr),Module._palloc=e=>(Module._palloc=wasmExports.palloc)(e),Module._pfree=e=>(Module._pfree=wasmExports.pfree)(e),Module._PageGetFreeSpace=e=>(Module._PageGetFreeSpace=wasmExports.PageGetFreeSpace)(e),Module._PageGetExactFreeSpace=e=>(Module._PageGetExactFreeSpace=wasmExports.PageGetExactFreeSpace)(e),Module._PageGetHeapFreeSpace=e=>(Module._PageGetHeapFreeSpace=wasmExports.PageGetHeapFreeSpace)(e),Module._PageIndexMultiDelete=(e,t,tr)=>(Module._PageIndexMultiDelete=wasmExports.PageIndexMultiDelete)(e,t,tr),Module._PageIndexTupleOverwrite=(e,t,tr,rr)=>(Module._PageIndexTupleOverwrite=wasmExports.PageIndexTupleOverwrite)(e,t,tr,rr),Module._ItemPointerEquals=(e,t)=>(Module._ItemPointerEquals=wasmExports.ItemPointerEquals)(e,t),Module._ItemPointerCompare=(e,t)=>(Module._ItemPointerCompare=wasmExports.ItemPointerCompare)(e,t),Module._add_size=(e,t)=>(Module._add_size=wasmExports.add_size)(e,t),Module._ShmemInitStruct=(e,t,tr)=>(Module._ShmemInitStruct=wasmExports.ShmemInitStruct)(e,t,tr),Module._s_init_lock_sema=(e,t)=>(Module._s_init_lock_sema=wasmExports.s_init_lock_sema)(e,t),Module._LWLockAcquire=(e,t)=>(Module._LWLockAcquire=wasmExports.LWLockAcquire)(e,t),Module._LWLockRelease=e=>(Module._LWLockRelease=wasmExports.LWLockRelease)(e),Module._on_shmem_exit=(e,t)=>(Module._on_shmem_exit=wasmExports.on_shmem_exit)(e,t),Module._tas_sema=e=>(Module._tas_sema=wasmExports.tas_sema)(e),Module._s_lock=(e,t,tr,rr)=>(Module._s_lock=wasmExports.s_lock)(e,t,tr,rr),Module._s_unlock_sema=e=>(Module._s_unlock_sema=wasmExports.s_unlock_sema)(e),Module._StartTransactionCommand=()=>(Module._StartTransactionCommand=wasmExports.StartTransactionCommand)(),Module._CommitTransactionCommand=()=>(Module._CommitTransactionCommand=wasmExports.CommitTransactionCommand)(),Module._WaitLatch=(e,t,tr,rr)=>(Module._WaitLatch=wasmExports.WaitLatch)(e,t,tr,rr),Module._ResetLatch=e=>(Module._ResetLatch=wasmExports.ResetLatch)(e),Module._ProcessInterrupts=()=>(Module._ProcessInterrupts=wasmExports.ProcessInterrupts)(),Module._MemoryContextAlloc=(e,t)=>(Module._MemoryContextAlloc=wasmExports.MemoryContextAlloc)(e,t),Module._AllocateDir=e=>(Module._AllocateDir=wasmExports.AllocateDir)(e),Module._ReadDir=(e,t)=>(Module._ReadDir=wasmExports.ReadDir)(e,t),Module._strncmp=(e,t,tr)=>(Module._strncmp=wasmExports.strncmp)(e,t,tr),Module._unlink=e=>(Module._unlink=wasmExports.unlink)(e),Module._errcode_for_file_access=()=>(Module._errcode_for_file_access=wasmExports.errcode_for_file_access)(),Module._FreeDir=e=>(Module._FreeDir=wasmExports.FreeDir)(e),Module._pg_prng_uint32=e=>(Module._pg_prng_uint32=wasmExports.pg_prng_uint32)(e),Module._dsm_create=(e,t)=>(Module._dsm_create=wasmExports.dsm_create)(e,t),Module._dsm_attach=e=>(Module._dsm_attach=wasmExports.dsm_attach)(e),Module._dsm_detach=e=>(Module._dsm_detach=wasmExports.dsm_detach)(e),Module._dsm_segment_address=e=>(Module._dsm_segment_address=wasmExports.dsm_segment_address)(e),Module._dsm_segment_handle=e=>(Module._dsm_segment_handle=wasmExports.dsm_segment_handle)(e),Module._MemoryContextAllocZero=(e,t)=>(Module._MemoryContextAllocZero=wasmExports.MemoryContextAllocZero)(e,t),Module._read=(e,t,tr)=>(Module._read=wasmExports.read)(e,t,tr),Module._hash_create=(e,t,tr,rr)=>(Module._hash_create=wasmExports.hash_create)(e,t,tr,rr),Module._hash_destroy=e=>(Module._hash_destroy=wasmExports.hash_destroy)(e),Module._hash_seq_init=(e,t)=>(Module._hash_seq_init=wasmExports.hash_seq_init)(e,t),Module._hash_seq_search=e=>(Module._hash_seq_search=wasmExports.hash_seq_search)(e),Module._hash_search=(e,t,tr,rr)=>(Module._hash_search=wasmExports.hash_search)(e,t,tr,rr),Module._initStringInfo=e=>(Module._initStringInfo=wasmExports.initStringInfo)(e),Module._appendStringInfo=(e,t,tr)=>(Module._appendStringInfo=wasmExports.appendStringInfo)(e,t,tr),Module._GetCurrentTimestamp=()=>(Module._GetCurrentTimestamp=wasmExports.GetCurrentTimestamp)(),Module._pg_usleep=e=>(Module._pg_usleep=wasmExports.pg_usleep)(e),Module._errdetail=(e,t)=>(Module._errdetail=wasmExports.errdetail)(e,t),Module._TransactionIdDidCommit=e=>(Module._TransactionIdDidCommit=wasmExports.TransactionIdDidCommit)(e),Module._TransactionIdPrecedes=(e,t)=>(Module._TransactionIdPrecedes=wasmExports.TransactionIdPrecedes)(e,t),Module._XLogBeginInsert=()=>(Module._XLogBeginInsert=wasmExports.XLogBeginInsert)(),Module._XLogRegisterData=(e,t)=>(Module._XLogRegisterData=wasmExports.XLogRegisterData)(e,t),Module._XLogInsert=(e,t)=>(Module._XLogInsert=wasmExports.XLogInsert)(e,t),Module._ConditionVariableInit=e=>(Module._ConditionVariableInit=wasmExports.ConditionVariableInit)(e),Module._ConditionVariableCancelSleep=()=>(Module._ConditionVariableCancelSleep=wasmExports.ConditionVariableCancelSleep)(),Module._ConditionVariableSleep=(e,t)=>(Module._ConditionVariableSleep=wasmExports.ConditionVariableSleep)(e,t),Module.___wasm_setjmp=(e,t,tr)=>(Module.___wasm_setjmp=wasmExports.__wasm_setjmp)(e,t,tr),Module.___wasm_setjmp_test=(e,t)=>(Module.___wasm_setjmp_test=wasmExports.__wasm_setjmp_test)(e,t),Module._pg_re_throw=()=>(Module._pg_re_throw=wasmExports.pg_re_throw)(),Module._emscripten_longjmp=(e,t)=>(Module._emscripten_longjmp=wasmExports.emscripten_longjmp)(e,t),Module._procsignal_sigusr1_handler=e=>(Module._procsignal_sigusr1_handler=wasmExports.procsignal_sigusr1_handler)(e),Module._close=e=>(Module._close=wasmExports.close)(e),Module._ReleaseExternalFD=()=>(Module._ReleaseExternalFD=wasmExports.ReleaseExternalFD)(),Module._fcntl=(e,t,tr)=>(Module._fcntl=wasmExports.fcntl)(e,t,tr),Module._pqsignal=(e,t)=>(Module._pqsignal=wasmExports.pqsignal)(e,t),Module._write=(e,t,tr)=>(Module._write=wasmExports.write)(e,t,tr),Module._AddWaitEventToSet=(e,t,tr,rr,ir)=>(Module._AddWaitEventToSet=wasmExports.AddWaitEventToSet)(e,t,tr,rr,ir),Module._clock_gettime=(e,t)=>(Module._clock_gettime=wasmExports.clock_gettime)(e,t),Module._poll=(e,t,tr)=>(Module._poll=wasmExports.poll)(e,t,tr),Module._WaitLatchOrSocket=(e,t,tr,rr,ir)=>(Module._WaitLatchOrSocket=wasmExports.WaitLatchOrSocket)(e,t,tr,rr,ir),Module._GetNumRegisteredWaitEvents=e=>(Module._GetNumRegisteredWaitEvents=wasmExports.GetNumRegisteredWaitEvents)(e),Module._ShmemInitHash=(e,t,tr,rr,ir)=>(Module._ShmemInitHash=wasmExports.ShmemInitHash)(e,t,tr,rr,ir),Module._InitMaterializedSRF=(e,t)=>(Module._InitMaterializedSRF=wasmExports.InitMaterializedSRF)(e,t),Module._cstring_to_text=e=>(Module._cstring_to_text=wasmExports.cstring_to_text)(e),Module._Int64GetDatum=e=>(Module._Int64GetDatum=wasmExports.Int64GetDatum)(e),Module._tuplestore_putvalues=(e,t,tr,rr)=>(Module._tuplestore_putvalues=wasmExports.tuplestore_putvalues)(e,t,tr,rr),Module._shm_toc_allocate=(e,t)=>(Module._shm_toc_allocate=wasmExports.shm_toc_allocate)(e,t),Module._shm_toc_insert=(e,t,tr)=>(Module._shm_toc_insert=wasmExports.shm_toc_insert)(e,t,tr),Module._shm_toc_lookup=(e,t,tr)=>(Module._shm_toc_lookup=wasmExports.shm_toc_lookup)(e,t,tr),Module._superuser_arg=e=>(Module._superuser_arg=wasmExports.superuser_arg)(e),Module._superuser=()=>(Module._superuser=wasmExports.superuser)(),Module._GetUserId=()=>(Module._GetUserId=wasmExports.GetUserId)(),Module._has_privs_of_role=(e,t)=>(Module._has_privs_of_role=wasmExports.has_privs_of_role)(e,t),Module._errmsg_plural=(e,t,tr,rr)=>(Module._errmsg_plural=wasmExports.errmsg_plural)(e,t,tr,rr),Module._errhint=(e,t)=>(Module._errhint=wasmExports.errhint)(e,t),Module._fstat=(e,t)=>(Module._fstat=wasmExports.fstat)(e,t),Module._ftruncate=(e,t)=>(Module._ftruncate=wasmExports.ftruncate)(e,t),Module._RequestAddinShmemSpace=e=>(Module._RequestAddinShmemSpace=wasmExports.RequestAddinShmemSpace)(e),Module._hash_estimate_size=(e,t)=>(Module._hash_estimate_size=wasmExports.hash_estimate_size)(e,t),Module._pg_sprintf=(e,t,tr)=>(Module._pg_sprintf=wasmExports.pg_sprintf)(e,t,tr),Module._SetConfigOption=(e,t,tr,rr)=>(Module._SetConfigOption=wasmExports.SetConfigOption)(e,t,tr,rr),Module._pg_printf=(e,t)=>(Module._pg_printf=wasmExports.pg_printf)(e,t),Module._before_shmem_exit=(e,t)=>(Module._before_shmem_exit=wasmExports.before_shmem_exit)(e,t),Module._cancel_before_shmem_exit=(e,t)=>(Module._cancel_before_shmem_exit=wasmExports.cancel_before_shmem_exit)(e,t),Module._pg_qsort=(e,t,tr,rr)=>(Module._pg_qsort=wasmExports.pg_qsort)(e,t,tr,rr),Module._TransactionIdIsInProgress=e=>(Module._TransactionIdIsInProgress=wasmExports.TransactionIdIsInProgress)(e),Module._TransactionIdIsCurrentTransactionId=e=>(Module._TransactionIdIsCurrentTransactionId=wasmExports.TransactionIdIsCurrentTransactionId)(e),Module._RecoveryInProgress=()=>(Module._RecoveryInProgress=wasmExports.RecoveryInProgress)(),Module._GetOldestNonRemovableTransactionId=e=>(Module._GetOldestNonRemovableTransactionId=wasmExports.GetOldestNonRemovableTransactionId)(e),Module._GetCurrentCommandId=e=>(Module._GetCurrentCommandId=wasmExports.GetCurrentCommandId)(e),Module._BackendXidGetPid=e=>(Module._BackendXidGetPid=wasmExports.BackendXidGetPid)(e),Module._lappend_int=(e,t)=>(Module._lappend_int=wasmExports.lappend_int)(e,t),Module._index_close=(e,t)=>(Module._index_close=wasmExports.index_close)(e,t),Module._table_close=(e,t)=>(Module._table_close=wasmExports.table_close)(e,t),Module._CommandCounterIncrement=()=>(Module._CommandCounterIncrement=wasmExports.CommandCounterIncrement)(),Module._GetActiveSnapshot=()=>(Module._GetActiveSnapshot=wasmExports.GetActiveSnapshot)(),Module._ScanKeyInit=(e,t,tr,rr,ir)=>(Module._ScanKeyInit=wasmExports.ScanKeyInit)(e,t,tr,rr,ir),Module._table_open=(e,t)=>(Module._table_open=wasmExports.table_open)(e,t),Module._systable_beginscan=(e,t,tr,rr,ir,lr)=>(Module._systable_beginscan=wasmExports.systable_beginscan)(e,t,tr,rr,ir,lr),Module._systable_getnext=e=>(Module._systable_getnext=wasmExports.systable_getnext)(e),Module._systable_endscan=e=>(Module._systable_endscan=wasmExports.systable_endscan)(e),Module._index_open=(e,t)=>(Module._index_open=wasmExports.index_open)(e,t),Module._systable_beginscan_ordered=(e,t,tr,rr,ir)=>(Module._systable_beginscan_ordered=wasmExports.systable_beginscan_ordered)(e,t,tr,rr,ir),Module._systable_getnext_ordered=(e,t)=>(Module._systable_getnext_ordered=wasmExports.systable_getnext_ordered)(e,t),Module._systable_endscan_ordered=e=>(Module._systable_endscan_ordered=wasmExports.systable_endscan_ordered)(e),Module._heap_form_tuple=(e,t,tr)=>(Module._heap_form_tuple=wasmExports.heap_form_tuple)(e,t,tr),Module._heap_freetuple=e=>(Module._heap_freetuple=wasmExports.heap_freetuple)(e),Module._AllocSetContextCreateInternal=(e,t,tr,rr,ir)=>(Module._AllocSetContextCreateInternal=wasmExports.AllocSetContextCreateInternal)(e,t,tr,rr,ir),Module._list_free_deep=e=>(Module._list_free_deep=wasmExports.list_free_deep)(e),Module._lappend=(e,t)=>(Module._lappend=wasmExports.lappend)(e,t),Module._LockBuffer=(e,t)=>(Module._LockBuffer=wasmExports.LockBuffer)(e,t),Module._GetFreeIndexPage=e=>(Module._GetFreeIndexPage=wasmExports.GetFreeIndexPage)(e),Module._RecordFreeIndexPage=(e,t)=>(Module._RecordFreeIndexPage=wasmExports.RecordFreeIndexPage)(e,t),Module._IndexFreeSpaceMapVacuum=e=>(Module._IndexFreeSpaceMapVacuum=wasmExports.IndexFreeSpaceMapVacuum)(e),Module._UnlockReleaseBuffer=e=>(Module._UnlockReleaseBuffer=wasmExports.UnlockReleaseBuffer)(e),Module._smgropen=(e,t)=>(Module._smgropen=wasmExports.smgropen)(e,t),Module._smgrsetowner=(e,t)=>(Module._smgrsetowner=wasmExports.smgrsetowner)(e,t),Module._RelationGetNumberOfBlocksInFork=(e,t)=>(Module._RelationGetNumberOfBlocksInFork=wasmExports.RelationGetNumberOfBlocksInFork)(e,t),Module._ReleaseBuffer=e=>(Module._ReleaseBuffer=wasmExports.ReleaseBuffer)(e),Module._GetRecordedFreeSpace=(e,t)=>(Module._GetRecordedFreeSpace=wasmExports.GetRecordedFreeSpace)(e,t),Module._smgrexists=(e,t)=>(Module._smgrexists=wasmExports.smgrexists)(e,t),Module._ReadBufferExtended=(e,t,tr,rr,ir)=>(Module._ReadBufferExtended=wasmExports.ReadBufferExtended)(e,t,tr,rr,ir),Module._MarkBufferDirty=e=>(Module._MarkBufferDirty=wasmExports.MarkBufferDirty)(e),Module._log_newpage_buffer=(e,t)=>(Module._log_newpage_buffer=wasmExports.log_newpage_buffer)(e,t),Module._copy_file=(e,t)=>(Module._copy_file=wasmExports.copy_file)(e,t),Module._fd_fsync_fname=(e,t)=>(Module._fd_fsync_fname=wasmExports.fd_fsync_fname)(e,t),Module._OpenTransientFile=(e,t)=>(Module._OpenTransientFile=wasmExports.OpenTransientFile)(e,t),Module._CloseTransientFile=e=>(Module._CloseTransientFile=wasmExports.CloseTransientFile)(e),Module._hash_bytes=(e,t)=>(Module._hash_bytes=wasmExports.hash_bytes)(e,t),Module._pstrdup=e=>(Module._pstrdup=wasmExports.pstrdup)(e),Module._repalloc=(e,t)=>(Module._repalloc=wasmExports.repalloc)(e,t),Module._wasm_OpenPipeStream=(e,t)=>(Module._wasm_OpenPipeStream=wasmExports.wasm_OpenPipeStream)(e,t),Module._access=(e,t)=>(Module._access=wasmExports.access)(e,t),Module._fopen=(e,t)=>(Module._fopen=wasmExports.fopen)(e,t),Module._fiprintf=(e,t,tr)=>(Module._fiprintf=wasmExports.fiprintf)(e,t,tr),Module._fclose=e=>(Module._fclose=wasmExports.fclose)(e),Module._fsync_fname_ext=(e,t,tr,rr)=>(Module._fsync_fname_ext=wasmExports.fsync_fname_ext)(e,t,tr,rr),Module._fd_durable_rename=(e,t,tr)=>(Module._fd_durable_rename=wasmExports.fd_durable_rename)(e,t,tr),Module._rename=(e,t)=>(Module._rename=wasmExports.rename)(e,t),Module._strlcpy=(e,t,tr)=>(Module._strlcpy=wasmExports.strlcpy)(e,t,tr),Module._dup=e=>(Module._dup=wasmExports.dup)(e),Module._open=(e,t,tr)=>(Module._open=wasmExports.open)(e,t,tr),Module._AcquireExternalFD=()=>(Module._AcquireExternalFD=wasmExports.AcquireExternalFD)(),Module._realloc=(e,t)=>(Module._realloc=wasmExports.realloc)(e,t),Module._stat=(e,t)=>(Module._stat=wasmExports.stat)(e,t),Module._pwrite=(e,t,tr,rr)=>(Module._pwrite=wasmExports.pwrite)(e,t,tr,rr),Module._lseek=(e,t,tr)=>(Module._lseek=wasmExports.lseek)(e,t,tr),Module._AllocateFile=(e,t)=>(Module._AllocateFile=wasmExports.AllocateFile)(e,t),Module._GetCurrentSubTransactionId=()=>(Module._GetCurrentSubTransactionId=wasmExports.GetCurrentSubTransactionId)(),Module._FreeFile=e=>(Module._FreeFile=wasmExports.FreeFile)(e),Module._pclose=e=>(Module._pclose=wasmExports.pclose)(e),Module._ClosePipeStream=e=>(Module._ClosePipeStream=wasmExports.ClosePipeStream)(e),Module._pg_prng_uint64_range=(e,t,tr)=>(Module._pg_prng_uint64_range=wasmExports.pg_prng_uint64_range)(e,t,tr),Module._AtEOSubXact_Files=(e,t,tr)=>(Module._AtEOSubXact_Files=wasmExports.AtEOSubXact_Files)(e,t,tr),Module._pre_format_elog_string=(e,t)=>(Module._pre_format_elog_string=wasmExports.pre_format_elog_string)(e,t),Module._format_elog_string=(e,t)=>(Module._format_elog_string=wasmExports.format_elog_string)(e,t),Module._list_free=e=>(Module._list_free=wasmExports.list_free)(e),Module._guc_malloc=(e,t)=>(Module._guc_malloc=wasmExports.guc_malloc)(e,t),Module._MemoryContextDelete=e=>(Module._MemoryContextDelete=wasmExports.MemoryContextDelete)(e),Module._strtoul=(e,t,tr)=>(Module._strtoul=wasmExports.strtoul)(e,t,tr),Module._hash_get_num_entries=e=>(Module._hash_get_num_entries=wasmExports.hash_get_num_entries)(e),Module._LWLockInitialize=(e,t)=>(Module._LWLockInitialize=wasmExports.LWLockInitialize)(e,t),Module._PrefetchBuffer=(e,t,tr,rr)=>(Module._PrefetchBuffer=wasmExports.PrefetchBuffer)(e,t,tr,rr),Module._LockBufHdr=e=>(Module._LockBufHdr=wasmExports.LockBufHdr)(e),Module._ReadBuffer=(e,t)=>(Module._ReadBuffer=wasmExports.ReadBuffer)(e,t),Module._pgstat_assoc_relation=e=>(Module._pgstat_assoc_relation=wasmExports.pgstat_assoc_relation)(e),Module._ExtendBufferedRel=(e,t,tr,rr)=>(Module._ExtendBufferedRel=wasmExports.ExtendBufferedRel)(e,t,tr,rr),Module._LockBufferForCleanup=e=>(Module._LockBufferForCleanup=wasmExports.LockBufferForCleanup)(e),Module._smgrread=(e,t,tr,rr)=>(Module._smgrread=wasmExports.smgrread)(e,t,tr,rr),Module._LockRelationForExtension=(e,t)=>(Module._LockRelationForExtension=wasmExports.LockRelationForExtension)(e,t),Module._UnlockRelationForExtension=(e,t)=>(Module._UnlockRelationForExtension=wasmExports.UnlockRelationForExtension)(e,t),Module._BufferGetBlockNumber=e=>(Module._BufferGetBlockNumber=wasmExports.BufferGetBlockNumber)(e),Module._bsearch=(e,t,tr,rr,ir)=>(Module._bsearch=wasmExports.bsearch)(e,t,tr,rr,ir),Module._set_errcontext_domain=e=>(Module._set_errcontext_domain=wasmExports.set_errcontext_domain)(e),Module._errcontext_msg=(e,t)=>(Module._errcontext_msg=wasmExports.errcontext_msg)(e,t),Module._GetAccessStrategy=e=>(Module._GetAccessStrategy=wasmExports.GetAccessStrategy)(e),Module._FreeAccessStrategy=e=>(Module._FreeAccessStrategy=wasmExports.FreeAccessStrategy)(e),Module._ConditionalLockBuffer=e=>(Module._ConditionalLockBuffer=wasmExports.ConditionalLockBuffer)(e),Module._TestForOldSnapshot_impl=(e,t)=>(Module._TestForOldSnapshot_impl=wasmExports.TestForOldSnapshot_impl)(e,t);var _calloc=Module._calloc=(e,t)=>(_calloc=Module._calloc=wasmExports.calloc)(e,t);Module._have_free_buffer=()=>(Module._have_free_buffer=wasmExports.have_free_buffer)(),Module._palloc0=e=>(Module._palloc0=wasmExports.palloc0)(e),Module._resetStringInfo=e=>(Module._resetStringInfo=wasmExports.resetStringInfo)(e),Module._appendStringInfoChar=(e,t)=>(Module._appendStringInfoChar=wasmExports.appendStringInfoChar)(e,t),Module._appendBinaryStringInfo=(e,t,tr)=>(Module._appendBinaryStringInfo=wasmExports.appendBinaryStringInfo)(e,t,tr),Module._errdetail_internal=(e,t)=>(Module._errdetail_internal=wasmExports.errdetail_internal)(e,t),Module._strcpy=(e,t)=>(Module._strcpy=wasmExports.strcpy)(e,t),Module._LWLockRegisterTranche=(e,t)=>(Module._LWLockRegisterTranche=wasmExports.LWLockRegisterTranche)(e,t),Module._GetNamedLWLockTranche=e=>(Module._GetNamedLWLockTranche=wasmExports.GetNamedLWLockTranche)(e),Module._LWLockNewTrancheId=()=>(Module._LWLockNewTrancheId=wasmExports.LWLockNewTrancheId)(),Module._RequestNamedLWLockTranche=(e,t)=>(Module._RequestNamedLWLockTranche=wasmExports.RequestNamedLWLockTranche)(e,t),Module._pg_prng_double=e=>(Module._pg_prng_double=wasmExports.pg_prng_double)(e),Module._getpid=()=>(Module._getpid=wasmExports.getpid)(),Module._GetTransactionSnapshot=()=>(Module._GetTransactionSnapshot=wasmExports.GetTransactionSnapshot)(),Module._ConditionVariableSignal=e=>(Module._ConditionVariableSignal=wasmExports.ConditionVariableSignal)(e),Module._LockPage=(e,t,tr)=>(Module._LockPage=wasmExports.LockPage)(e,t,tr),Module._UnlockPage=(e,t,tr)=>(Module._UnlockPage=wasmExports.UnlockPage)(e,t,tr),Module._pgstat_progress_update_param=(e,t)=>(Module._pgstat_progress_update_param=wasmExports.pgstat_progress_update_param)(e,t),Module._list_make1_impl=(e,t)=>(Module._list_make1_impl=wasmExports.list_make1_impl)(e,t),Module._psprintf=(e,t)=>(Module._psprintf=wasmExports.psprintf)(e,t),Module._smgrtruncate=(e,t,tr,rr)=>(Module._smgrtruncate=wasmExports.smgrtruncate)(e,t,tr,rr),Module._log=e=>(Module._log=wasmExports.log)(e),Module._pairingheap_allocate=(e,t)=>(Module._pairingheap_allocate=wasmExports.pairingheap_allocate)(e,t),Module._pairingheap_add=(e,t)=>(Module._pairingheap_add=wasmExports.pairingheap_add)(e,t),Module._pairingheap_first=e=>(Module._pairingheap_first=wasmExports.pairingheap_first)(e),Module._pairingheap_remove_first=e=>(Module._pairingheap_remove_first=wasmExports.pairingheap_remove_first)(e),Module._bloom_create=(e,t,tr)=>(Module._bloom_create=wasmExports.bloom_create)(e,t,tr),Module._bloom_free=e=>(Module._bloom_free=wasmExports.bloom_free)(e),Module._bloom_add_element=(e,t,tr)=>(Module._bloom_add_element=wasmExports.bloom_add_element)(e,t,tr),Module._hash_bytes_extended=(e,t,tr)=>(Module._hash_bytes_extended=wasmExports.hash_bytes_extended)(e,t,tr),Module._bloom_lacks_element=(e,t,tr)=>(Module._bloom_lacks_element=wasmExports.bloom_lacks_element)(e,t,tr),Module._bloom_prop_bits_set=e=>(Module._bloom_prop_bits_set=wasmExports.bloom_prop_bits_set)(e),Module._pg_popcount=(e,t)=>(Module._pg_popcount=wasmExports.pg_popcount)(e,t),Module._memcmp=(e,t,tr)=>(Module._memcmp=wasmExports.memcmp)(e,t,tr),Module._bms_make_singleton=e=>(Module._bms_make_singleton=wasmExports.bms_make_singleton)(e),Module._bms_add_members=(e,t)=>(Module._bms_add_members=wasmExports.bms_add_members)(e,t),Module._bms_add_member=(e,t)=>(Module._bms_add_member=wasmExports.bms_add_member)(e,t),Module._bms_del_member=(e,t)=>(Module._bms_del_member=wasmExports.bms_del_member)(e,t),Module._check_stack_depth=()=>(Module._check_stack_depth=wasmExports.check_stack_depth)(),Module._parser_errposition=(e,t)=>(Module._parser_errposition=wasmExports.parser_errposition)(e,t),Module._makeVar=(e,t,tr,rr,ir,lr)=>(Module._makeVar=wasmExports.makeVar)(e,t,tr,rr,ir,lr),Module._bms_union=(e,t)=>(Module._bms_union=wasmExports.bms_union)(e,t),Module._varstr_levenshtein_less_equal=(e,t,tr,rr,ir,lr,dr,fr,hr)=>(Module._varstr_levenshtein_less_equal=wasmExports.varstr_levenshtein_less_equal)(e,t,tr,rr,ir,lr,dr,fr,hr),Module._SearchSysCacheExists=(e,t,tr,rr,ir)=>(Module._SearchSysCacheExists=wasmExports.SearchSysCacheExists)(e,t,tr,rr,ir),Module._MemoryContextAllocZeroAligned=(e,t)=>(Module._MemoryContextAllocZeroAligned=wasmExports.MemoryContextAllocZeroAligned)(e,t),Module._makeString=e=>(Module._makeString=wasmExports.makeString)(e),Module._addRTEPermissionInfo=(e,t)=>(Module._addRTEPermissionInfo=wasmExports.addRTEPermissionInfo)(e,t),Module._copyObjectImpl=e=>(Module._copyObjectImpl=wasmExports.copyObjectImpl)(e),Module._exprType=e=>(Module._exprType=wasmExports.exprType)(e),Module._lappend_oid=(e,t)=>(Module._lappend_oid=wasmExports.lappend_oid)(e,t),Module._exprTypmod=e=>(Module._exprTypmod=wasmExports.exprTypmod)(e),Module._exprLocation=e=>(Module._exprLocation=wasmExports.exprLocation)(e),Module._CreateTemplateTupleDesc=e=>(Module._CreateTemplateTupleDesc=wasmExports.CreateTemplateTupleDesc)(e),Module._TupleDescInitEntry=(e,t,tr,rr,ir,lr)=>(Module._TupleDescInitEntry=wasmExports.TupleDescInitEntry)(e,t,tr,rr,ir,lr),Module._TupleDescInitEntryCollation=(e,t,tr)=>(Module._TupleDescInitEntryCollation=wasmExports.TupleDescInitEntryCollation)(e,t,tr),Module._typenameTypeIdAndMod=(e,t,tr,rr)=>(Module._typenameTypeIdAndMod=wasmExports.typenameTypeIdAndMod)(e,t,tr,rr),Module._format_type_be=e=>(Module._format_type_be=wasmExports.format_type_be)(e),Module._list_concat=(e,t)=>(Module._list_concat=wasmExports.list_concat)(e,t),Module._list_copy=e=>(Module._list_copy=wasmExports.list_copy)(e),Module._relation_open=(e,t)=>(Module._relation_open=wasmExports.relation_open)(e,t),Module._relation_close=(e,t)=>(Module._relation_close=wasmExports.relation_close)(e,t),Module._makeTargetEntry=(e,t,tr,rr)=>(Module._makeTargetEntry=wasmExports.makeTargetEntry)(e,t,tr,rr),Module._get_attname=(e,t,tr)=>(Module._get_attname=wasmExports.get_attname)(e,t,tr),Module._SearchSysCache2=(e,t,tr)=>(Module._SearchSysCache2=wasmExports.SearchSysCache2)(e,t,tr),Module._ReleaseSysCache=e=>(Module._ReleaseSysCache=wasmExports.ReleaseSysCache)(e),Module._RangeVarGetRelidExtended=(e,t,tr,rr,ir)=>(Module._RangeVarGetRelidExtended=wasmExports.RangeVarGetRelidExtended)(e,t,tr,rr,ir),Module._pg_mbstrlen_with_len=(e,t)=>(Module._pg_mbstrlen_with_len=wasmExports.pg_mbstrlen_with_len)(e,t),Module._errposition=e=>(Module._errposition=wasmExports.errposition)(e),Module._numeric_in=e=>(Module._numeric_in=wasmExports.numeric_in)(e),Module._DirectFunctionCall3Coll=(e,t,tr,rr,ir)=>(Module._DirectFunctionCall3Coll=wasmExports.DirectFunctionCall3Coll)(e,t,tr,rr,ir),Module._bit_in=e=>(Module._bit_in=wasmExports.bit_in)(e),Module._NameListToString=e=>(Module._NameListToString=wasmExports.NameListToString)(e),Module._appendStringInfoString=(e,t)=>(Module._appendStringInfoString=wasmExports.appendStringInfoString)(e,t),Module._lookup_type_cache=(e,t)=>(Module._lookup_type_cache=wasmExports.lookup_type_cache)(e,t),Module._CacheRegisterSyscacheCallback=(e,t,tr)=>(Module._CacheRegisterSyscacheCallback=wasmExports.CacheRegisterSyscacheCallback)(e,t,tr),Module._SearchSysCache1=(e,t)=>(Module._SearchSysCache1=wasmExports.SearchSysCache1)(e,t),Module._list_make2_impl=(e,t,tr)=>(Module._list_make2_impl=wasmExports.list_make2_impl)(e,t,tr),Module._get_base_element_type=e=>(Module._get_base_element_type=wasmExports.get_base_element_type)(e),Module._downcase_truncate_identifier=(e,t,tr)=>(Module._downcase_truncate_identifier=wasmExports.downcase_truncate_identifier)(e,t,tr),Module._pg_database_encoding_max_length=()=>(Module._pg_database_encoding_max_length=wasmExports.pg_database_encoding_max_length)(),Module._truncate_identifier=(e,t,tr)=>(Module._truncate_identifier=wasmExports.truncate_identifier)(e,t,tr),Module._scanner_isspace=e=>(Module._scanner_isspace=wasmExports.scanner_isspace)(e),Module._get_typcollation=e=>(Module._get_typcollation=wasmExports.get_typcollation)(e),Module._list_delete_cell=(e,t)=>(Module._list_delete_cell=wasmExports.list_delete_cell)(e,t),Module._makeTypeNameFromNameList=e=>(Module._makeTypeNameFromNameList=wasmExports.makeTypeNameFromNameList)(e),Module._SysCacheGetAttrNotNull=(e,t,tr)=>(Module._SysCacheGetAttrNotNull=wasmExports.SysCacheGetAttrNotNull)(e,t,tr),Module._text_to_cstring=e=>(Module._text_to_cstring=wasmExports.text_to_cstring)(e),Module._stringToNode=e=>(Module._stringToNode=wasmExports.stringToNode)(e),Module._bms_is_member=(e,t)=>(Module._bms_is_member=wasmExports.bms_is_member)(e,t),Module._bms_free=e=>(Module._bms_free=wasmExports.bms_free)(e),Module._core_yylex=(e,t,tr)=>(Module._core_yylex=wasmExports.core_yylex)(e,t,tr),Module._getc=e=>(Module._getc=wasmExports.getc)(e),Module._ferror=e=>(Module._ferror=wasmExports.ferror)(e),Module._fread=(e,t,tr,rr)=>(Module._fread=wasmExports.fread)(e,t,tr,rr),Module._clearerr=e=>(Module._clearerr=wasmExports.clearerr)(e),Module._scanner_init=(e,t,tr,rr)=>(Module._scanner_init=wasmExports.scanner_init)(e,t,tr,rr),Module._scanner_finish=e=>(Module._scanner_finish=wasmExports.scanner_finish)(e),Module._get_namespace_name=e=>(Module._get_namespace_name=wasmExports.get_namespace_name)(e),Module._lookup_rowtype_tupdesc=(e,t)=>(Module._lookup_rowtype_tupdesc=wasmExports.lookup_rowtype_tupdesc)(e,t),Module._DecrTupleDescRefCount=e=>(Module._DecrTupleDescRefCount=wasmExports.DecrTupleDescRefCount)(e),Module._relation_openrv=(e,t)=>(Module._relation_openrv=wasmExports.relation_openrv)(e,t),Module._errdetail_relkind_not_supported=e=>(Module._errdetail_relkind_not_supported=wasmExports.errdetail_relkind_not_supported)(e),Module._object_aclcheck=(e,t,tr,rr)=>(Module._object_aclcheck=wasmExports.object_aclcheck)(e,t,tr,rr),Module._aclcheck_error=(e,t,tr)=>(Module._aclcheck_error=wasmExports.aclcheck_error)(e,t,tr),Module._pg_class_aclcheck=(e,t,tr)=>(Module._pg_class_aclcheck=wasmExports.pg_class_aclcheck)(e,t,tr),Module._get_relkind_objtype=e=>(Module._get_relkind_objtype=wasmExports.get_relkind_objtype)(e),Module._list_make3_impl=(e,t,tr,rr)=>(Module._list_make3_impl=wasmExports.list_make3_impl)(e,t,tr,rr),Module._quote_qualified_identifier=(e,t)=>(Module._quote_qualified_identifier=wasmExports.quote_qualified_identifier)(e,t),Module._table_openrv=(e,t)=>(Module._table_openrv=wasmExports.table_openrv)(e,t),Module._equal=(e,t)=>(Module._equal=wasmExports.equal)(e,t),Module._RelationGetIndexList=e=>(Module._RelationGetIndexList=wasmExports.RelationGetIndexList)(e),Module._pg_detoast_datum=e=>(Module._pg_detoast_datum=wasmExports.pg_detoast_datum)(e),Module._SysCacheGetAttr=(e,t,tr,rr)=>(Module._SysCacheGetAttr=wasmExports.SysCacheGetAttr)(e,t,tr,rr),Module._deconstruct_array_builtin=(e,t,tr,rr,ir)=>(Module._deconstruct_array_builtin=wasmExports.deconstruct_array_builtin)(e,t,tr,rr,ir),Module._untransformRelOptions=e=>(Module._untransformRelOptions=wasmExports.untransformRelOptions)(e),Module._transformExpr=(e,t,tr)=>(Module._transformExpr=wasmExports.transformExpr)(e,t,tr),Module._get_rel_namespace=e=>(Module._get_rel_namespace=wasmExports.get_rel_namespace)(e),Module._get_rel_name=e=>(Module._get_rel_name=wasmExports.get_rel_name)(e),Module._makeRangeVar=(e,t,tr)=>(Module._makeRangeVar=wasmExports.makeRangeVar)(e,t,tr),Module._makeDefElem=(e,t,tr)=>(Module._makeDefElem=wasmExports.makeDefElem)(e,t,tr),Module._makeRangeVarFromNameList=e=>(Module._makeRangeVarFromNameList=wasmExports.makeRangeVarFromNameList)(e),Module._coerce_to_target_type=(e,t,tr,rr,ir,lr,dr,fr)=>(Module._coerce_to_target_type=wasmExports.coerce_to_target_type)(e,t,tr,rr,ir,lr,dr,fr),Module._LookupTypeName=(e,t,tr,rr)=>(Module._LookupTypeName=wasmExports.LookupTypeName)(e,t,tr,rr),Module._GetSysCacheOid=(e,t,tr,rr,ir,lr)=>(Module._GetSysCacheOid=wasmExports.GetSysCacheOid)(e,t,tr,rr,ir,lr),Module._construct_array_builtin=(e,t,tr)=>(Module._construct_array_builtin=wasmExports.construct_array_builtin)(e,t,tr),Module._get_collation_oid=(e,t)=>(Module._get_collation_oid=wasmExports.get_collation_oid)(e,t),Module._typeStringToTypeName=(e,t)=>(Module._typeStringToTypeName=wasmExports.typeStringToTypeName)(e,t),Module._raw_parser=(e,t)=>(Module._raw_parser=wasmExports.raw_parser)(e,t),Module._errsave_start=(e,t)=>(Module._errsave_start=wasmExports.errsave_start)(e,t),Module._errsave_finish=(e,t,tr,rr)=>(Module._errsave_finish=wasmExports.errsave_finish)(e,t,tr,rr),Module._defGetBoolean=e=>(Module._defGetBoolean=wasmExports.defGetBoolean)(e),Module._list_delete_last=e=>(Module._list_delete_last=wasmExports.list_delete_last)(e),Module._format_type_with_typemod=(e,t)=>(Module._format_type_with_typemod=wasmExports.format_type_with_typemod)(e,t),Module._list_member=(e,t)=>(Module._list_member=wasmExports.list_member)(e,t),Module._list_member_int=(e,t)=>(Module._list_member_int=wasmExports.list_member_int)(e,t),Module._list_sort=(e,t)=>(Module._list_sort=wasmExports.list_sort)(e,t),Module._get_element_type=e=>(Module._get_element_type=wasmExports.get_element_type)(e),Module._makeBoolean=e=>(Module._makeBoolean=wasmExports.makeBoolean)(e),Module._makeInteger=e=>(Module._makeInteger=wasmExports.makeInteger)(e),Module._makeTypeName=e=>(Module._makeTypeName=wasmExports.makeTypeName)(e),Module._list_make4_impl=(e,t,tr,rr,ir)=>(Module._list_make4_impl=wasmExports.list_make4_impl)(e,t,tr,rr,ir),Module._isxdigit=e=>(Module._isxdigit=wasmExports.isxdigit)(e),Module._strip_implicit_coercions=e=>(Module._strip_implicit_coercions=wasmExports.strip_implicit_coercions)(e),Module._SearchSysCacheList=(e,t,tr,rr,ir)=>(Module._SearchSysCacheList=wasmExports.SearchSysCacheList)(e,t,tr,rr,ir),Module._ReleaseCatCacheList=e=>(Module._ReleaseCatCacheList=wasmExports.ReleaseCatCacheList)(e),Module._get_sortgroupref_tle=(e,t)=>(Module._get_sortgroupref_tle=wasmExports.get_sortgroupref_tle)(e,t),Module._type_is_rowtype=e=>(Module._type_is_rowtype=wasmExports.type_is_rowtype)(e),Module._bms_next_member=(e,t)=>(Module._bms_next_member=wasmExports.bms_next_member)(e,t),Module._MemoryContextReset=e=>(Module._MemoryContextReset=wasmExports.MemoryContextReset)(e),Module._abort=()=>(Module._abort=wasmExports.abort)(),Module._heap_getnext=(e,t)=>(Module._heap_getnext=wasmExports.heap_getnext)(e,t),Module._OidOutputFunctionCall=(e,t)=>(Module._OidOutputFunctionCall=wasmExports.OidOutputFunctionCall)(e,t),Module._atoi=e=>(Module._atoi=wasmExports.atoi)(e),Module._GetConfigOption=(e,t,tr)=>(Module._GetConfigOption=wasmExports.GetConfigOption)(e,t,tr),Module._pg_strong_random=(e,t)=>(Module._pg_strong_random=wasmExports.pg_strong_random)(e,t),Module._pg_prng_seed_check=e=>(Module._pg_prng_seed_check=wasmExports.pg_prng_seed_check)(e),Module._pg_prng_seed=(e,t)=>(Module._pg_prng_seed=wasmExports.pg_prng_seed)(e,t),Module._fputc=(e,t)=>(Module._fputc=wasmExports.fputc)(e,t),Module._time=e=>(Module._time=wasmExports.time)(e),Module._TimestampDifferenceMilliseconds=(e,t)=>(Module._TimestampDifferenceMilliseconds=wasmExports.TimestampDifferenceMilliseconds)(e,t),Module._ProcessConfigFile=e=>(Module._ProcessConfigFile=wasmExports.ProcessConfigFile)(e),Module._send=(e,t,tr,rr)=>(Module._send=wasmExports.send)(e,t,tr,rr),Module._parse_bool=(e,t)=>(Module._parse_bool=wasmExports.parse_bool)(e,t),Module._enlargeStringInfo=(e,t)=>(Module._enlargeStringInfo=wasmExports.enlargeStringInfo)(e,t),Module._BackgroundWorkerInitializeConnectionByOid=(e,t,tr)=>(Module._BackgroundWorkerInitializeConnectionByOid=wasmExports.BackgroundWorkerInitializeConnectionByOid)(e,t,tr),Module._BackgroundWorkerUnblockSignals=()=>(Module._BackgroundWorkerUnblockSignals=wasmExports.BackgroundWorkerUnblockSignals)(),Module._pg_getnameinfo_all=(e,t,tr,rr,ir,lr,dr)=>(Module._pg_getnameinfo_all=wasmExports.pg_getnameinfo_all)(e,t,tr,rr,ir,lr,dr),Module._gai_strerror=e=>(Module._gai_strerror=wasmExports.gai_strerror)(e),Module._SignalHandlerForConfigReload=e=>(Module._SignalHandlerForConfigReload=wasmExports.SignalHandlerForConfigReload)(e),Module._fwrite=(e,t,tr,rr)=>(Module._fwrite=wasmExports.fwrite)(e,t,tr,rr),Module._SignalHandlerForShutdownRequest=e=>(Module._SignalHandlerForShutdownRequest=wasmExports.SignalHandlerForShutdownRequest)(e),Module._EmitErrorReport=()=>(Module._EmitErrorReport=wasmExports.EmitErrorReport)(),Module._FlushErrorState=()=>(Module._FlushErrorState=wasmExports.FlushErrorState)(),Module._die=e=>(Module._die=wasmExports.die)(e),Module._MultiXactIdPrecedes=(e,t)=>(Module._MultiXactIdPrecedes=wasmExports.MultiXactIdPrecedes)(e,t),Module._CreateTupleDescCopy=e=>(Module._CreateTupleDescCopy=wasmExports.CreateTupleDescCopy)(e),Module._pgstat_report_activity=(e,t)=>(Module._pgstat_report_activity=wasmExports.pgstat_report_activity)(e,t),Module._DirectFunctionCall2Coll=(e,t,tr,rr)=>(Module._DirectFunctionCall2Coll=wasmExports.DirectFunctionCall2Coll)(e,t,tr,rr),Module._RegisterBackgroundWorker=e=>(Module._RegisterBackgroundWorker=wasmExports.RegisterBackgroundWorker)(e),Module._RegisterDynamicBackgroundWorker=(e,t)=>(Module._RegisterDynamicBackgroundWorker=wasmExports.RegisterDynamicBackgroundWorker)(e,t),Module._WaitForBackgroundWorkerStartup=(e,t)=>(Module._WaitForBackgroundWorkerStartup=wasmExports.WaitForBackgroundWorkerStartup)(e,t),Module._WaitForBackgroundWorkerShutdown=e=>(Module._WaitForBackgroundWorkerShutdown=wasmExports.WaitForBackgroundWorkerShutdown)(e),Module._GetXLogReplayRecPtr=e=>(Module._GetXLogReplayRecPtr=wasmExports.GetXLogReplayRecPtr)(e),Module._gettimeofday=(e,t)=>(Module._gettimeofday=wasmExports.gettimeofday)(e,t),Module._sscanf=(e,t,tr)=>(Module._sscanf=wasmExports.sscanf)(e,t,tr),Module._get_call_result_type=(e,t,tr)=>(Module._get_call_result_type=wasmExports.get_call_result_type)(e,t,tr),Module._HeapTupleHeaderGetDatum=e=>(Module._HeapTupleHeaderGetDatum=wasmExports.HeapTupleHeaderGetDatum)(e),Module._wal_segment_close=e=>(Module._wal_segment_close=wasmExports.wal_segment_close)(e),Module._wal_segment_open=(e,t,tr)=>(Module._wal_segment_open=wasmExports.wal_segment_open)(e,t,tr),Module._GetFlushRecPtr=e=>(Module._GetFlushRecPtr=wasmExports.GetFlushRecPtr)(e),Module._XLogReadRecord=(e,t)=>(Module._XLogReadRecord=wasmExports.XLogReadRecord)(e,t),Module._RmgrNotFound=e=>(Module._RmgrNotFound=wasmExports.RmgrNotFound)(e),Module._CacheRegisterRelcacheCallback=(e,t)=>(Module._CacheRegisterRelcacheCallback=wasmExports.CacheRegisterRelcacheCallback)(e,t),Module._free_attrmap=e=>(Module._free_attrmap=wasmExports.free_attrmap)(e),Module._BuildIndexInfo=e=>(Module._BuildIndexInfo=wasmExports.BuildIndexInfo)(e),Module._hash_seq_term=e=>(Module._hash_seq_term=wasmExports.hash_seq_term)(e),Module._PushActiveSnapshot=e=>(Module._PushActiveSnapshot=wasmExports.PushActiveSnapshot)(e),Module._PopActiveSnapshot=()=>(Module._PopActiveSnapshot=wasmExports.PopActiveSnapshot)(),Module._MakePerTupleExprContext=e=>(Module._MakePerTupleExprContext=wasmExports.MakePerTupleExprContext)(e),Module._ExecInitExpr=(e,t)=>(Module._ExecInitExpr=wasmExports.ExecInitExpr)(e,t),Module._FreeExecutorState=e=>(Module._FreeExecutorState=wasmExports.FreeExecutorState)(e),Module._list_member_oid=(e,t)=>(Module._list_member_oid=wasmExports.list_member_oid)(e,t),Module._MemoryContextStrdup=(e,t)=>(Module._MemoryContextStrdup=wasmExports.MemoryContextStrdup)(e,t),Module._pq_getmsgint=(e,t)=>(Module._pq_getmsgint=wasmExports.pq_getmsgint)(e,t),Module._CreateExecutorState=()=>(Module._CreateExecutorState=wasmExports.CreateExecutorState)(),Module._ExecInitRangeTable=(e,t,tr)=>(Module._ExecInitRangeTable=wasmExports.ExecInitRangeTable)(e,t,tr),Module._getTypeInputInfo=(e,t,tr)=>(Module._getTypeInputInfo=wasmExports.getTypeInputInfo)(e,t,tr),Module._ExecStoreVirtualTuple=e=>(Module._ExecStoreVirtualTuple=wasmExports.ExecStoreVirtualTuple)(e),Module._execute_attr_map_slot=(e,t,tr)=>(Module._execute_attr_map_slot=wasmExports.execute_attr_map_slot)(e,t,tr),Module._slot_getsomeattrs_int=(e,t)=>(Module._slot_getsomeattrs_int=wasmExports.slot_getsomeattrs_int)(e,t),Module._GetUserNameFromId=(e,t)=>(Module._GetUserNameFromId=wasmExports.GetUserNameFromId)(e,t),Module._makeStringInfo=()=>(Module._makeStringInfo=wasmExports.makeStringInfo)(),Module._list_member_xid=(e,t)=>(Module._list_member_xid=wasmExports.list_member_xid)(e,t),Module._lappend_xid=(e,t)=>(Module._lappend_xid=wasmExports.lappend_xid)(e,t),Module._tuplestore_end=e=>(Module._tuplestore_end=wasmExports.tuplestore_end)(e),Module._quote_literal_cstr=e=>(Module._quote_literal_cstr=wasmExports.quote_literal_cstr)(e),Module._MakeSingleTupleTableSlot=(e,t)=>(Module._MakeSingleTupleTableSlot=wasmExports.MakeSingleTupleTableSlot)(e,t),Module._ExecDropSingleTupleTableSlot=e=>(Module._ExecDropSingleTupleTableSlot=wasmExports.ExecDropSingleTupleTableSlot)(e),Module._tuplestore_tuple_count=e=>(Module._tuplestore_tuple_count=wasmExports.tuplestore_tuple_count)(e),Module._quote_identifier=e=>(Module._quote_identifier=wasmExports.quote_identifier)(e),Module._BeginCopyFrom=(e,t,tr,rr,ir,lr,dr,fr)=>(Module._BeginCopyFrom=wasmExports.BeginCopyFrom)(e,t,tr,rr,ir,lr,dr,fr),Module._array_contains_nulls=e=>(Module._array_contains_nulls=wasmExports.array_contains_nulls)(e),Module._format_procedure=e=>(Module._format_procedure=wasmExports.format_procedure)(e),Module._pg_detoast_datum_packed=e=>(Module._pg_detoast_datum_packed=wasmExports.pg_detoast_datum_packed)(e),Module._cstring_to_text_with_len=(e,t)=>(Module._cstring_to_text_with_len=wasmExports.cstring_to_text_with_len)(e,t),Module._GenerationContextCreate=(e,t,tr,rr,ir)=>(Module._GenerationContextCreate=wasmExports.GenerationContextCreate)(e,t,tr,rr,ir),Module._BeginInternalSubTransaction=e=>(Module._BeginInternalSubTransaction=wasmExports.BeginInternalSubTransaction)(e),Module._RollbackAndReleaseCurrentSubTransaction=()=>(Module._RollbackAndReleaseCurrentSubTransaction=wasmExports.RollbackAndReleaseCurrentSubTransaction)(),Module._CopyErrorData=()=>(Module._CopyErrorData=wasmExports.CopyErrorData)(),Module._FreeErrorData=e=>(Module._FreeErrorData=wasmExports.FreeErrorData)(e),Module._RelidByRelfilenumber=(e,t)=>(Module._RelidByRelfilenumber=wasmExports.RelidByRelfilenumber)(e,t),Module._RelationIdGetRelation=e=>(Module._RelationIdGetRelation=wasmExports.RelationIdGetRelation)(e),Module._heap_deform_tuple=(e,t,tr,rr)=>(Module._heap_deform_tuple=wasmExports.heap_deform_tuple)(e,t,tr,rr),Module._RelationClose=e=>(Module._RelationClose=wasmExports.RelationClose)(e),Module._nocachegetattr=(e,t,tr)=>(Module._nocachegetattr=wasmExports.nocachegetattr)(e,t,tr),Module._XLogReaderAllocate=(e,t,tr,rr)=>(Module._XLogReaderAllocate=wasmExports.XLogReaderAllocate)(e,t,tr,rr),Module._XLogReaderFree=e=>(Module._XLogReaderFree=wasmExports.XLogReaderFree)(e),Module._OutputPluginPrepareWrite=(e,t)=>(Module._OutputPluginPrepareWrite=wasmExports.OutputPluginPrepareWrite)(e,t),Module._OutputPluginWrite=(e,t)=>(Module._OutputPluginWrite=wasmExports.OutputPluginWrite)(e,t),Module._OutputPluginUpdateProgress=(e,t)=>(Module._OutputPluginUpdateProgress=wasmExports.OutputPluginUpdateProgress)(e,t),Module._replorigin_by_oid=(e,t,tr)=>(Module._replorigin_by_oid=wasmExports.replorigin_by_oid)(e,t,tr),Module._logicalrep_write_begin=(e,t)=>(Module._logicalrep_write_begin=wasmExports.logicalrep_write_begin)(e,t),Module._logicalrep_write_commit=(e,t,tr)=>(Module._logicalrep_write_commit=wasmExports.logicalrep_write_commit)(e,t,tr),Module._logicalrep_write_begin_prepare=(e,t)=>(Module._logicalrep_write_begin_prepare=wasmExports.logicalrep_write_begin_prepare)(e,t),Module._logicalrep_write_prepare=(e,t,tr)=>(Module._logicalrep_write_prepare=wasmExports.logicalrep_write_prepare)(e,t,tr),Module._logicalrep_write_commit_prepared=(e,t,tr)=>(Module._logicalrep_write_commit_prepared=wasmExports.logicalrep_write_commit_prepared)(e,t,tr),Module._logicalrep_write_rollback_prepared=(e,t,tr,rr)=>(Module._logicalrep_write_rollback_prepared=wasmExports.logicalrep_write_rollback_prepared)(e,t,tr,rr),Module._logicalrep_write_stream_prepare=(e,t,tr)=>(Module._logicalrep_write_stream_prepare=wasmExports.logicalrep_write_stream_prepare)(e,t,tr),Module._logicalrep_write_origin=(e,t,tr)=>(Module._logicalrep_write_origin=wasmExports.logicalrep_write_origin)(e,t,tr),Module._logicalrep_write_insert=(e,t,tr,rr,ir,lr)=>(Module._logicalrep_write_insert=wasmExports.logicalrep_write_insert)(e,t,tr,rr,ir,lr),Module._logicalrep_write_update=(e,t,tr,rr,ir,lr,dr)=>(Module._logicalrep_write_update=wasmExports.logicalrep_write_update)(e,t,tr,rr,ir,lr,dr),Module._logicalrep_write_delete=(e,t,tr,rr,ir,lr)=>(Module._logicalrep_write_delete=wasmExports.logicalrep_write_delete)(e,t,tr,rr,ir,lr),Module._logicalrep_write_truncate=(e,t,tr,rr,ir,lr)=>(Module._logicalrep_write_truncate=wasmExports.logicalrep_write_truncate)(e,t,tr,rr,ir,lr),Module._logicalrep_write_message=(e,t,tr,rr,ir,lr,dr)=>(Module._logicalrep_write_message=wasmExports.logicalrep_write_message)(e,t,tr,rr,ir,lr,dr),Module._logicalrep_write_rel=(e,t,tr,rr)=>(Module._logicalrep_write_rel=wasmExports.logicalrep_write_rel)(e,t,tr,rr),Module._logicalrep_write_typ=(e,t,tr)=>(Module._logicalrep_write_typ=wasmExports.logicalrep_write_typ)(e,t,tr),Module._logicalrep_write_stream_start=(e,t,tr)=>(Module._logicalrep_write_stream_start=wasmExports.logicalrep_write_stream_start)(e,t,tr),Module._logicalrep_write_stream_stop=e=>(Module._logicalrep_write_stream_stop=wasmExports.logicalrep_write_stream_stop)(e),Module._logicalrep_write_stream_commit=(e,t,tr)=>(Module._logicalrep_write_stream_commit=wasmExports.logicalrep_write_stream_commit)(e,t,tr),Module._logicalrep_write_stream_abort=(e,t,tr,rr,ir,lr)=>(Module._logicalrep_write_stream_abort=wasmExports.logicalrep_write_stream_abort)(e,t,tr,rr,ir,lr),Module._ProcessWalRcvInterrupts=()=>(Module._ProcessWalRcvInterrupts=wasmExports.ProcessWalRcvInterrupts)(),Module._timestamptz_to_str=e=>(Module._timestamptz_to_str=wasmExports.timestamptz_to_str)(e),Module._GetDatabaseEncodingName=()=>(Module._GetDatabaseEncodingName=wasmExports.GetDatabaseEncodingName)(),Module._PQconnectStartParams=(e,t,tr)=>(Module._PQconnectStartParams=wasmExports.PQconnectStartParams)(e,t,tr),Module._PQstatus=e=>(Module._PQstatus=wasmExports.PQstatus)(e),Module._PQsocket=e=>(Module._PQsocket=wasmExports.PQsocket)(e),Module._PQconnectPoll=e=>(Module._PQconnectPoll=wasmExports.PQconnectPoll)(e),Module._PQconnectionUsedPassword=e=>(Module._PQconnectionUsedPassword=wasmExports.PQconnectionUsedPassword)(e),Module._PQfinish=e=>(Module._PQfinish=wasmExports.PQfinish)(e),Module._PQresultStatus=e=>(Module._PQresultStatus=wasmExports.PQresultStatus)(e),Module._PQclear=e=>(Module._PQclear=wasmExports.PQclear)(e),Module._PQerrorMessage=e=>(Module._PQerrorMessage=wasmExports.PQerrorMessage)(e),Module._pchomp=e=>(Module._pchomp=wasmExports.pchomp)(e),Module._PQnfields=e=>(Module._PQnfields=wasmExports.PQnfields)(e),Module._PQntuples=e=>(Module._PQntuples=wasmExports.PQntuples)(e),Module._PQgetvalue=(e,t,tr)=>(Module._PQgetvalue=wasmExports.PQgetvalue)(e,t,tr),Module._pg_strtoint32=e=>(Module._pg_strtoint32=wasmExports.pg_strtoint32)(e),Module._PQconsumeInput=e=>(Module._PQconsumeInput=wasmExports.PQconsumeInput)(e),Module._pg_lsn_in=e=>(Module._pg_lsn_in=wasmExports.pg_lsn_in)(e),Module._DirectFunctionCall1Coll=(e,t,tr)=>(Module._DirectFunctionCall1Coll=wasmExports.DirectFunctionCall1Coll)(e,t,tr),Module._PQgetisnull=(e,t,tr)=>(Module._PQgetisnull=wasmExports.PQgetisnull)(e,t,tr),Module._tuplestore_begin_heap=(e,t,tr)=>(Module._tuplestore_begin_heap=wasmExports.tuplestore_begin_heap)(e,t,tr),Module._TupleDescGetAttInMetadata=e=>(Module._TupleDescGetAttInMetadata=wasmExports.TupleDescGetAttInMetadata)(e),Module._BuildTupleFromCStrings=(e,t)=>(Module._BuildTupleFromCStrings=wasmExports.BuildTupleFromCStrings)(e,t),Module._tuplestore_puttuple=(e,t)=>(Module._tuplestore_puttuple=wasmExports.tuplestore_puttuple)(e,t),Module._PQresultErrorField=(e,t)=>(Module._PQresultErrorField=wasmExports.PQresultErrorField)(e,t),Module._PQsendQuery=(e,t)=>(Module._PQsendQuery=wasmExports.PQsendQuery)(e,t),Module._PQisBusy=e=>(Module._PQisBusy=wasmExports.PQisBusy)(e),Module._PQgetResult=e=>(Module._PQgetResult=wasmExports.PQgetResult)(e),Module._ResourceOwnerDelete=e=>(Module._ResourceOwnerDelete=wasmExports.ResourceOwnerDelete)(e),Module._CreateDestReceiver=e=>(Module._CreateDestReceiver=wasmExports.CreateDestReceiver)(e),Module._defGetString=e=>(Module._defGetString=wasmExports.defGetString)(e),Module._pg_md5_encrypt=(e,t,tr,rr,ir)=>(Module._pg_md5_encrypt=wasmExports.pg_md5_encrypt)(e,t,tr,rr,ir),Module._plain_crypt_verify=(e,t,tr,rr)=>(Module._plain_crypt_verify=wasmExports.plain_crypt_verify)(e,t,tr,rr),Module._pg_b64_enc_len=e=>(Module._pg_b64_enc_len=wasmExports.pg_b64_enc_len)(e),Module._pg_b64_encode=(e,t,tr,rr)=>(Module._pg_b64_encode=wasmExports.pg_b64_encode)(e,t,tr,rr),Module._pg_b64_dec_len=e=>(Module._pg_b64_dec_len=wasmExports.pg_b64_dec_len)(e),Module._pg_b64_decode=(e,t,tr,rr)=>(Module._pg_b64_decode=wasmExports.pg_b64_decode)(e,t,tr,rr),Module._pg_hmac_create=e=>(Module._pg_hmac_create=wasmExports.pg_hmac_create)(e),Module._pg_hmac_init=(e,t,tr)=>(Module._pg_hmac_init=wasmExports.pg_hmac_init)(e,t,tr),Module._pg_hmac_update=(e,t,tr)=>(Module._pg_hmac_update=wasmExports.pg_hmac_update)(e,t,tr),Module._pg_hmac_final=(e,t,tr)=>(Module._pg_hmac_final=wasmExports.pg_hmac_final)(e,t,tr),Module._pg_hmac_error=e=>(Module._pg_hmac_error=wasmExports.pg_hmac_error)(e),Module._pg_hmac_free=e=>(Module._pg_hmac_free=wasmExports.pg_hmac_free)(e),Module._scram_H=(e,t,tr,rr,ir)=>(Module._scram_H=wasmExports.scram_H)(e,t,tr,rr,ir),Module._pg_saslprep=(e,t)=>(Module._pg_saslprep=wasmExports.pg_saslprep)(e,t),Module._scram_build_secret=(e,t,tr,rr,ir,lr,dr)=>(Module._scram_build_secret=wasmExports.scram_build_secret)(e,t,tr,rr,ir,lr,dr),Module._scram_SaltedPassword=(e,t,tr,rr,ir,lr,dr,fr)=>(Module._scram_SaltedPassword=wasmExports.scram_SaltedPassword)(e,t,tr,rr,ir,lr,dr,fr),Module._scram_ServerKey=(e,t,tr,rr,ir)=>(Module._scram_ServerKey=wasmExports.scram_ServerKey)(e,t,tr,rr,ir),Module._strtol=(e,t,tr)=>(Module._strtol=wasmExports.strtol)(e,t,tr),Module._replace_percent_placeholders=(e,t,tr,rr)=>(Module._replace_percent_placeholders=wasmExports.replace_percent_placeholders)(e,t,tr,rr),Module._fgets=(e,t,tr)=>(Module._fgets=wasmExports.fgets)(e,t,tr),Module._explicit_bzero=(e,t)=>(Module._explicit_bzero=wasmExports.explicit_bzero)(e,t),Module._wait_result_to_str=e=>(Module._wait_result_to_str=wasmExports.wait_result_to_str)(e),Module._pg_strip_crlf=e=>(Module._pg_strip_crlf=wasmExports.pg_strip_crlf)(e),Module._geteuid=()=>(Module._geteuid=wasmExports.geteuid)(),Module._getpeereid=(e,t,tr)=>(Module._getpeereid=wasmExports.getpeereid)(e,t,tr),Module._pg_getaddrinfo_all=(e,t,tr,rr)=>(Module._pg_getaddrinfo_all=wasmExports.pg_getaddrinfo_all)(e,t,tr,rr),Module._socket=(e,t,tr)=>(Module._socket=wasmExports.socket)(e,t,tr),Module._connect=(e,t,tr)=>(Module._connect=wasmExports.connect)(e,t,tr),Module._recv=(e,t,tr,rr)=>(Module._recv=wasmExports.recv)(e,t,tr,rr),Module._pg_freeaddrinfo_all=(e,t)=>(Module._pg_freeaddrinfo_all=wasmExports.pg_freeaddrinfo_all)(e,t),Module._pq_sendtext=(e,t,tr)=>(Module._pq_sendtext=wasmExports.pq_sendtext)(e,t,tr),Module._pq_sendfloat4=(e,t)=>(Module._pq_sendfloat4=wasmExports.pq_sendfloat4)(e,t),Module._pq_sendfloat8=(e,t)=>(Module._pq_sendfloat8=wasmExports.pq_sendfloat8)(e,t),Module._pq_begintypsend=e=>(Module._pq_begintypsend=wasmExports.pq_begintypsend)(e),Module._pq_endtypsend=e=>(Module._pq_endtypsend=wasmExports.pq_endtypsend)(e),Module._pq_getmsgfloat4=e=>(Module._pq_getmsgfloat4=wasmExports.pq_getmsgfloat4)(e),Module._pq_getmsgfloat8=e=>(Module._pq_getmsgfloat8=wasmExports.pq_getmsgfloat8)(e),Module._pq_getmsgtext=(e,t,tr)=>(Module._pq_getmsgtext=wasmExports.pq_getmsgtext)(e,t,tr),Module._feof=e=>(Module._feof=wasmExports.feof)(e),Module._pg_mb2wchar_with_len=(e,t,tr)=>(Module._pg_mb2wchar_with_len=wasmExports.pg_mb2wchar_with_len)(e,t,tr),Module._pg_regcomp=(e,t,tr,rr,ir)=>(Module._pg_regcomp=wasmExports.pg_regcomp)(e,t,tr,rr,ir),Module._pg_regerror=(e,t,tr,rr)=>(Module._pg_regerror=wasmExports.pg_regerror)(e,t,tr,rr),Module._get_role_oid=(e,t)=>(Module._get_role_oid=wasmExports.get_role_oid)(e,t),Module._strcat=(e,t)=>(Module._strcat=wasmExports.strcat)(e,t),Module._sigemptyset=e=>(Module._sigemptyset=wasmExports.sigemptyset)(e),Module._be_lo_unlink=e=>(Module._be_lo_unlink=wasmExports.be_lo_unlink)(e),Module._object_ownercheck=(e,t,tr)=>(Module._object_ownercheck=wasmExports.object_ownercheck)(e,t,tr),Module._text_to_cstring_buffer=(e,t,tr)=>(Module._text_to_cstring_buffer=wasmExports.text_to_cstring_buffer)(e,t,tr),Module._setsockopt=(e,t,tr,rr,ir)=>(Module._setsockopt=wasmExports.setsockopt)(e,t,tr,rr,ir),Module._getsockname=(e,t,tr)=>(Module._getsockname=wasmExports.getsockname)(e,t,tr),Module._pq_recvbuf_fill=(e,t)=>(Module._pq_recvbuf_fill=wasmExports.pq_recvbuf_fill)(e,t),Module._getsockopt=(e,t,tr,rr,ir)=>(Module._getsockopt=wasmExports.getsockopt)(e,t,tr,rr,ir),Module._getmissingattr=(e,t,tr)=>(Module._getmissingattr=wasmExports.getmissingattr)(e,t,tr),Module._get_rel_relkind=e=>(Module._get_rel_relkind=wasmExports.get_rel_relkind)(e),Module._MemoryContextSetIdentifier=(e,t)=>(Module._MemoryContextSetIdentifier=wasmExports.MemoryContextSetIdentifier)(e,t),Module._MemoryContextSetParent=(e,t)=>(Module._MemoryContextSetParent=wasmExports.MemoryContextSetParent)(e,t),Module._find_base_rel=(e,t)=>(Module._find_base_rel=wasmExports.find_base_rel)(e,t),Module._bms_equal=(e,t)=>(Module._bms_equal=wasmExports.bms_equal)(e,t),Module._bms_num_members=e=>(Module._bms_num_members=wasmExports.bms_num_members)(e),Module._fmgr_info_copy=(e,t,tr)=>(Module._fmgr_info_copy=wasmExports.fmgr_info_copy)(e,t,tr),Module._fmgr_info_cxt=(e,t,tr)=>(Module._fmgr_info_cxt=wasmExports.fmgr_info_cxt)(e,t,tr),Module._get_typlenbyvalalign=(e,t,tr,rr)=>(Module._get_typlenbyvalalign=wasmExports.get_typlenbyvalalign)(e,t,tr,rr),Module._deconstruct_array=(e,t,tr,rr,ir,lr,dr,fr)=>(Module._deconstruct_array=wasmExports.deconstruct_array)(e,t,tr,rr,ir,lr,dr,fr),Module._datumCopy=(e,t,tr)=>(Module._datumCopy=wasmExports.datumCopy)(e,t,tr),Module._qsort_arg=(e,t,tr,rr,ir)=>(Module._qsort_arg=wasmExports.qsort_arg)(e,t,tr,rr,ir),Module._FunctionCall2Coll=(e,t,tr,rr)=>(Module._FunctionCall2Coll=wasmExports.FunctionCall2Coll)(e,t,tr,rr),Module._datumIsEqual=(e,t,tr,rr)=>(Module._datumIsEqual=wasmExports.datumIsEqual)(e,t,tr,rr),Module._bms_overlap=(e,t)=>(Module._bms_overlap=wasmExports.bms_overlap)(e,t),Module._ExecPrepareExpr=(e,t)=>(Module._ExecPrepareExpr=wasmExports.ExecPrepareExpr)(e,t),Module._RegisterSnapshot=e=>(Module._RegisterSnapshot=wasmExports.RegisterSnapshot)(e),Module._UnregisterSnapshot=e=>(Module._UnregisterSnapshot=wasmExports.UnregisterSnapshot)(e),Module._get_fn_expr_argtype=(e,t)=>(Module._get_fn_expr_argtype=wasmExports.get_fn_expr_argtype)(e,t),Module._get_opfamily_member=(e,t,tr,rr)=>(Module._get_opfamily_member=wasmExports.get_opfamily_member)(e,t,tr,rr),Module._init_MultiFuncCall=e=>(Module._init_MultiFuncCall=wasmExports.init_MultiFuncCall)(e),Module._per_MultiFuncCall=e=>(Module._per_MultiFuncCall=wasmExports.per_MultiFuncCall)(e),Module._end_MultiFuncCall=(e,t)=>(Module._end_MultiFuncCall=wasmExports.end_MultiFuncCall)(e,t),Module._textToQualifiedNameList=e=>(Module._textToQualifiedNameList=wasmExports.textToQualifiedNameList)(e),Module._FunctionCall1Coll=(e,t,tr)=>(Module._FunctionCall1Coll=wasmExports.FunctionCall1Coll)(e,t,tr),Module._DirectFunctionCall4Coll=(e,t,tr,rr,ir,lr)=>(Module._DirectFunctionCall4Coll=wasmExports.DirectFunctionCall4Coll)(e,t,tr,rr,ir,lr),Module._pg_mblen=e=>(Module._pg_mblen=wasmExports.pg_mblen)(e),Module._tsearch_readline_begin=(e,t)=>(Module._tsearch_readline_begin=wasmExports.tsearch_readline_begin)(e,t),Module._tsearch_readline=e=>(Module._tsearch_readline=wasmExports.tsearch_readline)(e),Module._t_isspace=e=>(Module._t_isspace=wasmExports.t_isspace)(e),Module._lowerstr=e=>(Module._lowerstr=wasmExports.lowerstr)(e),Module._tsearch_readline_end=e=>(Module._tsearch_readline_end=wasmExports.tsearch_readline_end)(e),Module._t_isdigit=e=>(Module._t_isdigit=wasmExports.t_isdigit)(e),Module._pnstrdup=(e,t)=>(Module._pnstrdup=wasmExports.pnstrdup)(e,t),Module._get_tsearch_config_filename=(e,t)=>(Module._get_tsearch_config_filename=wasmExports.get_tsearch_config_filename)(e,t),Module._lookup_ts_dictionary_cache=e=>(Module._lookup_ts_dictionary_cache=wasmExports.lookup_ts_dictionary_cache)(e),Module._FunctionCall4Coll=(e,t,tr,rr,ir,lr)=>(Module._FunctionCall4Coll=wasmExports.FunctionCall4Coll)(e,t,tr,rr,ir,lr),Module._t_isalnum=e=>(Module._t_isalnum=wasmExports.t_isalnum)(e),Module._isalnum=e=>(Module._isalnum=wasmExports.isalnum)(e),Module._pg_any_to_server=(e,t,tr)=>(Module._pg_any_to_server=wasmExports.pg_any_to_server)(e,t,tr),Module._lowerstr_with_len=(e,t)=>(Module._lowerstr_with_len=wasmExports.lowerstr_with_len)(e,t),Module._tolower=e=>(Module._tolower=wasmExports.tolower)(e),Module._readstoplist=(e,t,tr)=>(Module._readstoplist=wasmExports.readstoplist)(e,t,tr),Module._searchstoplist=(e,t)=>(Module._searchstoplist=wasmExports.searchstoplist)(e,t),Module._GetDatabaseEncoding=()=>(Module._GetDatabaseEncoding=wasmExports.GetDatabaseEncoding)(),Module._vacuum_delay_point=()=>(Module._vacuum_delay_point=wasmExports.vacuum_delay_point)(),Module._get_restriction_variable=(e,t,tr,rr,ir,lr)=>(Module._get_restriction_variable=wasmExports.get_restriction_variable)(e,t,tr,rr,ir,lr),Module._get_attstatsslot=(e,t,tr,rr,ir)=>(Module._get_attstatsslot=wasmExports.get_attstatsslot)(e,t,tr,rr,ir),Module._free_attstatsslot=e=>(Module._free_attstatsslot=wasmExports.free_attstatsslot)(e),Module._Float8GetDatum=e=>(Module._Float8GetDatum=wasmExports.Float8GetDatum)(e),Module._ExecReScan=e=>(Module._ExecReScan=wasmExports.ExecReScan)(e),Module._ExecAsyncResponse=e=>(Module._ExecAsyncResponse=wasmExports.ExecAsyncResponse)(e),Module._ExecAsyncRequestDone=(e,t)=>(Module._ExecAsyncRequestDone=wasmExports.ExecAsyncRequestDone)(e,t),Module._ExecAsyncRequestPending=e=>(Module._ExecAsyncRequestPending=wasmExports.ExecAsyncRequestPending)(e),Module._tuplesort_end=e=>(Module._tuplesort_end=wasmExports.tuplesort_end)(e),Module._ExecInitExprList=(e,t)=>(Module._ExecInitExprList=wasmExports.ExecInitExprList)(e,t),Module._fmgr_info=(e,t)=>(Module._fmgr_info=wasmExports.fmgr_info)(e,t),Module._get_typlenbyval=(e,t,tr)=>(Module._get_typlenbyval=wasmExports.get_typlenbyval)(e,t,tr),Module._ExecForceStoreHeapTuple=(e,t,tr)=>(Module._ExecForceStoreHeapTuple=wasmExports.ExecForceStoreHeapTuple)(e,t,tr),Module._tuplesort_performsort=e=>(Module._tuplesort_performsort=wasmExports.tuplesort_performsort)(e),Module._tuplesort_begin_heap=(e,t,tr,rr,ir,lr,dr,fr,hr)=>(Module._tuplesort_begin_heap=wasmExports.tuplesort_begin_heap)(e,t,tr,rr,ir,lr,dr,fr,hr),Module._MemoryContextMemAllocated=(e,t)=>(Module._MemoryContextMemAllocated=wasmExports.MemoryContextMemAllocated)(e,t),Module._tuplesort_gettupleslot=(e,t,tr,rr,ir)=>(Module._tuplesort_gettupleslot=wasmExports.tuplesort_gettupleslot)(e,t,tr,rr,ir),Module._tuplesort_puttupleslot=(e,t)=>(Module._tuplesort_puttupleslot=wasmExports.tuplesort_puttupleslot)(e,t),Module._ExecStoreAllNullTuple=e=>(Module._ExecStoreAllNullTuple=wasmExports.ExecStoreAllNullTuple)(e),Module._MakeExpandedObjectReadOnlyInternal=e=>(Module._MakeExpandedObjectReadOnlyInternal=wasmExports.MakeExpandedObjectReadOnlyInternal)(e),Module._BlessTupleDesc=e=>(Module._BlessTupleDesc=wasmExports.BlessTupleDesc)(e),Module._pg_detoast_datum_copy=e=>(Module._pg_detoast_datum_copy=wasmExports.pg_detoast_datum_copy)(e),Module._construct_md_array=(e,t,tr,rr,ir,lr,dr,fr,hr)=>(Module._construct_md_array=wasmExports.construct_md_array)(e,t,tr,rr,ir,lr,dr,fr,hr),Module._ArrayGetNItems=(e,t)=>(Module._ArrayGetNItems=wasmExports.ArrayGetNItems)(e,t),Module._construct_empty_array=e=>(Module._construct_empty_array=wasmExports.construct_empty_array)(e),Module._DatumGetEOHP=e=>(Module._DatumGetEOHP=wasmExports.DatumGetEOHP)(e),Module._expanded_record_fetch_tupdesc=e=>(Module._expanded_record_fetch_tupdesc=wasmExports.expanded_record_fetch_tupdesc)(e),Module._expanded_record_fetch_field=(e,t,tr)=>(Module._expanded_record_fetch_field=wasmExports.expanded_record_fetch_field)(e,t,tr),Module._execute_attr_map_tuple=(e,t)=>(Module._execute_attr_map_tuple=wasmExports.execute_attr_map_tuple)(e,t),Module._MemoryContextAllocExtended=(e,t,tr)=>(Module._MemoryContextAllocExtended=wasmExports.MemoryContextAllocExtended)(e,t,tr),Module._lookup_rowtype_tupdesc_domain=(e,t,tr)=>(Module._lookup_rowtype_tupdesc_domain=wasmExports.lookup_rowtype_tupdesc_domain)(e,t,tr),Module._MemoryContextGetParent=e=>(Module._MemoryContextGetParent=wasmExports.MemoryContextGetParent)(e),Module._DeleteExpandedObject=e=>(Module._DeleteExpandedObject=wasmExports.DeleteExpandedObject)(e),Module._InstrAlloc=(e,t,tr)=>(Module._InstrAlloc=wasmExports.InstrAlloc)(e,t,tr),Module._ExprEvalPushStep=(e,t)=>(Module._ExprEvalPushStep=wasmExports.ExprEvalPushStep)(e,t),Module._getTypeOutputInfo=(e,t,tr)=>(Module._getTypeOutputInfo=wasmExports.getTypeOutputInfo)(e,t,tr),Module._ExecInitExprWithParams=(e,t)=>(Module._ExecInitExprWithParams=wasmExports.ExecInitExprWithParams)(e,t),Module._ExecOpenScanRelation=(e,t,tr)=>(Module._ExecOpenScanRelation=wasmExports.ExecOpenScanRelation)(e,t,tr),Module._FreeExprContext=(e,t)=>(Module._FreeExprContext=wasmExports.FreeExprContext)(e,t),Module._CreateExprContext=e=>(Module._CreateExprContext=wasmExports.CreateExprContext)(e),Module._ExecGetReturningSlot=(e,t)=>(Module._ExecGetReturningSlot=wasmExports.ExecGetReturningSlot)(e,t),Module._build_attrmap_by_name_if_req=(e,t,tr)=>(Module._build_attrmap_by_name_if_req=wasmExports.build_attrmap_by_name_if_req)(e,t,tr),Module._ExecGetResultRelCheckAsUser=(e,t)=>(Module._ExecGetResultRelCheckAsUser=wasmExports.ExecGetResultRelCheckAsUser)(e,t),Module._InstrEndLoop=e=>(Module._InstrEndLoop=wasmExports.InstrEndLoop)(e),Module._ExecStoreHeapTuple=(e,t,tr)=>(Module._ExecStoreHeapTuple=wasmExports.ExecStoreHeapTuple)(e,t,tr),Module._get_partition_ancestors=e=>(Module._get_partition_ancestors=wasmExports.get_partition_ancestors)(e),Module._pull_varattnos=(e,t,tr)=>(Module._pull_varattnos=wasmExports.pull_varattnos)(e,t,tr),Module._ExecFindJunkAttributeInTlist=(e,t)=>(Module._ExecFindJunkAttributeInTlist=wasmExports.ExecFindJunkAttributeInTlist)(e,t),Module._visibilitymap_get_status=(e,t,tr)=>(Module._visibilitymap_get_status=wasmExports.visibilitymap_get_status)(e,t,tr),Module._index_deform_tuple=(e,t,tr,rr)=>(Module._index_deform_tuple=wasmExports.index_deform_tuple)(e,t,tr,rr),Module._LaunchParallelWorkers=e=>(Module._LaunchParallelWorkers=wasmExports.LaunchParallelWorkers)(e),Module._standard_ExecutorStart=(e,t)=>(Module._standard_ExecutorStart=wasmExports.standard_ExecutorStart)(e,t),Module._GetCommandTagName=e=>(Module._GetCommandTagName=wasmExports.GetCommandTagName)(e),Module._standard_ExecutorRun=(e,t,tr,rr)=>(Module._standard_ExecutorRun=wasmExports.standard_ExecutorRun)(e,t,tr,rr),Module._EnterParallelMode=()=>(Module._EnterParallelMode=wasmExports.EnterParallelMode)(),Module._ExitParallelMode=()=>(Module._ExitParallelMode=wasmExports.ExitParallelMode)(),Module._standard_ExecutorFinish=e=>(Module._standard_ExecutorFinish=wasmExports.standard_ExecutorFinish)(e),Module._standard_ExecutorEnd=e=>(Module._standard_ExecutorEnd=wasmExports.standard_ExecutorEnd)(e),Module._MakeTupleTableSlot=(e,t)=>(Module._MakeTupleTableSlot=wasmExports.MakeTupleTableSlot)(e,t),Module._CreateParallelContext=(e,t,tr)=>(Module._CreateParallelContext=wasmExports.CreateParallelContext)(e,t,tr),Module._InitializeParallelDSM=e=>(Module._InitializeParallelDSM=wasmExports.InitializeParallelDSM)(e),Module._WaitForParallelWorkersToFinish=e=>(Module._WaitForParallelWorkersToFinish=wasmExports.WaitForParallelWorkersToFinish)(e),Module._DestroyParallelContext=e=>(Module._DestroyParallelContext=wasmExports.DestroyParallelContext)(e),Module._SPI_connect=()=>(Module._SPI_connect=wasmExports.SPI_connect)(),Module._SPI_connect_ext=e=>(Module._SPI_connect_ext=wasmExports.SPI_connect_ext)(e),Module._SPI_finish=()=>(Module._SPI_finish=wasmExports.SPI_finish)(),Module._SPI_commit=()=>(Module._SPI_commit=wasmExports.SPI_commit)(),Module._ReThrowError=e=>(Module._ReThrowError=wasmExports.ReThrowError)(e),Module._SPI_commit_and_chain=()=>(Module._SPI_commit_and_chain=wasmExports.SPI_commit_and_chain)(),Module._SPI_rollback=()=>(Module._SPI_rollback=wasmExports.SPI_rollback)(),Module._SPI_rollback_and_chain=()=>(Module._SPI_rollback_and_chain=wasmExports.SPI_rollback_and_chain)(),Module._SPI_execute=(e,t,tr)=>(Module._SPI_execute=wasmExports.SPI_execute)(e,t,tr),Module._EnsurePortalSnapshotExists=()=>(Module._EnsurePortalSnapshotExists=wasmExports.EnsurePortalSnapshotExists)(),Module._SPI_freetuptable=e=>(Module._SPI_freetuptable=wasmExports.SPI_freetuptable)(e),Module._ReleaseCachedPlan=(e,t)=>(Module._ReleaseCachedPlan=wasmExports.ReleaseCachedPlan)(e,t),Module._SPI_exec=(e,t)=>(Module._SPI_exec=wasmExports.SPI_exec)(e,t),Module._SPI_execute_extended=(e,t)=>(Module._SPI_execute_extended=wasmExports.SPI_execute_extended)(e,t),Module._makeParamList=e=>(Module._makeParamList=wasmExports.makeParamList)(e),Module._SPI_execp=(e,t,tr,rr)=>(Module._SPI_execp=wasmExports.SPI_execp)(e,t,tr,rr),Module._SPI_execute_plan_extended=(e,t)=>(Module._SPI_execute_plan_extended=wasmExports.SPI_execute_plan_extended)(e,t),Module._SPI_execute_plan_with_paramlist=(e,t,tr,rr)=>(Module._SPI_execute_plan_with_paramlist=wasmExports.SPI_execute_plan_with_paramlist)(e,t,tr,rr),Module._SPI_prepare=(e,t,tr)=>(Module._SPI_prepare=wasmExports.SPI_prepare)(e,t,tr),Module._SPI_prepare_extended=(e,t)=>(Module._SPI_prepare_extended=wasmExports.SPI_prepare_extended)(e,t),Module._SPI_keepplan=e=>(Module._SPI_keepplan=wasmExports.SPI_keepplan)(e),Module._SPI_freeplan=e=>(Module._SPI_freeplan=wasmExports.SPI_freeplan)(e),Module._SPI_copytuple=e=>(Module._SPI_copytuple=wasmExports.SPI_copytuple)(e),Module._SPI_returntuple=(e,t)=>(Module._SPI_returntuple=wasmExports.SPI_returntuple)(e,t),Module._SPI_fnumber=(e,t)=>(Module._SPI_fnumber=wasmExports.SPI_fnumber)(e,t),Module._SPI_fname=(e,t)=>(Module._SPI_fname=wasmExports.SPI_fname)(e,t),Module._SPI_getvalue=(e,t,tr)=>(Module._SPI_getvalue=wasmExports.SPI_getvalue)(e,t,tr),Module._SPI_getbinval=(e,t,tr,rr)=>(Module._SPI_getbinval=wasmExports.SPI_getbinval)(e,t,tr,rr),Module._SPI_gettype=(e,t)=>(Module._SPI_gettype=wasmExports.SPI_gettype)(e,t),Module._SPI_gettypeid=(e,t)=>(Module._SPI_gettypeid=wasmExports.SPI_gettypeid)(e,t),Module._SPI_getrelname=e=>(Module._SPI_getrelname=wasmExports.SPI_getrelname)(e),Module._SPI_palloc=e=>(Module._SPI_palloc=wasmExports.SPI_palloc)(e),Module._SPI_datumTransfer=(e,t,tr)=>(Module._SPI_datumTransfer=wasmExports.SPI_datumTransfer)(e,t,tr),Module._datumTransfer=(e,t,tr)=>(Module._datumTransfer=wasmExports.datumTransfer)(e,t,tr),Module._SPI_cursor_open_with_paramlist=(e,t,tr,rr)=>(Module._SPI_cursor_open_with_paramlist=wasmExports.SPI_cursor_open_with_paramlist)(e,t,tr,rr),Module._SPI_cursor_parse_open=(e,t,tr)=>(Module._SPI_cursor_parse_open=wasmExports.SPI_cursor_parse_open)(e,t,tr),Module._SPI_cursor_find=e=>(Module._SPI_cursor_find=wasmExports.SPI_cursor_find)(e),Module._SPI_cursor_fetch=(e,t,tr)=>(Module._SPI_cursor_fetch=wasmExports.SPI_cursor_fetch)(e,t,tr),Module._SPI_scroll_cursor_fetch=(e,t,tr)=>(Module._SPI_scroll_cursor_fetch=wasmExports.SPI_scroll_cursor_fetch)(e,t,tr),Module._SPI_scroll_cursor_move=(e,t,tr)=>(Module._SPI_scroll_cursor_move=wasmExports.SPI_scroll_cursor_move)(e,t,tr),Module._SPI_cursor_close=e=>(Module._SPI_cursor_close=wasmExports.SPI_cursor_close)(e),Module._SPI_result_code_string=e=>(Module._SPI_result_code_string=wasmExports.SPI_result_code_string)(e),Module._SPI_plan_get_plan_sources=e=>(Module._SPI_plan_get_plan_sources=wasmExports.SPI_plan_get_plan_sources)(e),Module._SPI_plan_get_cached_plan=e=>(Module._SPI_plan_get_cached_plan=wasmExports.SPI_plan_get_cached_plan)(e),Module._geterrposition=()=>(Module._geterrposition=wasmExports.geterrposition)(),Module._internalerrposition=e=>(Module._internalerrposition=wasmExports.internalerrposition)(e),Module._internalerrquery=e=>(Module._internalerrquery=wasmExports.internalerrquery)(e),Module._SPI_register_trigger_data=e=>(Module._SPI_register_trigger_data=wasmExports.SPI_register_trigger_data)(e),Module._EOH_get_flat_size=e=>(Module._EOH_get_flat_size=wasmExports.EOH_get_flat_size)(e),Module._EOH_flatten_into=(e,t,tr)=>(Module._EOH_flatten_into=wasmExports.EOH_flatten_into)(e,t,tr),Module._ExecFetchSlotHeapTuple=(e,t,tr)=>(Module._ExecFetchSlotHeapTuple=wasmExports.ExecFetchSlotHeapTuple)(e,t,tr),Module._InputFunctionCall=(e,t,tr,rr)=>(Module._InputFunctionCall=wasmExports.InputFunctionCall)(e,t,tr,rr),Module._convert_tuples_by_position=(e,t,tr)=>(Module._convert_tuples_by_position=wasmExports.convert_tuples_by_position)(e,t,tr),Module._SetTuplestoreDestReceiverParams=(e,t,tr,rr,ir,lr)=>(Module._SetTuplestoreDestReceiverParams=wasmExports.SetTuplestoreDestReceiverParams)(e,t,tr,rr,ir,lr),Module._detoast_external_attr=e=>(Module._detoast_external_attr=wasmExports.detoast_external_attr)(e),Module._bms_nonempty_difference=(e,t)=>(Module._bms_nonempty_difference=wasmExports.bms_nonempty_difference)(e,t),Module._table_parallelscan_estimate=(e,t)=>(Module._table_parallelscan_estimate=wasmExports.table_parallelscan_estimate)(e,t),Module._table_parallelscan_initialize=(e,t,tr)=>(Module._table_parallelscan_initialize=wasmExports.table_parallelscan_initialize)(e,t,tr),Module._table_beginscan_parallel=(e,t)=>(Module._table_beginscan_parallel=wasmExports.table_beginscan_parallel)(e,t),Module._BufferUsageAccumDiff=(e,t,tr)=>(Module._BufferUsageAccumDiff=wasmExports.BufferUsageAccumDiff)(e,t,tr),Module._WalUsageAccumDiff=(e,t,tr)=>(Module._WalUsageAccumDiff=wasmExports.WalUsageAccumDiff)(e,t,tr),Module._InstrUpdateTupleCount=(e,t)=>(Module._InstrUpdateTupleCount=wasmExports.InstrUpdateTupleCount)(e,t),Module._tuplesort_reset=e=>(Module._tuplesort_reset=wasmExports.tuplesort_reset)(e),Module._get_call_expr_argtype=(e,t)=>(Module._get_call_expr_argtype=wasmExports.get_call_expr_argtype)(e,t),Module._get_typtype=e=>(Module._get_typtype=wasmExports.get_typtype)(e),Module._pull_var_clause=(e,t)=>(Module._pull_var_clause=wasmExports.pull_var_clause)(e,t),Module._bms_is_subset=(e,t)=>(Module._bms_is_subset=wasmExports.bms_is_subset)(e,t),Module._bms_membership=e=>(Module._bms_membership=wasmExports.bms_membership)(e),Module._make_restrictinfo=(e,t,tr,rr,ir,lr,dr,fr,hr,mr)=>(Module._make_restrictinfo=wasmExports.make_restrictinfo)(e,t,tr,rr,ir,lr,dr,fr,hr,mr),Module._GetSysCacheHashValue=(e,t,tr,rr,ir)=>(Module._GetSysCacheHashValue=wasmExports.GetSysCacheHashValue)(e,t,tr,rr,ir),Module._tlist_member=(e,t)=>(Module._tlist_member=wasmExports.tlist_member)(e,t),Module._add_path=(e,t)=>(Module._add_path=wasmExports.add_path)(e,t),Module._contain_mutable_functions=e=>(Module._contain_mutable_functions=wasmExports.contain_mutable_functions)(e),Module._make_orclause=e=>(Module._make_orclause=wasmExports.make_orclause)(e),Module._extract_actual_clauses=(e,t)=>(Module._extract_actual_clauses=wasmExports.extract_actual_clauses)(e,t),Module._cost_sort=(e,t,tr,rr,ir,lr,dr,fr,hr)=>(Module._cost_sort=wasmExports.cost_sort)(e,t,tr,rr,ir,lr,dr,fr,hr),Module._pathkeys_contained_in=(e,t)=>(Module._pathkeys_contained_in=wasmExports.pathkeys_contained_in)(e,t),Module._change_plan_targetlist=(e,t,tr)=>(Module._change_plan_targetlist=wasmExports.change_plan_targetlist)(e,t,tr),Module._make_foreignscan=(e,t,tr,rr,ir,lr,dr,fr)=>(Module._make_foreignscan=wasmExports.make_foreignscan)(e,t,tr,rr,ir,lr,dr,fr),Module._list_member_ptr=(e,t)=>(Module._list_member_ptr=wasmExports.list_member_ptr)(e,t),Module._clamp_row_est=e=>(Module._clamp_row_est=wasmExports.clamp_row_est)(e),Module._standard_planner=(e,t,tr,rr)=>(Module._standard_planner=wasmExports.standard_planner)(e,t,tr,rr),Module._estimate_expression_value=(e,t)=>(Module._estimate_expression_value=wasmExports.estimate_expression_value)(e,t),Module._add_new_columns_to_pathtarget=(e,t)=>(Module._add_new_columns_to_pathtarget=wasmExports.add_new_columns_to_pathtarget)(e,t),Module._get_sortgroupref_clause_noerr=(e,t)=>(Module._get_sortgroupref_clause_noerr=wasmExports.get_sortgroupref_clause_noerr)(e,t),Module._get_agg_clause_costs=(e,t,tr)=>(Module._get_agg_clause_costs=wasmExports.get_agg_clause_costs)(e,t,tr),Module._grouping_is_sortable=e=>(Module._grouping_is_sortable=wasmExports.grouping_is_sortable)(e),Module._create_sort_path=(e,t,tr,rr,ir)=>(Module._create_sort_path=wasmExports.create_sort_path)(e,t,tr,rr,ir),Module._copy_pathtarget=e=>(Module._copy_pathtarget=wasmExports.copy_pathtarget)(e),Module._get_sortgrouplist_exprs=(e,t)=>(Module._get_sortgrouplist_exprs=wasmExports.get_sortgrouplist_exprs)(e,t),Module._estimate_num_groups=(e,t,tr,rr,ir)=>(Module._estimate_num_groups=wasmExports.estimate_num_groups)(e,t,tr,rr,ir),Module._cost_qual_eval=(e,t,tr)=>(Module._cost_qual_eval=wasmExports.cost_qual_eval)(e,t,tr),Module._plan_create_index_workers=(e,t)=>(Module._plan_create_index_workers=wasmExports.plan_create_index_workers)(e,t),Module._create_projection_path=(e,t,tr,rr)=>(Module._create_projection_path=wasmExports.create_projection_path)(e,t,tr,rr),Module._get_plan_rowmark=(e,t)=>(Module._get_plan_rowmark=wasmExports.get_plan_rowmark)(e,t),Module._find_join_rel=(e,t)=>(Module._find_join_rel=wasmExports.find_join_rel)(e,t),Module._make_canonical_pathkey=(e,t,tr,rr,ir)=>(Module._make_canonical_pathkey=wasmExports.make_canonical_pathkey)(e,t,tr,rr,ir),Module._eclass_useful_for_merging=(e,t,tr)=>(Module._eclass_useful_for_merging=wasmExports.eclass_useful_for_merging)(e,t,tr),Module._update_mergeclause_eclasses=(e,t)=>(Module._update_mergeclause_eclasses=wasmExports.update_mergeclause_eclasses)(e,t),Module._clauselist_selectivity=(e,t,tr,rr,ir)=>(Module._clauselist_selectivity=wasmExports.clauselist_selectivity)(e,t,tr,rr,ir),Module._join_clause_is_movable_to=(e,t)=>(Module._join_clause_is_movable_to=wasmExports.join_clause_is_movable_to)(e,t),Module._generate_implied_equalities_for_column=(e,t,tr,rr,ir)=>(Module._generate_implied_equalities_for_column=wasmExports.generate_implied_equalities_for_column)(e,t,tr,rr,ir),Module._get_tablespace_page_costs=(e,t,tr)=>(Module._get_tablespace_page_costs=wasmExports.get_tablespace_page_costs)(e,t,tr),Module._set_baserel_size_estimates=(e,t)=>(Module._set_baserel_size_estimates=wasmExports.set_baserel_size_estimates)(e,t),Module._add_to_flat_tlist=(e,t)=>(Module._add_to_flat_tlist=wasmExports.add_to_flat_tlist)(e,t),Module._get_baserel_parampathinfo=(e,t,tr)=>(Module._get_baserel_parampathinfo=wasmExports.get_baserel_parampathinfo)(e,t,tr),Module._create_foreignscan_path=(e,t,tr,rr,ir,lr,dr,fr,hr,mr)=>(Module._create_foreignscan_path=wasmExports.create_foreignscan_path)(e,t,tr,rr,ir,lr,dr,fr,hr,mr),Module._create_foreign_join_path=(e,t,tr,rr,ir,lr,dr,fr,hr,mr)=>(Module._create_foreign_join_path=wasmExports.create_foreign_join_path)(e,t,tr,rr,ir,lr,dr,fr,hr,mr),Module._create_foreign_upper_path=(e,t,tr,rr,ir,lr,dr,fr,hr)=>(Module._create_foreign_upper_path=wasmExports.create_foreign_upper_path)(e,t,tr,rr,ir,lr,dr,fr,hr),Module._adjust_limit_rows_costs=(e,t,tr,rr,ir)=>(Module._adjust_limit_rows_costs=wasmExports.adjust_limit_rows_costs)(e,t,tr,rr,ir),Module._SearchSysCacheAttName=(e,t)=>(Module._SearchSysCacheAttName=wasmExports.SearchSysCacheAttName)(e,t),Module._get_translated_update_targetlist=(e,t,tr,rr)=>(Module._get_translated_update_targetlist=wasmExports.get_translated_update_targetlist)(e,t,tr,rr),Module._add_row_identity_var=(e,t,tr,rr)=>(Module._add_row_identity_var=wasmExports.add_row_identity_var)(e,t,tr,rr),Module._get_rel_all_updated_cols=(e,t)=>(Module._get_rel_all_updated_cols=wasmExports.get_rel_all_updated_cols)(e,t),Module._list_append_unique_ptr=(e,t)=>(Module._list_append_unique_ptr=wasmExports.list_append_unique_ptr)(e,t),Module._palloc_extended=(e,t)=>(Module._palloc_extended=wasmExports.palloc_extended)(e,t),Module._pg_reg_getinitialstate=e=>(Module._pg_reg_getinitialstate=wasmExports.pg_reg_getinitialstate)(e),Module._pg_reg_getfinalstate=e=>(Module._pg_reg_getfinalstate=wasmExports.pg_reg_getfinalstate)(e),Module._pg_reg_getnumoutarcs=(e,t)=>(Module._pg_reg_getnumoutarcs=wasmExports.pg_reg_getnumoutarcs)(e,t),Module._pg_reg_getoutarcs=(e,t,tr,rr)=>(Module._pg_reg_getoutarcs=wasmExports.pg_reg_getoutarcs)(e,t,tr,rr),Module._pg_reg_getnumcolors=e=>(Module._pg_reg_getnumcolors=wasmExports.pg_reg_getnumcolors)(e),Module._pg_reg_colorisbegin=(e,t)=>(Module._pg_reg_colorisbegin=wasmExports.pg_reg_colorisbegin)(e,t),Module._pg_reg_colorisend=(e,t)=>(Module._pg_reg_colorisend=wasmExports.pg_reg_colorisend)(e,t),Module._pg_reg_getnumcharacters=(e,t)=>(Module._pg_reg_getnumcharacters=wasmExports.pg_reg_getnumcharacters)(e,t),Module._pg_reg_getcharacters=(e,t,tr,rr)=>(Module._pg_reg_getcharacters=wasmExports.pg_reg_getcharacters)(e,t,tr,rr),Module._toupper=e=>(Module._toupper=wasmExports.toupper)(e),Module._pg_initdb=()=>(Module._pg_initdb=wasmExports.pg_initdb)(),Module._pg_initdb_main=()=>(Module._pg_initdb_main=wasmExports.pg_initdb_main)(),Module.___cxa_throw=(e,t,tr)=>(Module.___cxa_throw=wasmExports.__cxa_throw)(e,t,tr),Module._main_repl=()=>(Module._main_repl=wasmExports.main_repl)(),Module._main=(e,t)=>(Module._main=wasmExports.__main_argc_argv)(e,t),Module._setenv=(e,t,tr)=>(Module._setenv=wasmExports.setenv)(e,t,tr),Module._pg_repl_raf=()=>(Module._pg_repl_raf=wasmExports.pg_repl_raf)(),Module._GetForeignDataWrapper=e=>(Module._GetForeignDataWrapper=wasmExports.GetForeignDataWrapper)(e),Module._GetForeignServer=e=>(Module._GetForeignServer=wasmExports.GetForeignServer)(e),Module._GetForeignServerExtended=(e,t)=>(Module._GetForeignServerExtended=wasmExports.GetForeignServerExtended)(e,t),Module._GetForeignServerByName=(e,t)=>(Module._GetForeignServerByName=wasmExports.GetForeignServerByName)(e,t),Module._GetUserMapping=(e,t)=>(Module._GetUserMapping=wasmExports.GetUserMapping)(e,t),Module._GetForeignTable=e=>(Module._GetForeignTable=wasmExports.GetForeignTable)(e),Module._GetForeignColumnOptions=(e,t)=>(Module._GetForeignColumnOptions=wasmExports.GetForeignColumnOptions)(e,t),Module._initClosestMatch=(e,t,tr)=>(Module._initClosestMatch=wasmExports.initClosestMatch)(e,t,tr),Module._updateClosestMatch=(e,t)=>(Module._updateClosestMatch=wasmExports.updateClosestMatch)(e,t),Module._getClosestMatch=e=>(Module._getClosestMatch=wasmExports.getClosestMatch)(e),Module._GetExistingLocalJoinPath=e=>(Module._GetExistingLocalJoinPath=wasmExports.GetExistingLocalJoinPath)(e),Module._BaseBackupAddTarget=(e,t,tr)=>(Module._BaseBackupAddTarget=wasmExports.BaseBackupAddTarget)(e,t,tr),Module._bbsink_forward_begin_backup=e=>(Module._bbsink_forward_begin_backup=wasmExports.bbsink_forward_begin_backup)(e),Module._bbsink_forward_archive_contents=(e,t)=>(Module._bbsink_forward_archive_contents=wasmExports.bbsink_forward_archive_contents)(e,t),Module._bbsink_forward_end_archive=e=>(Module._bbsink_forward_end_archive=wasmExports.bbsink_forward_end_archive)(e),Module._bbsink_forward_begin_archive=(e,t)=>(Module._bbsink_forward_begin_archive=wasmExports.bbsink_forward_begin_archive)(e,t),Module._bbsink_forward_begin_manifest=e=>(Module._bbsink_forward_begin_manifest=wasmExports.bbsink_forward_begin_manifest)(e),Module._bbsink_forward_manifest_contents=(e,t)=>(Module._bbsink_forward_manifest_contents=wasmExports.bbsink_forward_manifest_contents)(e,t),Module._bbsink_forward_end_manifest=e=>(Module._bbsink_forward_end_manifest=wasmExports.bbsink_forward_end_manifest)(e),Module._bbsink_forward_end_backup=(e,t,tr)=>(Module._bbsink_forward_end_backup=wasmExports.bbsink_forward_end_backup)(e,t,tr),Module._bbsink_forward_cleanup=e=>(Module._bbsink_forward_cleanup=wasmExports.bbsink_forward_cleanup)(e),Module._ResourceOwnerCreate=(e,t)=>(Module._ResourceOwnerCreate=wasmExports.ResourceOwnerCreate)(e,t),Module._escape_json=(e,t)=>(Module._escape_json=wasmExports.escape_json)(e,t),Module._exprIsLengthCoercion=(e,t)=>(Module._exprIsLengthCoercion=wasmExports.exprIsLengthCoercion)(e,t),Module._tbm_add_tuples=(e,t,tr,rr)=>(Module._tbm_add_tuples=wasmExports.tbm_add_tuples)(e,t,tr,rr),Module._appendStringInfoStringQuoted=(e,t,tr)=>(Module._appendStringInfoStringQuoted=wasmExports.appendStringInfoStringQuoted)(e,t,tr),Module._list_make5_impl=(e,t,tr,rr,ir,lr)=>(Module._list_make5_impl=wasmExports.list_make5_impl)(e,t,tr,rr,ir,lr),Module._list_delete=(e,t)=>(Module._list_delete=wasmExports.list_delete)(e,t),Module._CleanQuerytext=(e,t,tr)=>(Module._CleanQuerytext=wasmExports.CleanQuerytext)(e,t,tr),Module._EnableQueryId=()=>(Module._EnableQueryId=wasmExports.EnableQueryId)(),Module._get_rel_type_id=e=>(Module._get_rel_type_id=wasmExports.get_rel_type_id)(e),Module._set_config_option=(e,t,tr,rr,ir,lr,dr,fr)=>(Module._set_config_option=wasmExports.set_config_option)(e,t,tr,rr,ir,lr,dr,fr),Module._NewGUCNestLevel=()=>(Module._NewGUCNestLevel=wasmExports.NewGUCNestLevel)(),Module._AtEOXact_GUC=(e,t)=>(Module._AtEOXact_GUC=wasmExports.AtEOXact_GUC)(e,t),Module._parse_int=(e,t,tr,rr)=>(Module._parse_int=wasmExports.parse_int)(e,t,tr,rr),Module._strtod=(e,t)=>(Module._strtod=wasmExports.strtod)(e,t),Module._parse_real=(e,t,tr,rr)=>(Module._parse_real=wasmExports.parse_real)(e,t,tr,rr),Module._DefineCustomBoolVariable=(e,t,tr,rr,ir,lr,dr,fr,hr,mr)=>(Module._DefineCustomBoolVariable=wasmExports.DefineCustomBoolVariable)(e,t,tr,rr,ir,lr,dr,fr,hr,mr),Module._DefineCustomIntVariable=(e,t,tr,rr,ir,lr,dr,fr,hr,mr,gr,yr)=>(Module._DefineCustomIntVariable=wasmExports.DefineCustomIntVariable)(e,t,tr,rr,ir,lr,dr,fr,hr,mr,gr,yr),Module._DefineCustomRealVariable=(e,t,tr,rr,ir,lr,dr,fr,hr,mr,gr,yr)=>(Module._DefineCustomRealVariable=wasmExports.DefineCustomRealVariable)(e,t,tr,rr,ir,lr,dr,fr,hr,mr,gr,yr),Module._DefineCustomStringVariable=(e,t,tr,rr,ir,lr,dr,fr,hr,mr)=>(Module._DefineCustomStringVariable=wasmExports.DefineCustomStringVariable)(e,t,tr,rr,ir,lr,dr,fr,hr,mr),Module._DefineCustomEnumVariable=(e,t,tr,rr,ir,lr,dr,fr,hr,mr,gr)=>(Module._DefineCustomEnumVariable=wasmExports.DefineCustomEnumVariable)(e,t,tr,rr,ir,lr,dr,fr,hr,mr,gr),Module._MarkGUCPrefixReserved=e=>(Module._MarkGUCPrefixReserved=wasmExports.MarkGUCPrefixReserved)(e),Module._strcspn=(e,t)=>(Module._strcspn=wasmExports.strcspn)(e,t),Module._BlockSampler_Init=(e,t,tr,rr)=>(Module._BlockSampler_Init=wasmExports.BlockSampler_Init)(e,t,tr,rr),Module._sampler_random_init_state=(e,t)=>(Module._sampler_random_init_state=wasmExports.sampler_random_init_state)(e,t),Module._BlockSampler_HasMore=e=>(Module._BlockSampler_HasMore=wasmExports.BlockSampler_HasMore)(e),Module._BlockSampler_Next=e=>(Module._BlockSampler_Next=wasmExports.BlockSampler_Next)(e),Module._sampler_random_fract=e=>(Module._sampler_random_fract=wasmExports.sampler_random_fract)(e),Module._reservoir_init_selection_state=(e,t)=>(Module._reservoir_init_selection_state=wasmExports.reservoir_init_selection_state)(e,t),Module._reservoir_get_next_S=(e,t,tr)=>(Module._reservoir_get_next_S=wasmExports.reservoir_get_next_S)(e,t,tr),Module._canonicalize_path=e=>(Module._canonicalize_path=wasmExports.canonicalize_path)(e),Module.__bt_mkscankey=(e,t)=>(Module.__bt_mkscankey=wasmExports._bt_mkscankey)(e,t),Module._nocache_index_getattr=(e,t,tr)=>(Module._nocache_index_getattr=wasmExports.nocache_index_getattr)(e,t,tr),Module._tuplesort_estimate_shared=e=>(Module._tuplesort_estimate_shared=wasmExports.tuplesort_estimate_shared)(e),Module._tuplesort_initialize_shared=(e,t,tr)=>(Module._tuplesort_initialize_shared=wasmExports.tuplesort_initialize_shared)(e,t,tr),Module._tuplesort_attach_shared=(e,t)=>(Module._tuplesort_attach_shared=wasmExports.tuplesort_attach_shared)(e,t),Module._GetCurrentTransactionNestLevel=()=>(Module._GetCurrentTransactionNestLevel=wasmExports.GetCurrentTransactionNestLevel)(),Module._in_error_recursion_trouble=()=>(Module._in_error_recursion_trouble=wasmExports.in_error_recursion_trouble)(),Module._strrchr=(e,t)=>(Module._strrchr=wasmExports.strrchr)(e,t),Module._errhidestmt=e=>(Module._errhidestmt=wasmExports.errhidestmt)(e),Module._err_generic_string=(e,t)=>(Module._err_generic_string=wasmExports.err_generic_string)(e,t),Module._getinternalerrposition=()=>(Module._getinternalerrposition=wasmExports.getinternalerrposition)(),Module._GetErrorContextStack=()=>(Module._GetErrorContextStack=wasmExports.GetErrorContextStack)(),Module._SplitIdentifierString=(e,t,tr)=>(Module._SplitIdentifierString=wasmExports.SplitIdentifierString)(e,t,tr),Module._appendStringInfoSpaces=(e,t)=>(Module._appendStringInfoSpaces=wasmExports.appendStringInfoSpaces)(e,t),Module._unpack_sql_state=e=>(Module._unpack_sql_state=wasmExports.unpack_sql_state)(e),Module._CreateTupleDescCopyConstr=e=>(Module._CreateTupleDescCopyConstr=wasmExports.CreateTupleDescCopyConstr)(e),Module._CachedPlanAllowsSimpleValidityCheck=(e,t,tr)=>(Module._CachedPlanAllowsSimpleValidityCheck=wasmExports.CachedPlanAllowsSimpleValidityCheck)(e,t,tr),Module._CachedPlanIsSimplyValid=(e,t,tr)=>(Module._CachedPlanIsSimplyValid=wasmExports.CachedPlanIsSimplyValid)(e,t,tr),Module._GetCachedExpression=e=>(Module._GetCachedExpression=wasmExports.GetCachedExpression)(e),Module._FreeCachedExpression=e=>(Module._FreeCachedExpression=wasmExports.FreeCachedExpression)(e),Module._MemoryContextDeleteChildren=e=>(Module._MemoryContextDeleteChildren=wasmExports.MemoryContextDeleteChildren)(e),Module._is_publishable_relation=e=>(Module._is_publishable_relation=wasmExports.is_publishable_relation)(e),Module._GetRelationPublications=e=>(Module._GetRelationPublications=wasmExports.GetRelationPublications)(e),Module._GetSchemaPublications=e=>(Module._GetSchemaPublications=wasmExports.GetSchemaPublications)(e),Module._index_getprocid=(e,t,tr)=>(Module._index_getprocid=wasmExports.index_getprocid)(e,t,tr),Module._get_rel_relispartition=e=>(Module._get_rel_relispartition=wasmExports.get_rel_relispartition)(e),Module._get_func_namespace=e=>(Module._get_func_namespace=wasmExports.get_func_namespace)(e),Module._get_typsubscript=(e,t)=>(Module._get_typsubscript=wasmExports.get_typsubscript)(e,t),Module._get_namespace_name_or_temp=e=>(Module._get_namespace_name_or_temp=wasmExports.get_namespace_name_or_temp)(e),Module._texteq=e=>(Module._texteq=wasmExports.texteq)(e),Module._GetUserIdAndSecContext=(e,t)=>(Module._GetUserIdAndSecContext=wasmExports.GetUserIdAndSecContext)(e,t),Module._SetUserIdAndSecContext=(e,t)=>(Module._SetUserIdAndSecContext=wasmExports.SetUserIdAndSecContext)(e,t),Module._DirectFunctionCall5Coll=(e,t,tr,rr,ir,lr,dr)=>(Module._DirectFunctionCall5Coll=wasmExports.DirectFunctionCall5Coll)(e,t,tr,rr,ir,lr,dr),Module._CallerFInfoFunctionCall2=(e,t,tr,rr,ir)=>(Module._CallerFInfoFunctionCall2=wasmExports.CallerFInfoFunctionCall2)(e,t,tr,rr,ir),Module._FunctionCall0Coll=(e,t)=>(Module._FunctionCall0Coll=wasmExports.FunctionCall0Coll)(e,t),Module._OutputFunctionCall=(e,t)=>(Module._OutputFunctionCall=wasmExports.OutputFunctionCall)(e,t),Module._get_fn_expr_rettype=e=>(Module._get_fn_expr_rettype=wasmExports.get_fn_expr_rettype)(e),Module._has_fn_opclass_options=e=>(Module._has_fn_opclass_options=wasmExports.has_fn_opclass_options)(e),Module._get_fn_opclass_options=e=>(Module._get_fn_opclass_options=wasmExports.get_fn_opclass_options)(e),Module._CheckFunctionValidatorAccess=(e,t)=>(Module._CheckFunctionValidatorAccess=wasmExports.CheckFunctionValidatorAccess)(e,t),Module._resolve_polymorphic_argtypes=(e,t,tr,rr)=>(Module._resolve_polymorphic_argtypes=wasmExports.resolve_polymorphic_argtypes)(e,t,tr,rr),Module._get_func_arg_info=(e,t,tr,rr)=>(Module._get_func_arg_info=wasmExports.get_func_arg_info)(e,t,tr,rr),Module._dlsym=(e,t)=>(Module._dlsym=wasmExports.dlsym)(e,t),Module._dlopen=(e,t)=>(Module._dlopen=wasmExports.dlopen)(e,t),Module._dlerror=()=>(Module._dlerror=wasmExports.dlerror)(),Module._dlclose=e=>(Module._dlclose=wasmExports.dlclose)(e),Module._find_rendezvous_variable=e=>(Module._find_rendezvous_variable=wasmExports.find_rendezvous_variable)(e),Module._fscanf=(e,t,tr)=>(Module._fscanf=wasmExports.fscanf)(e,t,tr),Module._strlcat=(e,t,tr)=>(Module._strlcat=wasmExports.strlcat)(e,t,tr),Module._pg_bindtextdomain=e=>(Module._pg_bindtextdomain=wasmExports.pg_bindtextdomain)(e),Module._pg_do_encoding_conversion=(e,t,tr,rr)=>(Module._pg_do_encoding_conversion=wasmExports.pg_do_encoding_conversion)(e,t,tr,rr),Module._report_invalid_encoding=(e,t,tr)=>(Module._report_invalid_encoding=wasmExports.report_invalid_encoding)(e,t,tr),Module._pg_encoding_to_char_private=e=>(Module._pg_encoding_to_char_private=wasmExports.pg_encoding_to_char_private)(e),Module._MemoryContextAllocHuge=(e,t)=>(Module._MemoryContextAllocHuge=wasmExports.MemoryContextAllocHuge)(e,t),Module._namein=e=>(Module._namein=wasmExports.namein)(e),Module._pg_char_to_encoding_private=e=>(Module._pg_char_to_encoding_private=wasmExports.pg_char_to_encoding_private)(e),Module._pg_encoding_max_length=e=>(Module._pg_encoding_max_length=wasmExports.pg_encoding_max_length)(e),Module._pg_server_to_any=(e,t,tr)=>(Module._pg_server_to_any=wasmExports.pg_server_to_any)(e,t,tr),Module._pg_utf_mblen=e=>(Module._pg_utf_mblen=wasmExports.pg_utf_mblen)(e),Module._pg_wchar2mb_with_len=(e,t,tr)=>(Module._pg_wchar2mb_with_len=wasmExports.pg_wchar2mb_with_len)(e,t,tr),Module._pg_encoding_mblen=(e,t)=>(Module._pg_encoding_mblen=wasmExports.pg_encoding_mblen)(e,t),Module._check_encoding_conversion_args=(e,t,tr,rr,ir)=>(Module._check_encoding_conversion_args=wasmExports.check_encoding_conversion_args)(e,t,tr,rr,ir),Module._report_untranslatable_char=(e,t,tr,rr)=>(Module._report_untranslatable_char=wasmExports.report_untranslatable_char)(e,t,tr,rr),Module._local2local=(e,t,tr,rr,ir,lr,dr)=>(Module._local2local=wasmExports.local2local)(e,t,tr,rr,ir,lr,dr),Module._latin2mic=(e,t,tr,rr,ir,lr)=>(Module._latin2mic=wasmExports.latin2mic)(e,t,tr,rr,ir,lr),Module._mic2latin=(e,t,tr,rr,ir,lr)=>(Module._mic2latin=wasmExports.mic2latin)(e,t,tr,rr,ir,lr),Module._latin2mic_with_table=(e,t,tr,rr,ir,lr,dr)=>(Module._latin2mic_with_table=wasmExports.latin2mic_with_table)(e,t,tr,rr,ir,lr,dr),Module._mic2latin_with_table=(e,t,tr,rr,ir,lr,dr)=>(Module._mic2latin_with_table=wasmExports.mic2latin_with_table)(e,t,tr,rr,ir,lr,dr),Module._pg_encoding_verifymbchar=(e,t,tr)=>(Module._pg_encoding_verifymbchar=wasmExports.pg_encoding_verifymbchar)(e,t,tr),Module._float_overflow_error=()=>(Module._float_overflow_error=wasmExports.float_overflow_error)(),Module._float_underflow_error=()=>(Module._float_underflow_error=wasmExports.float_underflow_error)(),Module._float4in_internal=(e,t,tr,rr,ir)=>(Module._float4in_internal=wasmExports.float4in_internal)(e,t,tr,rr,ir),Module._strtof=(e,t)=>(Module._strtof=wasmExports.strtof)(e,t),Module._float_to_shortest_decimal_buf=(e,t)=>(Module._float_to_shortest_decimal_buf=wasmExports.float_to_shortest_decimal_buf)(e,t),Module._float8in_internal=(e,t,tr,rr,ir)=>(Module._float8in_internal=wasmExports.float8in_internal)(e,t,tr,rr,ir),Module._float8out_internal=e=>(Module._float8out_internal=wasmExports.float8out_internal)(e),Module._btfloat4cmp=e=>(Module._btfloat4cmp=wasmExports.btfloat4cmp)(e),Module._btfloat8cmp=e=>(Module._btfloat8cmp=wasmExports.btfloat8cmp)(e),Module._pow=(e,t)=>(Module._pow=wasmExports.pow)(e,t),Module._log10=e=>(Module._log10=wasmExports.log10)(e),Module._acos=e=>(Module._acos=wasmExports.acos)(e),Module._asin=e=>(Module._asin=wasmExports.asin)(e),Module._cos=e=>(Module._cos=wasmExports.cos)(e),Module._sin=e=>(Module._sin=wasmExports.sin)(e),Module._fmod=(e,t)=>(Module._fmod=wasmExports.fmod)(e,t),Module._construct_array=(e,t,tr,rr,ir,lr)=>(Module._construct_array=wasmExports.construct_array)(e,t,tr,rr,ir,lr),Module._try_relation_open=(e,t)=>(Module._try_relation_open=wasmExports.try_relation_open)(e,t),Module._forkname_to_number=e=>(Module._forkname_to_number=wasmExports.forkname_to_number)(e),Module._numeric_lt=e=>(Module._numeric_lt=wasmExports.numeric_lt)(e),Module._int64_to_numeric=e=>(Module._int64_to_numeric=wasmExports.int64_to_numeric)(e),Module._numeric_sub=e=>(Module._numeric_sub=wasmExports.numeric_sub)(e),Module._numeric_ge=e=>(Module._numeric_ge=wasmExports.numeric_ge)(e),Module._inet_in=e=>(Module._inet_in=wasmExports.inet_in)(e),Module._format_operator=e=>(Module._format_operator=wasmExports.format_operator)(e),Module._RelationIsVisible=e=>(Module._RelationIsVisible=wasmExports.RelationIsVisible)(e),Module._pg_get_indexdef_columns_extended=(e,t)=>(Module._pg_get_indexdef_columns_extended=wasmExports.pg_get_indexdef_columns_extended)(e,t),Module._accumArrayResult=(e,t,tr,rr,ir)=>(Module._accumArrayResult=wasmExports.accumArrayResult)(e,t,tr,rr,ir),Module._makeArrayResult=(e,t)=>(Module._makeArrayResult=wasmExports.makeArrayResult)(e,t),Module._init_local_reloptions=(e,t)=>(Module._init_local_reloptions=wasmExports.init_local_reloptions)(e,t),Module._add_local_int_reloption=(e,t,tr,rr,ir,lr,dr)=>(Module._add_local_int_reloption=wasmExports.add_local_int_reloption)(e,t,tr,rr,ir,lr,dr),Module._pg_inet_net_ntop=(e,t,tr,rr,ir)=>(Module._pg_inet_net_ntop=wasmExports.pg_inet_net_ntop)(e,t,tr,rr,ir),Module._network_cmp=e=>(Module._network_cmp=wasmExports.network_cmp)(e),Module._convert_network_to_scalar=(e,t,tr)=>(Module._convert_network_to_scalar=wasmExports.convert_network_to_scalar)(e,t,tr),Module._JsonbValueToJsonb=e=>(Module._JsonbValueToJsonb=wasmExports.JsonbValueToJsonb)(e),Module._pushJsonbValue=(e,t,tr)=>(Module._pushJsonbValue=wasmExports.pushJsonbValue)(e,t,tr),Module._numeric_cmp=e=>(Module._numeric_cmp=wasmExports.numeric_cmp)(e),Module._timetz_cmp=e=>(Module._timetz_cmp=wasmExports.timetz_cmp)(e),Module._date_cmp=e=>(Module._date_cmp=wasmExports.date_cmp)(e),Module._time_cmp=e=>(Module._time_cmp=wasmExports.time_cmp)(e),Module._timestamp_cmp=e=>(Module._timestamp_cmp=wasmExports.timestamp_cmp)(e),Module._domain_check=(e,t,tr,rr,ir)=>(Module._domain_check=wasmExports.domain_check)(e,t,tr,rr,ir),Module._initArrayResult=(e,t,tr)=>(Module._initArrayResult=wasmExports.initArrayResult)(e,t,tr),Module._path_is_prefix_of_path=(e,t)=>(Module._path_is_prefix_of_path=wasmExports.path_is_prefix_of_path)(e,t),Module._path_is_relative_and_below_cwd=e=>(Module._path_is_relative_and_below_cwd=wasmExports.path_is_relative_and_below_cwd)(e),Module._ArrayGetIntegerTypmods=(e,t)=>(Module._ArrayGetIntegerTypmods=wasmExports.ArrayGetIntegerTypmods)(e,t),Module._bpchareq=e=>(Module._bpchareq=wasmExports.bpchareq)(e),Module._varstr_cmp=(e,t,tr,rr,ir)=>(Module._varstr_cmp=wasmExports.varstr_cmp)(e,t,tr,rr,ir),Module._bpcharlt=e=>(Module._bpcharlt=wasmExports.bpcharlt)(e),Module._bpcharle=e=>(Module._bpcharle=wasmExports.bpcharle)(e),Module._bpchargt=e=>(Module._bpchargt=wasmExports.bpchargt)(e),Module._bpcharge=e=>(Module._bpcharge=wasmExports.bpcharge)(e),Module._bpcharcmp=e=>(Module._bpcharcmp=wasmExports.bpcharcmp)(e),Module._current_query=e=>(Module._current_query=wasmExports.current_query)(e),Module._str_tolower=(e,t,tr)=>(Module._str_tolower=wasmExports.str_tolower)(e,t,tr),Module._TransferExpandedObject=(e,t)=>(Module._TransferExpandedObject=wasmExports.TransferExpandedObject)(e,t),Module._macaddr_cmp=e=>(Module._macaddr_cmp=wasmExports.macaddr_cmp)(e),Module._macaddr_lt=e=>(Module._macaddr_lt=wasmExports.macaddr_lt)(e),Module._macaddr_le=e=>(Module._macaddr_le=wasmExports.macaddr_le)(e),Module._macaddr_eq=e=>(Module._macaddr_eq=wasmExports.macaddr_eq)(e),Module._macaddr_ge=e=>(Module._macaddr_ge=wasmExports.macaddr_ge)(e),Module._macaddr_gt=e=>(Module._macaddr_gt=wasmExports.macaddr_gt)(e),Module._quote_ident=e=>(Module._quote_ident=wasmExports.quote_ident)(e),Module._timestamp_in=e=>(Module._timestamp_in=wasmExports.timestamp_in)(e),Module._ParseDateTime=(e,t,tr,rr,ir,lr,dr)=>(Module._ParseDateTime=wasmExports.ParseDateTime)(e,t,tr,rr,ir,lr,dr),Module._DecodeDateTime=(e,t,tr,rr,ir,lr,dr,fr)=>(Module._DecodeDateTime=wasmExports.DecodeDateTime)(e,t,tr,rr,ir,lr,dr,fr),Module.___multi3=(e,t,tr,rr,ir)=>(Module.___multi3=wasmExports.__multi3)(e,t,tr,rr,ir),Module._timestamptz_in=e=>(Module._timestamptz_in=wasmExports.timestamptz_in)(e),Module._timestamp_eq=e=>(Module._timestamp_eq=wasmExports.timestamp_eq)(e),Module._timestamp_lt=e=>(Module._timestamp_lt=wasmExports.timestamp_lt)(e),Module._timestamp_gt=e=>(Module._timestamp_gt=wasmExports.timestamp_gt)(e),Module._timestamp_le=e=>(Module._timestamp_le=wasmExports.timestamp_le)(e),Module._timestamp_ge=e=>(Module._timestamp_ge=wasmExports.timestamp_ge)(e),Module._interval_eq=e=>(Module._interval_eq=wasmExports.interval_eq)(e),Module._interval_lt=e=>(Module._interval_lt=wasmExports.interval_lt)(e),Module._interval_gt=e=>(Module._interval_gt=wasmExports.interval_gt)(e),Module._interval_le=e=>(Module._interval_le=wasmExports.interval_le)(e),Module._interval_ge=e=>(Module._interval_ge=wasmExports.interval_ge)(e),Module._interval_cmp=e=>(Module._interval_cmp=wasmExports.interval_cmp)(e),Module._timestamp_mi=e=>(Module._timestamp_mi=wasmExports.timestamp_mi)(e),Module._interval_um=e=>(Module._interval_um=wasmExports.interval_um)(e),Module._interval_mi=e=>(Module._interval_mi=wasmExports.interval_mi)(e),Module._IsValidJsonNumber=(e,t)=>(Module._IsValidJsonNumber=wasmExports.IsValidJsonNumber)(e,t),Module._btnamecmp=e=>(Module._btnamecmp=wasmExports.btnamecmp)(e),Module._strncpy=(e,t,tr)=>(Module._strncpy=wasmExports.strncpy)(e,t,tr),Module._expand_array=(e,t,tr)=>(Module._expand_array=wasmExports.expand_array)(e,t,tr),Module._pg_get_encoding_from_locale=(e,t)=>(Module._pg_get_encoding_from_locale=wasmExports.pg_get_encoding_from_locale)(e,t),Module._localtime=e=>(Module._localtime=wasmExports.localtime)(e),Module._strftime=(e,t,tr,rr)=>(Module._strftime=wasmExports.strftime)(e,t,tr,rr),Module._numeric_is_nan=e=>(Module._numeric_is_nan=wasmExports.numeric_is_nan)(e),Module._numeric_eq=e=>(Module._numeric_eq=wasmExports.numeric_eq)(e),Module._numeric_gt=e=>(Module._numeric_gt=wasmExports.numeric_gt)(e),Module._numeric_le=e=>(Module._numeric_le=wasmExports.numeric_le)(e),Module._numeric_div=e=>(Module._numeric_div=wasmExports.numeric_div)(e),Module._numeric_float8_no_overflow=e=>(Module._numeric_float8_no_overflow=wasmExports.numeric_float8_no_overflow)(e),Module._numeric_float4=e=>(Module._numeric_float4=wasmExports.numeric_float4)(e),Module._date_eq=e=>(Module._date_eq=wasmExports.date_eq)(e),Module._date_lt=e=>(Module._date_lt=wasmExports.date_lt)(e),Module._date_le=e=>(Module._date_le=wasmExports.date_le)(e),Module._date_gt=e=>(Module._date_gt=wasmExports.date_gt)(e),Module._date_ge=e=>(Module._date_ge=wasmExports.date_ge)(e),Module._date_mi=e=>(Module._date_mi=wasmExports.date_mi)(e),Module._time_eq=e=>(Module._time_eq=wasmExports.time_eq)(e),Module._time_lt=e=>(Module._time_lt=wasmExports.time_lt)(e),Module._time_le=e=>(Module._time_le=wasmExports.time_le)(e),Module._time_gt=e=>(Module._time_gt=wasmExports.time_gt)(e),Module._time_ge=e=>(Module._time_ge=wasmExports.time_ge)(e),Module._time_mi_time=e=>(Module._time_mi_time=wasmExports.time_mi_time)(e),Module._get_extension_oid=(e,t)=>(Module._get_extension_oid=wasmExports.get_extension_oid)(e,t),Module._pg_ltoa=(e,t)=>(Module._pg_ltoa=wasmExports.pg_ltoa)(e,t),Module._varbit_in=e=>(Module._varbit_in=wasmExports.varbit_in)(e),Module._biteq=e=>(Module._biteq=wasmExports.biteq)(e),Module._bitlt=e=>(Module._bitlt=wasmExports.bitlt)(e),Module._bitle=e=>(Module._bitle=wasmExports.bitle)(e),Module._bitgt=e=>(Module._bitgt=wasmExports.bitgt)(e),Module._bitge=e=>(Module._bitge=wasmExports.bitge)(e),Module._bitcmp=e=>(Module._bitcmp=wasmExports.bitcmp)(e),Module._tidin=e=>(Module._tidin=wasmExports.tidin)(e),Module._tidout=e=>(Module._tidout=wasmExports.tidout)(e),Module._cash_cmp=e=>(Module._cash_cmp=wasmExports.cash_cmp)(e),Module._arraycontsel=e=>(Module._arraycontsel=wasmExports.arraycontsel)(e),Module._arraycontjoinsel=e=>(Module._arraycontjoinsel=wasmExports.arraycontjoinsel)(e),Module._text_lt=e=>(Module._text_lt=wasmExports.text_lt)(e),Module._text_le=e=>(Module._text_le=wasmExports.text_le)(e),Module._text_gt=e=>(Module._text_gt=wasmExports.text_gt)(e),Module._text_ge=e=>(Module._text_ge=wasmExports.text_ge)(e),Module._bttextcmp=e=>(Module._bttextcmp=wasmExports.bttextcmp)(e),Module._byteaeq=e=>(Module._byteaeq=wasmExports.byteaeq)(e),Module._bytealt=e=>(Module._bytealt=wasmExports.bytealt)(e),Module._byteale=e=>(Module._byteale=wasmExports.byteale)(e),Module._byteagt=e=>(Module._byteagt=wasmExports.byteagt)(e),Module._byteage=e=>(Module._byteage=wasmExports.byteage)(e),Module._byteacmp=e=>(Module._byteacmp=wasmExports.byteacmp)(e),Module._to_hex32=e=>(Module._to_hex32=wasmExports.to_hex32)(e),Module._varstr_levenshtein=(e,t,tr,rr,ir,lr,dr,fr)=>(Module._varstr_levenshtein=wasmExports.varstr_levenshtein)(e,t,tr,rr,ir,lr,dr,fr),Module._utf8_to_unicode=e=>(Module._utf8_to_unicode=wasmExports.utf8_to_unicode)(e),Module._format_type_extended=(e,t,tr)=>(Module._format_type_extended=wasmExports.format_type_extended)(e,t,tr),Module._array_create_iterator=(e,t,tr)=>(Module._array_create_iterator=wasmExports.array_create_iterator)(e,t,tr),Module._array_iterate=(e,t,tr)=>(Module._array_iterate=wasmExports.array_iterate)(e,t,tr),Module._make_expanded_record_from_typeid=(e,t,tr)=>(Module._make_expanded_record_from_typeid=wasmExports.make_expanded_record_from_typeid)(e,t,tr),Module._make_expanded_record_from_tupdesc=(e,t)=>(Module._make_expanded_record_from_tupdesc=wasmExports.make_expanded_record_from_tupdesc)(e,t),Module._make_expanded_record_from_exprecord=(e,t)=>(Module._make_expanded_record_from_exprecord=wasmExports.make_expanded_record_from_exprecord)(e,t),Module._expanded_record_set_tuple=(e,t,tr,rr)=>(Module._expanded_record_set_tuple=wasmExports.expanded_record_set_tuple)(e,t,tr,rr),Module._expanded_record_get_tuple=e=>(Module._expanded_record_get_tuple=wasmExports.expanded_record_get_tuple)(e),Module._deconstruct_expanded_record=e=>(Module._deconstruct_expanded_record=wasmExports.deconstruct_expanded_record)(e),Module._expanded_record_lookup_field=(e,t,tr)=>(Module._expanded_record_lookup_field=wasmExports.expanded_record_lookup_field)(e,t,tr),Module._expanded_record_set_field_internal=(e,t,tr,rr,ir,lr)=>(Module._expanded_record_set_field_internal=wasmExports.expanded_record_set_field_internal)(e,t,tr,rr,ir,lr),Module._expanded_record_set_fields=(e,t,tr,rr)=>(Module._expanded_record_set_fields=wasmExports.expanded_record_set_fields)(e,t,tr,rr),Module._macaddr8_cmp=e=>(Module._macaddr8_cmp=wasmExports.macaddr8_cmp)(e),Module._macaddr8_lt=e=>(Module._macaddr8_lt=wasmExports.macaddr8_lt)(e),Module._macaddr8_le=e=>(Module._macaddr8_le=wasmExports.macaddr8_le)(e),Module._macaddr8_eq=e=>(Module._macaddr8_eq=wasmExports.macaddr8_eq)(e),Module._macaddr8_ge=e=>(Module._macaddr8_ge=wasmExports.macaddr8_ge)(e),Module._macaddr8_gt=e=>(Module._macaddr8_gt=wasmExports.macaddr8_gt)(e),Module._enum_lt=e=>(Module._enum_lt=wasmExports.enum_lt)(e),Module._enum_le=e=>(Module._enum_le=wasmExports.enum_le)(e),Module._enum_ge=e=>(Module._enum_ge=wasmExports.enum_ge)(e),Module._enum_gt=e=>(Module._enum_gt=wasmExports.enum_gt)(e),Module._enum_cmp=e=>(Module._enum_cmp=wasmExports.enum_cmp)(e),Module._uuid_in=e=>(Module._uuid_in=wasmExports.uuid_in)(e),Module._uuid_out=e=>(Module._uuid_out=wasmExports.uuid_out)(e),Module._uuid_cmp=e=>(Module._uuid_cmp=wasmExports.uuid_cmp)(e),Module._gen_random_uuid=e=>(Module._gen_random_uuid=wasmExports.gen_random_uuid)(e),Module._generic_restriction_selectivity=(e,t,tr,rr,ir,lr)=>(Module._generic_restriction_selectivity=wasmExports.generic_restriction_selectivity)(e,t,tr,rr,ir,lr),Module._genericcostestimate=(e,t,tr,rr)=>(Module._genericcostestimate=wasmExports.genericcostestimate)(e,t,tr,rr),Module._pg_xml_init=e=>(Module._pg_xml_init=wasmExports.pg_xml_init)(e),Module._xmlInitParser=()=>(Module._xmlInitParser=wasmExports.xmlInitParser)(),Module._xml_ereport=(e,t,tr,rr)=>(Module._xml_ereport=wasmExports.xml_ereport)(e,t,tr,rr),Module._pg_xml_done=(e,t)=>(Module._pg_xml_done=wasmExports.pg_xml_done)(e,t),Module._xmlXPathNewContext=e=>(Module._xmlXPathNewContext=wasmExports.xmlXPathNewContext)(e),Module._xmlXPathFreeContext=e=>(Module._xmlXPathFreeContext=wasmExports.xmlXPathFreeContext)(e),Module._xmlFreeDoc=e=>(Module._xmlFreeDoc=wasmExports.xmlFreeDoc)(e),Module._xmlXPathCompile=e=>(Module._xmlXPathCompile=wasmExports.xmlXPathCompile)(e),Module._xmlXPathCompiledEval=(e,t)=>(Module._xmlXPathCompiledEval=wasmExports.xmlXPathCompiledEval)(e,t),Module._xmlXPathFreeCompExpr=e=>(Module._xmlXPathFreeCompExpr=wasmExports.xmlXPathFreeCompExpr)(e),Module._xmlStrdup=e=>(Module._xmlStrdup=wasmExports.xmlStrdup)(e),Module._strnlen=(e,t)=>(Module._strnlen=wasmExports.strnlen)(e,t),Module._xmlXPathCastNodeToString=e=>(Module._xmlXPathCastNodeToString=wasmExports.xmlXPathCastNodeToString)(e),Module._heap_modify_tuple_by_cols=(e,t,tr,rr,ir,lr)=>(Module._heap_modify_tuple_by_cols=wasmExports.heap_modify_tuple_by_cols)(e,t,tr,rr,ir,lr),Module._ResourceOwnerReleaseAllPlanCacheRefs=e=>(Module._ResourceOwnerReleaseAllPlanCacheRefs=wasmExports.ResourceOwnerReleaseAllPlanCacheRefs)(e),Module._RegisterResourceReleaseCallback=(e,t)=>(Module._RegisterResourceReleaseCallback=wasmExports.RegisterResourceReleaseCallback)(e,t),Module._PinPortal=e=>(Module._PinPortal=wasmExports.PinPortal)(e),Module._UnpinPortal=e=>(Module._UnpinPortal=wasmExports.UnpinPortal)(e),Module._btint2cmp=e=>(Module._btint2cmp=wasmExports.btint2cmp)(e),Module._btint4cmp=e=>(Module._btint4cmp=wasmExports.btint4cmp)(e),Module._btoidcmp=e=>(Module._btoidcmp=wasmExports.btoidcmp)(e),Module._btcharcmp=e=>(Module._btcharcmp=wasmExports.btcharcmp)(e),Module._btint8cmp=e=>(Module._btint8cmp=wasmExports.btint8cmp)(e),Module._btboolcmp=e=>(Module._btboolcmp=wasmExports.btboolcmp)(e),Module._GetPublicationByName=(e,t)=>(Module._GetPublicationByName=wasmExports.GetPublicationByName)(e,t),Module._GetTopMostAncestorInPublication=(e,t,tr)=>(Module._GetTopMostAncestorInPublication=wasmExports.GetTopMostAncestorInPublication)(e,t,tr),Module._pub_collist_to_bitmapset=(e,t,tr)=>(Module._pub_collist_to_bitmapset=wasmExports.pub_collist_to_bitmapset)(e,t,tr),Module._getExtensionOfObject=(e,t)=>(Module._getExtensionOfObject=wasmExports.getExtensionOfObject)(e,t),Module._visibilitymap_prepare_truncate=(e,t)=>(Module._visibilitymap_prepare_truncate=wasmExports.visibilitymap_prepare_truncate)(e,t),Module._log_newpage_range=(e,t,tr,rr,ir)=>(Module._log_newpage_range=wasmExports.log_newpage_range)(e,t,tr,rr,ir),Module._function_parse_error_transpose=e=>(Module._function_parse_error_transpose=wasmExports.function_parse_error_transpose)(e),Module._IndexGetRelation=(e,t)=>(Module._IndexGetRelation=wasmExports.IndexGetRelation)(e,t),Module._RelnameGetRelid=e=>(Module._RelnameGetRelid=wasmExports.RelnameGetRelid)(e),Module._standard_ProcessUtility=(e,t,tr,rr,ir,lr,dr,fr)=>(Module._standard_ProcessUtility=wasmExports.standard_ProcessUtility)(e,t,tr,rr,ir,lr,dr,fr),Module._Async_Notify=(e,t)=>(Module._Async_Notify=wasmExports.Async_Notify)(e,t),Module._sigaddset=(e,t)=>(Module._sigaddset=wasmExports.sigaddset)(e,t),Module._fsync_pgdata=(e,t)=>(Module._fsync_pgdata=wasmExports.fsync_pgdata)(e,t),Module._get_restricted_token=()=>(Module._get_restricted_token=wasmExports.get_restricted_token)(),Module._pg_malloc=e=>(Module._pg_malloc=wasmExports.pg_malloc)(e),Module._pg_realloc=(e,t)=>(Module._pg_realloc=wasmExports.pg_realloc)(e,t),Module._pg_strdup=e=>(Module._pg_strdup=wasmExports.pg_strdup)(e),Module._simple_prompt=(e,t)=>(Module._simple_prompt=wasmExports.simple_prompt)(e,t),Module._interactive_file=()=>(Module._interactive_file=wasmExports.interactive_file)(),Module._interactive_one=()=>(Module._interactive_one=wasmExports.interactive_one)(),Module._pg_shutdown=()=>(Module._pg_shutdown=wasmExports.pg_shutdown)(),Module._interactive_write=e=>(Module._interactive_write=wasmExports.interactive_write)(e),Module._interactive_read=()=>(Module._interactive_read=wasmExports.interactive_read)(),Module._visibilitymap_pin=(e,t,tr)=>(Module._visibilitymap_pin=wasmExports.visibilitymap_pin)(e,t,tr),Module._HeapTupleSatisfiesVacuum=(e,t,tr)=>(Module._HeapTupleSatisfiesVacuum=wasmExports.HeapTupleSatisfiesVacuum)(e,t,tr),Module._visibilitymap_clear=(e,t,tr,rr)=>(Module._visibilitymap_clear=wasmExports.visibilitymap_clear)(e,t,tr,rr),Module._vac_estimate_reltuples=(e,t,tr,rr)=>(Module._vac_estimate_reltuples=wasmExports.vac_estimate_reltuples)(e,t,tr,rr),Module._heap_tuple_needs_eventual_freeze=e=>(Module._heap_tuple_needs_eventual_freeze=wasmExports.heap_tuple_needs_eventual_freeze)(e),Module._HeapTupleSatisfiesUpdate=(e,t,tr)=>(Module._HeapTupleSatisfiesUpdate=wasmExports.HeapTupleSatisfiesUpdate)(e,t,tr),Module._HeapTupleGetUpdateXid=e=>(Module._HeapTupleGetUpdateXid=wasmExports.HeapTupleGetUpdateXid)(e),Module._HeapTupleSatisfiesVisibility=(e,t,tr)=>(Module._HeapTupleSatisfiesVisibility=wasmExports.HeapTupleSatisfiesVisibility)(e,t,tr),Module._GetMultiXactIdMembers=(e,t,tr,rr)=>(Module._GetMultiXactIdMembers=wasmExports.GetMultiXactIdMembers)(e,t,tr,rr),Module._XLogRecGetBlockTagExtended=(e,t,tr,rr,ir,lr)=>(Module._XLogRecGetBlockTagExtended=wasmExports.XLogRecGetBlockTagExtended)(e,t,tr,rr,ir,lr),Module._toast_open_indexes=(e,t,tr,rr)=>(Module._toast_open_indexes=wasmExports.toast_open_indexes)(e,t,tr,rr),Module._init_toast_snapshot=e=>(Module._init_toast_snapshot=wasmExports.init_toast_snapshot)(e),Module._toast_close_indexes=(e,t,tr)=>(Module._toast_close_indexes=wasmExports.toast_close_indexes)(e,t,tr),Module._index_getprocinfo=(e,t,tr)=>(Module._index_getprocinfo=wasmExports.index_getprocinfo)(e,t,tr),Module._identify_opfamily_groups=(e,t)=>(Module._identify_opfamily_groups=wasmExports.identify_opfamily_groups)(e,t),Module._check_amproc_signature=(e,t,tr,rr,ir,lr)=>(Module._check_amproc_signature=wasmExports.check_amproc_signature)(e,t,tr,rr,ir,lr),Module._check_amoptsproc_signature=e=>(Module._check_amoptsproc_signature=wasmExports.check_amoptsproc_signature)(e),Module._check_amop_signature=(e,t,tr,rr)=>(Module._check_amop_signature=wasmExports.check_amop_signature)(e,t,tr,rr),Module._RelationGetIndexScan=(e,t,tr)=>(Module._RelationGetIndexScan=wasmExports.RelationGetIndexScan)(e,t,tr),Module.__hash_get_indextuple_hashkey=e=>(Module.__hash_get_indextuple_hashkey=wasmExports._hash_get_indextuple_hashkey)(e),Module.__hash_getbuf=(e,t,tr,rr)=>(Module.__hash_getbuf=wasmExports._hash_getbuf)(e,t,tr,rr),Module.__hash_relbuf=(e,t)=>(Module.__hash_relbuf=wasmExports._hash_relbuf)(e,t),Module.__hash_getbuf_with_strategy=(e,t,tr,rr,ir)=>(Module.__hash_getbuf_with_strategy=wasmExports._hash_getbuf_with_strategy)(e,t,tr,rr,ir),Module._build_reloptions=(e,t,tr,rr,ir,lr)=>(Module._build_reloptions=wasmExports.build_reloptions)(e,t,tr,rr,ir,lr),Module._index_form_tuple=(e,t,tr)=>(Module._index_form_tuple=wasmExports.index_form_tuple)(e,t,tr),Module.__hash_ovflblkno_to_bitno=(e,t)=>(Module.__hash_ovflblkno_to_bitno=wasmExports._hash_ovflblkno_to_bitno)(e,t),Module._brin_build_desc=e=>(Module._brin_build_desc=wasmExports.brin_build_desc)(e),Module._brin_deform_tuple=(e,t,tr)=>(Module._brin_deform_tuple=wasmExports.brin_deform_tuple)(e,t,tr),Module._brin_free_desc=e=>(Module._brin_free_desc=wasmExports.brin_free_desc)(e),Module._XLogRecGetBlockRefInfo=(e,t,tr,rr,ir)=>(Module._XLogRecGetBlockRefInfo=wasmExports.XLogRecGetBlockRefInfo)(e,t,tr,rr,ir),Module._ginPostingListDecode=(e,t)=>(Module._ginPostingListDecode=wasmExports.ginPostingListDecode)(e,t),Module._add_reloption_kind=()=>(Module._add_reloption_kind=wasmExports.add_reloption_kind)(),Module._register_reloptions_validator=(e,t)=>(Module._register_reloptions_validator=wasmExports.register_reloptions_validator)(e,t),Module._add_int_reloption=(e,t,tr,rr,ir,lr,dr)=>(Module._add_int_reloption=wasmExports.add_int_reloption)(e,t,tr,rr,ir,lr,dr),Module._XLogFindNextRecord=(e,t)=>(Module._XLogFindNextRecord=wasmExports.XLogFindNextRecord)(e,t),Module._RestoreBlockImage=(e,t,tr)=>(Module._RestoreBlockImage=wasmExports.RestoreBlockImage)(e,t,tr),Module._GenericXLogStart=e=>(Module._GenericXLogStart=wasmExports.GenericXLogStart)(e),Module._GenericXLogRegisterBuffer=(e,t,tr)=>(Module._GenericXLogRegisterBuffer=wasmExports.GenericXLogRegisterBuffer)(e,t,tr),Module._GenericXLogFinish=e=>(Module._GenericXLogFinish=wasmExports.GenericXLogFinish)(e),Module._GenericXLogAbort=e=>(Module._GenericXLogAbort=wasmExports.GenericXLogAbort)(e),Module._read_local_xlog_page_no_wait=(e,t,tr,rr,ir)=>(Module._read_local_xlog_page_no_wait=wasmExports.read_local_xlog_page_no_wait)(e,t,tr,rr,ir),Module._XLogRecStoreStats=(e,t)=>(Module._XLogRecStoreStats=wasmExports.XLogRecStoreStats)(e,t),Module._ReadMultiXactIdRange=(e,t)=>(Module._ReadMultiXactIdRange=wasmExports.ReadMultiXactIdRange)(e,t),Module._MultiXactIdPrecedesOrEquals=(e,t)=>(Module._MultiXactIdPrecedesOrEquals=wasmExports.MultiXactIdPrecedesOrEquals)(e,t),Module._RegisterXactCallback=(e,t)=>(Module._RegisterXactCallback=wasmExports.RegisterXactCallback)(e,t),Module._RegisterSubXactCallback=(e,t)=>(Module._RegisterSubXactCallback=wasmExports.RegisterSubXactCallback)(e,t),Module._ReleaseCurrentSubTransaction=()=>(Module._ReleaseCurrentSubTransaction=wasmExports.ReleaseCurrentSubTransaction)(),Module._WaitForParallelWorkersToAttach=e=>(Module._WaitForParallelWorkersToAttach=wasmExports.WaitForParallelWorkersToAttach)(e),Module.__bt_allequalimage=(e,t)=>(Module.__bt_allequalimage=wasmExports._bt_allequalimage)(e,t),Module.__bt_checkpage=(e,t)=>(Module.__bt_checkpage=wasmExports._bt_checkpage)(e,t),Module.__bt_relbuf=(e,t)=>(Module.__bt_relbuf=wasmExports._bt_relbuf)(e,t),Module.__bt_metaversion=(e,t,tr)=>(Module.__bt_metaversion=wasmExports._bt_metaversion)(e,t,tr),Module.__bt_search=(e,t,tr,rr,ir,lr)=>(Module.__bt_search=wasmExports._bt_search)(e,t,tr,rr,ir,lr),Module.__bt_compare=(e,t,tr,rr)=>(Module.__bt_compare=wasmExports._bt_compare)(e,t,tr,rr),Module.__bt_binsrch_insert=(e,t)=>(Module.__bt_binsrch_insert=wasmExports._bt_binsrch_insert)(e,t),Module.__bt_freestack=e=>(Module.__bt_freestack=wasmExports._bt_freestack)(e),Module.__bt_form_posting=(e,t,tr)=>(Module.__bt_form_posting=wasmExports._bt_form_posting)(e,t,tr),Module.__bt_check_natts=(e,t,tr,rr)=>(Module.__bt_check_natts=wasmExports._bt_check_natts)(e,t,tr,rr),Module._gistcheckpage=(e,t)=>(Module._gistcheckpage=wasmExports.gistcheckpage)(e,t),Module._EndCopyFrom=e=>(Module._EndCopyFrom=wasmExports.EndCopyFrom)(e),Module._ProcessCopyOptions=(e,t,tr,rr)=>(Module._ProcessCopyOptions=wasmExports.ProcessCopyOptions)(e,t,tr,rr),Module._CopyFromErrorCallback=e=>(Module._CopyFromErrorCallback=wasmExports.CopyFromErrorCallback)(e),Module._NextCopyFrom=(e,t,tr,rr)=>(Module._NextCopyFrom=wasmExports.NextCopyFrom)(e,t,tr,rr),Module._nextval=e=>(Module._nextval=wasmExports.nextval)(e),Module._defGetStreamingMode=e=>(Module._defGetStreamingMode=wasmExports.defGetStreamingMode)(e),Module._ExplainBeginOutput=e=>(Module._ExplainBeginOutput=wasmExports.ExplainBeginOutput)(e),Module._NewExplainState=()=>(Module._NewExplainState=wasmExports.NewExplainState)(),Module._ExplainEndOutput=e=>(Module._ExplainEndOutput=wasmExports.ExplainEndOutput)(e),Module._ExplainPrintPlan=(e,t)=>(Module._ExplainPrintPlan=wasmExports.ExplainPrintPlan)(e,t),Module._ExplainPrintTriggers=(e,t)=>(Module._ExplainPrintTriggers=wasmExports.ExplainPrintTriggers)(e,t),Module._ExplainPrintJITSummary=(e,t)=>(Module._ExplainPrintJITSummary=wasmExports.ExplainPrintJITSummary)(e,t),Module._ExplainPropertyInteger=(e,t,tr,rr)=>(Module._ExplainPropertyInteger=wasmExports.ExplainPropertyInteger)(e,t,tr,rr),Module._ExplainQueryText=(e,t)=>(Module._ExplainQueryText=wasmExports.ExplainQueryText)(e,t),Module._ExplainPropertyText=(e,t,tr)=>(Module._ExplainPropertyText=wasmExports.ExplainPropertyText)(e,t,tr),Module._ExplainQueryParameters=(e,t,tr)=>(Module._ExplainQueryParameters=wasmExports.ExplainQueryParameters)(e,t,tr),Module._pg_is_ascii=e=>(Module._pg_is_ascii=wasmExports.pg_is_ascii)(e),Module._fputs=(e,t)=>(Module._fputs=wasmExports.fputs)(e,t),Module._popen=(e,t)=>(Module._popen=wasmExports.popen)(e,t),Module._float_to_shortest_decimal_bufn=(e,t)=>(Module._float_to_shortest_decimal_bufn=wasmExports.float_to_shortest_decimal_bufn)(e,t),Module._pg_prng_uint64=e=>(Module._pg_prng_uint64=wasmExports.pg_prng_uint64)(e),Module._scram_ClientKey=(e,t,tr,rr,ir)=>(Module._scram_ClientKey=wasmExports.scram_ClientKey)(e,t,tr,rr,ir),Module._pg_encoding_dsplen=(e,t)=>(Module._pg_encoding_dsplen=wasmExports.pg_encoding_dsplen)(e,t),Module._getcwd=(e,t)=>(Module._getcwd=wasmExports.getcwd)(e,t),Module._pg_get_user_home_dir=(e,t,tr)=>(Module._pg_get_user_home_dir=wasmExports.pg_get_user_home_dir)(e,t,tr),Module._nanosleep=(e,t)=>(Module._nanosleep=wasmExports.nanosleep)(e,t),Module._snprintf=(e,t,tr,rr)=>(Module._snprintf=wasmExports.snprintf)(e,t,tr,rr),Module._pg_strerror_r=(e,t,tr)=>(Module._pg_strerror_r=wasmExports.pg_strerror_r)(e,t,tr),Module._pthread_mutex_lock=e=>(Module._pthread_mutex_lock=wasmExports.pthread_mutex_lock)(e),Module._pthread_mutex_unlock=e=>(Module._pthread_mutex_unlock=wasmExports.pthread_mutex_unlock)(e),Module._strncat=(e,t,tr)=>(Module._strncat=wasmExports.strncat)(e,t,tr),Module._PQexec=(e,t)=>(Module._PQexec=wasmExports.PQexec)(e,t),Module._PQsetSingleRowMode=e=>(Module._PQsetSingleRowMode=wasmExports.PQsetSingleRowMode)(e),Module._PQcmdStatus=e=>(Module._PQcmdStatus=wasmExports.PQcmdStatus)(e),Module._pthread_sigmask=(e,t,tr)=>(Module._pthread_sigmask=wasmExports.pthread_sigmask)(e,t,tr),Module._sigismember=(e,t)=>(Module._sigismember=wasmExports.sigismember)(e,t),Module._sigpending=e=>(Module._sigpending=wasmExports.sigpending)(e),Module._sigwait=(e,t)=>(Module._sigwait=wasmExports.sigwait)(e,t),Module._isolat1ToUTF8=(e,t,tr,rr)=>(Module._isolat1ToUTF8=wasmExports.isolat1ToUTF8)(e,t,tr,rr),Module._UTF8Toisolat1=(e,t,tr,rr)=>(Module._UTF8Toisolat1=wasmExports.UTF8Toisolat1)(e,t,tr,rr),Module._vfprintf=(e,t,tr)=>(Module._vfprintf=wasmExports.vfprintf)(e,t,tr),Module._vsnprintf=(e,t,tr,rr)=>(Module._vsnprintf=wasmExports.vsnprintf)(e,t,tr,rr),Module._xmlParserValidityWarning=(e,t,tr)=>(Module._xmlParserValidityWarning=wasmExports.xmlParserValidityWarning)(e,t,tr),Module._xmlParserValidityError=(e,t,tr)=>(Module._xmlParserValidityError=wasmExports.xmlParserValidityError)(e,t,tr),Module._xmlParserError=(e,t,tr)=>(Module._xmlParserError=wasmExports.xmlParserError)(e,t,tr),Module._xmlParserWarning=(e,t,tr)=>(Module._xmlParserWarning=wasmExports.xmlParserWarning)(e,t,tr),Module._fprintf=(e,t,tr)=>(Module._fprintf=wasmExports.fprintf)(e,t,tr),Module.___xmlParserInputBufferCreateFilename=(e,t)=>(Module.___xmlParserInputBufferCreateFilename=wasmExports.__xmlParserInputBufferCreateFilename)(e,t),Module.___xmlOutputBufferCreateFilename=(e,t,tr)=>(Module.___xmlOutputBufferCreateFilename=wasmExports.__xmlOutputBufferCreateFilename)(e,t,tr),Module._xmlSAX2InternalSubset=(e,t,tr,rr)=>(Module._xmlSAX2InternalSubset=wasmExports.xmlSAX2InternalSubset)(e,t,tr,rr),Module._xmlSAX2IsStandalone=e=>(Module._xmlSAX2IsStandalone=wasmExports.xmlSAX2IsStandalone)(e),Module._xmlSAX2HasInternalSubset=e=>(Module._xmlSAX2HasInternalSubset=wasmExports.xmlSAX2HasInternalSubset)(e),Module._xmlSAX2HasExternalSubset=e=>(Module._xmlSAX2HasExternalSubset=wasmExports.xmlSAX2HasExternalSubset)(e),Module._xmlSAX2ResolveEntity=(e,t,tr)=>(Module._xmlSAX2ResolveEntity=wasmExports.xmlSAX2ResolveEntity)(e,t,tr),Module._xmlSAX2GetEntity=(e,t)=>(Module._xmlSAX2GetEntity=wasmExports.xmlSAX2GetEntity)(e,t),Module._xmlSAX2EntityDecl=(e,t,tr,rr,ir,lr)=>(Module._xmlSAX2EntityDecl=wasmExports.xmlSAX2EntityDecl)(e,t,tr,rr,ir,lr),Module._xmlSAX2NotationDecl=(e,t,tr,rr)=>(Module._xmlSAX2NotationDecl=wasmExports.xmlSAX2NotationDecl)(e,t,tr,rr),Module._xmlSAX2AttributeDecl=(e,t,tr,rr,ir,lr,dr)=>(Module._xmlSAX2AttributeDecl=wasmExports.xmlSAX2AttributeDecl)(e,t,tr,rr,ir,lr,dr),Module._xmlSAX2ElementDecl=(e,t,tr,rr)=>(Module._xmlSAX2ElementDecl=wasmExports.xmlSAX2ElementDecl)(e,t,tr,rr),Module._xmlSAX2UnparsedEntityDecl=(e,t,tr,rr,ir)=>(Module._xmlSAX2UnparsedEntityDecl=wasmExports.xmlSAX2UnparsedEntityDecl)(e,t,tr,rr,ir),Module._xmlSAX2SetDocumentLocator=(e,t)=>(Module._xmlSAX2SetDocumentLocator=wasmExports.xmlSAX2SetDocumentLocator)(e,t),Module._xmlSAX2StartDocument=e=>(Module._xmlSAX2StartDocument=wasmExports.xmlSAX2StartDocument)(e),Module._xmlSAX2EndDocument=e=>(Module._xmlSAX2EndDocument=wasmExports.xmlSAX2EndDocument)(e),Module._xmlSAX2StartElement=(e,t,tr)=>(Module._xmlSAX2StartElement=wasmExports.xmlSAX2StartElement)(e,t,tr),Module._xmlSAX2EndElement=(e,t)=>(Module._xmlSAX2EndElement=wasmExports.xmlSAX2EndElement)(e,t),Module._xmlSAX2Reference=(e,t)=>(Module._xmlSAX2Reference=wasmExports.xmlSAX2Reference)(e,t),Module._xmlSAX2Characters=(e,t,tr)=>(Module._xmlSAX2Characters=wasmExports.xmlSAX2Characters)(e,t,tr),Module._xmlSAX2ProcessingInstruction=(e,t,tr)=>(Module._xmlSAX2ProcessingInstruction=wasmExports.xmlSAX2ProcessingInstruction)(e,t,tr),Module._xmlSAX2Comment=(e,t)=>(Module._xmlSAX2Comment=wasmExports.xmlSAX2Comment)(e,t),Module._xmlSAX2GetParameterEntity=(e,t)=>(Module._xmlSAX2GetParameterEntity=wasmExports.xmlSAX2GetParameterEntity)(e,t),Module._xmlSAX2CDataBlock=(e,t,tr)=>(Module._xmlSAX2CDataBlock=wasmExports.xmlSAX2CDataBlock)(e,t,tr),Module._xmlSAX2ExternalSubset=(e,t,tr,rr)=>(Module._xmlSAX2ExternalSubset=wasmExports.xmlSAX2ExternalSubset)(e,t,tr,rr),Module._xmlSAX2GetPublicId=e=>(Module._xmlSAX2GetPublicId=wasmExports.xmlSAX2GetPublicId)(e),Module._xmlSAX2GetSystemId=e=>(Module._xmlSAX2GetSystemId=wasmExports.xmlSAX2GetSystemId)(e),Module._xmlSAX2GetLineNumber=e=>(Module._xmlSAX2GetLineNumber=wasmExports.xmlSAX2GetLineNumber)(e),Module._xmlSAX2GetColumnNumber=e=>(Module._xmlSAX2GetColumnNumber=wasmExports.xmlSAX2GetColumnNumber)(e),Module._xmlSAX2IgnorableWhitespace=(e,t,tr)=>(Module._xmlSAX2IgnorableWhitespace=wasmExports.xmlSAX2IgnorableWhitespace)(e,t,tr),Module._xmlHashDefaultDeallocator=(e,t)=>(Module._xmlHashDefaultDeallocator=wasmExports.xmlHashDefaultDeallocator)(e,t),Module._iconv_open=(e,t)=>(Module._iconv_open=wasmExports.iconv_open)(e,t),Module._iconv_close=e=>(Module._iconv_close=wasmExports.iconv_close)(e),Module._iconv=(e,t,tr,rr,ir)=>(Module._iconv=wasmExports.iconv)(e,t,tr,rr,ir),Module._UTF8ToHtml=(e,t,tr,rr)=>(Module._UTF8ToHtml=wasmExports.UTF8ToHtml)(e,t,tr,rr),Module._xmlReadMemory=(e,t,tr,rr,ir)=>(Module._xmlReadMemory=wasmExports.xmlReadMemory)(e,t,tr,rr,ir),Module._xmlSAX2StartElementNs=(e,t,tr,rr,ir,lr,dr,fr,hr)=>(Module._xmlSAX2StartElementNs=wasmExports.xmlSAX2StartElementNs)(e,t,tr,rr,ir,lr,dr,fr,hr),Module._xmlSAX2EndElementNs=(e,t,tr,rr)=>(Module._xmlSAX2EndElementNs=wasmExports.xmlSAX2EndElementNs)(e,t,tr,rr),Module.___cxa_atexit=(e,t,tr)=>(Module.___cxa_atexit=wasmExports.__cxa_atexit)(e,t,tr),Module._xmlDocGetRootElement=e=>(Module._xmlDocGetRootElement=wasmExports.xmlDocGetRootElement)(e),Module._xmlFileMatch=e=>(Module._xmlFileMatch=wasmExports.xmlFileMatch)(e),Module._xmlFileOpen=e=>(Module._xmlFileOpen=wasmExports.xmlFileOpen)(e),Module._xmlFileRead=(e,t,tr)=>(Module._xmlFileRead=wasmExports.xmlFileRead)(e,t,tr),Module._xmlFileClose=e=>(Module._xmlFileClose=wasmExports.xmlFileClose)(e),Module._gzread=(e,t,tr)=>(Module._gzread=wasmExports.gzread)(e,t,tr),Module._gzclose=e=>(Module._gzclose=wasmExports.gzclose)(e),Module._gzdirect=e=>(Module._gzdirect=wasmExports.gzdirect)(e),Module._gzdopen=(e,t)=>(Module._gzdopen=wasmExports.gzdopen)(e,t),Module._gzopen=(e,t)=>(Module._gzopen=wasmExports.gzopen)(e,t),Module._gzwrite=(e,t,tr)=>(Module._gzwrite=wasmExports.gzwrite)(e,t,tr),Module._xmlUCSIsCatNd=e=>(Module._xmlUCSIsCatNd=wasmExports.xmlUCSIsCatNd)(e),Module._xmlUCSIsCatP=e=>(Module._xmlUCSIsCatP=wasmExports.xmlUCSIsCatP)(e),Module._xmlUCSIsCatZ=e=>(Module._xmlUCSIsCatZ=wasmExports.xmlUCSIsCatZ)(e),Module._xmlUCSIsCatC=e=>(Module._xmlUCSIsCatC=wasmExports.xmlUCSIsCatC)(e),Module._xmlUCSIsCatL=e=>(Module._xmlUCSIsCatL=wasmExports.xmlUCSIsCatL)(e),Module._xmlUCSIsCatLu=e=>(Module._xmlUCSIsCatLu=wasmExports.xmlUCSIsCatLu)(e),Module._xmlUCSIsCatLl=e=>(Module._xmlUCSIsCatLl=wasmExports.xmlUCSIsCatLl)(e),Module._xmlUCSIsCatLt=e=>(Module._xmlUCSIsCatLt=wasmExports.xmlUCSIsCatLt)(e),Module._xmlUCSIsCatLm=e=>(Module._xmlUCSIsCatLm=wasmExports.xmlUCSIsCatLm)(e),Module._xmlUCSIsCatLo=e=>(Module._xmlUCSIsCatLo=wasmExports.xmlUCSIsCatLo)(e),Module._xmlUCSIsCatM=e=>(Module._xmlUCSIsCatM=wasmExports.xmlUCSIsCatM)(e),Module._xmlUCSIsCatMn=e=>(Module._xmlUCSIsCatMn=wasmExports.xmlUCSIsCatMn)(e),Module._xmlUCSIsCatMc=e=>(Module._xmlUCSIsCatMc=wasmExports.xmlUCSIsCatMc)(e),Module._xmlUCSIsCatMe=e=>(Module._xmlUCSIsCatMe=wasmExports.xmlUCSIsCatMe)(e),Module._xmlUCSIsCatN=e=>(Module._xmlUCSIsCatN=wasmExports.xmlUCSIsCatN)(e),Module._xmlUCSIsCatNl=e=>(Module._xmlUCSIsCatNl=wasmExports.xmlUCSIsCatNl)(e),Module._xmlUCSIsCatNo=e=>(Module._xmlUCSIsCatNo=wasmExports.xmlUCSIsCatNo)(e),Module._xmlUCSIsCatPc=e=>(Module._xmlUCSIsCatPc=wasmExports.xmlUCSIsCatPc)(e),Module._xmlUCSIsCatPd=e=>(Module._xmlUCSIsCatPd=wasmExports.xmlUCSIsCatPd)(e),Module._xmlUCSIsCatPs=e=>(Module._xmlUCSIsCatPs=wasmExports.xmlUCSIsCatPs)(e),Module._xmlUCSIsCatPe=e=>(Module._xmlUCSIsCatPe=wasmExports.xmlUCSIsCatPe)(e),Module._xmlUCSIsCatPi=e=>(Module._xmlUCSIsCatPi=wasmExports.xmlUCSIsCatPi)(e),Module._xmlUCSIsCatPf=e=>(Module._xmlUCSIsCatPf=wasmExports.xmlUCSIsCatPf)(e),Module._xmlUCSIsCatPo=e=>(Module._xmlUCSIsCatPo=wasmExports.xmlUCSIsCatPo)(e),Module._xmlUCSIsCatZs=e=>(Module._xmlUCSIsCatZs=wasmExports.xmlUCSIsCatZs)(e),Module._xmlUCSIsCatZl=e=>(Module._xmlUCSIsCatZl=wasmExports.xmlUCSIsCatZl)(e),Module._xmlUCSIsCatZp=e=>(Module._xmlUCSIsCatZp=wasmExports.xmlUCSIsCatZp)(e),Module._xmlUCSIsCatS=e=>(Module._xmlUCSIsCatS=wasmExports.xmlUCSIsCatS)(e),Module._xmlUCSIsCatSm=e=>(Module._xmlUCSIsCatSm=wasmExports.xmlUCSIsCatSm)(e),Module._xmlUCSIsCatSc=e=>(Module._xmlUCSIsCatSc=wasmExports.xmlUCSIsCatSc)(e),Module._xmlUCSIsCatSk=e=>(Module._xmlUCSIsCatSk=wasmExports.xmlUCSIsCatSk)(e),Module._xmlUCSIsCatSo=e=>(Module._xmlUCSIsCatSo=wasmExports.xmlUCSIsCatSo)(e),Module._xmlUCSIsCatCc=e=>(Module._xmlUCSIsCatCc=wasmExports.xmlUCSIsCatCc)(e),Module._xmlUCSIsCatCf=e=>(Module._xmlUCSIsCatCf=wasmExports.xmlUCSIsCatCf)(e),Module._xmlUCSIsCatCo=e=>(Module._xmlUCSIsCatCo=wasmExports.xmlUCSIsCatCo)(e),Module._xmlUCSIsAegeanNumbers=e=>(Module._xmlUCSIsAegeanNumbers=wasmExports.xmlUCSIsAegeanNumbers)(e),Module._xmlUCSIsAlphabeticPresentationForms=e=>(Module._xmlUCSIsAlphabeticPresentationForms=wasmExports.xmlUCSIsAlphabeticPresentationForms)(e),Module._xmlUCSIsArabic=e=>(Module._xmlUCSIsArabic=wasmExports.xmlUCSIsArabic)(e),Module._xmlUCSIsArabicPresentationFormsA=e=>(Module._xmlUCSIsArabicPresentationFormsA=wasmExports.xmlUCSIsArabicPresentationFormsA)(e),Module._xmlUCSIsArabicPresentationFormsB=e=>(Module._xmlUCSIsArabicPresentationFormsB=wasmExports.xmlUCSIsArabicPresentationFormsB)(e),Module._xmlUCSIsArmenian=e=>(Module._xmlUCSIsArmenian=wasmExports.xmlUCSIsArmenian)(e),Module._xmlUCSIsArrows=e=>(Module._xmlUCSIsArrows=wasmExports.xmlUCSIsArrows)(e),Module._xmlUCSIsBasicLatin=e=>(Module._xmlUCSIsBasicLatin=wasmExports.xmlUCSIsBasicLatin)(e),Module._xmlUCSIsBengali=e=>(Module._xmlUCSIsBengali=wasmExports.xmlUCSIsBengali)(e),Module._xmlUCSIsBlockElements=e=>(Module._xmlUCSIsBlockElements=wasmExports.xmlUCSIsBlockElements)(e),Module._xmlUCSIsBopomofo=e=>(Module._xmlUCSIsBopomofo=wasmExports.xmlUCSIsBopomofo)(e),Module._xmlUCSIsBopomofoExtended=e=>(Module._xmlUCSIsBopomofoExtended=wasmExports.xmlUCSIsBopomofoExtended)(e),Module._xmlUCSIsBoxDrawing=e=>(Module._xmlUCSIsBoxDrawing=wasmExports.xmlUCSIsBoxDrawing)(e),Module._xmlUCSIsBraillePatterns=e=>(Module._xmlUCSIsBraillePatterns=wasmExports.xmlUCSIsBraillePatterns)(e),Module._xmlUCSIsBuhid=e=>(Module._xmlUCSIsBuhid=wasmExports.xmlUCSIsBuhid)(e),Module._xmlUCSIsByzantineMusicalSymbols=e=>(Module._xmlUCSIsByzantineMusicalSymbols=wasmExports.xmlUCSIsByzantineMusicalSymbols)(e),Module._xmlUCSIsCJKCompatibility=e=>(Module._xmlUCSIsCJKCompatibility=wasmExports.xmlUCSIsCJKCompatibility)(e),Module._xmlUCSIsCJKCompatibilityForms=e=>(Module._xmlUCSIsCJKCompatibilityForms=wasmExports.xmlUCSIsCJKCompatibilityForms)(e),Module._xmlUCSIsCJKCompatibilityIdeographs=e=>(Module._xmlUCSIsCJKCompatibilityIdeographs=wasmExports.xmlUCSIsCJKCompatibilityIdeographs)(e),Module._xmlUCSIsCJKCompatibilityIdeographsSupplement=e=>(Module._xmlUCSIsCJKCompatibilityIdeographsSupplement=wasmExports.xmlUCSIsCJKCompatibilityIdeographsSupplement)(e),Module._xmlUCSIsCJKRadicalsSupplement=e=>(Module._xmlUCSIsCJKRadicalsSupplement=wasmExports.xmlUCSIsCJKRadicalsSupplement)(e),Module._xmlUCSIsCJKSymbolsandPunctuation=e=>(Module._xmlUCSIsCJKSymbolsandPunctuation=wasmExports.xmlUCSIsCJKSymbolsandPunctuation)(e),Module._xmlUCSIsCJKUnifiedIdeographs=e=>(Module._xmlUCSIsCJKUnifiedIdeographs=wasmExports.xmlUCSIsCJKUnifiedIdeographs)(e),Module._xmlUCSIsCJKUnifiedIdeographsExtensionA=e=>(Module._xmlUCSIsCJKUnifiedIdeographsExtensionA=wasmExports.xmlUCSIsCJKUnifiedIdeographsExtensionA)(e),Module._xmlUCSIsCJKUnifiedIdeographsExtensionB=e=>(Module._xmlUCSIsCJKUnifiedIdeographsExtensionB=wasmExports.xmlUCSIsCJKUnifiedIdeographsExtensionB)(e),Module._xmlUCSIsCherokee=e=>(Module._xmlUCSIsCherokee=wasmExports.xmlUCSIsCherokee)(e),Module._xmlUCSIsCombiningDiacriticalMarks=e=>(Module._xmlUCSIsCombiningDiacriticalMarks=wasmExports.xmlUCSIsCombiningDiacriticalMarks)(e),Module._xmlUCSIsCombiningDiacriticalMarksforSymbols=e=>(Module._xmlUCSIsCombiningDiacriticalMarksforSymbols=wasmExports.xmlUCSIsCombiningDiacriticalMarksforSymbols)(e),Module._xmlUCSIsCombiningHalfMarks=e=>(Module._xmlUCSIsCombiningHalfMarks=wasmExports.xmlUCSIsCombiningHalfMarks)(e),Module._xmlUCSIsCombiningMarksforSymbols=e=>(Module._xmlUCSIsCombiningMarksforSymbols=wasmExports.xmlUCSIsCombiningMarksforSymbols)(e),Module._xmlUCSIsControlPictures=e=>(Module._xmlUCSIsControlPictures=wasmExports.xmlUCSIsControlPictures)(e),Module._xmlUCSIsCurrencySymbols=e=>(Module._xmlUCSIsCurrencySymbols=wasmExports.xmlUCSIsCurrencySymbols)(e),Module._xmlUCSIsCypriotSyllabary=e=>(Module._xmlUCSIsCypriotSyllabary=wasmExports.xmlUCSIsCypriotSyllabary)(e),Module._xmlUCSIsCyrillic=e=>(Module._xmlUCSIsCyrillic=wasmExports.xmlUCSIsCyrillic)(e),Module._xmlUCSIsCyrillicSupplement=e=>(Module._xmlUCSIsCyrillicSupplement=wasmExports.xmlUCSIsCyrillicSupplement)(e),Module._xmlUCSIsDeseret=e=>(Module._xmlUCSIsDeseret=wasmExports.xmlUCSIsDeseret)(e),Module._xmlUCSIsDevanagari=e=>(Module._xmlUCSIsDevanagari=wasmExports.xmlUCSIsDevanagari)(e),Module._xmlUCSIsDingbats=e=>(Module._xmlUCSIsDingbats=wasmExports.xmlUCSIsDingbats)(e),Module._xmlUCSIsEnclosedAlphanumerics=e=>(Module._xmlUCSIsEnclosedAlphanumerics=wasmExports.xmlUCSIsEnclosedAlphanumerics)(e),Module._xmlUCSIsEnclosedCJKLettersandMonths=e=>(Module._xmlUCSIsEnclosedCJKLettersandMonths=wasmExports.xmlUCSIsEnclosedCJKLettersandMonths)(e),Module._xmlUCSIsEthiopic=e=>(Module._xmlUCSIsEthiopic=wasmExports.xmlUCSIsEthiopic)(e),Module._xmlUCSIsGeneralPunctuation=e=>(Module._xmlUCSIsGeneralPunctuation=wasmExports.xmlUCSIsGeneralPunctuation)(e),Module._xmlUCSIsGeometricShapes=e=>(Module._xmlUCSIsGeometricShapes=wasmExports.xmlUCSIsGeometricShapes)(e),Module._xmlUCSIsGeorgian=e=>(Module._xmlUCSIsGeorgian=wasmExports.xmlUCSIsGeorgian)(e),Module._xmlUCSIsGothic=e=>(Module._xmlUCSIsGothic=wasmExports.xmlUCSIsGothic)(e),Module._xmlUCSIsGreek=e=>(Module._xmlUCSIsGreek=wasmExports.xmlUCSIsGreek)(e),Module._xmlUCSIsGreekExtended=e=>(Module._xmlUCSIsGreekExtended=wasmExports.xmlUCSIsGreekExtended)(e),Module._xmlUCSIsGreekandCoptic=e=>(Module._xmlUCSIsGreekandCoptic=wasmExports.xmlUCSIsGreekandCoptic)(e),Module._xmlUCSIsGujarati=e=>(Module._xmlUCSIsGujarati=wasmExports.xmlUCSIsGujarati)(e),Module._xmlUCSIsGurmukhi=e=>(Module._xmlUCSIsGurmukhi=wasmExports.xmlUCSIsGurmukhi)(e),Module._xmlUCSIsHalfwidthandFullwidthForms=e=>(Module._xmlUCSIsHalfwidthandFullwidthForms=wasmExports.xmlUCSIsHalfwidthandFullwidthForms)(e),Module._xmlUCSIsHangulCompatibilityJamo=e=>(Module._xmlUCSIsHangulCompatibilityJamo=wasmExports.xmlUCSIsHangulCompatibilityJamo)(e),Module._xmlUCSIsHangulJamo=e=>(Module._xmlUCSIsHangulJamo=wasmExports.xmlUCSIsHangulJamo)(e),Module._xmlUCSIsHangulSyllables=e=>(Module._xmlUCSIsHangulSyllables=wasmExports.xmlUCSIsHangulSyllables)(e),Module._xmlUCSIsHanunoo=e=>(Module._xmlUCSIsHanunoo=wasmExports.xmlUCSIsHanunoo)(e),Module._xmlUCSIsHebrew=e=>(Module._xmlUCSIsHebrew=wasmExports.xmlUCSIsHebrew)(e),Module._xmlUCSIsHighPrivateUseSurrogates=e=>(Module._xmlUCSIsHighPrivateUseSurrogates=wasmExports.xmlUCSIsHighPrivateUseSurrogates)(e),Module._xmlUCSIsHighSurrogates=e=>(Module._xmlUCSIsHighSurrogates=wasmExports.xmlUCSIsHighSurrogates)(e),Module._xmlUCSIsHiragana=e=>(Module._xmlUCSIsHiragana=wasmExports.xmlUCSIsHiragana)(e),Module._xmlUCSIsIPAExtensions=e=>(Module._xmlUCSIsIPAExtensions=wasmExports.xmlUCSIsIPAExtensions)(e),Module._xmlUCSIsIdeographicDescriptionCharacters=e=>(Module._xmlUCSIsIdeographicDescriptionCharacters=wasmExports.xmlUCSIsIdeographicDescriptionCharacters)(e),Module._xmlUCSIsKanbun=e=>(Module._xmlUCSIsKanbun=wasmExports.xmlUCSIsKanbun)(e),Module._xmlUCSIsKangxiRadicals=e=>(Module._xmlUCSIsKangxiRadicals=wasmExports.xmlUCSIsKangxiRadicals)(e),Module._xmlUCSIsKannada=e=>(Module._xmlUCSIsKannada=wasmExports.xmlUCSIsKannada)(e),Module._xmlUCSIsKatakana=e=>(Module._xmlUCSIsKatakana=wasmExports.xmlUCSIsKatakana)(e),Module._xmlUCSIsKatakanaPhoneticExtensions=e=>(Module._xmlUCSIsKatakanaPhoneticExtensions=wasmExports.xmlUCSIsKatakanaPhoneticExtensions)(e),Module._xmlUCSIsKhmer=e=>(Module._xmlUCSIsKhmer=wasmExports.xmlUCSIsKhmer)(e),Module._xmlUCSIsKhmerSymbols=e=>(Module._xmlUCSIsKhmerSymbols=wasmExports.xmlUCSIsKhmerSymbols)(e),Module._xmlUCSIsLao=e=>(Module._xmlUCSIsLao=wasmExports.xmlUCSIsLao)(e),Module._xmlUCSIsLatin1Supplement=e=>(Module._xmlUCSIsLatin1Supplement=wasmExports.xmlUCSIsLatin1Supplement)(e),Module._xmlUCSIsLatinExtendedA=e=>(Module._xmlUCSIsLatinExtendedA=wasmExports.xmlUCSIsLatinExtendedA)(e),Module._xmlUCSIsLatinExtendedB=e=>(Module._xmlUCSIsLatinExtendedB=wasmExports.xmlUCSIsLatinExtendedB)(e),Module._xmlUCSIsLatinExtendedAdditional=e=>(Module._xmlUCSIsLatinExtendedAdditional=wasmExports.xmlUCSIsLatinExtendedAdditional)(e),Module._xmlUCSIsLetterlikeSymbols=e=>(Module._xmlUCSIsLetterlikeSymbols=wasmExports.xmlUCSIsLetterlikeSymbols)(e),Module._xmlUCSIsLimbu=e=>(Module._xmlUCSIsLimbu=wasmExports.xmlUCSIsLimbu)(e),Module._xmlUCSIsLinearBIdeograms=e=>(Module._xmlUCSIsLinearBIdeograms=wasmExports.xmlUCSIsLinearBIdeograms)(e),Module._xmlUCSIsLinearBSyllabary=e=>(Module._xmlUCSIsLinearBSyllabary=wasmExports.xmlUCSIsLinearBSyllabary)(e),Module._xmlUCSIsLowSurrogates=e=>(Module._xmlUCSIsLowSurrogates=wasmExports.xmlUCSIsLowSurrogates)(e),Module._xmlUCSIsMalayalam=e=>(Module._xmlUCSIsMalayalam=wasmExports.xmlUCSIsMalayalam)(e),Module._xmlUCSIsMathematicalAlphanumericSymbols=e=>(Module._xmlUCSIsMathematicalAlphanumericSymbols=wasmExports.xmlUCSIsMathematicalAlphanumericSymbols)(e),Module._xmlUCSIsMathematicalOperators=e=>(Module._xmlUCSIsMathematicalOperators=wasmExports.xmlUCSIsMathematicalOperators)(e),Module._xmlUCSIsMiscellaneousMathematicalSymbolsA=e=>(Module._xmlUCSIsMiscellaneousMathematicalSymbolsA=wasmExports.xmlUCSIsMiscellaneousMathematicalSymbolsA)(e),Module._xmlUCSIsMiscellaneousMathematicalSymbolsB=e=>(Module._xmlUCSIsMiscellaneousMathematicalSymbolsB=wasmExports.xmlUCSIsMiscellaneousMathematicalSymbolsB)(e),Module._xmlUCSIsMiscellaneousSymbols=e=>(Module._xmlUCSIsMiscellaneousSymbols=wasmExports.xmlUCSIsMiscellaneousSymbols)(e),Module._xmlUCSIsMiscellaneousSymbolsandArrows=e=>(Module._xmlUCSIsMiscellaneousSymbolsandArrows=wasmExports.xmlUCSIsMiscellaneousSymbolsandArrows)(e),Module._xmlUCSIsMiscellaneousTechnical=e=>(Module._xmlUCSIsMiscellaneousTechnical=wasmExports.xmlUCSIsMiscellaneousTechnical)(e),Module._xmlUCSIsMongolian=e=>(Module._xmlUCSIsMongolian=wasmExports.xmlUCSIsMongolian)(e),Module._xmlUCSIsMusicalSymbols=e=>(Module._xmlUCSIsMusicalSymbols=wasmExports.xmlUCSIsMusicalSymbols)(e),Module._xmlUCSIsMyanmar=e=>(Module._xmlUCSIsMyanmar=wasmExports.xmlUCSIsMyanmar)(e),Module._xmlUCSIsNumberForms=e=>(Module._xmlUCSIsNumberForms=wasmExports.xmlUCSIsNumberForms)(e),Module._xmlUCSIsOgham=e=>(Module._xmlUCSIsOgham=wasmExports.xmlUCSIsOgham)(e),Module._xmlUCSIsOldItalic=e=>(Module._xmlUCSIsOldItalic=wasmExports.xmlUCSIsOldItalic)(e),Module._xmlUCSIsOpticalCharacterRecognition=e=>(Module._xmlUCSIsOpticalCharacterRecognition=wasmExports.xmlUCSIsOpticalCharacterRecognition)(e),Module._xmlUCSIsOriya=e=>(Module._xmlUCSIsOriya=wasmExports.xmlUCSIsOriya)(e),Module._xmlUCSIsOsmanya=e=>(Module._xmlUCSIsOsmanya=wasmExports.xmlUCSIsOsmanya)(e),Module._xmlUCSIsPhoneticExtensions=e=>(Module._xmlUCSIsPhoneticExtensions=wasmExports.xmlUCSIsPhoneticExtensions)(e),Module._xmlUCSIsPrivateUse=e=>(Module._xmlUCSIsPrivateUse=wasmExports.xmlUCSIsPrivateUse)(e),Module._xmlUCSIsPrivateUseArea=e=>(Module._xmlUCSIsPrivateUseArea=wasmExports.xmlUCSIsPrivateUseArea)(e),Module._xmlUCSIsRunic=e=>(Module._xmlUCSIsRunic=wasmExports.xmlUCSIsRunic)(e),Module._xmlUCSIsShavian=e=>(Module._xmlUCSIsShavian=wasmExports.xmlUCSIsShavian)(e),Module._xmlUCSIsSinhala=e=>(Module._xmlUCSIsSinhala=wasmExports.xmlUCSIsSinhala)(e),Module._xmlUCSIsSmallFormVariants=e=>(Module._xmlUCSIsSmallFormVariants=wasmExports.xmlUCSIsSmallFormVariants)(e),Module._xmlUCSIsSpacingModifierLetters=e=>(Module._xmlUCSIsSpacingModifierLetters=wasmExports.xmlUCSIsSpacingModifierLetters)(e),Module._xmlUCSIsSpecials=e=>(Module._xmlUCSIsSpecials=wasmExports.xmlUCSIsSpecials)(e),Module._xmlUCSIsSuperscriptsandSubscripts=e=>(Module._xmlUCSIsSuperscriptsandSubscripts=wasmExports.xmlUCSIsSuperscriptsandSubscripts)(e),Module._xmlUCSIsSupplementalArrowsA=e=>(Module._xmlUCSIsSupplementalArrowsA=wasmExports.xmlUCSIsSupplementalArrowsA)(e),Module._xmlUCSIsSupplementalArrowsB=e=>(Module._xmlUCSIsSupplementalArrowsB=wasmExports.xmlUCSIsSupplementalArrowsB)(e),Module._xmlUCSIsSupplementalMathematicalOperators=e=>(Module._xmlUCSIsSupplementalMathematicalOperators=wasmExports.xmlUCSIsSupplementalMathematicalOperators)(e),Module._xmlUCSIsSupplementaryPrivateUseAreaA=e=>(Module._xmlUCSIsSupplementaryPrivateUseAreaA=wasmExports.xmlUCSIsSupplementaryPrivateUseAreaA)(e),Module._xmlUCSIsSupplementaryPrivateUseAreaB=e=>(Module._xmlUCSIsSupplementaryPrivateUseAreaB=wasmExports.xmlUCSIsSupplementaryPrivateUseAreaB)(e),Module._xmlUCSIsSyriac=e=>(Module._xmlUCSIsSyriac=wasmExports.xmlUCSIsSyriac)(e),Module._xmlUCSIsTagalog=e=>(Module._xmlUCSIsTagalog=wasmExports.xmlUCSIsTagalog)(e),Module._xmlUCSIsTagbanwa=e=>(Module._xmlUCSIsTagbanwa=wasmExports.xmlUCSIsTagbanwa)(e),Module._xmlUCSIsTags=e=>(Module._xmlUCSIsTags=wasmExports.xmlUCSIsTags)(e),Module._xmlUCSIsTaiLe=e=>(Module._xmlUCSIsTaiLe=wasmExports.xmlUCSIsTaiLe)(e),Module._xmlUCSIsTaiXuanJingSymbols=e=>(Module._xmlUCSIsTaiXuanJingSymbols=wasmExports.xmlUCSIsTaiXuanJingSymbols)(e),Module._xmlUCSIsTamil=e=>(Module._xmlUCSIsTamil=wasmExports.xmlUCSIsTamil)(e),Module._xmlUCSIsTelugu=e=>(Module._xmlUCSIsTelugu=wasmExports.xmlUCSIsTelugu)(e),Module._xmlUCSIsThaana=e=>(Module._xmlUCSIsThaana=wasmExports.xmlUCSIsThaana)(e),Module._xmlUCSIsThai=e=>(Module._xmlUCSIsThai=wasmExports.xmlUCSIsThai)(e),Module._xmlUCSIsTibetan=e=>(Module._xmlUCSIsTibetan=wasmExports.xmlUCSIsTibetan)(e),Module._xmlUCSIsUgaritic=e=>(Module._xmlUCSIsUgaritic=wasmExports.xmlUCSIsUgaritic)(e),Module._xmlUCSIsUnifiedCanadianAboriginalSyllabics=e=>(Module._xmlUCSIsUnifiedCanadianAboriginalSyllabics=wasmExports.xmlUCSIsUnifiedCanadianAboriginalSyllabics)(e),Module._xmlUCSIsVariationSelectors=e=>(Module._xmlUCSIsVariationSelectors=wasmExports.xmlUCSIsVariationSelectors)(e),Module._xmlUCSIsVariationSelectorsSupplement=e=>(Module._xmlUCSIsVariationSelectorsSupplement=wasmExports.xmlUCSIsVariationSelectorsSupplement)(e),Module._xmlUCSIsYiRadicals=e=>(Module._xmlUCSIsYiRadicals=wasmExports.xmlUCSIsYiRadicals)(e),Module._xmlUCSIsYiSyllables=e=>(Module._xmlUCSIsYiSyllables=wasmExports.xmlUCSIsYiSyllables)(e),Module._xmlUCSIsYijingHexagramSymbols=e=>(Module._xmlUCSIsYijingHexagramSymbols=wasmExports.xmlUCSIsYijingHexagramSymbols)(e),Module._xmlUCSIsCatCs=e=>(Module._xmlUCSIsCatCs=wasmExports.xmlUCSIsCatCs)(e),Module.___small_fprintf=(e,t,tr)=>(Module.___small_fprintf=wasmExports.__small_fprintf)(e,t,tr),Module._xmlXPathBooleanFunction=(e,t)=>(Module._xmlXPathBooleanFunction=wasmExports.xmlXPathBooleanFunction)(e,t),Module._xmlXPathCeilingFunction=(e,t)=>(Module._xmlXPathCeilingFunction=wasmExports.xmlXPathCeilingFunction)(e,t),Module._xmlXPathCountFunction=(e,t)=>(Module._xmlXPathCountFunction=wasmExports.xmlXPathCountFunction)(e,t),Module._xmlXPathConcatFunction=(e,t)=>(Module._xmlXPathConcatFunction=wasmExports.xmlXPathConcatFunction)(e,t),Module._xmlXPathContainsFunction=(e,t)=>(Module._xmlXPathContainsFunction=wasmExports.xmlXPathContainsFunction)(e,t),Module._xmlXPathIdFunction=(e,t)=>(Module._xmlXPathIdFunction=wasmExports.xmlXPathIdFunction)(e,t),Module._xmlXPathFalseFunction=(e,t)=>(Module._xmlXPathFalseFunction=wasmExports.xmlXPathFalseFunction)(e,t),Module._xmlXPathFloorFunction=(e,t)=>(Module._xmlXPathFloorFunction=wasmExports.xmlXPathFloorFunction)(e,t),Module._xmlXPathLastFunction=(e,t)=>(Module._xmlXPathLastFunction=wasmExports.xmlXPathLastFunction)(e,t),Module._xmlXPathLangFunction=(e,t)=>(Module._xmlXPathLangFunction=wasmExports.xmlXPathLangFunction)(e,t),Module._xmlXPathLocalNameFunction=(e,t)=>(Module._xmlXPathLocalNameFunction=wasmExports.xmlXPathLocalNameFunction)(e,t),Module._xmlXPathNotFunction=(e,t)=>(Module._xmlXPathNotFunction=wasmExports.xmlXPathNotFunction)(e,t),Module._xmlXPathNamespaceURIFunction=(e,t)=>(Module._xmlXPathNamespaceURIFunction=wasmExports.xmlXPathNamespaceURIFunction)(e,t),Module._xmlXPathNormalizeFunction=(e,t)=>(Module._xmlXPathNormalizeFunction=wasmExports.xmlXPathNormalizeFunction)(e,t),Module._xmlXPathNumberFunction=(e,t)=>(Module._xmlXPathNumberFunction=wasmExports.xmlXPathNumberFunction)(e,t),Module._xmlXPathPositionFunction=(e,t)=>(Module._xmlXPathPositionFunction=wasmExports.xmlXPathPositionFunction)(e,t),Module._xmlXPathRoundFunction=(e,t)=>(Module._xmlXPathRoundFunction=wasmExports.xmlXPathRoundFunction)(e,t),Module._xmlXPathStringFunction=(e,t)=>(Module._xmlXPathStringFunction=wasmExports.xmlXPathStringFunction)(e,t),Module._xmlXPathStringLengthFunction=(e,t)=>(Module._xmlXPathStringLengthFunction=wasmExports.xmlXPathStringLengthFunction)(e,t),Module._xmlXPathStartsWithFunction=(e,t)=>(Module._xmlXPathStartsWithFunction=wasmExports.xmlXPathStartsWithFunction)(e,t),Module._xmlXPathSubstringFunction=(e,t)=>(Module._xmlXPathSubstringFunction=wasmExports.xmlXPathSubstringFunction)(e,t),Module._xmlXPathSubstringBeforeFunction=(e,t)=>(Module._xmlXPathSubstringBeforeFunction=wasmExports.xmlXPathSubstringBeforeFunction)(e,t),Module._xmlXPathSubstringAfterFunction=(e,t)=>(Module._xmlXPathSubstringAfterFunction=wasmExports.xmlXPathSubstringAfterFunction)(e,t),Module._xmlXPathSumFunction=(e,t)=>(Module._xmlXPathSumFunction=wasmExports.xmlXPathSumFunction)(e,t),Module._xmlXPathTrueFunction=(e,t)=>(Module._xmlXPathTrueFunction=wasmExports.xmlXPathTrueFunction)(e,t),Module._xmlXPathTranslateFunction=(e,t)=>(Module._xmlXPathTranslateFunction=wasmExports.xmlXPathTranslateFunction)(e,t),Module._xmlXPathNextSelf=(e,t)=>(Module._xmlXPathNextSelf=wasmExports.xmlXPathNextSelf)(e,t),Module._xmlXPathNextChild=(e,t)=>(Module._xmlXPathNextChild=wasmExports.xmlXPathNextChild)(e,t),Module._xmlXPathNextDescendant=(e,t)=>(Module._xmlXPathNextDescendant=wasmExports.xmlXPathNextDescendant)(e,t),Module._xmlXPathNextDescendantOrSelf=(e,t)=>(Module._xmlXPathNextDescendantOrSelf=wasmExports.xmlXPathNextDescendantOrSelf)(e,t),Module._xmlXPathNextParent=(e,t)=>(Module._xmlXPathNextParent=wasmExports.xmlXPathNextParent)(e,t),Module._xmlXPathNextAncestor=(e,t)=>(Module._xmlXPathNextAncestor=wasmExports.xmlXPathNextAncestor)(e,t),Module._xmlXPathNextAncestorOrSelf=(e,t)=>(Module._xmlXPathNextAncestorOrSelf=wasmExports.xmlXPathNextAncestorOrSelf)(e,t),Module._xmlXPathNextFollowingSibling=(e,t)=>(Module._xmlXPathNextFollowingSibling=wasmExports.xmlXPathNextFollowingSibling)(e,t),Module._xmlXPathNextPrecedingSibling=(e,t)=>(Module._xmlXPathNextPrecedingSibling=wasmExports.xmlXPathNextPrecedingSibling)(e,t),Module._xmlXPathNextFollowing=(e,t)=>(Module._xmlXPathNextFollowing=wasmExports.xmlXPathNextFollowing)(e,t),Module._xmlXPathNextNamespace=(e,t)=>(Module._xmlXPathNextNamespace=wasmExports.xmlXPathNextNamespace)(e,t),Module._xmlXPathNextAttribute=(e,t)=>(Module._xmlXPathNextAttribute=wasmExports.xmlXPathNextAttribute)(e,t),Module._zcalloc=(e,t,tr)=>(Module._zcalloc=wasmExports.zcalloc)(e,t,tr),Module._zcfree=(e,t)=>(Module._zcfree=wasmExports.zcfree)(e,t),Module._strerror=e=>(Module._strerror=wasmExports.strerror)(e);var ___dl_seterr=(e,t)=>(___dl_seterr=wasmExports.__dl_seterr)(e,t);Module._putc=(e,t)=>(Module._putc=wasmExports.putc)(e,t),Module._gmtime=e=>(Module._gmtime=wasmExports.gmtime)(e);var _htonl=e=>(_htonl=wasmExports.htonl)(e),_htons=e=>(_htons=wasmExports.htons)(e);Module._ioctl=(e,t,tr)=>(Module._ioctl=wasmExports.ioctl)(e,t,tr);var _emscripten_builtin_memalign=(e,t)=>(_emscripten_builtin_memalign=wasmExports.emscripten_builtin_memalign)(e,t),_ntohs=e=>(_ntohs=wasmExports.ntohs)(e);Module._srand=e=>(Module._srand=wasmExports.srand)(e),Module._rand=()=>(Module._rand=wasmExports.rand)();var __emscripten_timeout=(e,t)=>(__emscripten_timeout=wasmExports._emscripten_timeout)(e,t);Module.___floatsitf=(e,t)=>(Module.___floatsitf=wasmExports.__floatsitf)(e,t),Module.___multf3=(e,t,tr,rr,ir)=>(Module.___multf3=wasmExports.__multf3)(e,t,tr,rr,ir),Module.___extenddftf2=(e,t)=>(Module.___extenddftf2=wasmExports.__extenddftf2)(e,t),Module.___getf2=(e,t,tr,rr)=>(Module.___getf2=wasmExports.__getf2)(e,t,tr,rr),Module.___subtf3=(e,t,tr,rr,ir)=>(Module.___subtf3=wasmExports.__subtf3)(e,t,tr,rr,ir),Module.___letf2=(e,t,tr,rr)=>(Module.___letf2=wasmExports.__letf2)(e,t,tr,rr),Module.___lttf2=(e,t,tr,rr)=>(Module.___lttf2=wasmExports.__lttf2)(e,t,tr,rr);var _setThrew=(e,t)=>(_setThrew=wasmExports.setThrew)(e,t),__emscripten_tempret_set=e=>(__emscripten_tempret_set=wasmExports._emscripten_tempret_set)(e),__emscripten_tempret_get=()=>(__emscripten_tempret_get=wasmExports._emscripten_tempret_get)();Module.___fixtfsi=(e,t)=>(Module.___fixtfsi=wasmExports.__fixtfsi)(e,t);var __emscripten_stack_restore=e=>(__emscripten_stack_restore=wasmExports._emscripten_stack_restore)(e),__emscripten_stack_alloc=e=>(__emscripten_stack_alloc=wasmExports._emscripten_stack_alloc)(e),_emscripten_stack_get_current=()=>(_emscripten_stack_get_current=wasmExports.emscripten_stack_get_current)();Module._ScanKeywords=18770052,Module._stderr=18792480,Module._stdout=18792784,Module._TopMemoryContext=18830716,Module._MainLWLockArray=18800668,Module._MyProc=18802328,Module._MyProcPid=18824228,Module._MyLatch=18824260,Module._CurrentMemoryContext=18830712,Module._InterruptPending=18824092,Module._pg_global_prng_state=18936304,Module._CurrentResourceOwner=18830692,Module._InterruptHoldoffCount=18824132,Module._IsUnderPostmaster=18824165,Module._wal_level=18758340,Module._MyDatabaseId=18824148,Module._error_context_stack=18816816,Module._PG_exception_stack=18816820,Module.___THREW__=18950052,Module.___threwValue=18950056,Module._ShmemVariableCache=18849760,Module._shmem_startup_hook=18794508,Module._debug_query_string=18848300,Module._CritSectionCount=18824140,Module._old_snapshot_threshold=18823756,Module._TopTransactionResourceOwner=18830700,Module._LocalBufferBlockPointers=18800556,Module._BufferBlocks=18795304,Module._pgBufferUsage=18813728,Module._GUC_check_errdetail_string=18814680,Module._NBuffers=18690456,Module._BufferDescriptors=18795300,Module._ParallelWorkerNumber=18767008,Module._stdin=18792632,Module._ScanKeywordTokens=17487664,Module._post_parse_analyze_hook=18802584,Module._progname=18848060,Module._DataDir=18824144,Module._MyStartTime=18824232,Module._MyProcPort=18824248,Module._Log_directory=18803120,Module._Log_filename=18803124,Module._ConfigReloadPending=18803272,Module._ShutdownRequestPending=18803276,Module._process_shared_preload_libraries_in_progress=18824080,Module._wal_segment_size=18758360,Module._application_name=18815988,Module._XactIsoLevel=18758700,Module._RmgrTable=18758816,Module._CacheMemoryContext=18830728,Module._TopTransactionContext=18830736,Module._TTSOpsVirtual=18638668,Module._WalReceiverFunctions=18803712,Module._TTSOpsMinimalTuple=18638764,Module._cluster_name=18640444,Module._work_mem=18690432,Module._ClientAuthentication_hook=18804032,Module._cma_rsize=18848108,Module._SOCKET_DATA=18854312,Module._SOCKET_FILE=18854308,Module._TTSOpsHeapTuple=18638716,Module._SnapshotAnyData=18690240,Module._ExecutorStart_hook=18813600,Module._ExecutorRun_hook=18813604,Module._ExecutorFinish_hook=18813608,Module._ExecutorEnd_hook=18813612,Module._SPI_processed=18813624,Module._SPI_tuptable=18813632,Module._SPI_result=18813636,Module._pgWalUsage=18813840,Module._cpu_operator_cost=18638912,Module._planner_hook=18813876,Module._maintenance_work_mem=18690448,Module._max_parallel_maintenance_workers=18690452,Module._cpu_tuple_cost=18638896,Module._seq_page_cost=18638880,Module._check_function_bodies=18640389,Module._quote_all_identifiers=18848065,Module._extra_float_digits=18692128,Module._IntervalStyle=18824172,Module._pg_crc32_table=18115504,Module._oldSnapshotControl=18823760,Module._shmem_request_hook=18824084,Module._DateStyle=18690420,Module._pg_number_of_ones=18433360,Module._xmlStructuredError=18936668,Module._xmlStructuredErrorContext=18936676,Module._xmlGenericErrorContext=18936672,Module._xmlGenericError=18774356,Module._xmlIsBaseCharGroup=18774120,Module._xmlIsDigitGroup=18774152,Module._xmlIsCombiningGroup=18774136,Module._xmlIsExtenderGroup=18774168,Module._xmlFree=18774320,Module._ProcessUtility_hook=18848012,Module._single_mode_feed=18848076,Module._cma_wsize=18848116,Module._check_password_hook=18850784,Module._IDB_STAGE=18854320,Module._IDB_PIPE_FP=18854316,Module._pg_scram_mech=18774064,Module._pg_g_threadlock=18772168,Module._pgresStatus=18773856,Module._xmlIsPubidChar_tab=18433648,Module._xmlGetWarningsDefaultValue=18774348,Module._xmlMalloc=18774324,Module._xmlRealloc=18774332,Module._xmlLastError=18936688,Module._xmlMallocAtomic=18774328,Module._xmlMemStrdup=18774336,Module._xmlBufferAllocScheme=18774340,Module._xmlDefaultBufferSize=18774344,Module._xmlParserDebugEntities=18936628,Module._xmlDoValidityCheckingDefaultValue=18936632,Module._xmlLoadExtDtdDefaultValue=18936636,Module._xmlPedanticParserDefaultValue=18936640,Module._xmlLineNumbersDefaultValue=18936644,Module._xmlKeepBlanksDefaultValue=18774352,Module._xmlSubstituteEntitiesDefaultValue=18936648,Module._xmlRegisterNodeDefaultValue=18936652,Module._xmlDeregisterNodeDefaultValue=18936656,Module._xmlParserInputBufferCreateFilenameValue=18936660,Module._xmlOutputBufferCreateFilenameValue=18936664,Module._xmlIndentTreeOutput=18774360,Module._xmlTreeIndentString=18774364,Module._xmlSaveNoEmptyTags=18936680,Module._xmlDefaultSAXHandler=18774368,Module._xmlDefaultSAXLocator=18774480,Module._xmlParserMaxDepth=18775140,Module._xmlStringText=18435456,Module._xmlStringComment=18435471,Module._xmlStringTextNoenc=18435461,Module._xmlXPathNAN=18937352,Module._xmlXPathNINF=18937368,Module._xmlXPathPINF=18937360,Module._z_errmsg=18791696,Module.__length_code=18455120,Module.__dist_code=18454608;function invoke_i(e){var t=stackSave();try{return getWasmTableEntry(e)()}catch(tr){if(stackRestore(t),tr!==tr+0)throw tr;_setThrew(1,0)}}function invoke_v(e){var t=stackSave();try{getWasmTableEntry(e)()}catch(tr){if(stackRestore(t),tr!==tr+0)throw tr;_setThrew(1,0)}}function invoke_vi(e,t){var tr=stackSave();try{getWasmTableEntry(e)(t)}catch(rr){if(stackRestore(tr),rr!==rr+0)throw rr;_setThrew(1,0)}}function invoke_iii(e,t,tr){var rr=stackSave();try{return getWasmTableEntry(e)(t,tr)}catch(ir){if(stackRestore(rr),ir!==ir+0)throw ir;_setThrew(1,0)}}function invoke_iiiiii(e,t,tr,rr,ir,lr){var dr=stackSave();try{return getWasmTableEntry(e)(t,tr,rr,ir,lr)}catch(fr){if(stackRestore(dr),fr!==fr+0)throw fr;_setThrew(1,0)}}function invoke_viii(e,t,tr,rr){var ir=stackSave();try{getWasmTableEntry(e)(t,tr,rr)}catch(lr){if(stackRestore(ir),lr!==lr+0)throw lr;_setThrew(1,0)}}function invoke_viiiiiii(e,t,tr,rr,ir,lr,dr,fr){var hr=stackSave();try{getWasmTableEntry(e)(t,tr,rr,ir,lr,dr,fr)}catch(mr){if(stackRestore(hr),mr!==mr+0)throw mr;_setThrew(1,0)}}function invoke_iiii(e,t,tr,rr){var ir=stackSave();try{return getWasmTableEntry(e)(t,tr,rr)}catch(lr){if(stackRestore(ir),lr!==lr+0)throw lr;_setThrew(1,0)}}function invoke_viiii(e,t,tr,rr,ir){var lr=stackSave();try{getWasmTableEntry(e)(t,tr,rr,ir)}catch(dr){if(stackRestore(lr),dr!==dr+0)throw dr;_setThrew(1,0)}}function invoke_iiiii(e,t,tr,rr,ir){var lr=stackSave();try{return getWasmTableEntry(e)(t,tr,rr,ir)}catch(dr){if(stackRestore(lr),dr!==dr+0)throw dr;_setThrew(1,0)}}function invoke_vii(e,t,tr){var rr=stackSave();try{getWasmTableEntry(e)(t,tr)}catch(ir){if(stackRestore(rr),ir!==ir+0)throw ir;_setThrew(1,0)}}function invoke_ii(e,t){var tr=stackSave();try{return getWasmTableEntry(e)(t)}catch(rr){if(stackRestore(tr),rr!==rr+0)throw rr;_setThrew(1,0)}}function invoke_viiiiiiii(e,t,tr,rr,ir,lr,dr,fr,hr){var mr=stackSave();try{getWasmTableEntry(e)(t,tr,rr,ir,lr,dr,fr,hr)}catch(gr){if(stackRestore(mr),gr!==gr+0)throw gr;_setThrew(1,0)}}function invoke_viiiii(e,t,tr,rr,ir,lr){var dr=stackSave();try{getWasmTableEntry(e)(t,tr,rr,ir,lr)}catch(fr){if(stackRestore(dr),fr!==fr+0)throw fr;_setThrew(1,0)}}function invoke_ij(e,t){var tr=stackSave();try{return getWasmTableEntry(e)(t)}catch(rr){if(stackRestore(tr),rr!==rr+0)throw rr;_setThrew(1,0)}}function invoke_ji(e,t){var tr=stackSave();try{return getWasmTableEntry(e)(t)}catch(rr){if(stackRestore(tr),rr!==rr+0)throw rr;return _setThrew(1,0),0n}}function invoke_ijiiiiii(e,t,tr,rr,ir,lr,dr,fr){var hr=stackSave();try{return getWasmTableEntry(e)(t,tr,rr,ir,lr,dr,fr)}catch(mr){if(stackRestore(hr),mr!==mr+0)throw mr;_setThrew(1,0)}}function invoke_vij(e,t,tr){var rr=stackSave();try{getWasmTableEntry(e)(t,tr)}catch(ir){if(stackRestore(rr),ir!==ir+0)throw ir;_setThrew(1,0)}}function invoke_vj(e,t){var tr=stackSave();try{getWasmTableEntry(e)(t)}catch(rr){if(stackRestore(tr),rr!==rr+0)throw rr;_setThrew(1,0)}}function invoke_viijii(e,t,tr,rr,ir,lr){var dr=stackSave();try{getWasmTableEntry(e)(t,tr,rr,ir,lr)}catch(fr){if(stackRestore(dr),fr!==fr+0)throw fr;_setThrew(1,0)}}function invoke_iiiiiji(e,t,tr,rr,ir,lr,dr){var fr=stackSave();try{return getWasmTableEntry(e)(t,tr,rr,ir,lr,dr)}catch(hr){if(stackRestore(fr),hr!==hr+0)throw hr;_setThrew(1,0)}}function invoke_viijiiii(e,t,tr,rr,ir,lr,dr,fr){var hr=stackSave();try{getWasmTableEntry(e)(t,tr,rr,ir,lr,dr,fr)}catch(mr){if(stackRestore(hr),mr!==mr+0)throw mr;_setThrew(1,0)}}function invoke_viij(e,t,tr,rr){var ir=stackSave();try{getWasmTableEntry(e)(t,tr,rr)}catch(lr){if(stackRestore(ir),lr!==lr+0)throw lr;_setThrew(1,0)}}function invoke_jiiiiiiii(e,t,tr,rr,ir,lr,dr,fr,hr){var mr=stackSave();try{return getWasmTableEntry(e)(t,tr,rr,ir,lr,dr,fr,hr)}catch(gr){if(stackRestore(mr),gr!==gr+0)throw gr;return _setThrew(1,0),0n}}function invoke_jiiiii(e,t,tr,rr,ir,lr){var dr=stackSave();try{return getWasmTableEntry(e)(t,tr,rr,ir,lr)}catch(fr){if(stackRestore(dr),fr!==fr+0)throw fr;return _setThrew(1,0),0n}}function invoke_iiiiiiiii(e,t,tr,rr,ir,lr,dr,fr,hr){var mr=stackSave();try{return getWasmTableEntry(e)(t,tr,rr,ir,lr,dr,fr,hr)}catch(gr){if(stackRestore(mr),gr!==gr+0)throw gr;_setThrew(1,0)}}function invoke_vji(e,t,tr){var rr=stackSave();try{getWasmTableEntry(e)(t,tr)}catch(ir){if(stackRestore(rr),ir!==ir+0)throw ir;_setThrew(1,0)}}function invoke_iiiijii(e,t,tr,rr,ir,lr,dr){var fr=stackSave();try{return getWasmTableEntry(e)(t,tr,rr,ir,lr,dr)}catch(hr){if(stackRestore(fr),hr!==hr+0)throw hr;_setThrew(1,0)}}function invoke_vijiji(e,t,tr,rr,ir,lr){var dr=stackSave();try{getWasmTableEntry(e)(t,tr,rr,ir,lr)}catch(fr){if(stackRestore(dr),fr!==fr+0)throw fr;_setThrew(1,0)}}function invoke_viji(e,t,tr,rr){var ir=stackSave();try{getWasmTableEntry(e)(t,tr,rr)}catch(lr){if(stackRestore(ir),lr!==lr+0)throw lr;_setThrew(1,0)}}function invoke_iiij(e,t,tr,rr){var ir=stackSave();try{return getWasmTableEntry(e)(t,tr,rr)}catch(lr){if(stackRestore(ir),lr!==lr+0)throw lr;_setThrew(1,0)}}function invoke_iiiiiiii(e,t,tr,rr,ir,lr,dr,fr){var hr=stackSave();try{return getWasmTableEntry(e)(t,tr,rr,ir,lr,dr,fr)}catch(mr){if(stackRestore(hr),mr!==mr+0)throw mr;_setThrew(1,0)}}function invoke_iiiiiii(e,t,tr,rr,ir,lr,dr){var fr=stackSave();try{return getWasmTableEntry(e)(t,tr,rr,ir,lr,dr)}catch(hr){if(stackRestore(fr),hr!==hr+0)throw hr;_setThrew(1,0)}}function invoke_di(e,t){var tr=stackSave();try{return getWasmTableEntry(e)(t)}catch(rr){if(stackRestore(tr),rr!==rr+0)throw rr;_setThrew(1,0)}}function invoke_id(e,t){var tr=stackSave();try{return getWasmTableEntry(e)(t)}catch(rr){if(stackRestore(tr),rr!==rr+0)throw rr;_setThrew(1,0)}}function invoke_ijiiiii(e,t,tr,rr,ir,lr,dr){var fr=stackSave();try{return getWasmTableEntry(e)(t,tr,rr,ir,lr,dr)}catch(hr){if(stackRestore(fr),hr!==hr+0)throw hr;_setThrew(1,0)}}function invoke_jiiii(e,t,tr,rr,ir){var lr=stackSave();try{return getWasmTableEntry(e)(t,tr,rr,ir)}catch(dr){if(stackRestore(lr),dr!==dr+0)throw dr;return _setThrew(1,0),0n}}function invoke_viiiiii(e,t,tr,rr,ir,lr,dr){var fr=stackSave();try{getWasmTableEntry(e)(t,tr,rr,ir,lr,dr)}catch(hr){if(stackRestore(fr),hr!==hr+0)throw hr;_setThrew(1,0)}}function invoke_viiiiiiiiiiii(e,t,tr,rr,ir,lr,dr,fr,hr,mr,gr,yr,_r){var br=stackSave();try{getWasmTableEntry(e)(t,tr,rr,ir,lr,dr,fr,hr,mr,gr,yr,_r)}catch(wr){if(stackRestore(br),wr!==wr+0)throw wr;_setThrew(1,0)}}function invoke_jii(e,t,tr){var rr=stackSave();try{return getWasmTableEntry(e)(t,tr)}catch(ir){if(stackRestore(rr),ir!==ir+0)throw ir;return _setThrew(1,0),0n}}function invoke_iiiij(e,t,tr,rr,ir){var lr=stackSave();try{return getWasmTableEntry(e)(t,tr,rr,ir)}catch(dr){if(stackRestore(lr),dr!==dr+0)throw dr;_setThrew(1,0)}}function invoke_iiiiiiiiii(e,t,tr,rr,ir,lr,dr,fr,hr,mr){var gr=stackSave();try{return getWasmTableEntry(e)(t,tr,rr,ir,lr,dr,fr,hr,mr)}catch(yr){if(stackRestore(gr),yr!==yr+0)throw yr;_setThrew(1,0)}}function invoke_viiji(e,t,tr,rr,ir){var lr=stackSave();try{getWasmTableEntry(e)(t,tr,rr,ir)}catch(dr){if(stackRestore(lr),dr!==dr+0)throw dr;_setThrew(1,0)}}function invoke_iiji(e,t,tr,rr){var ir=stackSave();try{return getWasmTableEntry(e)(t,tr,rr)}catch(lr){if(stackRestore(ir),lr!==lr+0)throw lr;_setThrew(1,0)}}function invoke_vid(e,t,tr){var rr=stackSave();try{getWasmTableEntry(e)(t,tr)}catch(ir){if(stackRestore(rr),ir!==ir+0)throw ir;_setThrew(1,0)}}function invoke_viiiiiiiii(e,t,tr,rr,ir,lr,dr,fr,hr,mr){var gr=stackSave();try{getWasmTableEntry(e)(t,tr,rr,ir,lr,dr,fr,hr,mr)}catch(yr){if(stackRestore(gr),yr!==yr+0)throw yr;_setThrew(1,0)}}function invoke_viiij(e,t,tr,rr,ir){var lr=stackSave();try{getWasmTableEntry(e)(t,tr,rr,ir)}catch(dr){if(stackRestore(lr),dr!==dr+0)throw dr;_setThrew(1,0)}}function invoke_iiiiiiiiiiiiiiiii(e,t,tr,rr,ir,lr,dr,fr,hr,mr,gr,yr,_r,br,wr,vr,Sr){var Ir=stackSave();try{return getWasmTableEntry(e)(t,tr,rr,ir,lr,dr,fr,hr,mr,gr,yr,_r,br,wr,vr,Sr)}catch(Mr){if(stackRestore(Ir),Mr!==Mr+0)throw Mr;_setThrew(1,0)}}Module.addRunDependency=addRunDependency,Module.removeRunDependency=removeRunDependency,Module.callMain=callMain,Module.ccall=ccall,Module.cwrap=cwrap,Module.setValue=setValue,Module.getValue=getValue,Module.UTF8ToString=UTF8ToString,Module.stringToNewUTF8=stringToNewUTF8,Module.stringToUTF8OnStack=stringToUTF8OnStack,Module.FS_createPreloadedFile=FS_createPreloadedFile,Module.FS_unlink=FS_unlink,Module.FS_createPath=FS_createPath,Module.FS_createDevice=FS_createDevice,Module.FS=FS,Module.FS_createDataFile=FS_createDataFile,Module.FS_createLazyFile=FS_createLazyFile;var calledRun;dependenciesFulfilled=function e(){calledRun||run(),calledRun||(dependenciesFulfilled=e)};function callMain(e=[]){var t=resolveGlobalSymbol("main").sym;if(t){e.unshift(thisProgram);var tr=e.length,rr=stackAlloc((tr+1)*4),ir=rr;e.forEach(dr=>{HEAPU32[ir>>2]=stringToUTF8OnStack(dr),ir+=4}),HEAPU32[ir>>2]=0;try{var lr=t(tr,rr);return exitJS(lr),lr}catch(dr){return handleException(dr)}}}function run(e=arguments_){if(runDependencies>0||(preRun(),runDependencies>0))return;function t(){var tr;calledRun||(calledRun=!0,Module.calledRun=!0,!ABORT&&(initRuntime(),preMain(),readyPromiseResolve(Module),(tr=Module.onRuntimeInitialized)==null||tr.call(Module),shouldRunNow&&callMain(e),postRun()))}Module.setStatus?(Module.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>Module.setStatus(""),1),t()},1)):t()}if(Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;return Module.noInitialRun&&(shouldRunNow=!1),run(),moduleRtn=readyPromise,moduleRtn}})(),ke=Qe,Te=ke,Y,W,j$1,J,$$1,_e,ie,me,Z,ae,oe,se,V,G,k$1,K,O$1,qe,re,pe=class Gc extends z$1{constructor(t={},tr={}){super(),R$3(this,O$1),R$3(this,Y,!1),R$3(this,W,!1),R$3(this,j$1,!1),R$3(this,J,!1),R$3(this,$$1,!1),R$3(this,_e,new H$1),R$3(this,ie,new H$1),R$3(this,me,new H$1),R$3(this,Z,!1),this.debug=0,R$3(this,ae),R$3(this,oe,[]),R$3(this,se,new ye),R$3(this,V),R$3(this,G),R$3(this,k$1,new Map),R$3(this,K,new Set),typeof t=="string"?tr={dataDir:t,...tr}:tr=t,this.dataDir=tr.dataDir,tr.parsers!==void 0&&(this.parsers={...this.parsers,...tr.parsers}),tr.serializers!==void 0&&(this.serializers={...this.serializers,...tr.serializers}),(tr==null?void 0:tr.debug)!==void 0&&(this.debug=tr.debug),(tr==null?void 0:tr.relaxedDurability)!==void 0&&x$4(this,$$1,tr.relaxedDurability),x$4(this,ae,tr.extensions??{}),this.waitReady=T$2(this,O$1,qe).call(this,tr??{})}static async create(t,tr){let rr=typeof t=="string"?{dataDir:t,...tr??{}}:t??{},ir=new Gc(rr);return await ir.waitReady,ir}get Module(){return this.mod}get ready(){return h$2(this,Y)&&!h$2(this,W)&&!h$2(this,j$1)}get closed(){return h$2(this,j$1)}async close(){await this._checkReady(),x$4(this,W,!0);for(let t of h$2(this,oe))await t();try{await this.execProtocol(O$3.end()),this.mod._pg_shutdown()}catch(t){let tr=t;if(!(tr.name==="ExitStatus"&&tr.status===0))throw t}await this.fs.closeFs(),x$4(this,j$1,!0),x$4(this,W,!1)}async[Symbol.asyncDispose](){await this.close()}async _handleBlob(t){x$4(this,V,t?await t.arrayBuffer():void 0)}async _cleanupBlob(){x$4(this,V,void 0)}async _getWrittenBlob(){if(!h$2(this,G))return;let t=new Blob(h$2(this,G));return x$4(this,G,void 0),t}async _checkReady(){if(h$2(this,W))throw new Error("PGlite is closing");if(h$2(this,j$1))throw new Error("PGlite is closed");h$2(this,Y)||await this.waitReady}execProtocolRawSync(t){let tr=t.length,rr=this.mod;rr._interactive_write(tr),rr.HEAPU8.set(t,1),rr._interactive_one();let ir=tr+2,lr=ir+rr._interactive_read();return rr.HEAPU8.subarray(ir,lr)}async execProtocolRaw(t,{syncToFs:tr=!0}={}){let rr=t.length,ir=this.mod;ir._interactive_write(rr),ir.HEAPU8.set(t,1),ir._interactive_one();let lr=rr+2,dr=lr+ir._interactive_read(),fr=ir.HEAPU8.subarray(lr,dr);return tr&&await this.syncToFs(),fr}async execProtocol(t,{syncToFs:tr=!0,throwOnError:rr=!0,onNotice:ir}={}){let lr=await this.execProtocolRaw(t,{syncToFs:tr}),dr=[];return h$2(this,se).parse(lr,fr=>{if(fr instanceof E$2){if(x$4(this,se,new ye),rr)throw fr}else if(fr instanceof ne)this.debug>0&&console.warn(fr),ir&&ir(fr);else if(fr instanceof ee$1)switch(fr.text){case"BEGIN":x$4(this,J,!0);break;case"COMMIT":case"ROLLBACK":x$4(this,J,!1);break}else if(fr instanceof X){let hr=h$2(this,k$1).get(fr.channel);hr&&hr.forEach(mr=>{queueMicrotask(()=>mr(fr.payload))}),h$2(this,K).forEach(mr=>{queueMicrotask(()=>mr(fr.channel,fr.payload))})}dr.push(fr)}),{messages:dr,data:lr}}isInTransaction(){return h$2(this,J)}async syncToFs(){if(h$2(this,Z))return;x$4(this,Z,!0);let t=async()=>{await h$2(this,me).runExclusive(async()=>{x$4(this,Z,!1),await this.fs.syncToFs(h$2(this,$$1))})};h$2(this,$$1)?t():await t()}async listen(t,tr){var ir;let rr=Nr(t);h$2(this,k$1).has(rr)||h$2(this,k$1).set(rr,new Set),h$2(this,k$1).get(rr).add(tr);try{await this.exec(`LISTEN ${t}`)}catch(lr){throw h$2(this,k$1).get(rr).delete(tr),((ir=h$2(this,k$1).get(rr))==null?void 0:ir.size)===0&&h$2(this,k$1).delete(rr),lr}return async()=>{await this.unlisten(rr,tr)}}async unlisten(t,tr){var ir,lr;let rr=Nr(t);tr?((ir=h$2(this,k$1).get(rr))==null||ir.delete(tr),((lr=h$2(this,k$1).get(rr))==null?void 0:lr.size)===0&&(await this.exec(`UNLISTEN ${t}`),h$2(this,k$1).delete(rr))):(await this.exec(`UNLISTEN ${t}`),h$2(this,k$1).delete(rr))}onNotification(t){return h$2(this,K).add(t),()=>{h$2(this,K).delete(t)}}offNotification(t){h$2(this,K).delete(t)}async dumpDataDir(t){var rr;let tr=((rr=this.dataDir)==null?void 0:rr.split("/").pop())??"pgdata";return this.fs.dumpTar(tr,t)}_runExclusiveQuery(t){return h$2(this,_e).runExclusive(t)}_runExclusiveTransaction(t){return h$2(this,ie).runExclusive(t)}async clone(){let t=await this.dumpDataDir("none");return new Gc({loadDataDir:t})}};Y=new WeakMap,W=new WeakMap,j$1=new WeakMap,J=new WeakMap,$$1=new WeakMap,_e=new WeakMap,ie=new WeakMap,me=new WeakMap,Z=new WeakMap,ae=new WeakMap,oe=new WeakMap,se=new WeakMap,V=new WeakMap,G=new WeakMap,k$1=new WeakMap,K=new WeakMap,O$1=new WeakSet,qe=async function(e){if(e.fs)this.fs=e.fs;else{let{dataDir:mr,fsType:gr}=Fe(e.dataDir);this.fs=await Ae(mr,gr)}let t={},tr=[],rr=[`PGDATA=${C$1}`,`PREFIX=${Vr}`,`PGUSER=${e.username??"postgres"}`,`PGDATABASE=${e.database??"template1"}`,"MODE=REACT","REPL=N",...this.debug?["-d",this.debug.toString()]:[]];e.wasmModule||Rr();let ir=e.fsBundle?e.fsBundle.arrayBuffer():Er(),lr;ir.then(mr=>{lr=mr});let dr={WASM_PREFIX:Vr,arguments:rr,INITIAL_MEMORY:e.initialMemory,noExitRuntime:!0,...this.debug>0?{print:console.info,printErr:console.error}:{print:()=>{},printErr:()=>{}},instantiateWasm:(mr,gr)=>(Tr(mr,e.wasmModule).then(({instance:yr,module:_r})=>{gr(yr,_r)}),{}),getPreloadedPackage:(mr,gr)=>{if(mr==="postgres.data"){if(lr.byteLength!==gr)throw new Error(`Invalid FS bundle size: ${lr.byteLength} !== ${gr}`);return lr}throw new Error(`Unknown package: ${mr}`)},preRun:[mr=>{let gr=mr.FS.makedev(64,0),yr={open:_r=>{},close:_r=>{},read:(_r,br,wr,vr,Sr)=>{let Ir=h$2(this,V);if(!Ir)throw new Error("No /dev/blob File or Blob provided to read from");let Mr=new Uint8Array(Ir);if(Sr>=Mr.length)return 0;let Ar=Math.min(Mr.length-Sr,vr);for(let kr=0;kr<Ar;kr++)br[wr+kr]=Mr[Sr+kr];return Ar},write:(_r,br,wr,vr,Sr)=>(h$2(this,G)??x$4(this,G,[]),h$2(this,G).push(br.slice(wr,wr+vr)),vr),llseek:(_r,br,wr)=>{let vr=h$2(this,V);if(!vr)throw new Error("No /dev/blob File or Blob provided to llseek");let Sr=br;if(wr===1?Sr+=_r.position:wr===2&&(Sr=new Uint8Array(vr).length),Sr<0)throw new mr.FS.ErrnoError(28);return Sr}};mr.FS.registerDevice(gr,yr),mr.FS.mkdev("/dev/blob",gr)}]},{emscriptenOpts:fr}=await this.fs.init(this,dr);dr=fr;for(let[mr,gr]of Object.entries(h$2(this,ae)))if(gr instanceof URL)t[mr]=ge(gr);else{let yr=await gr.setup(this,dr);if(yr.emscriptenOpts&&(dr=yr.emscriptenOpts),yr.namespaceObj){let _r=this;_r[mr]=yr.namespaceObj}yr.bundlePath&&(t[mr]=ge(yr.bundlePath)),yr.init&&tr.push(yr.init),yr.close&&h$2(this,oe).push(yr.close)}if(dr.pg_extensions=t,await ir,this.mod=await Te(dr),await this.fs.initialSyncFs(),e.loadDataDir){if(this.mod.FS.analyzePath(C$1+"/PG_VERSION").exists)throw new Error("Database already exists, cannot load from tarball");T$2(this,O$1,re).call(this,"pglite: loading data from tarball"),await ce$1(this.mod.FS,e.loadDataDir,C$1)}this.mod.FS.analyzePath(C$1+"/PG_VERSION").exists?T$2(this,O$1,re).call(this,"pglite: found DB, resuming"):T$2(this,O$1,re).call(this,"pglite: no db"),await Pe(this.mod,(...mr)=>T$2(this,O$1,re).call(this,...mr));let hr=this.mod._pg_initdb();if(!hr)throw new Error("INITDB failed to return value");if(hr&1)throw new Error("INITDB failed");if(hr&2){let mr=e.username??"postgres",gr=e.database??"template1";if(hr&4){if(!(hr&12))throw new Error("Invalid db/user combination")}else if(gr!=="template1"&&mr!=="postgres")throw new Error("INITDB created a new datadir, but an alternative db/user was requested")}await this.syncToFs(),x$4(this,Y,!0),await this.exec("SET search_path TO public;"),await this._initArrayTypes();for(let mr of tr)await mr()},re=function(...e){this.debug>0&&console.log(...e)};var Ue=pe;u$2();u$2();var M$1=5,U=async(e,t)=>{let tr=new Set,rr={async query(ir,lr,dr){let fr,hr,mr;if(typeof ir!="string"&&(fr=ir.signal,lr=ir.params,dr=ir.callback,hr=ir.offset,mr=ir.limit,ir=ir.query),hr===void 0!=(mr===void 0))throw new Error("offset and limit must be provided together");let gr=hr!==void 0&&mr!==void 0,yr;if(gr&&(typeof hr!="number"||isNaN(hr)||typeof mr!="number"||isNaN(mr)))throw new Error("offset and limit must be numbers");let _r=dr?[dr]:[],br=Cr().replace(/-/g,""),wr=!1,vr,Sr,Ir=async()=>{await e.transaction(async Dr=>{let $r=lr&&lr.length>0?await Pr(e,ir,lr,Dr):ir;await Dr.exec(`CREATE OR REPLACE TEMP VIEW live_query_${br}_view AS ${$r}`),Sr=await q$1(Dr,`live_query_${br}_view`),await F(Dr,Sr,tr),gr?(await Dr.exec(`
|
|
488
488
|
PREPARE live_query_${br}_get(int, int) AS
|
|
@@ -661,4 +661,4 @@ ${prettyStateOverride(br)}`),super(t.shortMessage,{cause:t,docsPath:rr,metaMessa
|
|
|
661
661
|
font-size: .6rem;
|
|
662
662
|
font-weight: bold;
|
|
663
663
|
color: hsl(${Math.max(0,Math.min(120-120*Sr,120))}deg 100% 31%);`,tr==null?void 0:tr.key)}return(mr=tr==null?void 0:tr.onChange)==null||mr.call(tr,ir),ir}return lr.updateDeps=dr=>{rr=dr},lr}function notUndefined(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const approxEqual=(e,t)=>Math.abs(e-t)<=1,debounce=(e,t,tr)=>{let rr;return function(...ir){e.clearTimeout(rr),rr=e.setTimeout(()=>t.apply(this,ir),tr)}},getRect=e=>{const{offsetWidth:t,offsetHeight:tr}=e;return{width:t,height:tr}},defaultKeyExtractor=e=>e,defaultRangeExtractor=e=>{const t=Math.max(e.startIndex-e.overscan,0),tr=Math.min(e.endIndex+e.overscan,e.count-1),rr=[];for(let ir=t;ir<=tr;ir++)rr.push(ir);return rr},observeElementRect=(e,t)=>{const tr=e.scrollElement;if(!tr)return;const rr=e.targetWindow;if(!rr)return;const ir=dr=>{const{width:fr,height:hr}=dr;t({width:Math.round(fr),height:Math.round(hr)})};if(ir(getRect(tr)),!rr.ResizeObserver)return()=>{};const lr=new rr.ResizeObserver(dr=>{const fr=()=>{const hr=dr[0];if(hr!=null&&hr.borderBoxSize){const mr=hr.borderBoxSize[0];if(mr){ir({width:mr.inlineSize,height:mr.blockSize});return}}ir(getRect(tr))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(fr):fr()});return lr.observe(tr,{box:"border-box"}),()=>{lr.unobserve(tr)}},addEventListenerOptions={passive:!0},supportsScrollend=typeof window>"u"?!0:"onscrollend"in window,observeElementOffset=(e,t)=>{const tr=e.scrollElement;if(!tr)return;const rr=e.targetWindow;if(!rr)return;let ir=0;const lr=e.options.useScrollendEvent&&supportsScrollend?()=>{}:debounce(rr,()=>{t(ir,!1)},e.options.isScrollingResetDelay),dr=gr=>()=>{const{horizontal:yr,isRtl:_r}=e.options;ir=yr?tr.scrollLeft*(_r&&-1||1):tr.scrollTop,lr(),t(ir,gr)},fr=dr(!0),hr=dr(!1);hr(),tr.addEventListener("scroll",fr,addEventListenerOptions);const mr=e.options.useScrollendEvent&&supportsScrollend;return mr&&tr.addEventListener("scrollend",hr,addEventListenerOptions),()=>{tr.removeEventListener("scroll",fr),mr&&tr.removeEventListener("scrollend",hr)}},measureElement=(e,t,tr)=>{if(t!=null&&t.borderBoxSize){const rr=t.borderBoxSize[0];if(rr)return Math.round(rr[tr.options.horizontal?"inlineSize":"blockSize"])}return e[tr.options.horizontal?"offsetWidth":"offsetHeight"]},elementScroll=(e,{adjustments:t=0,behavior:tr},rr)=>{var ir,lr;const dr=e+t;(lr=(ir=rr.scrollElement)==null?void 0:ir.scrollTo)==null||lr.call(ir,{[rr.options.horizontal?"left":"top"]:dr,behavior:tr})};class Virtualizer{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let tr=null;const rr=()=>tr||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:tr=new this.targetWindow.ResizeObserver(ir=>{ir.forEach(lr=>{const dr=()=>{this._measureElement(lr.target,lr)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(dr):dr()})}));return{disconnect:()=>{var ir;(ir=rr())==null||ir.disconnect(),tr=null},observe:ir=>{var lr;return(lr=rr())==null?void 0:lr.observe(ir,{box:"border-box"})},unobserve:ir=>{var lr;return(lr=rr())==null?void 0:lr.unobserve(ir)}}})(),this.range=null,this.setOptions=tr=>{Object.entries(tr).forEach(([rr,ir])=>{typeof ir>"u"&&delete tr[rr]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:defaultKeyExtractor,rangeExtractor:defaultRangeExtractor,onChange:()=>{},measureElement,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...tr}},this.notify=tr=>{var rr,ir;(ir=(rr=this.options).onChange)==null||ir.call(rr,this,tr)},this.maybeNotify=memo(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),tr=>{this.notify(tr)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(tr=>tr()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var tr;const rr=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==rr){if(this.cleanup(),!rr){this.maybeNotify();return}this.scrollElement=rr,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((tr=this.scrollElement)==null?void 0:tr.window)??null,this.elementsCache.forEach(ir=>{this.observer.observe(ir)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,ir=>{this.scrollRect=ir,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(ir,lr)=>{this.scrollAdjustments=0,this.scrollDirection=lr?this.getScrollOffset()<ir?"forward":"backward":null,this.scrollOffset=ir,this.isScrolling=lr,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(tr,rr)=>{const ir=new Map,lr=new Map;for(let dr=rr-1;dr>=0;dr--){const fr=tr[dr];if(ir.has(fr.lane))continue;const hr=lr.get(fr.lane);if(hr==null||fr.end>hr.end?lr.set(fr.lane,fr):fr.end<hr.end&&ir.set(fr.lane,!0),ir.size===this.options.lanes)break}return lr.size===this.options.lanes?Array.from(lr.values()).sort((dr,fr)=>dr.end===fr.end?dr.index-fr.index:dr.end-fr.end)[0]:void 0},this.getMeasurementOptions=memo(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(tr,rr,ir,lr,dr)=>(this.pendingMeasuredCacheIndexes=[],{count:tr,paddingStart:rr,scrollMargin:ir,getItemKey:lr,enabled:dr}),{key:!1}),this.getMeasurements=memo(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:tr,paddingStart:rr,scrollMargin:ir,getItemKey:lr,enabled:dr},fr)=>{if(!dr)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(gr=>{this.itemSizeCache.set(gr.key,gr.size)}));const hr=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const mr=this.measurementsCache.slice(0,hr);for(let gr=hr;gr<tr;gr++){const yr=lr(gr),_r=this.options.lanes===1?mr[gr-1]:this.getFurthestMeasurement(mr,gr),br=_r?_r.end+this.options.gap:rr+ir,wr=fr.get(yr),vr=typeof wr=="number"?wr:this.options.estimateSize(gr),Sr=br+vr,Ir=_r?_r.lane:gr%this.options.lanes;mr[gr]={index:gr,start:br,size:vr,end:Sr,key:yr,lane:Ir}}return this.measurementsCache=mr,mr},{key:!1,debug:()=>this.options.debug}),this.calculateRange=memo(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(tr,rr,ir,lr)=>this.range=tr.length>0&&rr>0?calculateRange({measurements:tr,outerSize:rr,scrollOffset:ir,lanes:lr}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=memo(()=>{let tr=null,rr=null;const ir=this.calculateRange();return ir&&(tr=ir.startIndex,rr=ir.endIndex),this.maybeNotify.updateDeps([this.isScrolling,tr,rr]),[this.options.rangeExtractor,this.options.overscan,this.options.count,tr,rr]},(tr,rr,ir,lr,dr)=>lr===null||dr===null?[]:tr({startIndex:lr,endIndex:dr,overscan:rr,count:ir}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=tr=>{const rr=this.options.indexAttribute,ir=tr.getAttribute(rr);return ir?parseInt(ir,10):(console.warn(`Missing attribute name '${rr}={index}' on measured element.`),-1)},this._measureElement=(tr,rr)=>{const ir=this.indexFromElement(tr),lr=this.measurementsCache[ir];if(!lr)return;const dr=lr.key,fr=this.elementsCache.get(dr);fr!==tr&&(fr&&this.observer.unobserve(fr),this.observer.observe(tr),this.elementsCache.set(dr,tr)),tr.isConnected&&this.resizeItem(ir,this.options.measureElement(tr,rr,this))},this.resizeItem=(tr,rr)=>{const ir=this.measurementsCache[tr];if(!ir)return;const lr=this.itemSizeCache.get(ir.key)??ir.size,dr=rr-lr;dr!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(ir,dr,this):ir.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=dr,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(ir.index),this.itemSizeCache=new Map(this.itemSizeCache.set(ir.key,rr)),this.notify(!1))},this.measureElement=tr=>{if(!tr){this.elementsCache.forEach((rr,ir)=>{rr.isConnected||(this.observer.unobserve(rr),this.elementsCache.delete(ir))});return}this._measureElement(tr,void 0)},this.getVirtualItems=memo(()=>[this.getVirtualIndexes(),this.getMeasurements()],(tr,rr)=>{const ir=[];for(let lr=0,dr=tr.length;lr<dr;lr++){const fr=tr[lr],hr=rr[fr];ir.push(hr)}return ir},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=tr=>{const rr=this.getMeasurements();if(rr.length!==0)return notUndefined(rr[findNearestBinarySearch(0,rr.length-1,ir=>notUndefined(rr[ir]).start,tr)])},this.getOffsetForAlignment=(tr,rr,ir=0)=>{const lr=this.getSize(),dr=this.getScrollOffset();rr==="auto"&&(rr=tr>=dr+lr?"end":"start"),rr==="center"?tr+=(ir-lr)/2:rr==="end"&&(tr-=lr);const fr=this.getTotalSize()-lr;return Math.max(Math.min(fr,tr),0)},this.getOffsetForIndex=(tr,rr="auto")=>{tr=Math.max(0,Math.min(tr,this.options.count-1));const ir=this.measurementsCache[tr];if(!ir)return;const lr=this.getSize(),dr=this.getScrollOffset();if(rr==="auto")if(ir.end>=dr+lr-this.options.scrollPaddingEnd)rr="end";else if(ir.start<=dr+this.options.scrollPaddingStart)rr="start";else return[dr,rr];const fr=rr==="end"?ir.end+this.options.scrollPaddingEnd:ir.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(fr,rr,ir.size),rr]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(tr,{align:rr="start",behavior:ir}={})=>{this.cancelScrollToIndex(),ir==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(tr,rr),{adjustments:void 0,behavior:ir})},this.scrollToIndex=(tr,{align:rr="auto",behavior:ir}={})=>{tr=Math.max(0,Math.min(tr,this.options.count-1)),this.cancelScrollToIndex(),ir==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const lr=this.getOffsetForIndex(tr,rr);if(!lr)return;const[dr,fr]=lr;this._scrollToOffset(dr,{adjustments:void 0,behavior:ir}),ir!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(tr))){const mr=this.getOffsetForIndex(tr,fr);if(!mr)return;const[gr]=mr,yr=this.getScrollOffset();approxEqual(gr,yr)||this.scrollToIndex(tr,{align:fr,behavior:ir})}else this.scrollToIndex(tr,{align:fr,behavior:ir})}))},this.scrollBy=(tr,{behavior:rr}={})=>{this.cancelScrollToIndex(),rr==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+tr,{adjustments:void 0,behavior:rr})},this.getTotalSize=()=>{var tr;const rr=this.getMeasurements();let ir;if(rr.length===0)ir=this.options.paddingStart;else if(this.options.lanes===1)ir=((tr=rr[rr.length-1])==null?void 0:tr.end)??0;else{const lr=Array(this.options.lanes).fill(null);let dr=rr.length-1;for(;dr>=0&&lr.some(fr=>fr===null);){const fr=rr[dr];lr[fr.lane]===null&&(lr[fr.lane]=fr.end),dr--}ir=Math.max(...lr.filter(fr=>fr!==null))}return Math.max(ir-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(tr,{adjustments:rr,behavior:ir})=>{this.options.scrollToFn(tr,{behavior:ir,adjustments:rr},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const findNearestBinarySearch=(e,t,tr,rr)=>{for(;e<=t;){const ir=(e+t)/2|0,lr=tr(ir);if(lr<rr)e=ir+1;else if(lr>rr)t=ir-1;else return ir}return e>0?e-1:0};function calculateRange({measurements:e,outerSize:t,scrollOffset:tr,lanes:rr}){const ir=e.length-1,lr=hr=>e[hr].start;if(e.length<=rr)return{startIndex:0,endIndex:ir};let dr=findNearestBinarySearch(0,ir,lr,tr),fr=dr;if(rr===1)for(;fr<ir&&e[fr].end<tr+t;)fr++;else if(rr>1){const hr=Array(rr).fill(0);for(;fr<ir&&hr.some(gr=>gr<tr+t);){const gr=e[fr];hr[gr.lane]=gr.end,fr++}const mr=Array(rr).fill(tr+t);for(;dr>=0&&mr.some(gr=>gr>=tr);){const gr=e[dr];mr[gr.lane]=gr.start,dr--}dr=Math.max(0,dr-dr%rr),fr=Math.min(ir,fr+(rr-1-fr%rr))}return{startIndex:dr,endIndex:fr}}const useIsomorphicLayoutEffect=typeof document<"u"?React.useLayoutEffect:React.useEffect;function useVirtualizerBase(e){const t=React.useReducer(()=>({}),{})[1],tr={...e,onChange:(ir,lr)=>{var dr;lr?flushSync(t):t(),(dr=e.onChange)==null||dr.call(e,ir,lr)}},[rr]=React.useState(()=>new Virtualizer(tr));return rr.setOptions(tr),useIsomorphicLayoutEffect(()=>rr._didMount(),[]),useIsomorphicLayoutEffect(()=>rr._willUpdate()),rr}function useVirtualizer(e){return useVirtualizerBase({observeElementRect,observeElementOffset,scrollToFn:elementScroll,...e})}function Address(e){const{address:t,chainId:tr}=e,[,rr]=useCopyToClipboard();if(!t)return null;const ir=formatEthAddress(t);function lr(fr){return()=>{rr(fr).catch(hr=>{console.error("Failed to copy!",hr)})}}const dr=jsxs("button",{className:"flex items-center gap-1",onClick:lr(t),children:[t,jsx$1(Icon,{className:"inline-block text-gray-600",name:"FilesEarmark",size:16})]});return jsx$1(Tooltip,{content:dr,children:jsxs("span",{className:"flex w-fit cursor-pointer items-center gap-1 rounded-lg bg-gray-100 p-1 text-xs text-slate-100",children:[jsx$1(ENSAvatar,{address:t,chainId:tr}),ir]})})}function Errors(e){const{errors:t}=e,tr=!!(t!=null&&t.length),rr=tr?"text-red-800":"text-green-700",ir=tr?jsx$1(Icon,{name:"Exclamation",size:16}):jsx$1(Icon,{name:"Check",size:16}),lr=tr?`Error: ${t[0]}`:"No errors",dr=jsxs("span",{className:twMerge("flex w-fit items-center rounded-lg border border-gray-200 px-2 py-1 text-xs",rr,tr&&"cursor-pointer"),children:[ir,jsx$1("span",{className:twMerge("inline-block max-w-36 truncate"),children:lr})]}),fr=t==null?void 0:t.map((hr,mr)=>jsxs("p",{className:"text-red-800",children:["Error: ",hr]},mr));return tr?jsx$1(Tooltip,{content:fr,children:dr}):dr}function Operation(e){const{operationType:t,operationInput:tr}=e,rr=jsx$1("code",{children:jsx$1("pre",{children:JSON.stringify(tr,null,2)})});return jsx$1(Tooltip,{content:rr,children:jsxs("span",{className:"flex cursor-pointer items-center gap-2 text-xs",children:[t,jsx$1(Icon,{className:"text-gray-300",name:"Braces",size:16})]})})}function RevisionNumber(e){const{operationIndex:t,eventId:tr,stateHash:rr}=e,[,ir]=useCopyToClipboard(),lr=t+1,dr=jsxs("button",{className:"flex items-center gap-1",onClick:fr(rr),children:["Revision ",lr," - Event ID: ",tr," - State Hash: ",rr,jsx$1(Icon,{className:"inline-block text-gray-600",name:"FilesEarmark",size:16})]});function fr(hr){return()=>{ir(hr).catch(mr=>{console.error("Failed to copy!",mr)})}}return jsx$1(Tooltip,{content:dr,children:jsxs("span",{className:"flex cursor-pointer items-center gap-2 text-xs text-gray-600",children:["Revision ",lr,".",jsx$1("a",{children:jsx$1(Icon,{className:"cursor-pointer text-slate-100",name:"Ellipsis",size:14})})]})})}function Signature(e){const{signatures:t}=e;if(!(t!=null&&t.length))return null;const tr=jsxs("div",{className:"text-xs text-slate-300",children:[jsx$1("h3",{className:"mb-2",children:"Signature details:"}),t.map((rr,ir)=>jsxs("div",{className:"mb-2 last:mb-0",children:[jsxs("h4",{children:["Signature #",ir+1," -"," ",rr.isVerified?"verified":"unverified"]}),jsx$1("code",{children:jsx$1("pre",{children:JSON.stringify(rr,null,2)})})]},rr.hash))]});return jsx$1(Tooltip,{content:tr,children:jsxs("span",{className:"flex w-fit cursor-pointer items-center gap-1 rounded-lg border border-gray-200 px-2 py-1",children:[jsx$1(VerificationStatus,{signatures:t})," ",jsx$1(Icon,{className:"text-gray-300",name:"InfoSquare",size:16})]})})}function VerificationStatus(e){const{signatures:t}=e;if(!(t!=null&&t.length))return null;const tr=t.length,rr=t.filter(fr=>fr.isVerified).length,lr=`${rr}/${tr} ${tr===1?"signature":"signatures"} verified`;return jsx$1("span",{className:`text-xs ${rr===0?"text-red-800":rr===tr?"text-green-700":"text-orange-700"}`,children:lr})}function Timestamp(e){const{timestamp:t}=e,tr=typeof t=="string"&&!t.includes("-")?parseInt(t):t,rr=new Date(tr),ir=format(rr,"HH:mm 'UTC'"),lr=format(rr,"eee, dd MMM yyyy HH:mm:ss 'UTC'"),dr=jsx$1("div",{children:lr});return jsx$1(Tooltip,{content:dr,children:jsxs("span",{className:"cursor-pointer text-xs",children:["committed at ",ir]})})}function _Revision(e){return jsxs("article",{className:"flex items-center justify-between rounded-xl border border-gray-200 bg-white px-4 py-2",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx$1(RevisionNumber,{...e}),jsx$1(Operation,{...e}),jsx$1(Address,{...e}),jsx$1(Timestamp,{...e})]}),jsxs("div",{className:"flex items-center gap-1",children:[jsx$1(Signature,{...e}),jsx$1(Errors,{...e})]})]})}const Revision=memo$1(_Revision);function Skip(e){const{operationIndex:t,skipCount:tr}=e,rr=t,ir=tr===1?`${rr}`:`${rr} - ${rr+1-tr}`;return jsxs("article",{className:"grid grid-cols-[1fr,auto,1fr] items-center py-2",children:[jsx$1("div",{className:"h-px rounded-full bg-slate-100"}),jsxs("div",{className:"mx-3 text-xs text-slate-100",children:["[Skipped Revision ",ir,"]"]}),jsx$1("div",{className:"h-px rounded-full bg-slate-100"})]})}function makeRows(e){var rr,ir,lr,dr,fr,hr;const t=[],tr=new Set;for(const mr of e){const gr=mr.timestamp.split("T")[0];tr.has(gr)||(tr.add(gr),t.push({type:"day",height:32,timestamp:gr})),t.push({type:"revision",height:46,operationIndex:mr.index,eventId:mr.id??"EVENT_ID_NOT_FOUND",stateHash:mr.hash,operationType:mr.type,operationInput:mr.input??{},address:(ir=(rr=mr.context)==null?void 0:rr.signer)==null?void 0:ir.user.address,chainId:(dr=(lr=mr.context)==null?void 0:lr.signer)==null?void 0:dr.user.chainId,timestamp:mr.timestamp,signatures:makeSignatures(((hr=(fr=mr.context)==null?void 0:fr.signer)==null?void 0:hr.signatures)??[]),errors:mr.error?[mr.error]:void 0}),mr.skip>0&&t.push({type:"skip",height:34,operationIndex:mr.index,skipCount:mr.skip,timestamp:mr.timestamp})}return t}function makeSignatureFromSignatureArray(e){const[t,tr,rr,ir]=e;return{signerAddress:t,hash:tr,prevStateHash:rr,signatureBytes:ir,isVerified:!0}}function makeSignatures(e){return e==null?void 0:e.map(makeSignatureFromSignatureArray)}function Day(e){const{timestamp:t}=e,tr=format(t,"MMM dd, yyyy");return jsxs("h2",{className:"-ml-6 flex items-center gap-1 bg-slate-50 py-2 text-xs text-slate-100",children:[jsx$1(Icon,{name:"Ring",size:16})," Changes on ",tr]})}function Timeline(e){const{localOperations:t,globalOperations:tr,scope:rr}=e,ir=rr==="local"?t:tr,lr=100,dr=useMemo(()=>makeRows(ir),[ir]),[fr,hr]=useState(0),[mr,gr]=useState(lr),[yr,_r]=useState(()=>dr.slice(0,mr)),br=useRef(null),wr=yr.length<dr.length,vr=useVirtualizer({count:yr.length,getScrollElement:()=>br.current,estimateSize:Ir=>dr[Ir].height,gap:8});useEffect(()=>{if(!wr)return;const Ir=Math.floor(fr/46),Mr=lr+Ir;gr(Ar=>Mr>Ar?Mr:Ar)},[fr,wr]),useEffect(()=>{_r(dr.slice(0,mr))},[dr,mr]);const Sr=Ir=>{hr(Mr=>{const Ar=Mr+Ir.deltaY;return Ar<0?0:Ar})};return useEffect(()=>(window.addEventListener("wheel",Sr),()=>{window.removeEventListener("wheel",Sr)}),[]),jsx$1("div",{className:"border-l border-slate-100",ref:br,style:{height:`${vr.getTotalSize()}px`,width:"100%",position:"relative"},children:vr.getVirtualItems().map(Ir=>{const Mr=yr[Ir.index];return jsxs("div",{style:{position:"absolute",top:0,left:16,width:"100%",height:`${Ir.size}px`,transform:`translateY(${Ir.start}px)`},children:[Mr.type==="revision"&&createElement(Revision,{...Mr,key:Ir.key}),Mr.type==="skip"&&jsx$1(Skip,{...Mr},Ir.key),Mr.type==="day"&&jsx$1(Day,{...Mr},Ir.key)]},Ir.index)})})}function RevisionHistory(e){const{documentTitle:t,documentId:tr,globalOperations:rr,localOperations:ir,onClose:lr,itemsPerPage:dr=100}=e,[fr,hr]=useState("global"),mr=useMemo(()=>garbageCollect(sortOperations(fr==="global"?rr:ir)).sort((Fr,Lr)=>Lr.index-Fr.index),[rr,ir,fr]),{pageItems:gr,pages:yr,goToPage:_r,goToNextPage:br,goToPreviousPage:wr,goToFirstPage:vr,goToLastPage:Sr,hiddenNextPages:Ir,isNextPageAvailable:Mr,isPreviousPageAvailable:Ar}=usePagination(mr,{itemsPerPage:dr});function kr($r){vr(),hr($r)}const Dr=mr.length>dr?jsx$1("div",{className:"mt-4 flex w-full justify-end",children:jsx$1(Pagination,{firstPageLabel:"First Page",goToFirstPage:vr,goToLastPage:Sr,goToNextPage:br,goToPage:_r,goToPreviousPage:wr,hiddenNextPages:Ir,isNextPageAvailable:Mr,isPreviousPageAvailable:Ar,lastPageLabel:"Last Page",nextPageLabel:"Next",pages:yr,previousPageLabel:"Previous"})}):jsx$1("hr",{className:"h-12 border-none"});return jsxs(TooltipProvider,{children:[jsx$1(Header,{docId:tr,onChangeScope:kr,onClose:lr,scope:fr,title:t}),Dr,jsx$1("div",{className:"mt-4 flex justify-center rounded-md bg-slate-50 p-4",children:mr.length>0?jsx$1("div",{className:"grid grid-cols-[minmax(min-content,1018px)]",children:jsx$1(Timeline,{globalOperations:fr==="global"?gr:[],localOperations:fr==="local"?gr:[],scope:fr})}):jsx$1("h3",{className:"my-40 text-gray-600",children:"This document has no recorded operations yet."})}),Dr]})}const FilterItem=e=>{const{item:t,...tr}=e;return jsxs("div",{...mergeClassNameProps(tr,"flex h-full flex-row items-center justify-between gap-x-4 px-2"),children:[t.icon,jsx$1("div",{className:"text-sm font-semibold text-slate-200",children:t.label})]})},ConnectSearchBar=e=>{const{value:t,onChange:tr,placeholder:rr,filterLabel:ir,filterItems:lr,selectedFilter:dr,onFilterSelect:fr=()=>{},className:hr}=e,mr=useMemo(()=>(lr==null?void 0:lr.map(br=>({id:br.id,content:jsx$1(FilterItem,{item:br})})))??[],[lr]),gr=lr==null?void 0:lr.find(br=>br.id===dr),yr=gr?jsx$1(FilterItem,{className:"gap-x-1",item:gr}):ir&&jsx$1("div",{className:"mr-2 text-sm font-semibold text-slate-200",children:ir});function _r(br){tr==null||tr(br.target.value)}return jsxs("div",{className:cn$2("flex items-center",hr),children:[jsx$1(Icon,{className:"mr-3",name:"Search"}),jsx$1("input",{className:twMerge("flex h-[52px] min-w-0 flex-1 items-center rounded-xl border border-gray-200 bg-gray-50 px-4 text-sm text-slate-200 outline-none"),onChange:_r,placeholder:rr,value:t}),jsxs(DropdownMenu,{children:[jsxs(DropdownMenuTrigger,{className:"ml-3 flex h-full flex-row items-center outline-none",children:[yr," ",jsx$1(Icon,{name:"ChevronDown"})]}),jsx$1(DropdownMenuContent,{className:"rounded-xl border border-gray-100 bg-gray-50 p-2",children:mr.map(br=>jsx$1(DropdownMenuItem,{className:"h-10 cursor-pointer overflow-hidden rounded-lg hover:bg-gray-100",id:br.id,onSelect:()=>fr(br.id),children:br.content},br.id))})]})]})},renownShortHover=""+new URL("renown-short-hover-BiSLBV7L.png",import.meta.url).href,renownShort="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAtmSURBVHgB7Z3dbtvmGcefl5LsqHYCq0C6tEUCZ0kDzAFqd0NTYAmweAfr0YD0CrpeQboriH0H6RUsu4ChAYodtCdJD3LQBGttILEBJ4tdJ2uzBoi0yIpsi+S790+ZDkmREilSHySfX6FKpkgliH5+nuf9pKAEkFLO1Bu7VzRNzEuiWfXzglDHSIgZYsYC9b1sCaEeJFZMU66WCnS7XC5vUUwE9Qmk2dndvar+ZpetB5NCxIr6Hr+II1NkgQ7FMeTnHGGygxLhRkGj5agiRRKo3mxeY3EyjkZLR8vl5bCnhxKo2WzOGqb4UpJcCDpH1T+E/wpKY+3gU4XoO0MyCaKyhvVsqifTNNWzVM8y8Hz1rW2pr3ExTDTq+Q3vNPc/lYZ+3S/qwI+iVlDSCJYlZcgDiVqGQdLXJVGTJD47NjV5s9vndP3W6429a8rZpY6LIE6hoB4aMenHMMxgkXqktECBguSBNHhwxMkWiEgt3SRDpbgOukjka8HLxt4VQeaX3uOlIkedrKPr7WjkRWiFv0yXJ/7ecdx7AAWzbsgfnDUPgs1EsWgVykz2QTTaa+melCZqRU1+4C2sO8KJSoe3vAXzZInlyRMoTxAw3MgZXbXEvee6BELdg6EI5zGkLa538gcCRkk1lNzIhXqjseQ8cmiGlbpM2nS+WdA0migViMkvKKx1V00kavr+5OlKRdTw02EEUqnrmvNCBJ1SkQvmvFMsauROQHKmOPHqc/sn6y2/6MMtLsams2X2OgpZhrQM92h6u6OQ5WHadItCliWqSL7quqDAdQ/jpqB5nBDaH6wnv/R1ZKLILS/GBbqEdvdarmP6/pGK5k1f1qg6y8N4gBHevsBSafeKOuSeoqGxPEwAXjcwvUfVQGLedZLGxTPjj9cNKWhWw/9cJ3EAYgLwuqHaZvM4Nus+zAYxAXSkMDGj9TiHYQ7pVEP1BxEzFL6+9T3tvGrS4u/fpzcrRykrcMU8BLb/85yePa/STmOX1h49oSzBAg2BJ0qgw9dPn1OWYIEGzH5LtyKQ8+dnv1QpK7BAA2ZbRRxI42T1wSZlBRZowKw/2u44hnpov9WiLMACDRCI8qK64/ve2sZTygIs0ABZvf848L31je1MRCEWaEA82vxZRaBa4Puoi1bvp78WYoEGxOra457nrD18kvoWGQs0AFYfPLY6DcOdm+4oxAIlzE6jSSsRpEChvbaR3t5pFihBUBR/fft7isq9lY3UpjIWKEHufLceOnV1XHtvzYpeaYMFSgjUPds/9T/OBfEQvdLWtGeBEgDyrCRQDFsS3UqXRCxQTJKSx+ZFbSdVErFAMbi38jBReWwg0Vff3E1FTcQC9YHV2lJRYm1jmwaFXRONu0Si3mi69qEqT5aICQb9NnfurvXd2uqHhfO/pvnzp2kcaHpWp7JAIUHUWX2wNdCo0403Z6Zp8eL7ND1VplHCAvXBuuopXlHFsndi2Cg4O/u2FY1GJRILFBJEnEebz2j94fZQ01UYpqeO0InjlZGIxAL1ADUOJsFjOsY4RJxenHr3OJ05/Tadeuc4DQMWKAC0dtqtnvGKNmGZKBXp4oU5S6hB4hWIm/EHoO8lrfIAa/XHT8NfMsQCHXDirYqqK9J7FytEoLmzp2jYcArzgCiEqRWYUTjuEQnSWPWPSlsoqocB10ARwIJATH7vNrd5FECc35w7SXPnTlmvhwkL1AdokY1DRBqlODYsUAzQmTiqOcwnVTP90kdzIxPHhgWKSXuQ819Di0YQ5sMPzlk90OMAC5QQd1c2rCGOQYIe548v/856Hhe8AvEGU31yYeGcFR0GldLQpbB4aX7kKasXLFAMMM0CJC3RGZWuLqle5TQwcoGGUUsMMgUkLVGa5AEjF+gf/7xDwwQyTb9RpomJIlVmpg96oON1wiUlEeb8pEkekLsUhohnRz10FNpfOiRCr26/rR1IhPGofgtriL14cZ7SBtdAB2AaBx5YZXF29p2+ppBCov/+UlMDs3WKyri1tsLCg6keEJ3QYYjU+mjr50jXosWEaadRW04fLryXSnkACxQARMLk+ah1DUSYP6iJwoDmOoYm0goL1ANEI4gUhTk1XhV2asjFC+cpzbBAIUAqiypRmCiEc9KaumxYoJBAoij7+PSaoAZxxmV8Kw4sUASwj8+LavgWVrcodEa19NIefQALFBGshw9LtyiUhegDWKCIWP1FEXYT84tCGK7IQvQBqe1IxBdwJuRvcbW6Qy/+V09s3A1Ne0SXMODWTugXcq4xO3s6G9EHpFcgNZ61EKG/BSQ1NRU9zVi5OlHqPXfKnvhuD3HYq0qzQq5SGH7z//ynj2LXH+077oSfaO9cNfqrDMkDclcD2Ss4464BQy0UFqS7k+8et0bbo0bNcSe3g6noAf7qm+/6Xv8eNQ3+UY2RZZHctsKsIjxGMVvtY8Q9i+S6GR9nR4s0r6NPklwLlKW7J4+KXAs07ise0gD3RDOxyLVAadiBbNzJtUAvYrSksjKWFZdcC/TvzWhznp1gKIXJsUDYEzFKb7KXSmWamBwLtP7waay+nCwNiMYhlwJh7VfcHedPvJXe/RSTJFcdIdbCwfubsVIXwDykMFM58kBqBdp51bSW3IShgY0zlTRJDT9kaUJYXNIrkJJhFNvNofbh+uc13BMdkYsp2z1j0LBAEcjCQsCkYYFCghmMC2Ny07dxggUKgXWzt0vp27tnGPB8hh6My/7M4wr/qwQAYbDJVJq3XhkGLJAPuJ0AVk9w1OkN10A+oJeZ5QkHC+QD7tCDladMb1L7a4be4I8Xfxv4fpwbo2Cm4trGU262hyCzESjuLZE4CoUjswLZ99bqFzsKMd3JdA3EUWjwZFogjkKDJ/OtMI5CgyXzAtkbPPULR6Hu5KIfaO69eMMRHIWCyYVA7W3l+p8Ez1EomNz0RM/H3BmMo5A/uRGo187xveAo5E+uxsI4CiVPrgTiKJQ8uRuN5yiULLkTiKNQsuRyPhDulBMHjkKvyaVAWJocZ30XR6HX5HZG4pmYtzvgKNQmtwLFHWTlKNQmtwLFneoBOArlfFI9R6H4iHqjKZ0HypO8cRITTHPPHXFVBJKuG19JSQzji58amiRR630awygzTLcbgmhLE0KsOA+a7A8TgFcNKZRAZJo/Og8apkkM44fpdcOUq0hhrggkuQhiAjA9bsAdzWjt3nSdpHIYO8R4QWAxPfWNUaDbWqVSqSmVbjvf0E2DGMaJ2VFAy5VKubzV7kiU9K3zTUPnOohx0zLcTphSfIFnSyBd373u7A+Ca7rBUYhpYyh5vLUx0heeLYGsNGa2jbLRdZNrIcYSxxt9BGk3kL7arw+oVqszxYnJTXXocLpesahRqVAgJr/s64YVgZzoGp22BTocTA2KQpzK8ouuxPHKo6qfZVseILwX1Ru7P6jAteA8NqlGrDVNEJMfkLp29933lBWq53n6jbJr27aO6Ry6Jj/xDrBi2gJ3MOYHQzXZ91rezCNrLUGL3nM7BEJ4klL81XWpesBGTmfZB2nLL2BIKnzmTF02vhPKjk2Xb5BJy97jLVUToajiaJQ9rNaW+m7x6MRcPjY1edPvuq6FTb3eXFKKXeu4SCXDYkGzHkz6QdTRffp62pjLR6emloKu7VkZv3zZuCIK4m/O5v3hxQciFVSBjddMeoAsuolWlgwQR9aEKmWmkY26EOpbrzabsyVJt9SfMxt0DlppmmiLhNf4YJZqPLAFQXGMEXW/gVEnmCPWEvITv5qn41yKQFBKY7KCtPoCjx4tL4W9InKIQDQqGOaSENqnxGSEtjj69JHrFeGd4tydvnNMWyS6rMLdVW/HI5MShBoQNejbfsR5/REJcCiTJZKYl4Jm1QfPEjMmyBoWT2AOj+rQ+REzCY2pIzf7lcbJ/wH9VD8KK3ri6QAAAABJRU5ErkJggg==",SidebarLogin=({onLogin:e})=>{const t=jsx$1(AccountPopoverLogin,{onLogin:e});return jsx$1(AccountPopover,{content:t,children:jsxs("div",{className:twMerge("group/sidebar-footer flex w-full items-baseline justify-start text-sm font-semibold leading-10 text-gray-600",e?"cursor-pointer":"cursor-wait"),children:[jsx$1("img",{width:42,height:42,loading:"lazy",className:"group-hover/sidebar-footer:hidden",src:renownShort,alt:"Renown Login"}),jsx$1("img",{width:42,height:42,loading:"lazy",className:"hidden group-hover/sidebar-footer:block",src:renownShortHover,alt:"Renown Login Hover"})]})})},SidebarUser=({address:e,etherscanUrl:t,onDisconnect:tr})=>{const{data:rr}=useEnsName({address:e}),lr=jsx$1(AccountPopoverUser,{address:e,username:rr,onDisconnect:tr,etherscanUrl:t});return jsx$1(AccountPopover,{content:lr,children:jsx$1("div",{className:"flex items-center justify-center rounded-sm",children:jsx$1(ENSAvatar,{address:e,size:"40px"})})})},ConnectSidebarFooter=({address:e,className:t,onLogin:tr,onClickSettings:rr,onDisconnect:ir,etherscanUrl:lr="",...dr})=>jsxs(SidebarFooter,{...dr,className:twMerge("flex flex-col gap-2 border-t border-gray-300 px-2 py-4",t),children:[jsx$1("div",{children:e?jsx$1(SidebarUser,{address:e,onDisconnect:ir,etherscanUrl:lr}):jsx$1(SidebarLogin,{onLogin:tr})}),jsxs("button",{"aria-label":"Settings",type:"button",className:twMerge("mt-3 flex w-full items-center justify-center outline-none",rr?"cursor-pointer":"cursor-wait"),onClick:rr,children:[jsx$1(Icon,{className:"text-gray-600",name:"Settings"}),jsx$1("span",{className:"hidden text-sm font-semibold leading-6 text-gray-800",children:"Settings"})]})]}),ConnectSidebarHeader=({onClick:e,className:t,children:tr,...rr})=>jsx$1(SidebarHeader,{...rr,className:twMerge("flex justify-center gap-4 border-b border-gray-300 py-4",t),children:jsx$1("button",{"aria-label":"Home",className:e?"cursor-pointer":"cursor-wait",onClick:e,type:"button",children:jsx$1(Icon,{className:"text-gray-600",name:"ConnectSmall",size:24})})}),ConnectSidebar=({onClick:e,address:t,headerContent:tr,onClickSettings:rr,maxWidth:ir="304px",minWidth:lr="58px",onLogin:dr,onDisconnect:fr,etherscanUrl:hr,...mr})=>jsxs(Sidebar,{...mr,maxWidth:ir,minWidth:lr,children:[jsxs(SidebarPanel,{children:[jsx$1(ConnectSidebarHeader,{onClick:e,children:tr}),jsx$1("div",{className:"flex flex-col",children:mr.children})]}),jsx$1(ConnectSidebarFooter,{address:t,onClickSettings:rr,onLogin:dr,onDisconnect:fr,etherscanUrl:hr})]}),SidebarItem=function e(t){const{icon:tr,title:rr,containerClassName:ir,active:lr,onClick:dr}=t;return jsx$1("div",{className:twMerge("relative flex cursor-pointer flex-col items-center justify-center text-center text-sm text-black",ir,lr&&"bg-white",dr&&"cursor-pointer"),onClick:dr,children:jsx$1("div",{className:"mx-auto py-4",children:tr||jsx$1("div",{className:"size-8 items-center justify-center rounded-lg bg-black pt-1",children:jsx$1("span",{className:"text-6 w-6 text-white",children:rr.slice(0,1).toUpperCase()})})})})},SidebarAddDriveItem=function e(t){const{containerClassName:tr,onClick:rr}=t;return jsx$1(SidebarItem,{title:"Create New Drive",icon:jsx$1(Icon,{name:"PlusSquare",size:32}),onClick:rr,containerClassName:tr})};function TabContent(e){const{children:t}=e;return jsx$1("div",{children:t})}var TABS_NAME="Tabs",[createTabsContext,createTabsScope]=createContextScope(TABS_NAME,[createRovingFocusGroupScope]),useRovingFocusGroupScope=createRovingFocusGroupScope(),[TabsProvider,useTabsContext]=createTabsContext(TABS_NAME),Tabs$1=React.forwardRef((e,t)=>{const{__scopeTabs:tr,value:rr,onValueChange:ir,defaultValue:lr,orientation:dr="horizontal",dir:fr,activationMode:hr="automatic",...mr}=e,gr=useDirection(fr),[yr,_r]=useControllableState({prop:rr,onChange:ir,defaultProp:lr??"",caller:TABS_NAME});return jsx$1(TabsProvider,{scope:tr,baseId:useId(),value:yr,onValueChange:_r,orientation:dr,dir:gr,activationMode:hr,children:jsx$1(Primitive.div,{dir:gr,"data-orientation":dr,...mr,ref:t})})});Tabs$1.displayName=TABS_NAME;var TAB_LIST_NAME="TabsList",TabsList=React.forwardRef((e,t)=>{const{__scopeTabs:tr,loop:rr=!0,...ir}=e,lr=useTabsContext(TAB_LIST_NAME,tr),dr=useRovingFocusGroupScope(tr);return jsx$1(Root$2,{asChild:!0,...dr,orientation:lr.orientation,dir:lr.dir,loop:rr,children:jsx$1(Primitive.div,{role:"tablist","aria-orientation":lr.orientation,...ir,ref:t})})});TabsList.displayName=TAB_LIST_NAME;var TRIGGER_NAME="TabsTrigger",TabsTrigger=React.forwardRef((e,t)=>{const{__scopeTabs:tr,value:rr,disabled:ir=!1,...lr}=e,dr=useTabsContext(TRIGGER_NAME,tr),fr=useRovingFocusGroupScope(tr),hr=makeTriggerId(dr.baseId,rr),mr=makeContentId(dr.baseId,rr),gr=rr===dr.value;return jsx$1(Item,{asChild:!0,...fr,focusable:!ir,active:gr,children:jsx$1(Primitive.button,{type:"button",role:"tab","aria-selected":gr,"aria-controls":mr,"data-state":gr?"active":"inactive","data-disabled":ir?"":void 0,disabled:ir,id:hr,...lr,ref:t,onMouseDown:composeEventHandlers(e.onMouseDown,yr=>{!ir&&yr.button===0&&yr.ctrlKey===!1?dr.onValueChange(rr):yr.preventDefault()}),onKeyDown:composeEventHandlers(e.onKeyDown,yr=>{[" ","Enter"].includes(yr.key)&&dr.onValueChange(rr)}),onFocus:composeEventHandlers(e.onFocus,()=>{const yr=dr.activationMode!=="manual";!gr&&!ir&&yr&&dr.onValueChange(rr)})})})});TabsTrigger.displayName=TRIGGER_NAME;var CONTENT_NAME="TabsContent",TabsContent=React.forwardRef((e,t)=>{const{__scopeTabs:tr,value:rr,forceMount:ir,children:lr,...dr}=e,fr=useTabsContext(CONTENT_NAME,tr),hr=makeTriggerId(fr.baseId,rr),mr=makeContentId(fr.baseId,rr),gr=rr===fr.value,yr=React.useRef(gr);return React.useEffect(()=>{const _r=requestAnimationFrame(()=>yr.current=!1);return()=>cancelAnimationFrame(_r)},[]),jsx$1(Presence,{present:ir||gr,children:({present:_r})=>jsx$1(Primitive.div,{"data-state":gr?"active":"inactive","data-orientation":fr.orientation,role:"tabpanel","aria-labelledby":hr,hidden:!_r,id:mr,tabIndex:0,...dr,ref:t,style:{...e.style,animationDuration:yr.current?"0s":void 0},children:_r&&lr})})});TabsContent.displayName=CONTENT_NAME;function makeTriggerId(e,t){return`${e}-trigger-${t}`}function makeContentId(e,t){return`${e}-content-${t}`}var Root2=Tabs$1,List=TabsList,Trigger=TabsTrigger,Content=TabsContent;function Tabs({children:e,defaultValue:t}){return jsxs(Root2,{defaultValue:t,className:"flex flex-col gap-2",children:[jsx$1("div",{className:"flex w-full justify-between",children:jsx$1(List,{className:"flex w-full gap-x-2 rounded-xl bg-slate-50 p-1 text-sm font-semibold text-gray-600 outline-none",children:React__default.Children.map(e,(tr,rr)=>{if(!React__default.isValidElement(tr))return;const{label:ir,disabled:lr}=tr.props;return jsx$1(Trigger,{className:"data-[state='active']:tab-shadow ata-disabled:cursor-not-allowed data-disabled:text-gray-400 flex h-7 flex-1 items-center justify-center rounded-lg transition duration-300 data-[state='active']:bg-gray-50 data-[state='active']:text-gray-900",value:ir,disabled:lr??!1,children:ir},ir)})})}),jsx$1("div",{className:"mt-3 rounded-md bg-white",children:React__default.Children.map(e,(tr,rr)=>{if(!React__default.isValidElement(tr))return;const{label:ir}=tr.props;return jsx$1(Content,{value:ir,children:tr},rr)})})]})}const c=e=>typeof e=="number"&&!isNaN(e),d=e=>typeof e=="string",u=e=>typeof e=="function",p=e=>d(e)||u(e)?e:null,m=e=>isValidElement(e)||d(e)||u(e)||c(e);function f(e,t,tr){tr===void 0&&(tr=300);const{scrollHeight:rr,style:ir}=e;requestAnimationFrame(()=>{ir.minHeight="initial",ir.height=rr+"px",ir.transition=`all ${tr}ms`,requestAnimationFrame(()=>{ir.height="0",ir.padding="0",ir.margin="0",setTimeout(t,tr)})})}function g(e){let{enter:t,exit:tr,appendPosition:rr=!1,collapse:ir=!0,collapseDuration:lr=300}=e;return function(dr){let{children:fr,position:hr,preventExitTransition:mr,done:gr,nodeRef:yr,isIn:_r,playToast:br}=dr;const wr=rr?`${t}--${hr}`:t,vr=rr?`${tr}--${hr}`:tr,Sr=useRef(0);return useLayoutEffect(()=>{const Ir=yr.current,Mr=wr.split(" "),Ar=kr=>{kr.target===yr.current&&(br(),Ir.removeEventListener("animationend",Ar),Ir.removeEventListener("animationcancel",Ar),Sr.current===0&&kr.type!=="animationcancel"&&Ir.classList.remove(...Mr))};Ir.classList.add(...Mr),Ir.addEventListener("animationend",Ar),Ir.addEventListener("animationcancel",Ar)},[]),useEffect(()=>{const Ir=yr.current,Mr=()=>{Ir.removeEventListener("animationend",Mr),ir?f(Ir,gr,lr):gr()};_r||(mr?Mr():(Sr.current=1,Ir.className+=` ${vr}`,Ir.addEventListener("animationend",Mr)))},[_r]),React__default.createElement(React__default.Fragment,null,fr)}}function y(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const v=new Map;let h=[];const T=new Set,E=e=>T.forEach(t=>t(e)),b=()=>v.size>0;function I(e,t){var tr;if(t)return!((tr=v.get(t))==null||!tr.isToastActive(e));let rr=!1;return v.forEach(ir=>{ir.isToastActive(e)&&(rr=!0)}),rr}function _(e,t){m(e)&&(b()||h.push({content:e,options:t}),v.forEach(tr=>{tr.buildToast(e,t)}))}function C(e,t){v.forEach(tr=>{t!=null&&t!=null&&t.containerId?(t==null?void 0:t.containerId)===tr.id&&tr.toggle(e,t==null?void 0:t.id):tr.toggle(e,t==null?void 0:t.id)})}function L(e){const{subscribe:t,getSnapshot:tr,setProps:rr}=useRef(function(lr){const dr=lr.containerId||1;return{subscribe(fr){const hr=function(gr,yr,_r){let br=1,wr=0,vr=[],Sr=[],Ir=[],Mr=yr;const Ar=new Map,kr=new Set,Or=()=>{Ir=Array.from(Ar.values()),kr.forEach(Fr=>Fr())},Dr=Fr=>{Sr=Fr==null?[]:Sr.filter(Lr=>Lr!==Fr),Or()},$r=Fr=>{const{toastId:Lr,onOpen:qn,updateId:Kn,children:Gr}=Fr.props,Zn=Kn==null;Fr.staleId&&Ar.delete(Fr.staleId),Ar.set(Lr,Fr),Sr=[...Sr,Fr.props.toastId].filter(zr=>zr!==Fr.staleId),Or(),_r(y(Fr,Zn?"added":"updated")),Zn&&u(qn)&&qn(isValidElement(Gr)&&Gr.props)};return{id:gr,props:Mr,observe:Fr=>(kr.add(Fr),()=>kr.delete(Fr)),toggle:(Fr,Lr)=>{Ar.forEach(qn=>{Lr!=null&&Lr!==qn.props.toastId||u(qn.toggle)&&qn.toggle(Fr)})},removeToast:Dr,toasts:Ar,clearQueue:()=>{wr-=vr.length,vr=[]},buildToast:(Fr,Lr)=>{if((Qr=>{let{containerId:ls,toastId:ns,updateId:rs}=Qr;const ws=ls?ls!==gr:gr!==1,_s=Ar.has(ns)&&rs==null;return ws||_s})(Lr))return;const{toastId:qn,updateId:Kn,data:Gr,staleId:Zn,delay:zr}=Lr,$n=()=>{Dr(qn)},Hn=Kn==null;Hn&&wr++;const Jn={...Mr,style:Mr.toastStyle,key:br++,...Object.fromEntries(Object.entries(Lr).filter(Qr=>{let[ls,ns]=Qr;return ns!=null})),toastId:qn,updateId:Kn,data:Gr,closeToast:$n,isIn:!1,className:p(Lr.className||Mr.toastClassName),bodyClassName:p(Lr.bodyClassName||Mr.bodyClassName),progressClassName:p(Lr.progressClassName||Mr.progressClassName),autoClose:!Lr.isLoading&&(Yn=Lr.autoClose,Xn=Mr.autoClose,Yn===!1||c(Yn)&&Yn>0?Yn:Xn),deleteToast(){const Qr=Ar.get(qn),{onClose:ls,children:ns}=Qr.props;u(ls)&&ls(isValidElement(ns)&&ns.props),_r(y(Qr,"removed")),Ar.delete(qn),wr--,wr<0&&(wr=0),vr.length>0?$r(vr.shift()):Or()}};var Yn,Xn;Jn.closeButton=Mr.closeButton,Lr.closeButton===!1||m(Lr.closeButton)?Jn.closeButton=Lr.closeButton:Lr.closeButton===!0&&(Jn.closeButton=!m(Mr.closeButton)||Mr.closeButton);let ds=Fr;isValidElement(Fr)&&!d(Fr.type)?ds=cloneElement(Fr,{closeToast:$n,toastProps:Jn,data:Gr}):u(Fr)&&(ds=Fr({closeToast:$n,toastProps:Jn,data:Gr}));const ss={content:ds,props:Jn,staleId:Zn};Mr.limit&&Mr.limit>0&&wr>Mr.limit&&Hn?vr.push(ss):c(zr)?setTimeout(()=>{$r(ss)},zr):$r(ss)},setProps(Fr){Mr=Fr},setToggle:(Fr,Lr)=>{Ar.get(Fr).toggle=Lr},isToastActive:Fr=>Sr.some(Lr=>Lr===Fr),getSnapshot:()=>Ir}}(dr,lr,E);v.set(dr,hr);const mr=hr.observe(fr);return h.forEach(gr=>_(gr.content,gr.options)),h=[],()=>{mr(),v.delete(dr)}},setProps(fr){var hr;(hr=v.get(dr))==null||hr.setProps(fr)},getSnapshot(){var fr;return(fr=v.get(dr))==null?void 0:fr.getSnapshot()}}}(e)).current;rr(e);const ir=useSyncExternalStore(t,tr,tr);return{getToastToRender:function(lr){if(!ir)return[];const dr=new Map;return e.newestOnTop&&ir.reverse(),ir.forEach(fr=>{const{position:hr}=fr.props;dr.has(hr)||dr.set(hr,[]),dr.get(hr).push(fr)}),Array.from(dr,fr=>lr(fr[0],fr[1]))},isToastActive:I,count:ir==null?void 0:ir.length}}function N(e){const[t,tr]=useState(!1),[rr,ir]=useState(!1),lr=useRef(null),dr=useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:fr,pauseOnHover:hr,closeToast:mr,onClick:gr,closeOnClick:yr}=e;var _r,br;function wr(){tr(!0)}function vr(){tr(!1)}function Sr(Ar){const kr=lr.current;dr.canDrag&&kr&&(dr.didMove=!0,t&&vr(),dr.delta=e.draggableDirection==="x"?Ar.clientX-dr.start:Ar.clientY-dr.start,dr.start!==Ar.clientX&&(dr.canCloseOnClick=!1),kr.style.transform=`translate3d(${e.draggableDirection==="x"?`${dr.delta}px, var(--y)`:`0, calc(${dr.delta}px + var(--y))`},0)`,kr.style.opacity=""+(1-Math.abs(dr.delta/dr.removalDistance)))}function Ir(){document.removeEventListener("pointermove",Sr),document.removeEventListener("pointerup",Ir);const Ar=lr.current;if(dr.canDrag&&dr.didMove&&Ar){if(dr.canDrag=!1,Math.abs(dr.delta)>dr.removalDistance)return ir(!0),e.closeToast(),void e.collapseAll();Ar.style.transition="transform 0.2s, opacity 0.2s",Ar.style.removeProperty("transform"),Ar.style.removeProperty("opacity")}}(br=v.get((_r={id:e.toastId,containerId:e.containerId,fn:tr}).containerId||1))==null||br.setToggle(_r.id,_r.fn),useEffect(()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||vr(),window.addEventListener("focus",wr),window.addEventListener("blur",vr),()=>{window.removeEventListener("focus",wr),window.removeEventListener("blur",vr)}},[e.pauseOnFocusLoss]);const Mr={onPointerDown:function(Ar){if(e.draggable===!0||e.draggable===Ar.pointerType){dr.didMove=!1,document.addEventListener("pointermove",Sr),document.addEventListener("pointerup",Ir);const kr=lr.current;dr.canCloseOnClick=!0,dr.canDrag=!0,kr.style.transition="none",e.draggableDirection==="x"?(dr.start=Ar.clientX,dr.removalDistance=kr.offsetWidth*(e.draggablePercent/100)):(dr.start=Ar.clientY,dr.removalDistance=kr.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(Ar){const{top:kr,bottom:Or,left:Dr,right:$r}=lr.current.getBoundingClientRect();Ar.nativeEvent.type!=="touchend"&&e.pauseOnHover&&Ar.clientX>=Dr&&Ar.clientX<=$r&&Ar.clientY>=kr&&Ar.clientY<=Or?vr():wr()}};return fr&&hr&&(Mr.onMouseEnter=vr,e.stacked||(Mr.onMouseLeave=wr)),yr&&(Mr.onClick=Ar=>{gr&&gr(Ar),dr.canCloseOnClick&&mr()}),{playToast:wr,pauseToast:vr,isRunning:t,preventExitTransition:rr,toastRef:lr,eventHandlers:Mr}}function $(e){let{delay:t,isRunning:tr,closeToast:rr,type:ir="default",hide:lr,className:dr,style:fr,controlledProgress:hr,progress:mr,rtl:gr,isIn:yr,theme:_r}=e;const br=lr||hr&&mr===0,wr={...fr,animationDuration:`${t}ms`,animationPlayState:tr?"running":"paused"};hr&&(wr.transform=`scaleX(${mr})`);const vr=clsx("Toastify__progress-bar",hr?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${_r}`,`Toastify__progress-bar--${ir}`,{"Toastify__progress-bar--rtl":gr}),Sr=u(dr)?dr({rtl:gr,type:ir,defaultClassName:vr}):clsx(vr,dr),Ir={[hr&&mr>=1?"onTransitionEnd":"onAnimationEnd"]:hr&&mr<1?null:()=>{yr&&rr()}};return React__default.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":br},React__default.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${_r} Toastify__progress-bar--${ir}`}),React__default.createElement("div",{role:"progressbar","aria-hidden":br?"true":"false","aria-label":"notification timer",className:Sr,style:wr,...Ir}))}let w=1;const k=()=>""+w++;function P(e){return e&&(d(e.toastId)||c(e.toastId))?e.toastId:k()}function M(e,t){return _(e,t),t.toastId}function x(e,t){return{...t,type:t&&t.type||e,toastId:P(t)}}function A(e){return(t,tr)=>M(t,x(e,tr))}function B(e,t){return M(e,x("default",t))}B.loading=(e,t)=>M(e,x("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),B.promise=function(e,t,tr){let rr,{pending:ir,error:lr,success:dr}=t;ir&&(rr=d(ir)?B.loading(ir,tr):B.loading(ir.render,{...tr,...ir}));const fr={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},hr=(gr,yr,_r)=>{if(yr==null)return void B.dismiss(rr);const br={type:gr,...fr,...tr,data:_r},wr=d(yr)?{render:yr}:yr;return rr?B.update(rr,{...br,...wr}):B(wr.render,{...br,...wr}),_r},mr=u(e)?e():e;return mr.then(gr=>hr("success",dr,gr)).catch(gr=>hr("error",lr,gr)),mr},B.success=A("success"),B.info=A("info"),B.error=A("error"),B.warning=A("warning"),B.warn=B.warning,B.dark=(e,t)=>M(e,x("default",{theme:"dark",...t})),B.dismiss=function(e){(function(t){var tr;if(b()){if(t==null||d(tr=t)||c(tr))v.forEach(rr=>{rr.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){const rr=v.get(t.containerId);rr?rr.removeToast(t.id):v.forEach(ir=>{ir.removeToast(t.id)})}}else h=h.filter(rr=>t!=null&&rr.options.toastId!==t)})(e)},B.clearWaitingQueue=function(e){e===void 0&&(e={}),v.forEach(t=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()})},B.isActive=I,B.update=function(e,t){t===void 0&&(t={});const tr=((rr,ir)=>{var lr;let{containerId:dr}=ir;return(lr=v.get(dr||1))==null?void 0:lr.toasts.get(rr)})(e,t);if(tr){const{props:rr,content:ir}=tr,lr={delay:100,...rr,...t,toastId:t.toastId||e,updateId:k()};lr.toastId!==e&&(lr.staleId=e);const dr=lr.render||ir;delete lr.render,M(dr,lr)}},B.done=e=>{B.update(e,{progress:1})},B.onChange=function(e){return T.add(e),()=>{T.delete(e)}},B.play=e=>C(!0,e),B.pause=e=>C(!1,e);const O=typeof window<"u"?useLayoutEffect:useEffect,D=e=>{let{theme:t,type:tr,isLoading:rr,...ir}=e;return React__default.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${tr})`,...ir})},z={info:function(e){return React__default.createElement(D,{...e},React__default.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return React__default.createElement(D,{...e},React__default.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return React__default.createElement(D,{...e},React__default.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return React__default.createElement(D,{...e},React__default.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return React__default.createElement("div",{className:"Toastify__spinner"})}},R=e=>{const{isRunning:t,preventExitTransition:tr,toastRef:rr,eventHandlers:ir,playToast:lr}=N(e),{closeButton:dr,children:fr,autoClose:hr,onClick:mr,type:gr,hideProgressBar:yr,closeToast:_r,transition:br,position:wr,className:vr,style:Sr,bodyClassName:Ir,bodyStyle:Mr,progressClassName:Ar,progressStyle:kr,updateId:Or,role:Dr,progress:$r,rtl:Fr,toastId:Lr,deleteToast:qn,isIn:Kn,isLoading:Gr,closeOnClick:Zn,theme:zr}=e,$n=clsx("Toastify__toast",`Toastify__toast-theme--${zr}`,`Toastify__toast--${gr}`,{"Toastify__toast--rtl":Fr},{"Toastify__toast--close-on-click":Zn}),Hn=u(vr)?vr({rtl:Fr,position:wr,type:gr,defaultClassName:$n}):clsx($n,vr),Jn=function(ss){let{theme:Qr,type:ls,isLoading:ns,icon:rs}=ss,ws=null;const _s={theme:Qr,type:ls};return rs===!1||(u(rs)?ws=rs({..._s,isLoading:ns}):isValidElement(rs)?ws=cloneElement(rs,_s):ns?ws=z.spinner():(Cs=>Cs in z)(ls)&&(ws=z[ls](_s))),ws}(e),Yn=!!$r||!hr,Xn={closeToast:_r,type:gr,theme:zr};let ds=null;return dr===!1||(ds=u(dr)?dr(Xn):isValidElement(dr)?cloneElement(dr,Xn):function(ss){let{closeToast:Qr,theme:ls,ariaLabel:ns="close"}=ss;return React__default.createElement("button",{className:`Toastify__close-button Toastify__close-button--${ls}`,type:"button",onClick:rs=>{rs.stopPropagation(),Qr(rs)},"aria-label":ns},React__default.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},React__default.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(Xn)),React__default.createElement(br,{isIn:Kn,done:qn,position:wr,preventExitTransition:tr,nodeRef:rr,playToast:lr},React__default.createElement("div",{id:Lr,onClick:mr,"data-in":Kn,className:Hn,...ir,style:Sr,ref:rr},React__default.createElement("div",{...Kn&&{role:Dr},className:u(Ir)?Ir({type:gr}):clsx("Toastify__toast-body",Ir),style:Mr},Jn!=null&&React__default.createElement("div",{className:clsx("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!Gr})},Jn),React__default.createElement("div",null,fr)),ds,React__default.createElement($,{...Or&&!Yn?{key:`pb-${Or}`}:{},rtl:Fr,theme:zr,delay:hr,isRunning:t,isIn:Kn,closeToast:_r,hide:yr,type:gr,style:kr,className:Ar,controlledProgress:Yn,progress:$r||0})))},S=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},H=g(S("bounce",!0));g(S("slide",!0));g(S("zoom"));g(S("flip"));const q={position:"top-right",transition:H,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function Q(e){let t={...q,...e};const tr=e.stacked,[rr,ir]=useState(!0),lr=useRef(null),{getToastToRender:dr,isToastActive:fr,count:hr}=L(t),{className:mr,style:gr,rtl:yr,containerId:_r}=t;function br(vr){const Sr=clsx("Toastify__toast-container",`Toastify__toast-container--${vr}`,{"Toastify__toast-container--rtl":yr});return u(mr)?mr({position:vr,rtl:yr,defaultClassName:Sr}):clsx(Sr,p(mr))}function wr(){tr&&(ir(!0),B.play())}return O(()=>{if(tr){var vr;const Sr=lr.current.querySelectorAll('[data-in="true"]'),Ir=12,Mr=(vr=t.position)==null?void 0:vr.includes("top");let Ar=0,kr=0;Array.from(Sr).reverse().forEach((Or,Dr)=>{const $r=Or;$r.classList.add("Toastify__toast--stacked"),Dr>0&&($r.dataset.collapsed=`${rr}`),$r.dataset.pos||($r.dataset.pos=Mr?"top":"bot");const Fr=Ar*(rr?.2:1)+(rr?0:Ir*Dr);$r.style.setProperty("--y",`${Mr?Fr:-1*Fr}px`),$r.style.setProperty("--g",`${Ir}`),$r.style.setProperty("--s",""+(1-(rr?kr:0))),Ar+=$r.offsetHeight,kr+=.025})}},[rr,hr,tr]),React__default.createElement("div",{ref:lr,className:"Toastify",id:_r,onMouseEnter:()=>{tr&&(ir(!1),B.pause())},onMouseLeave:wr},dr((vr,Sr)=>{const Ir=Sr.length?{...gr}:{...gr,pointerEvents:"none"};return React__default.createElement("div",{className:br(vr),style:Ir,key:`container-${vr}`},Sr.map(Mr=>{let{content:Ar,props:kr}=Mr;return React__default.createElement(R,{...kr,stacked:tr,collapseAll:wr,isIn:fr(kr.toastId,kr.containerId),style:kr.style,key:`toast-${kr.key}`},Ar)}))}))}function isConnectTypeOptions(e){return e==="connect-success"||e==="connect-warning"||e==="connect-loading"||e==="connect-deleted"}function getDefaultOptions(e){if(isConnectTypeOptions(e)){const t={};switch(e){case"connect-success":t.type="success",t.icon=jsx$1(Icon,{className:"text-green-800",name:"CheckCircleFill",size:24});break;case"connect-warning":t.type="warning",t.icon=jsx$1(Icon,{className:"text-gray-600",name:"WarningFill",size:24});break;case"connect-loading":t.type="default",t.icon=jsx$1(Icon,{className:"text-gray-600",name:"ClockFill",size:24});break;case"connect-deleted":t.type="error",t.icon=jsx$1(Icon,{className:"text-red-800",name:"TrashFill",size:24});break}return t}return{type:e}}function toast(e,t){const{type:tr="default",...rr}=t||{},ir=getDefaultOptions(tr);return B(e,{...ir,...rr})}const CloseButton=({closeToast:e})=>jsx$1("button",{className:"flex items-center text-gray-500 hover:text-gray-600",onClick:e,children:jsx$1(Icon,{name:"XmarkLight",size:16})}),ToastContainer=e=>jsx$1(Q,{closeButton:CloseButton,...e}),Toggle=forwardRef(function e(t,tr){return jsxs("label",{className:"relative cursor-pointer items-center",htmlFor:t.id,children:[jsx$1("input",{className:"peer sr-only",ref:tr,type:"checkbox",value:"",...t}),jsx$1("div",{className:"peer h-6 w-11 rounded-full bg-gray-500 after:absolute after:start-0.5 after:top-0.5 after:size-5 after:rounded-full after:border after:border-none after:bg-gray-50 after:transition-all peer-checked:bg-blue-900 peer-checked:after:translate-x-full peer-focus:outline-none"})]})});function Tooltip(e){const{children:t,content:tr,open:rr,defaultOpen:ir,onOpenChange:lr,className:dr,side:fr="top",sideOffset:hr=5,delayDuration:mr,...gr}=e;return jsxs(Root3,{defaultOpen:ir,delayDuration:mr,onOpenChange:lr,open:rr,children:[jsx$1(Trigger$2,{asChild:!0,children:t}),jsx$1(Portal$1,{children:jsx$1(Content2$1,{...gr,side:fr,sideOffset:hr,className:twMerge("shadow-tooltip rounded-lg border border-gray-200 bg-white p-2 text-xs",dr),children:tr})})]})}const TooltipProvider=Provider$1,BUDGET="powerhouse/budget-statement",DEFAULT="powerhouse/default",MAKERDAO_RWA_PORTFOLIO="makerdao/rwa-portfolio",documentTypes=[BUDGET,DEFAULT,MAKERDAO_RWA_PORTFOLIO],SWITCHBOARD="SWITCHBOARD",LOCAL="LOCAL",CLOUD="CLOUD",PUBLIC="PUBLIC",BudgetStatementImg="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGwAAAB4CAYAAAAXIRdAAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAzWSURBVHgB7V1dbBXHFZ5d/wI1WMhuVBUJq1GlAg9QlZSngNU2D9BIreoYGikKUdVKjaoSklSRWol4TdWmUgs0SFVTVaqUELUKhDTlIUFqiDA8lKQ8QCvMS5PaVRAN14kMjrGN7TuZb5izPne89/r+7HrXvvNJ17s7O3v3er89Z845M3PGE+XDw58j372+Pi8bv+3n5WZV0i2l1y6EbBfLFNKT/U8fvycQGYFXznkppTi8O7fXF95eKWS3qDN4irQnM0LaPMIUOWGZ53ni0O7r3Z5o+JOQokvUMYyk9dOhSAkFhHGyfvXg/9pbVq7oU7tP8DotqzzRsb5R3Lu1Sazb2CTaOnxdtpxw9OGPI8st0nSRWGT4dgGk6je7P+xSZL0tGFkgZVvPCvHY8+2i50Cb2LKzVRHXsOzIKgVPen1HdufwEosgCPCPL/o/79n7v+79f1eD57/NVeCWnS2KrJV1Q04xCSOol7p//ysd/Xi5LSQucY1Qg3Tj57453G6Ttf3RlVqaHOagnlnf4T03sNtvnfJgoKnnmRhxPn9LdJvFyHrgh6scWUUA9Xho94d988rN8+T2QJwI27BDvTf2CtZmQbI27GgRDsURRRokTGjeIGzxkxYSpl6M8MYbtrc4ySoTNmlcwrAfN2masMMPXX+MVOHqTl9se2iFcCgfUZJG7VjcpN2VMK9xHxVAukCaQ2WwSANZBQEIEZML4MOMV9+/hQpcu1U9GGnaWjS+mt6atq32exzak9vv5eURHHxha7N48OnPiHrHQn7YQkBEZGzj7w8qokKWjLkvajX7fV+KHXSwbmOjcKgdkLS2wcefLSgzxkiEs10RfMn8rk4VanKIB8VMfjL7qzVElEjJLjpAUNdBiDZldI3l8qJWmNijuLnxdwf18V3fTJh9Mv0rUo8wB8POx3oK5JbC6s74NA3CWGuUeuzr6+PEhCZ/pXD2ewTWbYhX0yhBQuyxD9YiSFJbPzxVoWp0hEVgy674ozxkiIA0Zj16lUqZIywCLSs98XnVORs3QNqawR8diDxVpqQ5wooAPRVJtOmKmKBYlL8c0hxhRaBjqj3JxFTJ5C8S/ShJmiOsBNBjkSRpv90z8iwnrZz2zBG2ANBzgb7BpNQj98OMQVLyRt7h3hvhBfv+slY4ROOWcqTfeXVCXD03JeLEUyc+61OcEWD7kfrShTbKBNq0Bx5fpSXu/Yt3xHsXp8XI8IyYGq89Ct/f3w+GyvoiR1iFAHFo22rpka+lN8C1YRkAOdIUCRFWByiHIyxD4BGQYnUcYSmDzHqyDi3fTI8u5g61IyxlQAeCLBPNl9wA4V0xwkidIyxlKLK0KjRE0RgQzUtEX5nnrMQMAJKkCNP7fByImD+7yElY2oCE8ZAUb8t41IMsSCdhGYEiBGMSwmFxRh3ysJXedxKWMiBhCjA8fDaOURaLKToJywAMabTVkma1ZSGchGUExlpcsBPTEZYyGFHyypUrHh/kYdSiLOgzq7fulWuD0+LCycmSkXaM59i4vTmxeQY8+Ku6VxpIJYKwTZs2UVxR8m4XQl1J2DsnJ8TJn49p0kp1i+D8318Y1/UXAR4RxsnSJyyy6soPuzowpTsgK4HusByIt8PSRm9vb2S57YNhCwLrhrDBc3dENaj2unIBqYKE0chgZubP88GAuiEMbVY1gHpMEmi3sEUskQwQBfLDwn4yql83flgcXflJgVuKZjY7BX5DR5rqOrM+ZZw4cUISYZAy1aZFDt8mKXORjpRBFiIA9QgCTTk3OiRJmSMsZXCSYICoT9hHFlXfqcSUociCaa9VIYspenxCO6+/ZCQMRsOl05NiUPlFxWZHYggaohTbelpjnZSXJLgkQbpYmTY6eLcLsCQk7FZuVvz5pze1I1tqKitG58LRfU1FM3DNUgBUIkmR2Q/nQZsqBRK2JAhDOKmSOccgDqQtFRijIrQYjU8WEmUI1L5Z5gmD41rNBHGQ9kHCTm8cQBtG4BYjV5U0agplmScsN1y9ars2WF10YzERZQ1aE9gLkHmjI8sRijhAISge7aBym0w3aioDoGg9GRyeN9eHac/QrKtofVZB0XoW4cBGS5dJEbH0rMTlDJIsFqkHiqpFR1hGwC1Ec8zJCklbFKMjC+Mosg5LykKyDHEhgYkThnER5XTNg1R8bo3kE5u5n0XAD7NVot3bzHMsJqoSszqOIsugHmiAgsDc+EhUwmoZR1EvqpHMekgXDXOj6IclaXn18ROVsKyOo8giSB0iylEsQw5IS5Sw5R6liANMmrQvxh3nCGQ/+LvcwaxBO/gbzhNjEpf94G+9ICicwRIGgCFtZjqtPnRjOlIGWYXUF0bHMOPZMAE3zC0rQBsGy5DGdFBsEaDRUtwIcRKWMmDWG4K4CR8mCQvmps9qOAlLGTRqyrLlJVmKLvibMYAQMudtSzEKjrCUQQRBwniPszk3b8qRa8NSBhFGs1d46qIgYspRohIWR9rVuFK3ZnXVC2a60/G8pCq8XqIShrVcqokL8kV7OmpYwKej4Htq/y1JgKxE5oNJK4UsVKW/KBKGIdPVgGf7xGrs1ST9x7Dte+9rjvW3JAE+LpHNceap+LxFc5zX6XHulXVGor7dtYKk/20VLPMIsr5zYHUivyVuMD+Md2RGTkoHErcSkdQYD7yUlKB9wXnUi1owFQT0KAKwPmcp4tpMPl6QFbWOZxy/JW7waH3A5joTyGikIPCiWIl4S2t9UymrdRZ+S5ygDkwTmuK5fgtTkxppc35YBkAxRDqWd6H3KTzl/LCMwYxPLGi7WDwxNEYcYSmDulUUJE9dBLBVacPVaZ1KzAjsGKKVoDkkzRGWMqgfLGDj66OSgrk2LCOwMgeQpIVp95jRIZXJ71Y3SgNW+r1Gu88LvlixkVNOJaYMPpCUtjToJioA7FRixsBDU5bkaZXoJCwDCIr0MvOwlDBLCDvCUgb3u2ziuElP6tERljKMBciP57VdHK4NSxm8A5NgIvZewBI1owx1HGEpg/wwgIjzIhYtJbXoVGJGQWoRJj71hQVLIRNOPSCYn0WAz3GWPHrvCEsZlPaBEBQZTArSnFmfIfAgMElX1ExMZ3SkDPLDeBCYLENrQW493M1JWEbA1SC1WcaUDyfzOaMjo+CqMHCzV7KFoHDCg97avcwAbRVh3ihd4Gb9J4+p2wXPeDQq0gHYo6aIvEbhyVHVrLXjJNIGda5aGtmolypGhgpylwwbo4MbFxrWyrPhaCpfitlzdKIeE5osNgpT4sohSA9fzqMYQpWoDMhLVPjexWSXXnIQBYmj854cCExG7Yhoh0bA1g4D/Lw3dopOjgzNisnxyjNYO5SHmzdmxfsX5wibuJM7xZOBwXnGNmCrQhhCw5G//jOvfHFIcT2AAzSIl96cFA7xAyrtakGyNHn5zOiPh/l0I5ZGVlpkhekffFgpMj/7El10+c0pJ2UxAw9ar1pxjqUVlPnnOzs7pb2kYmDlTAzYItza6ADDF/z9L6r9IRRCypCzsEhGMYcKQc/x3ZNzy5DgWZ8aefgY1WEkFVwbRGTCwao62o7/qjiyo0E0n6ET9z+yQmzZ1WpukM35wVkHkYVm5vwxluhTzn7vqVc/p7WaHckwy1Pl7e+ZN93oXfHkgMznj9Lx+ZfvZga1sok5lAl6bliNiZMlZf7oP7x9YRNkRzqOHz8+rz1iycG0w6YlDLr0yzMH21sb1yop8zZThfsfaRWbd7YWhEscosFfbOxfPl1Iliodzn387688d+YbOrqEZw7HmWat0OJvZi3M0Erk9wglDG3Zz/66YXTGv9VD7Rlw/uVJ8dYL48okndE/Ip/Ph2+P+0R/Jj6ZFeeO3S4gS73mQ6Jp8mv/WfuHkCz27MMuFl2XpS0KrBFUYNA3JzWbYPm+6V92NTWveUvdu4sqtnX44kvbm9SnWaxW+7ak8eOo2Rc2eJ2o+nYZHZdTt1JUe70tUTDYIFX/On3HihnKyzPTt3qeeR0uVHHJ4hfY9yJ+NFnkvKEwl8t5+OKJ6Y+2Qt/SBWMqzvjP16bEsf1j4o0j47oh/eDKtH6bSPLoYx9HfXidqPrFvrOcupV+qr0e/3vuvzP6Wbz+i0/0s8Ez4mRJOXN0cmbo62+M/mDYJoBS7VH6PVMe+VKQtKGSz8Mi3POGmjzUc22v39B0gEubw8KACrwjJ75/0fvJWSojJ5nUIUkVyCLyqP0i2O2YNuvZtE0yK8MLuru7vbNnz8rDe64/KvL+E9wgcYjEgPSmX7og97/ICYLmUs8yH6H+eAwxckIfJ01LGF1EWxJP3ATeOPZxc5C3654/rm/Ir/qWumyH8rvXe8Jbr5radlGHUP/7qFKmN1XTMaC6qS7fnh7/2wHVnNBLbkcxAHssPUlXqTlhAJH4Kc1sL4jISlnaAAAAAElFTkSuQmCC",MakerdaoRWAPortfolioImg=""+new URL("rwa-report-Bb0W5-ac.png",import.meta.url).href,DefaultImg="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGwAAAB4CAYAAAAXIRdAAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAzzSURBVHgB7V1dbFxHFT5zdwNt+lCTJq1EItkPBKmJlCK1JW+JBTzQgkTAtUPlKAGUhzit0ki88JL4biseeCEiLQG1AqlpEaqdP/riIBFk961VHwhVUkErYUsND7FjuT9J1Nq+0zmzc8Znx/fau/buvbP2fNJm7996N/e758w538ycEVA/BP4jj/+0Ez6X+yBKHgEputWRDnW4A9YsREWcGYrBE4h6zkspAZ7pO6T2DoGEblhviBRpL/lB2iLCFDn2mBACZo/2dZcB/qzOdME6RqIsrXRmqGJ2JRSEGsI4WR8f/WHH/WLjoNp8ruYT994HcmsnyF2PAXxjB8gHNutjawmlY09nnNHuscIO5E7cIsLQqu4e7u2656twQf2cb9mTSFT39yHpfmLNEeQimzAg91iJ41ioFxKWK2nC3ZbP9nZBIv7JXaBUJCVP9Kx5oghLEoZQpMGLb1Tw4XbQcvLKZFWImYEfdCwi6ycHq1YVsIBEDsIz+3Gr4pwRGKCp+9ky4iL+lFTbLEZW/5FAVibk4PzRvkH3KN1PHg80E5H9+qO9h4AFGNqydu+FgGxEKaTpFEjzhsbWfNKihU1hv1ju3hMsq064pHELw+1mk6YJmxt46mfWFW7aogKMpyCgfiBp0rE0aseaTZomrBSJY3QArQtJC2gUNaQhWTUCBCyvKtWFCHMunm+Fdms1sO5RR4uYq+FRfDdt26oh5MD+4yCSU/rrlHqRHP4lrHcsm4ctC1GpPLjjeZNYa5hwH1Yb9keKMmtSUklNAc2AHDxx8/pJfoSCkZRkuyEgYV12T2mEAc1BWiCC1kVh/0oDkbJqv7rsH9wWCENIFXSJ6UlYPRRpz/ZBZfOO53HP5GZgtin0b8g9YpS40Pm4TrTCZdHMKFnJWINT108ODg5yYmzI3ygiCFgEuf1haCqq2uMgRotIknqn+96wGhIIS4HsfhKaD2VpKhBh3TII0aiVBcLScO/GFkXMmrQTKSfqDkICYRlIDhxpUZsu4yyVvx7SAmFZ0JpqD7QCJBhnqB9i6c8GZAJ72mULSVOByElOWj3tWSBsGWDPRaL6BlvlHnkeZgKSJVkTquPSfmD+9F8hIAMqkY5GzoF4+y1oJsSZ4Yh0RgTbTvWXZQioD9im9Q8AKIsT/363+roxAXD3NqwWlUoFGapL8QiENQpFnG7bVtEjv5regNCGeQBKpEkJAacDlCMQ5hG4ApJ1TSCsYFBYT9Ghk5vhsRoVJBBWMNAHIllGzZc8AOFdMWCsLhBWMBRZ2hUaomgMiOYlpa9MhCjRA6AlKcL0Nh8HAosnqwQLKxpoYVyS4m0ZVz0oggwW5gkUIQksuEQaOsBlK70dLKxgoIUpYOARsXGMMktTLNTCxB0l63z4PogPrwPcuQPNBo6z1DNF+XcaWQk2Vjsp3fNFwJBG79rSnLbMojDCxMh5iEZHmqLFZUFP53UJuTEO4p2x6m/A70eNcPfelnWj1AsTLYIK75ccNpC7SxS3JqH0m19p5buVZNUNo8KX4mP6t+UNIgpH41y7dk1wtoxblDyZzpUwvCHRiy+op3wCvMO0+W0FPERImMnDiEC9bZLpGovLl7DL5/WN8RZI2iu/hZwhqA3buXMnicCp4xZzzcPE22P65TswABIfXIe80Nvbm3rczcHwHQnMkbDm9tS2EhgQ5QW0KhNskHXpn8CjRL6dC2HYdunQvU2gf2tObRkGGviObRgFIICDPUzAgTvc2vIJ630MMpYB5moyp8mNPFI0s9lJ+LWJNF2bj0tUuU/b4W7zE/k0DA8PSyIMrUy1aal5GFmZN1oiJq6ygVkjOjhoZbuYk0ukCBGB7hEJNMd50CHJyrwgbCXVdtBdia1dEF04C+0MThIGIOpl+8jSrvdC/F1pTRC5BibQK7IwtNeukGmKgk9o59f74RLR/axgZK0Wj9sc3JLQutgxHXTwbheEFxYWnX8NVgJxsb3dIQJdIlmR2bbzoM0l/lkYquclFURg4cx6LU28964f4nETYIIK3JQULfJ2jMJ87DPzp8dZ6XjCZ52xRcA2jLlCe5y7Sho1hcdCj3PBSIsGnQnsNQhjOgoGSVBc7aDjLplh1JQHILWeAg4hFvow3RmaXo2a8k7pyAksWeZJs6BAxLW0oHQUDFI6yCVStIj/pLnFoHR4Ah4hmn1OVs5q/XJYYT61FpQOQlw71M2SZYIS4ZVaj0qHrovRINaC0oF5mOMOwe1t5jUWg9LhGUwPdE0Xi1E5tNUFpaNgUFiP1oVkYdSIVmeOcUtLUJoKeZgnIHeIKkdWhRwkLRBWMJg16eECPHFOgQiEFQwWDbrir50nxizOnzZsvSodBB7Wx2acopGqrN4IvkyZXe9KB76T2kH7FBnidpz7MLdlsN7HdGBkSGM6aCQwwuiJNUFIGNNRMDCs5/ohgoYJkDvk1QTCmI6CQaOmnFheUqToir9B6SgY1I1iCqzURIppyIewekjwTenIqYY/EcTG1XPrqhGB85Om2nGJkJx+MxFGI6V46aI4ZcpRLm2Y3NbVdqtOyO35LBzEQnfaX1RUhV+Xk0vcCHLXo22T6OpF73ICRYksB5NOCVk9HjFXC0O00zKNef5W0hIRbI4zL8VX0JgOrIehFA3flQldryPHJSXRwvhA0piN+E0TgXPNw1pZB74ZwN+Wtyfgaj1piPw8pWckAueeh+ENwackz4nf9aCoFeGpA9NIU7zWb21pUmNthSgdSNp8fLrauBcZParvRqvH31LkutWkIdK+rEJvkzyVb5SYBqoD3w/Vuhg4p7jJyoVOJ9xjux6HRKn8upy5RysSmpG/NW0X0xNtMOJH98r2HBdLVQmx9CiRp24VBUljOugcW5XWTjkKPc6ewNUQnQLNlrRAWMGgfjAa04HH+FoshOLbsAANp3IAWZotu8eCDqlC/rC6URHga6+IM8Nlt88Lc7GskVPBJRYMPpCU3lntxEUCcHCJnoFLU47laZcYLMwDxBm9zFyWAlOZNBBWMHje5RLHQ3pyj4GwgmEiQL6/qO3iCFFiAeBRYt8klJnaoYFRohkyIB2lI+RhRYPyMATlYSJl0VJyi8Elegpyi2hp1BcWh0o4fsBRORB8eJvk6n0grGBQQRVCnDGYFEkLYb1H4CJwzKq4uQhBR8GgPIyLwBQROgty6+FuwcI8AXeD1GaZSX220GUIOjwFd4Wxj6WL1jPi2nLn+t3tZUbQOxI2Yz+9BguVeIfaBQxm+FBtDnfUFJGngg6hCJMd+uz0FMDW9pq00G4QH43bbXX/J0zQwYOL6nW1K8/a0VRRIsHOUMhzGaZ1C7YOjbr/42g9vPxeFhZcooR/2T+Ai3kGtBbMKBIQY/FCIctU1xiztcMQ0aeJeJNOihvjINdQSTvvcOsmRO8tGMXU3BdvUpkHBCbP+B6zVSEMoXbkb9Tx8hvjytjG9CdUg6hXfg1oOnQyzObHqd2r+/87M8GnG7GFcqRDli3/EGGUMpckdg5QNDYSrKzJ0O0PzuF+Z4GwBOTvtmzZIt0lFWOnZmLMFuHWQQcy3H8relXtjusr0cpGzkFGRbGABmGDhZHzbNK9GP/e+1O21gUfMcURp1TCwVV1Srhx9gHYe08EV+hE8uMDkHQ/Wb1oiYWgA7JhcynVzJQuLtQimZfyF+U/nNNezVUyTNHmxP07i6YbHbwFYwkkp2k/uvi6XhXWqSYWUCfovuE95GQpV3j66SlhmyBX6RgaGkrcv0XjFBG4oS0MfempB+c6vg7lK0LCI3TB/L4Deu4Ul0sC0sEfbB0gjF2uIUudnfjPZ9OPPnz2ilaXzHRZO2uFSqJTrY54qTLo2JZt+/3FmU9mox7bnimULr0O0V/+CHLqpv4RSZLYpye8Ml63P4Powms1ZCmMfy43fOfk3U2WLHbvbRcLvvOyRbEzggoZjMxJzSay/MrXZrvuL3/lH+qZ6LJPx6bNMP/4HpDf3qO3XUvj+2mzL1zwa9Kud4/Rfj3XNoqVft61KAzYSsqqorcug2CaoRRw9ZPZ2Z6Oly+N436WZfE/7X4X8aPJouQND05OTgr8wzfE7GPob+kDQumM5b9fgA0vHIfyn04BqIZUfnBNP01kefRy99Ne/Jq067P+Zj3XNvpa6ef1//2j/+l7UX7p1/relNQ94mThPfw/zH13n8q5XAKo1B6V3zPHUx8Ksja8KOKyCM+80U1+caTn0IaodIJbW0BdGL89Lw//fFqM0gFKkskdklUhWUQetV8Etx3TYT0fyGjM036gu7tbjI6OyrmB/QejKHmOByQBi4Gq0ZwQZ/tvylc5Qei51L1MUtwf1xBTJ/Rx0rSF0YfoncwTvwSzcdzGL0fyLn3zoc77RPIjEcHeKIJORWCnOt0B6xMz6uZ8rNzemJwXV6fl7N8eUs0JPeSuioFwx9KTdS01JwxBJH4JoOdEKaNKcdAAAAAASUVORK5CYII=",iconMap={[BUDGET]:BudgetStatementImg,[DEFAULT]:DefaultImg,[MAKERDAO_RWA_PORTFOLIO]:MakerdaoRWAPortfolioImg},DRIVE="DRIVE",FOLDER="FOLDER",FILE="FILE",WRITE="WRITE",READ="READ",UI_NODE="UI_NODE",DUPLICATE="DUPLICATE",RENAME="RENAME",DELETE="DELETE",SETTINGS="SETTINGS",REMOVE_TRIGGER="REMOVE_TRIGGER",ADD_TRIGGER="ADD_TRIGGER",ADD_INVALID_TRIGGER="ADD_INVALID_TRIGGER",defaultFileOptions=[RENAME,DELETE,DUPLICATE],defaultFolderOptions=[RENAME,DELETE,DUPLICATE],sharingTypeOptions=[{value:LOCAL,icon:jsx$1(Icon,{name:"Lock"}),description:"Only available to you"},{value:CLOUD,icon:jsx$1(Icon,{name:"People"}),description:"Only available to people in this drive"},{value:PUBLIC,icon:jsx$1(Icon,{name:"Globe"}),description:"Available to everyone",disabled:!0}],locationInfoByLocation={CLOUD:{title:"Secure cloud",description:"End to end encryption between members.",icon:jsx$1(Icon,{name:"Lock"})},LOCAL:{title:"Local",description:"Private and only available to you.",icon:jsx$1(Icon,{name:"Hdd"})},SWITCHBOARD:{title:"Switchboard",description:"Public and available to everyone.",icon:jsx$1(Icon,{name:"Drive"})}},debugNodeOptionsMap={[ADD_TRIGGER]:{label:"Add Trigger",icon:jsx$1(Icon,{className:"text-orange-900",name:"Plus"})},[REMOVE_TRIGGER]:{label:"Remove Trigger",icon:jsx$1(Icon,{className:"text-orange-900",name:"Xmark"})},[ADD_INVALID_TRIGGER]:{label:"Add Trigger",icon:jsx$1(Icon,{className:"text-orange-900",name:"Exclamation"})}},normalNodeOptionsMap={[DUPLICATE]:{label:"Duplicate",icon:jsx$1(Icon,{name:"FilesEarmark"})},[RENAME]:{label:"Rename",icon:jsx$1(Icon,{name:"Pencil"})},[DELETE]:{label:"Delete",icon:jsx$1(Icon,{name:"Trash"}),className:"text-red-900"},[SETTINGS]:{label:"Settings",icon:jsx$1(Icon,{name:"Gear"})}},nodeOptionsMap={...debugNodeOptionsMap,...normalNodeOptionsMap},SYNCING="SYNCING",SUCCESS="SUCCESS",CONFLICT="CONFLICT",MISSING="MISSING",ERROR="ERROR",INITIAL_SYNC="INITIAL_SYNC",contracts={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},formatters={block:defineBlock({format(e){var tr;return{transactions:(tr=e.transactions)==null?void 0:tr.map(rr=>{if(typeof rr=="string")return rr;const ir=formatTransaction(rr);return ir.typeHex==="0x7e"&&(ir.isSystemTx=rr.isSystemTx,ir.mint=rr.mint?hexToBigInt(rr.mint):void 0,ir.sourceHash=rr.sourceHash,ir.type="deposit"),ir}),stateRoot:e.stateRoot}}}),transaction:defineTransaction({format(e){const t={};return e.type==="0x7e"&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?hexToBigInt(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:defineTransactionReceipt({format(e){return{l1GasPrice:e.l1GasPrice?hexToBigInt(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?hexToBigInt(e.l1GasUsed):null,l1Fee:e.l1Fee?hexToBigInt(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null}}})};function serializeTransaction(e,t){return isDeposit(e)?serializeTransactionDeposit(e):serializeTransaction$1(e,t)}const serializers={transaction:serializeTransaction};function serializeTransactionDeposit(e){assertTransactionDeposit(e);const{sourceHash:t,data:tr,from:rr,gas:ir,isSystemTx:lr,mint:dr,to:fr,value:hr}=e,mr=[t,rr,fr??"0x",dr?toHex(dr):"0x",hr?toHex(hr):"0x",ir?toHex(ir):"0x",lr?"0x1":"0x",tr??"0x"];return concatHex(["0x7e",toRlp(mr)])}function isDeposit(e){return e.type==="deposit"||typeof e.sourceHash<"u"}function assertTransactionDeposit(e){const{from:t,to:tr}=e;if(t&&!isAddress(t))throw new InvalidAddressError$1({address:t});if(tr&&!isAddress(tr))throw new InvalidAddressError$1({address:tr})}const chainConfig={blockTime:2e3,contracts,formatters,serializers},arbitrum=defineChain({id:42161,name:"Arbitrum One",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://arbiscan.io",apiUrl:"https://api.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}}),sourceId$1=1,base=defineChain({...chainConfig,id:8453,name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://basescan.org",apiUrl:"https://api.basescan.org/api"}},contracts:{...chainConfig.contracts,disputeGameFactory:{[sourceId$1]:{address:"0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e"}},l2OutputOracle:{[sourceId$1]:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{[sourceId$1]:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{[sourceId$1]:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:sourceId$1}),goerli=defineChain({id:5,name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://5.rpc.thirdweb.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.etherscan.io",apiUrl:"https://api-goerli.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xfc4AC75C46C914aF5892d6d3eFFcebD7917293F1",blockCreated:10339206},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6507670}},testnet:!0}),mainnet=defineChain({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),sourceId=1,optimism=defineChain({...chainConfig,id:10,name:"OP Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.optimism.io"]}},blockExplorers:{default:{name:"Optimism Explorer",url:"https://optimistic.etherscan.io",apiUrl:"https://api-optimistic.etherscan.io/api"}},contracts:{...chainConfig.contracts,disputeGameFactory:{[sourceId]:{address:"0xe5965Ab5962eDc7477C8520243A95517CD252fA9"}},l2OutputOracle:{[sourceId]:{address:"0xdfe97868233d1aa22e815a266982f2cf17685a27"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263},portal:{[sourceId]:{address:"0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"}},l1StandardBridge:{[sourceId]:{address:"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"}}},sourceId}),sepolia=defineChain({id:11155111,name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.drpc.org"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.etherscan.io",apiUrl:"https://api-sepolia.etherscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",blockCreated:5317080}},testnet:!0}),wagmiConfig=createConfig({chains:[mainnet],transports:{[mainnet.id]:http()}}),defaultQueryClient=new QueryClient;function WagmiContext(e){const{children:t,wagmiProviderProps:tr,queryClientProviderProps:rr}=e,{config:ir=wagmiConfig,...lr}=tr??{},{client:dr=defaultQueryClient,...fr}=rr??{};return jsx$1(WagmiProvider,{config:ir,...lr,children:jsx$1(QueryClientProvider,{client:dr,...fr,children:t})})}function useDrag(e){const{uiNode:t}=e,[tr,rr]=useState(!1),ir=useCallback(fr=>{fr.dataTransfer.setData(UI_NODE,JSON.stringify(t))},[t]),lr=useCallback(()=>{rr(!1)},[]),dr=!!t&&t.kind!==DRIVE;return useMemo(()=>({isDragging:tr,dragProps:dr?{draggable:!0,onDragStart:ir,onDragEnd:lr}:{draggable:!1,onDragStart:void 0,onDragEnd:void 0}}),[dr,tr,lr,ir])}function useDrop(e){const{uiNode:t,onAddFile:tr,onCopyNode:rr,onMoveNode:ir}=e,[lr,dr]=useState(!1),fr=!t||t.kind!==FILE,hr=useCallback(yr=>{yr.preventDefault(),dr(!0)},[]),mr=useCallback(()=>{dr(!1)},[]),gr=useCallback(async yr=>{yr.preventDefault(),yr.stopPropagation();try{const _r=getDroppedFiles(yr.dataTransfer.items).filter(Boolean);if(_r.length)for(const br of _r)br&&await tr(br,t);else if(t){const br=yr.getModifierState("Alt"),wr=yr.dataTransfer.getData(UI_NODE),vr=JSON.parse(wr);br?await rr(vr,t):await ir(vr,t)}}catch(_r){console.error(_r)}finally{dr(!1)}},[tr,rr,ir,t]);return useMemo(()=>({isDropTarget:lr,dropProps:fr?{onDragOver:hr,onDragLeave:mr,onDrop:gr}:{onDragOver:void 0,onDragLeave:void 0,onDrop:void 0}}),[fr,lr,mr,hr,gr])}function getDroppedFiles(e){return Array.from(e).map(tr=>tr.kind==="file"?tr.getAsFile():null).filter(Boolean)}function formatEthAddress(e){return`${e.slice(0,7)}...${e.slice(-5)}`}function getDocumentIconSrc(e,t){return t||(documentTypes.includes(e)?iconMap[e]:iconMap[DEFAULT])}const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$1=getAugmentedNamespace(__viteBrowserExternal$1);export{FILE$1 as $,AnimatedLoader as A,Icon as B,ConnectSidebar as C,Button$1 as D,useWindowSize as E,useVirtualizer as F,FileItem as G,HomeScreen as H,InternalTransmitter as I,cn$1 as J,FOLDER as K,FILE as L,twMerge as M,FolderItem as N,ConnectSearchBar as O,Provider as P,QueryClientProvider as Q,ReadDriveNotFoundError as R,DriveContextProvider as S,ToastContainer as T,Ue as U,useDriveContext as V,WagmiContext as W,useDriveActionsWithUiNodes as X,useDrop as Y,useBreadcrumbs as Z,__vitePreload as _,atom as a,ConnectConfirmationModal as a$,Breadcrumbs as a0,useAtom as a1,hashDocumentStateForScope as a2,validateInitialState as a3,validateStateSchemaName as a4,validateModules as a5,DefaultEditorLoader as a6,undo as a7,redo as a8,DocumentToolbar as a9,base as aA,optimism as aB,http as aC,hoistNonReactStatics as aD,ur as aE,C$1 as aF,u$2 as aG,cr as aH,R$3 as aI,T$2 as aJ,h$2 as aK,pr as aL,x$4 as aM,U$3 as aN,ConnectDeleteItemModal as aO,ConnectUpgradeDriveModal as aP,CreateDocumentModal as aQ,AddDriveModal as aR,requestPublicDrive as aS,AddLocalDriveModal as aT,AddRemoteDriveModal as aU,DriveSettingsModal as aV,About as aW,DangerZone as aX,DefaultEditor as aY,PackageManager as aZ,SettingsModal as a_,RevisionHistory as aa,module as ab,useDocument as ac,useDocumentEditorProps as ad,SidebarItem as ae,SidebarAddDriveItem as af,LOCAL as ag,SUCCESS as ah,CONFLICT as ai,ERROR as aj,DRIVE as ak,PUBLIC as al,toast as am,kebabCase as an,lzStringExports as ao,generateDocumentStateQueryFields as ap,gql as aq,request as ar,getAugmentedNamespace as as,getEnsName$1 as at,getEnsAvatar$1 as au,createPublicClient as av,mainnet as aw,sepolia as ax,goerli as ay,arbitrum as az,useAtomValue as b,GraphQLList as b$,ConnectDeleteDriveModal as b0,setLogLevel as b1,CLOUD as b2,isLogLevel as b3,getDefaultStore as b4,documentModelDocumentModelModule as b5,BrowserStorage as b6,ReactorBuilder as b7,InMemoryCache as b8,BaseQueueManager as b9,Combobox as bA,FormInput as bB,ReadRequiredModal as bC,clsx as bD,versionInfo as bE,specifiedRules as bF,isObjectType as bG,GraphQLID as bH,GraphQLBoolean as bI,GraphQLString as bJ,GraphQLFloat as bK,GraphQLInt as bL,isSpecifiedDirective as bM,GraphQLDirective as bN,GraphQLObjectType as bO,isInterfaceType as bP,GraphQLInterfaceType as bQ,isUnionType as bR,GraphQLUnionType as bS,isInputObjectType as bT,GraphQLInputObjectType as bU,isEnumType as bV,GraphQLEnumType as bW,isScalarType as bX,isSpecifiedScalarType as bY,GraphQLScalarType as bZ,isListType as b_,_extends as ba,baseLoadFromInput as bb,baseSaveToFileHandle as bc,createZip as bd,buildSignedOperation as be,reducer as bf,isDocumentDrive as bg,generateAddNodeAction as bh,isFileNode as bi,updateFile as bj,addFolder as bk,isFolderNode as bl,deleteNode as bm,updateNode as bn,moveNode as bo,generateNodesCopy as bp,copyNode as bq,createDriveState as br,setDriveName as bs,setAvailableOffline as bt,setSharingType as bu,SynchronizationUnitNotFoundError as bv,removeTrigger as bw,PullResponderTransmitter as bx,addTrigger as by,Modal as bz,childLogger as c,setModelExtension as c$,isNonNullType as c0,GraphQLNonNull as c1,isNamedType as c2,getNullableType as c3,isLeafType as c4,GraphQLSchema as c5,Kind as c6,objectType as c7,numberType as c8,stringType as c9,Slot$3 as cA,useForm as cB,getNamedType as cC,isAbstractType as cD,BREAK as cE,SchemaMetaFieldDef as cF,TypeMetaFieldDef as cG,TypeNameMetaFieldDef as cH,isCompositeType as cI,isOutputType as cJ,isInputType as cK,assertAbstractType as cL,doTypesOverlap as cM,DirectiveLocation as cN,NoUnusedFragmentsRule as cO,ExecutableDefinitionsRule as cP,NoDeprecatedCustomRule as cQ,validateSchema as cR,locatedError as cS,sentenceCase as cT,Root2 as cU,List as cV,Trigger as cW,Content as cX,setModelName as cY,setModelId as cZ,setModelDescription as c_,GraphQLError as ca,lazyType as cb,unionType as cc,booleanType as cd,nullType as ce,arrayType as cf,recordType as cg,buildSchema as ch,printSchema as ci,buildASTSchema as cj,parse as ck,validate$2 as cl,pascalCase as cm,visit as cn,print as co,get$1 as cp,set$1 as cq,appendErrors as cr,snakeCase as cs,constantCase as ct,literalType as cu,useFormContext as cv,Primitive as cw,cva as cx,FormProvider as cy,Controller as cz,createStore$2 as d,setAuthorName as d0,setAuthorWebsite as d1,setStateSchema as d2,setInitialState as d3,addModule as d4,setModuleName as d5,deleteModule as d6,addOperation as d7,setOperationName as d8,setOperationSchema as d9,setOperationDescription as da,deleteOperation as db,addOperationError as dc,deleteOperationError as dd,setOperationErrorName as de,index$2 as df,commonjsGlobal as e,ee as f,getDefaultExportFromCjs as g,QueryClient as h,useQueryClient as i,useMutation as j,useQuery$1 as k,relationalDbToQueryBuilder as l,generateId$1 as m,logger as n,useSetPGliteDB as o,process as p,j as q,require$$1 as r,useRelationalDb as s,UiNodesContextProvider as t,useSetAtom as u,CookieBanner as v,runAsapAsync as w,useUiNodesContext as x,HomeScreenItem as y,HomeScreenAddDriveItem as z};
|
|
664
|
-
//# sourceMappingURL=index.
|
|
664
|
+
//# sourceMappingURL=index.DFyMrewv.js.map
|