/*! For license information please see server-ui-1.0.0.js.LICENSE.txt */
import*as e from"@minecraft/server-ui-bindings";var r={d:(e,o)=>{for(var t in o)r.o(o,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r)},o={};r.d(o,{W_:()=>n.ActionFormData,S_:()=>n.ActionFormResponse,_v:()=>n.FormCancelationReason,wA:()=>n.FormRejectError,XJ:()=>n.FormRejectReason,KB:()=>n.FormResponse,Hk:()=>n.MessageFormData,zS:()=>n.MessageFormResponse,yX:()=>n.ModalFormData,FK:()=>n.ModalFormResponse,jz:()=>n.UIManager,vB:()=>n.uiManager});var t,a=function(e,r,o,t){if("a"===o&&!t)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof r?e!==r||!t:!r.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===o?t:"a"===o?t.call(e):t?t.value:r.get(e)};t=new WeakMap;const n=(s={ActionFormData:()=>e.ActionFormData,ActionFormResponse:()=>e.ActionFormResponse,FormCancelationReason:()=>e.FormCancelationReason,FormRejectError:()=>e.FormRejectError,FormRejectReason:()=>e.FormRejectReason,FormResponse:()=>e.FormResponse,MessageFormData:()=>e.MessageFormData,MessageFormResponse:()=>e.MessageFormResponse,ModalFormData:()=>e.ModalFormData,ModalFormResponse:()=>e.ModalFormResponse,UIManager:()=>e.UIManager,uiManager:()=>e.uiManager},i={},r.d(i,s),i);var s,i;new class{constructor(){t.set(this,Symbol()),this.coreToProxyConstructor=new Map,this.proxyToGetInner=new Map}registerProxy(e,r){this.coreToProxyConstructor.set(e,r.prototype.constructor),this.proxyToGetInner.set(r,r.prototype.getInner)}wrapCore(e,r,o){if(r.closure_type)return(...t)=>{const a=[];let n=0;for(const e of t)a.push(this.unwrapCore(e,r.closure_type.argument_types[n],`${o} closure`,n)),n++;return this.wrapCore(e(...a),r.closure_type.return_type,`${o} closure`)};if(r.array_type){if(!Array.isArray(e))throw new Error(`Invalid type passed out of ${o}. Was expecting an array.`);let t=0;const a=[];for(const n of e)a[t++]=this.wrapCore(n,r.array_type,o);return a}if(!(e instanceof Object))return e;if(!e.constructor.name)return e;const n=this.coreToProxyConstructor.get(e.constructor);return n?new n(e,a(this,t,"f")):e}unwrapCore(e,r,o,n){if("void"!==r.name){if(r.array_type){if(!Array.isArray(e))throw new Error(`Invalid type passed into ${o}${void 0!==n?` for argument ${n}`:""}. Was expecting an array.`);let t=0;const a=[];for(const s of e)a[t++]=this.unwrapCore(s,r.array_type,o,n);return a}if(r.is_type){if(r.type_alias)return this.unwrapCore(e,r.type_alias,o,n);throw new Error(`Invalid type passed into ${o}${void 0!==n?` for argument ${n}`:""}. Was expecting a ${r.name}.`)}if(r.variant_types&&r.variant_types.length>0){const t=r.variant_types.map((e=>e.name));for(const t of r.variant_types)try{return this.unwrapCore(e,t,o,n)}catch{}throw new Error(`Invalid type passed into ${o}${void 0!==n?` for argument ${n}`:""}. Was expecting a variant of [ ${t.join(" | ")} ].`)}if("string"===r.name||"number"===r.name||"boolean"===r.name){if(typeof e!==r.name)throw new Error(`Invalid type passed into ${o}${void 0!==n?` for argument ${n}`:""}. Was expecting a ${r.name}.`);return e}if(r.optional_type)return e?this.unwrapCore(e,r.optional_type,o,n):e;if(r.class_type&&!(e instanceof r.class_type))throw new Error(`Invalid type passed into ${o}${void 0!==n?` for argument ${n}`:""}. Was expecting a ${r.name}.`);if(r.interface_data){if("object"!=typeof e||void 0===e)throw new Error(`Invalid type passed into ${o}${void 0!==n?` for argument ${n}`:""}. Was expecting a ${r.name}.`);const t=e,a={};for(const e of r.interface_data.properties)if(e.name in t)a[e.name]=this.unwrapCore(t[e.name],e.type,o,n);else if(void 0===e.type.optional_type)throw new Error(`Invalid type passed into ${o}${void 0!==n?` for argument ${n}`:""}. Was expecting a ${r.name} but object is missing property ${e.name}.`);return a}if(r.closure_type)return(...t)=>{const a=[];let n=0;for(const e of t)a.push(this.wrapCore(e,r.closure_type.argument_types[n],`${o} returned closure`)),n++;return this.unwrapCore(e(...a),r.closure_type.return_type,`${o} closure`)};if(r.is_generic_instance||r.class_type){if(!(e instanceof Object))return e;const r=this.proxyToGetInner.get(e.constructor);return r?r.call(e,a(this,t,"f")):e}throw new Error(`Unexpected type ${r.name} for ${o}${void 0!==n?` argument ${n}`:""}.`)}}};var p=o.W_,c=o.S_,m=o._v,u=o.wA,y=o.XJ,f=o.KB,l=o.Hk,d=o.zS,g=o.yX,w=o.FK,F=o.jz,h=o.vB;export{p as ActionFormData,c as ActionFormResponse,m as FormCancelationReason,u as FormRejectError,y as FormRejectReason,f as FormResponse,l as MessageFormData,d as MessageFormResponse,g as ModalFormData,w as ModalFormResponse,F as UIManager,h as uiManager};