| /*! For license information please see server-ui-2.0.0.js.LICENSE.txt */ | |
| import*as r from"@minecraft/common";import*as e from"@minecraft/server-ui-bindings";var o={d:(r,e)=>{for(var t in e)o.o(e,t)&&!o.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:e[t]})},o:(r,e)=>Object.prototype.hasOwnProperty.call(r,e)},t={};o.d(t,{W_:()=>m.ActionFormData,S_:()=>m.ActionFormResponse,_v:()=>m.FormCancelationReason,wA:()=>m.FormRejectError,XJ:()=>m.FormRejectReason,KB:()=>m.FormResponse,Hk:()=>m.MessageFormData,zS:()=>m.MessageFormResponse,yX:()=>m.ModalFormData,_S:()=>m.ModalFormDataDropdownOptions,Cm:()=>m.ModalFormDataSliderOptions,I4:()=>m.ModalFormDataTextFieldOptions,vI:()=>m.ModalFormDataToggleOptions,FK:()=>m.ModalFormResponse,jz:()=>m.UIManager,vB:()=>m.uiManager});const n=(a={InvalidArgumentError:()=>r.InvalidArgumentError,InvalidArgumentErrorType:()=>r.InvalidArgumentErrorType},s={},o.d(s,a),s);var a,s,i,p=function(r,e,o,t){if("a"===o&&!t)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?r!==e||!t:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===o?t:"a"===o?t.call(r):t?t.value:e.get(r)};i=new WeakMap;const m=(r=>{var e={};return o.d(e,r),e})({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,ModalFormDataDropdownOptions:()=>e.ModalFormDataDropdownOptions,ModalFormDataSliderOptions:()=>e.ModalFormDataSliderOptions,ModalFormDataTextFieldOptions:()=>e.ModalFormDataTextFieldOptions,ModalFormDataToggleOptions:()=>e.ModalFormDataToggleOptions,ModalFormResponse:()=>e.ModalFormResponse,UIManager:()=>e.UIManager,uiManager:()=>e.uiManager});new class{constructor(){i.set(this,Symbol()),this.coreToProxyConstructor=new Map,this.proxyToGetInner=new Map}registerProxy(r,e){this.coreToProxyConstructor.set(r,e.prototype.constructor),this.proxyToGetInner.set(e,e.prototype.getInner)}wrapError(r,e){try{return r()}catch(r){throw this.wrapCore(r,{name:"Error",is_error:!0},e)}}wrapCore(r,e,o){if(e.closure_type)return(...t)=>{const n=[];let a=0;for(const r of t)n.push(this.unwrapCore(r,e.closure_type.argument_types[a],`${o} closure`,a)),a++;try{return this.wrapCore(r(...n),e.closure_type.return_type,`${o} closure`)}catch(r){throw this.wrapCore(r,{name:"Error",is_error:!0},`${o} closure`)}};if(e.array_type){if(!Array.isArray(r))throw new Error(`Invalid type passed out of ${o}. Was expecting an array.`);let t=0;const n=[];for(const a of r)n[t++]=this.wrapCore(a,e.array_type,o);return n}if(e.is_external_enum){if("string"!=typeof r&&"number"!=typeof r)throw new Error(`Invalid type passed out of ${o}. Was expecting a string or number enum value.`);return r}if(e.is_internal_enum){if(-1===e.enum_values?.indexOf(r))throw new Error(`Invalid data passed out of ${o}. Received ${JSON.stringify(r)}, but expected one of [${e.enum_values?.join(",")}]`);return r}if(!(r instanceof Object))return r;if(!r.constructor.name)return r;const t=this.coreToProxyConstructor.get(r.constructor);return t?new t(r,p(this,i,"f")):r}unwrapCore(r,e,o,t){if("void"!==e.name){if(e.array_type){if(!Array.isArray(r))throw new n.InvalidArgumentError(o,"array",n.InvalidArgumentErrorType.InvalidType,t);let a=0;const s=[];for(const n of r)s[a++]=this.unwrapCore(n,e.array_type,o,t);return s}if(e.is_external_enum){if("string"!=typeof r&&"number"!=typeof r)throw new n.InvalidArgumentError(o,e.name,n.InvalidArgumentErrorType.InvalidType,t);return r}if(e.is_internal_enum){if(-1===e.enum_values?.indexOf(r))throw new n.InvalidArgumentError(o,e.name,n.InvalidArgumentErrorType.InvalidType,t);return r}if(e.is_type){if(e.type_alias)return this.unwrapCore(r,e.type_alias,o,t);throw new n.InvalidArgumentError(o,e.name,n.InvalidArgumentErrorType.InvalidType,t)}if(e.variant_types&&e.variant_types.length>0){const a=e.variant_types.map((r=>r.name));for(const n of e.variant_types)try{return this.unwrapCore(r,n,o,t)}catch{}throw new n.InvalidArgumentError(o,`variant of [ ${a.join(" | ")} ]`,n.InvalidArgumentErrorType.InvalidType,t)}if("string"===e.name||"number"===e.name||"boolean"===e.name){if(typeof r!==e.name)throw new n.InvalidArgumentError(o,e.name,n.InvalidArgumentErrorType.InvalidType,t);return r}if(e.optional_type)return r?this.unwrapCore(r,e.optional_type,o,t):r;if(e.class_type&&!(r instanceof e.class_type))throw new n.InvalidArgumentError(o,e.name,n.InvalidArgumentErrorType.InvalidType,t);if(e.interface_data){if("object"!=typeof r||void 0===r)throw new n.InvalidArgumentError(o,e.name,n.InvalidArgumentErrorType.InvalidType,t);const a=r,s={};for(const r of e.interface_data().properties)if(r.name in a)s[r.name]=this.unwrapCore(a[r.name],r.type,o,t);else if(void 0===r.type.optional_type)throw new n.InvalidArgumentError(o,e.name,n.InvalidArgumentErrorType.Empty,t);return s}if(e.closure_type)return(...t)=>{const n=[];let a=0;for(const r of t)n.push(this.wrapCore(r,e.closure_type.argument_types[a],`${o} returned closure`)),a++;try{return this.unwrapCore(r(...n),e.closure_type.return_type,`${o} closure`)}catch(r){throw this.unwrapCore(r,{name:"Error",is_error:!0},`${o} closure`)}};if(e.is_generic_instance||e.class_type||"unknown"===e.name||e.is_error){if(!(r instanceof Object))return r;const e=this.proxyToGetInner.get(r.constructor);return e?e.call(r,p(this,i,"f")):r}throw new n.InvalidArgumentError(o,e.name,n.InvalidArgumentErrorType.Unknown,t)}}};var l=t.W_,u=t.S_,c=t._v,d=t.wA,y=t.XJ,f=t.KB,g=t.Hk,w=t.zS,v=t.yX,F=t._S,_=t.Cm,h=t.I4,I=t.vI,M=t.FK,A=t.jz,E=t.vB;export{l as ActionFormData,u as ActionFormResponse,c as FormCancelationReason,d as FormRejectError,y as FormRejectReason,f as FormResponse,g as MessageFormData,w as MessageFormResponse,v as ModalFormData,F as ModalFormDataDropdownOptions,_ as ModalFormDataSliderOptions,h as ModalFormDataTextFieldOptions,I as ModalFormDataToggleOptions,M as ModalFormResponse,A as UIManager,E as uiManager}; |
Xet Storage Details
- Size:
- 6.19 kB
- Xet hash:
- 9bc32ef4738225e7a138262fe9563ee65c298ef1e4e570513f575698dbba13f1
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.