@luminocity/lemonate-gateway 8.2.21 → 8.2.23

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.
@@ -1,4 +1,4 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("short-unique-id"),require("axios"),require("axios-retry"),require("isomorphic-ws"),require("form-data"),require("jszip")):"function"==typeof define&&define.amd?define(["exports","short-unique-id","axios","axios-retry","isomorphic-ws","form-data","jszip"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["lemonate-gateway"]={},e["short-unique-id"],e.axios,e["axios-retry"],e["isomorphic-ws"],e["form-data"],e.jszip)}(this,(function(e,t,a,n,i,r,s){"use strict";class o{func;owner;constructor(e,t){this.func=e,this.owner=t}}class l{_debugMode=!1;_listeners=new Map;_onceListeners=new Map;_catchAllListeners=[];_capturedEvents=new Map;_capturedAccumulatedDuration=0;constructor(){}setDebugMode(e){this._debugMode&&!e&&(console.log("Captured events: ",this._capturedEvents),console.log(`Total duration: ${this._capturedAccumulatedDuration}ms`)),this._debugMode=e,this._capturedEvents=new Map,this._capturedAccumulatedDuration=0}$clear(){this._listeners.clear(),this._onceListeners.clear()}clearCatchAllListeners(){this._catchAllListeners=[]}listenerCount(e){let t=0;return t+=this._listeners.get(e)?.length||0,t+=this._onceListeners.get(e)?.length||0,t}$hasListener(e){return this.listenerCount(e)>0}$catchAll(e,t){this._catchAllListeners.push(new o(e,t))}$on(e,t,a){let n;this._listeners.has(e)?n=this._listeners.get(e):(n=[],this._listeners.set(e,n)),n.push(new o(t,a))}$once(e,t,a){let n;this._onceListeners.has(e)?n=this._onceListeners.get(e):(n=[],this._onceListeners.set(e,n)),n.push(new o(t,a))}$off(e,t,a){let n=0;if(this._listeners.has(e)){n+=this._listeners.get(e).removeByFilterFunc((e=>e.func===t&&e.owner===a))}if(this._onceListeners.has(e)){n+=this._onceListeners.get(e).removeByFilterFunc((e=>e.func===t&&e.owner===a))}return n}$offByOwner(e,t){let a=0;if(this._listeners.has(e)){a+=this._listeners.get(e).removeByFilterFunc((e=>e.owner===t))}if(this._onceListeners.has(e)){a+=this._onceListeners.get(e).removeByFilterFunc((e=>e.owner===t))}return a}$emitSync(e,...t){const a=[],n=performance.now();let i=0;try{for(const n of this._catchAllListeners.values())try{const r=n.func.call(n.owner,e,...t);r&&r.then&&a.push(r),i++}catch(e){console.error(e)}if(this._listeners.has(e)){const n=this._listeners.get(e);for(const e of n)try{const n=e.func.call(e.owner,...t);n&&n.then&&a.push(n),i++}catch(e){console.error(e)}}if(this._onceListeners.has(e)){const n=this._onceListeners.get(e);for(const e of n)try{const n=e.func.call(e.owner,...t);n&&n.then&&a.push(n),i++}catch(e){console.error(e)}this._onceListeners.set(e,[])}}catch(e){console.error(e)}if(this._debugMode&&"log"!==e){const t=performance.now(),r=Math.floor(t-n);let s=this._capturedEvents.get(e);s?(s.count++,s.duration+=r,s.promises+=a.length,s.sentTo+=i):(s={eventType:e,count:1,duration:r,promises:a.length,sentTo:i},this._capturedEvents.set(e,s)),r>3&&console.log(`Expensive event ${e}: ${r}ms`)}return a.length>0?Promise.all(a):null}$emit(e,...t){return new Promise((a=>{a(this.$emitSync(e,...t))}))}}const u=new l;class c{type;itemId;elementId;target;prop;value;oldValue;createdAt=Date.now();moveTargetArray;moveTargetArrayIndex;moveTargetElementId;start;length;position;elementsToDelete;field;fieldId;isLink;bundleIndex=0;_undoFunction;_redoFunction;constructor(e,t,a,n,i,r,s){this.type=e,this.itemId=t,this.elementId=a,this.target=n,this.prop=i,this.value=r,this.oldValue=s}async undo(){this._undoFunction&&await this._undoFunction()}async redo(){this._redoFunction&&await this._redoFunction()}setUndoFunction(e){this._undoFunction=e}setRedoFunction(e){this._redoFunction=e}setMoveTarget(e,t,a){this.moveTargetArray=e,this.moveTargetArrayIndex=t,this.moveTargetElementId=a}setRange(e,t){this.start=e,this.length=t}setPosition(e){this.position=e}setElementsToDelete(e){this.elementsToDelete=e}setField(e){this.field=e}setFieldId(e){this.fieldId=e}setIsLink(e){this.isLink=e}clone(){return Object.assign(new c,this)}isWithinMergeDeltaOf(e,t){return Math.abs(e.createdAt-this.createdAt)<=t}isMergeableWith(e,t){if(!this.isWithinMergeDeltaOf(e,t))return!1;const a=e.type===this.type&&e.itemId===this.itemId&&e.elementId===this.elementId&&e.target===this.target&&e.prop===this.prop,n=void 0!==e.value&&void 0!==e.oldValue&&void 0===e.start&&void 0===e.length&&void 0===e.position&&void 0===e.elementsToDelete;return a&&n}merge(e,t){if(!this.isMergeableWith(e,t))return null;let a=this.clone();return a.value=e.value,a.createdAt=e.createdAt,a._redoFunction=e._redoFunction,a}}const d=new t({dictionary:"hex",length:12});let p=(new Date).valueOf();var h={createItemOrBlockID:function(){return d.rnd()},createFieldID:function(){return(p++).toString()},createGUID:function(){return d.rnd()},createGeneratedItemId:function(){return"gen_"+this.createGUID()},toUserFriendlyName:function(e){return e.replace(/_./g,(e=>e.charAt(1).toUpperCase())).replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^(.)/,(e=>e.toUpperCase()))},assert:function(e,t){e||console.error(`ASSERTION FAILED: '${e}' is untrue: ${t}`)},matchItemIdAndObject:(e,t)=>!(!e||!t)&&(e._id===t||e===t._id),getDepth(e,t=new WeakSet){if(null===e||"object"!=typeof e)return 1;const a=e;if(t.has(a))return 0;t.add(a);const n=Array.isArray(a)?a:Object.values(a);let i=0;for(const e of n){const a=this.getDepth(e,t);a>i&&(i=a)}return 1+i},areValuesEqual(e,t,a=3){if(e===t)return!0;if("number"==typeof e&&"number"==typeof t)return isNaN(e)&&isNaN(t);if(null==e||null==t||typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;if(e._id&&e._id!==t._id)return!1;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(let i of n){if(!Object.prototype.hasOwnProperty.call(t,i))return!1;if(a>0&&!this.areValuesEqual(e[i],t[i],a-1))return!1}return!0},startTimer(e){const t=Date.now();return e&&console.log(`[TIMER] - ${e}`),function(e){const a=Date.now()-t;e?console.log(`[TIMER] - ${e}: ${a}ms`):console.log(`[TIMER] - ${a}ms`)}},dataURItoBlob(e){const t=e.split(",")[0].split(":")[1].split(";")[0],a=atob(e.split(",")[1]),n=[];for(let e=0;e<a.length;e++)n.push(a.charCodeAt(e));return new Blob([new Uint8Array(n)],{type:t})},xmur3(e){let t=1779033703^e.length;for(let a=0;a<e.length;a++)t=Math.imul(t^e.charCodeAt(a),3432918353),t=t<<13|t>>>19;return()=>(t=Math.imul(t^t>>>16,2246822507),t=Math.imul(t^t>>>13,3266489909),t^=t>>>16,t>>>0)},mulberry32:e=>()=>{let t=e+=1831565813;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296},hslToRgb(e,t,a){const n=(1-Math.abs(2*a-1))*t,i=e/60,r=n*(1-Math.abs(i%2-1));let[s,o,l]=[0,0,0];[s,o,l]=i>=0&&i<1?[n,r,0]:i<2?[r,n,0]:i<3?[0,n,r]:i<4?[0,r,n]:i<5?[r,0,n]:[n,0,r];const u=a-n/2;return[Math.round(255*(s+u)),Math.round(255*(o+u)),Math.round(255*(l+u))]},rgbToHex:(e,t,a)=>"#"+[e,t,a].map((e=>e.toString(16).padStart(2,"0"))).join(""),colorFromString(e,t={}){const{minS:a=.72,maxS:n=.97,minL:i=.48,maxL:r=.62,return:s="hex"}=t,o=this.xmur3(e)(),l=this.mulberry32(o),u=Math.floor(360*l()),c=a+l()*(n-a),d=i+l()*(r-i);if("hsl"===s)return`hsl(${u} ${Math.round(100*c)}% ${Math.round(100*d)}%)`;const[p,h,f]=this.hslToRgb(u,c,d);return"rgb"===s?`rgb(${p}, ${h}, ${f})`:this.rgbToHex(p,h,f)},async downloadFile(e,t){if(e.startsWith("blob:")){const t=await fetch(e),a=await t.blob();return{data:a,mimeType:a.type}}return a.get(e,{responseType:"blob",onDownloadProgress:e=>{if(t&&e.total){const a=Math.round(100*e.loaded/e.total);t(a,e.total,e.loaded)}}})}};const f=new Set(["dependantFields","conditionFields","dependenciesInitialized","_hidden","_updateConditions"]),m=new Set(["__proto__","__ob__","isSelected","isDirty","options","_hidden","_updateConditions","dependantFields","conditionFields","separatorFields","dependenciesInitialized","order","inject","type","datatype","minValue","maxValue","id","_id","linkableTypes","info"]),y=new Set(["isSelected","isDirty","_hidden","_updateConditions","options","dependantFields","conditionFields","separatorFields","dependenciesInitialized","id","_id","linkableTypes","info"]);class g{suppressDirty=!1;undoManager;_promises=[];_capturePromises=!1;_profiledEvents=[];_profiling=!1;_profilerStartTime=0;_profiledCount=0;static _instance;static get instance(){return this._instance||(this._instance=new this)}constructor(){}suppressDirtyFlag(e){this.suppressDirty=e}setUndoManager(e){this.undoManager=e}isUndoManagerActive(){return this.undoManager?.getEnabled()}_postUndoManagerEvent(e){this.undoManager&&(y.has(e.prop)||this.undoManager.event(e))}setItemDirty(e,t,a,n){this.suppressDirty||e.isDirty||a===n||m.has(t)||e.markDirty()}capturePromise(e){try{return this._capturePromises=!0,e(),Promise.all(this._promises)}finally{this._capturePromises=!1,this._promises=[]}}startProfiling(){this._profiling=!0,this._profiledEvents=[],this._profiledCount=0,this._profilerStartTime=performance.now(),u.setDebugMode(!0)}endProfiling(){const e=performance.now()-this._profilerStartTime;u.setDebugMode(!1),console.log("Profiled events: ",this._profiledEvents),console.log(`Profiling took ${e}ms`)}_addPromise(e){this._capturePromises&&this._promises.push(e)}_proxyObject(e,t,a,n){const i=this;if(!e)throw"_proxyObject(): Object is not defined. Cannot create proxy!";if(!a)throw"_proxyObject(): Item is not defined. Cannot create proxy!";if(!n)throw"_proxyObject(): Options is not defined. Cannot create proxy!";return new Proxy(e,{set:function(r,s,o){if(f.has(s))return Reflect.set(r,s,o);const l=performance.now();let d=i.isUndoManagerActive();const p=Reflect.get(r,s);if(h.areValuesEqual(p,o))return!0;let m=Reflect.set(r,s,o);function y(i,o){const l=new c(n.proxyEventTypeName,a._id,t?t.id:null,r,s,i,o);return n.isField&&(l.setField(e.name),l.setFieldId(e.id)),void 0!==n.isLink&&l.setIsLink(n.isLink),l}n.changeDoesNotMakeItemDirty||(h.matchItemIdAndObject(p,o)?d=!1:i.setItemDirty(a,s,p,o));const g=y(o,p);d&&(g.setUndoFunction((()=>{Reflect.set(r,s,g.oldValue);const e=y(g.oldValue,g.value);u.$emitSync("proxy:valueChange",e),n.changeEventFunc(e)})),g.setRedoFunction((()=>{Reflect.set(r,s,g.value);const e=y(g.value,g.oldValue);u.$emitSync("proxy:valueChange",e),n.changeEventFunc(e)}))),n.changeEventFunc(g),d&&i._postUndoManagerEvent(g),u.$emitSync("proxy:valueChange",g);const b=performance.now();return i._profiledCount++,i._profiledEvents.push({event:g,type:"object",duration:b-l}),m}})}_proxyArray(e,t,a,n){const i=this;if(!e)throw"_proxyArray(): Array is not defined. Cannot create proxy!";if(!a)throw"_proxyArray(): Item is not defined. Cannot create proxy!";if(!n)throw"_proxyArray(): Options is not defined. Cannot create proxy!";return new Proxy(e,{set(e,r,s){const o=performance.now(),l=Reflect.get(e,r);let d=Reflect.set(e,r,s);if("length"!==r&&"__proto__"!==r){const p=i.isUndoManagerActive();function h(i,s){const o=new c("arraySetValue",a._id,t?t.id:null,e,r,i,s);return n.field&&(o.setField(n.field.name),o.setFieldId(n.field.id)),o}n.changeDoesNotMakeItemDirty||i.setItemDirty(a,r,l,s);const f=h(s,l);p&&(f.setUndoFunction((()=>{const t=h(f.oldValue,f.value),a=parseInt(r);if(void 0===f.oldValue&&e.length-1===a){const n=e.pop();t.setElementsToDelete([n]),t.setRange(a,1)}else Reflect.set(e,r,f.oldValue);u.$emitSync("proxy:valueChange",t),n.deleteEventFunc(t)})),f.setRedoFunction((()=>{Reflect.set(e,r,f.value);const t=h(f.value,f.oldValue);u.$emitSync("proxy:valueChange",t),n.addEventFunc(t)}))),n.addEventFunc(f),p&&i._postUndoManagerEvent(f),u.$emitSync("proxy:valueChange",f);const m=performance.now();i._profiledCount++,i._profiledEvents.push({event:f,type:"set_array",duration:m-o})}return d},get(r,s){if("splice"===s){const e=Reflect.get(r,s);return function(...o){const l=o[0],d=o[1],p=[];for(let e=l;e<l+d;e++){const t=r[e];p.push(t)}function h(e,i,s){const o=new c("arraySpliceRemove",a._id,t?t.id:null,r);return n.field&&(o.setField(n.field.name),o.setFieldId(n.field.id)),o.setRange(e,i),o.setElementsToDelete(s),o}function f(e,i){const o=new c("arraySpliceAdd",a._id,t?t.id:null,r,s,i);return n.field&&(o.setField(n.field.name),o.setFieldId(n.field.id)),o.setPosition(e),o}if(e.apply(r,o),i.setItemDirty(a,s,!0,!1),d>0&&o.length<3){const e=i.isUndoManagerActive(),t=h(l,d,p);e&&(t.setUndoFunction((()=>{r.splice(l,0,...p);const e=f(l,p);u.$emitSync("proxy:valueChange",e),n.addEventFunc(e)})),t.setRedoFunction((()=>{r.splice(l,d);const e=h(l,d,p);u.$emitSync("proxy:valueChange",e),n.deleteEventFunc(e)}))),n.deleteEventFunc(t),e&&i._postUndoManagerEvent(t),u.$emitSync("proxy:valueChange",t)}else if(o.length>2){const e=o.slice(2),t=f(l,e);t.setPosition(l),t.setUndoFunction((()=>{r.splice(l,e.length);const t=h(l,e.length,e);u.$emitSync("proxy:valueChange",t),n.deleteEventFunc(t)})),t.setRedoFunction((()=>{r.splice(l,0,...e);const t=f(l,e);u.$emitSync("proxy:valueChange",t),n.addEventFunc(t)})),n.addEventFunc(t),i._postUndoManagerEvent(t),u.$emitSync("proxy:valueChange",t)}}}return"moveToArray"===s?function(e,o,l){const d=r,p=t,{array:h,element:f}=o.getTargetArrayAndElement();function m(e,t,a,n){n=void 0===n?a.length:n;const i=Reflect.get(e,"splice").apply(e,[t,1]);if(i.length>0){const e=i[0];return Reflect.get(a,"splice").apply(a,[n,0,e]),e}return null}const y=m(d,e,h,l);if(y){function g(e,n,i,r,s,o){const l=new c("arrayMoveToArray",a._id,t?t.id:null,e,void 0,o);return l.setRange(n,1),l.setMoveTarget(i,r,s?s.id:null),l}i.setItemDirty(a,s,!0,!1);const b=i.isUndoManagerActive(),v=g(d,e,o,l,f,y);b&&(v.setUndoFunction((()=>{const t=m(h,l,d,e),a=g(o,l,d,e,p,t);u.$emitSync("proxy:valueChange",a),n.moveEventFunc(a)})),v.setRedoFunction((()=>{const t=m(d,e,h,l),a=g(d,e,o,l,f,t);u.$emitSync("proxy:valueChange",a),n.moveEventFunc(a)}))),n.moveEventFunc(v),b&&i._postUndoManagerEvent(v),u.$emitSync("proxy:valueChange",v)}}:"getTargetArrayAndElement"===s?function(){return{array:e,element:t}}:("move"===s&&console.warn("'move' prop is not implemented in Proxifier"),Reflect.get(r,s))}})}proxyBlockArray(e,t,a){return this._proxyArray(e,t,a,{addEventFunc:e=>{this._addPromise(u.$emit("itemRepo:blockAdded",e))},deleteEventFunc:e=>{this._addPromise(u.$emit("itemRepo:blockDeleted",e))},moveEventFunc:e=>{this._addPromise(u.$emit("itemRepo:blockMoved",e))}})}proxyListArray(e,t,a){return this._proxyArray(e,null,a,{field:t,addEventFunc:function(e){u.$emit("itemRepo:listEntryAdded",e)},deleteEventFunc:function(e){u.$emit("itemRepo:listEntryDeleted",e)}})}proxyScriptArray(e,t,a){return this._proxyArray(e,t,a,{addEventFunc:function(e){u.$emit("itemRepo:scriptAdded",e)},deleteEventFunc:function(e){u.$emit("itemRepo:scriptDeleted",e)}})}proxyBlock(e,t){return this._proxyObject(e,e,t,{isLink:!0,changeEventFunc:function(e){u.$emit("itemRepo:fieldChanged",e),u.$emit("itemRepo:linkChanged",e)},proxyEventTypeName:"blockSetValue"})}proxyGraphBlock(e,t){return this._proxyObject(e,e,t,{isLink:!0,changeEventFunc:function(e){u.$emit("itemRepo:graphNodeChanged",e)},proxyEventTypeName:"blockSetValue"})}proxyGraphBlockArray(e,t){return this._proxyArray(e,t,t,{addEventFunc:function(e){u.$emit("itemRepo:graphNodeAdded",e)},deleteEventFunc:function(e){u.$emit("itemRepo:graphNodeDeleted",e)}})}proxyConnection(e,t){return this._proxyObject(e,t,t,{changeEventFunc:function(e){u.$emit("itemRepo:graphConnectionChanged",e)},proxyEventTypeName:"connectionSetValue"})}proxyConnectionArray(e,t){return this._proxyArray(e,e,t,{addEventFunc:function(e){u.$emit("itemRepo:graphConnectionAdded",e)},deleteEventFunc:function(e){u.$emit("itemRepo:graphConnectionDeleted",e)}})}proxyItemField(e,t){const a="Link"===e.type;return this._proxyObject(e,null,t,{isLink:a,isField:!0,changeEventFunc:function(e){u.$emit("itemRepo:fieldChanged",e),a&&u.$emit("itemRepo:linkChanged",e)},proxyEventTypeName:"itemFieldSetValue"})}proxyGraphBlockField(e,t,a){return this._proxyObject(e,t,a,{isLink:"Link"===e.type,isField:!0,changeEventFunc:function(e){u.$emit("itemRepo:graphNodeFieldChanged",e)},proxyEventTypeName:"blockFieldSetValue"})}proxyBlockField(e,t,a){const n="Link"===e.type;return this._proxyObject(e,t,a,{isLink:n,isField:!0,changeEventFunc:function(e){u.$emit("itemRepo:fieldChanged",e),n&&u.$emit("itemRepo:linkChanged",e)},proxyEventTypeName:"blockFieldSetValue"})}proxyScriptItem(e,t,a){return this._proxyObject(e,t,a,{isLink:!0,changeEventFunc:function(e){u.$emit("itemRepo:scriptItemChanged",e)},proxyEventTypeName:"scriptItemSetValue"})}proxyScriptFieldsArray(e,t,a){return this._proxyArray(e,t,a,{addEventFunc:function(e){u.$emit("itemRepo:scriptFieldAdded",e)},deleteEventFunc:function(e){u.$emit("itemRepo:scriptFieldDeleted",e)},changeDoesNotMakeItemDirty:!0})}proxyScriptField(e,t,a){return this._proxyObject(e,t,a,{isLink:!1,isField:!0,changeEventFunc:function(e){u.$emit("itemRepo:scriptFieldChanged",e)},proxyEventTypeName:"itemScriptFieldSetValue",changeDoesNotMakeItemDirty:!1})}proxyCustomFieldsArray(e,t){return this._proxyArray(e,null,t,{addEventFunc:function(e){u.$emit("itemRepo:customFieldAdded",e)},deleteEventFunc:function(e){u.$emit("itemRepo:customFieldDeleted",e)},changeDoesNotMakeItemDirty:!0})}proxyCustomField(e,t){return this._proxyObject(e,null,t,{isLink:!1,isField:!0,changeEventFunc:function(e){u.$emit("itemRepo:customFieldChanged",e)},proxyEventTypeName:"itemCustomFieldSetValue",changeDoesNotMakeItemDirty:!1})}}class b{level;name;times;durations=[];childrenMap=new Map;children=[];parent;constructor(e,t,a,n){this.name=e,this.level=t,this.times=[a],this.parent=n}}class v{startTime=0;endTime=0;startIteration=0;currentLevel=0;root=new b("root",0,0,void 0);currentEntry;active=!1;static _instance;static get instance(){return this._instance||(this._instance=new this)}constructor(){this.currentEntry=this.root}start(){this.startTime=performance.now(),this.startIteration=this.startTime,this.root=new b("root",0,0,void 0),this.currentEntry=this.root,this.currentLevel=0,this.active=!0}end(e=!1){this.active=!1,this.endTime=performance.now()-this.startTime,this.root.durations.push(this.endTime-this.root.times[0]),e&&this.printResults()}_iterate(e,t){e(t=t||this.root);for(const a of t.children)this._iterate(e,a)}getResults(){const e=[];function t(e){return Math.round(1e3*e)/1e3}function a(e){return e.reduce(((e,t)=>e+t),0)}return this._iterate((function(n){const i=t(a(n.times)/n.times.length),r=t(a(n.durations)/n.durations.length),s=t(a(n.durations)),o=t(s-n.children.reduce(((e,t)=>e+a(t.durations)),0));e.push({name:"".padStart(2*n.level," .")+n.name,executions:n.times.length,avgTimeStartMs:i,avgTimeEndMs:t(i+r),avgDurationMs:r,totalDurationMs:s,selfDurationMs:o})})),e}printResults(){console.table(this.getResults(),["name","executions","avgTimeStartMs","avgTimeEndMs","avgDurationMs","totalDurationMs","selfDurationMs"])}newIteration(){this.startIteration=performance.now(),this.currentLevel=0}async asyncBlock(e,t){if(!this.active)return t();let a;try{return a=this.beginBlock(e),await t()}finally{this.endBlock(a)}}block(e,t){if(!this.active)return t();let a;try{return a=this.beginBlock(e),t()}finally{this.endBlock(a)}}beginBlock(e){if(!this.active)return;this.currentLevel++;const t=performance.now()-this.startIteration;let a=this.currentEntry.childrenMap.get(e);return a?a.times.push(t):(a=new b(e,this.currentLevel,t,this.currentEntry),this.currentEntry.children.push(a),this.currentEntry.childrenMap.set(e,a)),this.currentEntry=a,a}endBlock(e){if(!e)return;const t=performance.now()-this.startIteration-e.times[e.times.length-1];e.durations.push(t),this.currentEntry=e.parent,this.currentLevel--}}class _ extends Error{constructor(e,t){super(e),t&&(this.name=t)}toString(){return this.name?`${this.name}: ${this.message}`:this.message}}class w extends _{constructor(e){super(e,"InvalidArgumentException")}}class A extends _{constructor(e){super(e,"RuntimeException")}}class k extends _{constructor(e){super(e,"LoaderException")}}class S extends _{constructor(e){super(e,"QuotaExceededException")}}class N extends _{constructor(e){super(e,"AccessDeniedException")}}let T=class{_id;name;folder;folderPath;links;attributes;userAttributes;filename;createdAt;updatedAt;version;filesize;hash;mimeType;type;packageType;createdBy;updatedBy;acl;visibility;properties;allowConversation;conversation;tags;contributors;description;shortDescription;userAttributeTemplate;categories;attachments;license;quotaUser;quotaGroup;itemSize;totalSize;flags;perceptiveHash;unpackagedSize;location;itemFlag;constructor(e){if(this._id=e._id,this.name=e.name,this.folder=e.folder,this.folderPath=e.folderPath,this.links=[],Array.isArray(e.links))for(const t of e.links)this.links.push({to:t.to,usage:t.usage});this.attributes=JSON.parse(JSON.stringify(e.attributes||{})),this.userAttributes=JSON.parse(JSON.stringify(e.userAttributes||{})),this.filename=e.filename,this.createdAt=e.createdAt,this.updatedAt=e.updatedAt,this.version={major:e.version?.major||0,minor:e.version?.minor||0,revision:e.version?.revision||1},this.filesize=e.filesize,this.hash=e.hash,this.mimeType=e.mimeType,this.type=e.type,this.packageType=e.packageType,this.createdBy=e.createdBy,this.updatedBy=e.updatedBy,this.acl=JSON.parse(JSON.stringify(e.acl||[])),this.visibility=e.visibility,this.properties=JSON.parse(JSON.stringify(e.properties||{})),this.allowConversation=e.allowConversation,this.conversation=e.conversation,this.tags=JSON.parse(JSON.stringify(e.tags||[])),this.contributors=JSON.parse(JSON.stringify(e.contributors||[])),this.description=e.description,this.shortDescription=e.shortDescription,this.userAttributeTemplate=e.userAttributeTemplate,this.categories=e.categories,this.attachments=JSON.parse(JSON.stringify(e.attachments||[])),this.license=e.license,this.quotaUser=e.quotaUser,this.quotaGroup=e.quotaGroup,this.itemSize=e.itemSize,this.totalSize=e.totalSize,this.flags=JSON.parse(JSON.stringify(e.flags||[])),this.perceptiveHash=e.perceptiveHash,this.unpackagedSize=e.unpackagedSize,this.location=e.location,this.itemFlag=JSON.parse(JSON.stringify(e.itemFlag||{}))}};class M extends T{links;thumbnails;fieldSets;fields;userFields;isAggregatedItem=!0;constructor(e){if(super(e),this.links=[],Array.isArray(e.links))for(const t of e.links)this.links.push({to:t.to,usage:t.usage,stopRecursion:t.stopRecursion});this.thumbnails=JSON.parse(JSON.stringify(e.thumbnails||[])),this.fieldSets=JSON.parse(JSON.stringify(e.fieldSets||[])),this.fields=JSON.parse(JSON.stringify(e.fields||[])),this.userFields=JSON.parse(JSON.stringify(e.userFields||[]))}}var x=[{_id:{$oid:"5e6a1ace89707feef5738292"},contentTypes:["model/splat"],fieldSets:[],fields:[],name:"Gaussian Splats",updateRequiresThumbRefresh:!0,creatableEmpty:!1},{_id:{$oid:"5e6a1ace89707feef3748569"},contentTypes:[],fieldSets:[],fields:[{label:"Scenes",type:"Separator"},{elementName:"Scene",fields:[{linkableTypes:["Scene"],type:"Link",usageAs:"Scene",mandatory:!0},{datatype:"Boolean",defaultValue:!0,displayName:"Load",name:"Load",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Active",if:{Load:!0},name:"Active",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Primary",name:"Primary",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Exclude in packages",name:"ExcludeInPackages",type:"Attribute"},{datatype:"Transform",defaultValue:{position:{x:0,y:0,z:0},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},name:"Transform",type:"Attribute"}],name:"Scenes",type:"List"},{label:"Variable Sets",type:"Separator",collapsed:!0},{displayName:"Variable sets",elementName:"Variable set",fields:[{displayName:"Variable set",linkableTypes:["Variable Set"],type:"Link",usageAs:"VariableSet",mandatory:!0},{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"}],name:"VariableSets",type:"List"},{label:"Graphics",type:"Separator",collapsed:!0},{datatype:"Enum",defaultValue:"Not defined",displayName:"Aspect ratio",info:"This determines the project's aspect ratio. If not defined, the game will run in the default aspect depending on platform and browser size",name:"AspectRatio",options:["Not defined","Standard (4:3)","Widescreen (16:9)","Ultrawide (21:9)","Custom"],type:"Attribute"},{datatype:"Float",defaultValue:1.3,minValue:.1,maxValue:10,displayName:"Custom Aspect",if:{AspectRatio:"Custom"},name:"CustomAspect",type:"Attribute"},{label:"Physics",type:"Separator",collapsed:!0},{datatype:"Boolean",defaultValue:!1,displayName:"Enabled",name:"PhysicsEnabled",type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:0,y:-9.81,z:0},displayName:"Gravity",if:{PhysicsEnabled:!0},name:"Gravity",type:"Attribute"},{datatype:"LayerMatrix",defaultValue:[[0]],displayName:"Collision matrix",if:{PhysicsEnabled:!0},info:"This controls which physics object interact with which others depending on their layers",name:"CollisionMatrix",type:"Attribute"},{datatype:"StringList",defaultValue:["Default","Terrain","TransparentFX","Water"],displayName:"Layer names",fixedLength:!0,info:"Names of the layers to use with all scenegraph nodes",name:"LayerNames",type:"Attribute"},{label:"Resources",type:"Separator",collapsed:!0},{datatype:"Enum",defaultValue:"After loading everything",displayName:"Start execution",info:"This controls when the engine will start execution of the project in the player",name:"StartExecution",options:["Right away","After loading minimum LOD","After loading everything"],type:"Attribute"},{label:"Controls",type:"Separator",collapsed:!0},{datatype:"Boolean",defaultValue:!1,displayName:"Automatic pointer lock",name:"AutomaticPointerLock",type:"Attribute",info:"Enabling this will cause the mouse pointer to be locked until Escape is pressed"},{label:"Canvas Fonts",type:"Separator",collapsed:!0},{displayName:"Canvas fonts",elementName:"Font",fields:[{displayName:"Font",linkableTypes:["Font"],type:"Link",usageAs:"Font",mandatory:!0}],name:"CanvasFonts",type:"List"}],name:"Project",recursiveLoadStopsHere:!0,updateRequiresThumbRefresh:!1,creatableEmpty:!1},{_id:{$oid:"5e6a1ace24a07f56f3742569"},contentTypes:[],fieldSets:[],fields:[{elementName:"Variable",fields:[{datatype:"String",defaultValue:"Name",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Enum",defaultValue:"Integer",displayName:"Type",name:"Type",options:["Integer","Float","String","Boolean"],type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Value",if:{Type:"Boolean"},name:"BooleanValue",type:"Attribute"},{datatype:"Integer",defaultValue:0,displayName:"Value",if:{Type:"Integer"},name:"IntegerValue",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Value",if:{Type:"Float"},name:"FloatValue",type:"Attribute"},{datatype:"String",defaultValue:"",displayName:"Value",if:{Type:"String"},name:"StringValue",type:"Attribute"}],name:"Variables",type:"List"}],name:"Variable Set",updateRequiresThumbRefresh:!1,creatableEmpty:!0},{_id:{$oid:"5e6a1ace89707feef9173386"},contentTypes:["audio/mpeg"],fieldSets:[],fields:[{datatype:"Float",defaultValue:1,displayName:"Volume",maxValue:1,minValue:0,name:"Volume",type:"Attribute",widget:"Slider"}],name:"Audio",updateRequiresThumbRefresh:!1,creatableEmpty:!1},{_id:{$oid:"5e6a1acf89707feef917338f"},contentTypes:["*"],fieldSets:[],fields:[],name:"Binary",creatableEmpty:!1},{_id:{$oid:"5e6a1acf89707feef917337f"},contentTypes:["application/vnd.lumino.package"],fieldSets:[],fields:[],name:"Package",creatableEmpty:!1},{_id:{$oid:"5e6a1ad189707feef9173391"},contentTypes:["image/vnd.radiance"],fieldSets:[],fields:[],name:"HDR Image",creatableEmpty:!1},{_id:{$oid:"5e6a1ad189707feef9173392"},contentTypes:["image/png","image/jpeg","image/avif","image/heif"],fieldSets:[],fields:[{datatype:"Enum",defaultValue:"Linear",displayName:"Encoding",name:"Encoding",options:["Linear","sRGB"],type:"Attribute"}],name:"Image",updateRequiresThumbRefresh:!0,creatableEmpty:!1},{_id:{$oid:"5e6a1ad189707feef9173393"},contentTypes:[""],fieldSets:[],fields:[{label:"Type",type:"Separator"},{datatype:"Enum",defaultValue:"Physical",displayName:"Material type",name:"MaterialType",options:["Physical","Shader","Point","Basic","Normal","Toon","Matcap","Lambert","Phong"],type:"Attribute"},{label:"Matcap material options",type:"Separator",if:{MaterialType:"Matcap"}},{displayName:"Matcap map",linkableTypes:["Image"],type:"Link",usageAs:"Matcap",if:{MaterialType:"Matcap"}},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{MaterialType:"Matcap",Matcap:{$isset:!0}},name:"MatcapWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{MaterialType:"Matcap",Matcap:{$isset:!0}},name:"MatcapWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{MaterialType:"Matcap",Matcap:{$isset:!0}},name:"MatcapMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{MaterialType:"Matcap",Matcap:{$isset:!0}},name:"MatcapMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{MaterialType:"Matcap",Matcap:{$isset:!0}},name:"MatcapAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Toon material options",type:"Separator",if:{MaterialType:"Toon"}},{displayName:"Gradient map",linkableTypes:["Image"],if:{MaterialType:"Toon"},type:"Link",usageAs:"Gradient"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{MaterialType:"Toon",Gradient:{$isset:!0}},name:"GradientWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{MaterialType:"Toon",Gradient:{$isset:!0}},name:"GradientWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Nearest",displayName:"Mag filter",if:{MaterialType:"Toon",Gradient:{$isset:!0}},name:"GradientMagFilter",options:["Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Nearest",displayName:"Min Filter",if:{MaterialType:"Toon",Gradient:{$isset:!0}},name:"GradientMinFilter",options:["Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{MaterialType:"Toon",Gradient:{$isset:!0}},name:"GradientAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Basic material options",type:"Separator",if:{MaterialType:"Basic"}},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},displayName:"Color",name:"EmissionColor",type:"Attribute",if:{MaterialType:"Basic"}},{label:"Custom shaders",type:"Separator",if:{MaterialType:"Shader"}},{displayName:"Vertex shader",linkableTypes:["Vertex Shader"],type:"Link",usageAs:"VertexShader",if:{MaterialType:"Shader"}},{displayName:"Pixel shader",linkableTypes:["Pixel Shader"],type:"Link",usageAs:"PixelShader",if:{MaterialType:"Shader"}},{label:"Point rendering",type:"Separator",if:{MaterialType:"Point"}},{datatype:"Float",defaultValue:1,displayName:"Size",if:{MaterialType:"Point"},minValue:0,name:"PointSize",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Size attenuation",if:{MaterialType:"Point"},name:"PointSizeAttenuation",type:"Attribute"},{label:"Attenuation",type:"Separator",if:{MaterialType:"Physical"}},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},displayName:"Color",info:"The color that white light turns into due to absorption when reaching the attenuation distance.",name:"AttenuationColor",type:"Attribute",if:{MaterialType:"Physical"}},{datatype:"Float",defaultValue:1e3,displayName:"Distance",info:"Density of the medium given as the average distance that light travels in the medium before interacting with a particle. The value is given in world space units, and must be greater than zero.",minValue:1e-5,name:"AttenuationDistance",type:"Attribute",if:{MaterialType:"Physical"}},{label:"Diffuse",type:"Separator",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},displayName:"Color",name:"DiffuseColor",type:"Attribute",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{displayName:"Albedo map",linkableTypes:["Image","Composition","Video"],type:"Link",usageAs:"Albedo",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Albedo:{$isset:!0}},name:"AlbedoWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Albedo:{$isset:!0}},name:"AlbedoWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Albedo:{$isset:!0}},name:"AlbedoMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Albedo:{$isset:!0}},name:"AlbedoMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Albedo:{$isset:!0}},name:"AlbedoAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Vertex Colors",name:"VertexColors",type:"Attribute"},{label:"Transparency",type:"Separator"},{datatype:"Float",defaultValue:0,displayName:"Alpha test",maxValue:1,minValue:0,name:"AlphaTest",type:"Attribute",widget:"Slider"},{datatype:"Boolean",defaultValue:!1,displayName:"Transparent",name:"Transparent",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Opacity",if:{Transparent:!0},maxValue:1,minValue:0,name:"Opacity",type:"Attribute",widget:"Slider"},{displayName:"Alpha map",linkableTypes:["Image"],type:"Link",usageAs:"Alpha",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Alpha:{$isset:!0}},name:"AlphaWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Alpha:{$isset:!0}},name:"AlphaWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Alpha:{$isset:!0}},name:"AlphaMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Alpha:{$isset:!0}},name:"AlphaMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Alpha:{$isset:!0}},name:"AlphaAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Emission",type:"Separator",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Color",defaultValue:{a:255,b:0,g:0,r:0},displayName:"Color",name:"EmissiveColor",type:"Attribute",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Float",defaultValue:1,displayName:"Intensity",maxValue:10,minValue:0,name:"EmissiveIntensity",type:"Attribute",widget:"Slider",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{displayName:"Emissive map",linkableTypes:["Image"],type:"Link",usageAs:"Emissive",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Emissive:{$isset:!0}},name:"EmissiveWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Emissive:{$isset:!0}},name:"EmissiveWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Emissive:{$isset:!0}},name:"EmissiveMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Emissive:{$isset:!0}},name:"EmissiveMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Emissive:{$isset:!0}},name:"EmissiveAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Sheen",type:"Separator",if:{MaterialType:"Physical"}},{datatype:"Float",defaultValue:0,displayName:"Sheen",maxValue:1,minValue:0,name:"Sheen",type:"Attribute",if:{MaterialType:"Physical"}},{datatype:"Float",defaultValue:0,displayName:"Sheen roughness",maxValue:1,minValue:0,name:"SheenRoughness",type:"Attribute",if:{MaterialType:"Physical"}},{displayName:"Sheen roughness map",linkableTypes:["Image"],type:"Link",usageAs:"SheenRoughnessMap",if:{MaterialType:"Physical"}},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{MaterialType:"Physical",SheenRoughnessMap:{$isset:!0}},name:"SheenRoughnessWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{MaterialType:"Physical",SheenRoughnessMap:{$isset:!0}},name:"SheenRoughnessWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{MaterialType:"Physical",SheenRoughnessMap:{$isset:!0}},name:"SheenRoughnessMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{MaterialType:"Physical",SheenRoughnessMap:{$isset:!0}},name:"SheenRoughnessMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{MaterialType:"Physical",SheenRoughnessMap:{$isset:!0}},name:"SheenRoughnessAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},displayName:"Sheen color",name:"SheenColor",type:"Attribute",if:{MaterialType:"Physical"}},{displayName:"Sheen color map",linkableTypes:["Image"],type:"Link",usageAs:"SheenColorMap",if:{MaterialType:"Physical"}},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{MaterialType:"Physical",SheenColorMap:{$isset:!0}},name:"SheenColorWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{MaterialType:"Physical",SheenColorMap:{$isset:!0}},name:"SheenColorWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{MaterialType:"Physical",SheenColorMap:{$isset:!0}},name:"SheenColorMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{MaterialType:"Physical",SheenColorMap:{$isset:!0}},name:"SheenColorMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{MaterialType:"Physical",SheenColorMap:{$isset:!0}},name:"SheenColorAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Normal",type:"Separator",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{displayName:"Normal map",linkableTypes:["Image"],type:"Link",usageAs:"Normal",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Vector2d",defaultValue:{x:1,y:1},displayName:"Scale",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Normal:{$isset:!0}},maxValue:10,minValue:0,name:"NormalScale2d",type:"Attribute"},{datatype:"Enum",defaultValue:"TangentSpace",displayName:"Type",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Normal:{$isset:!0}},name:"NormalType",options:["TangentSpace","ObjectSpace"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Normal:{$isset:!0}},name:"NormalWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Normal:{$isset:!0}},name:"NormalWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Normal:{$isset:!0}},name:"NormalMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Normal:{$isset:!0}},name:"NormalMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Normal:{$isset:!0}},name:"NormalAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Roughness",type:"Separator",if:{MaterialType:"Physical"}},{datatype:"Float",defaultValue:1,displayName:"Roughness Intensity",maxValue:1,minValue:0,name:"RoughnessIntensity",type:"Attribute",widget:"Slider",if:{MaterialType:"Physical"}},{displayName:"Roughness map",linkableTypes:["Image"],type:"Link",usageAs:"Roughness",if:{MaterialType:"Physical"}},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{Roughness:{$isset:!0}},name:"RoughnessWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{Roughness:{$isset:!0}},name:"RoughnessWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{Roughness:{$isset:!0}},name:"RoughnessMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{Roughness:{$isset:!0}},name:"RoughnessMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{MaterialType:"Physical",Roughness:{$isset:!0}},name:"RoughnessAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Metalness",type:"Separator",if:{MaterialType:"Physical"}},{datatype:"Float",defaultValue:1,displayName:"Metalness Intensity",maxValue:1,minValue:0,name:"MetalnessIntensity",type:"Attribute",widget:"Slider",if:{MaterialType:"Physical"}},{displayName:"Metalness map",linkableTypes:["Image"],type:"Link",usageAs:"Metalness",if:{MaterialType:"Physical"}},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{Metalness:{$isset:!0}},name:"MetalnessWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{Metalness:{$isset:!0}},name:"MetalnessWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{Metalness:{$isset:!0}},name:"MetalnessMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{Metalness:{$isset:!0}},name:"MetalnessMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{MaterialType:"Physical",Metalness:{$isset:!0}},name:"MetalnessAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Specular",type:"Separator",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"}]}},{datatype:"Float",defaultValue:1,displayName:"Specular intensity",maxValue:1,minValue:0,name:"SpecularIntensity",type:"Attribute",widget:"Slider",if:{MaterialType:"Physical"}},{displayName:"Specular intensity map",linkableTypes:["Image"],type:"Link",usageAs:"SpecularIntensityMap",if:{MaterialType:"Physical"}},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{MaterialType:"Physical",SpecularIntensityMap:{$isset:!0}},name:"SpecularIntensityWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{MaterialType:"Physical",SpecularIntensityMap:{$isset:!0}},name:"SpecularIntensityWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{MaterialType:"Physical",SpecularIntensityMap:{$isset:!0}},name:"SpecularIntensityMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{MaterialType:"Physical",SpecularIntensityMap:{$isset:!0}},name:"SpecularIntensityMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{MaterialType:"Physical",SpecularIntensityMap:{$isset:!0}},name:"SpecularIntensityAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},if:{MaterialType:"Physical"},displayName:"Specular color",name:"SpecularColor",type:"Attribute"},{displayName:"Specular color map",linkableTypes:["Image"],if:{MaterialType:"Physical"},type:"Link",usageAs:"SpecularColorMap"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{MaterialType:"Physical",SpecularColorMap:{$isset:!0}},name:"SpecularColorWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{MaterialType:"Physical",SpecularColorMap:{$isset:!0}},name:"SpecularColorWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{MaterialType:"Physical",SpecularColorMap:{$isset:!0}},name:"SpecularColorMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{MaterialType:"Physical",SpecularColorMap:{$isset:!0}},name:"SpecularColorMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{MaterialType:"Physical",SpecularColorMap:{$isset:!0}},name:"SpecularColorAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Ambient occlusion",type:"Separator",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{displayName:"Ambient occlusion map",linkableTypes:["Image"],type:"Link",usageAs:"AmbientOcclusion",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Float",defaultValue:1,displayName:"Intensity",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],AmbientOcclusion:{$isset:!0}},maxValue:10,minValue:0,name:"AmbientOcclusionIntensity",type:"Attribute",widget:"Slider"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],AmbientOcclusion:{$isset:!0}},name:"AmbientOcclusionWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],AmbientOcclusion:{$isset:!0}},name:"AmbientOcclusionWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],AmbientOcclusion:{$isset:!0}},name:"AmbientOcclusionMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],AmbientOcclusion:{$isset:!0}},name:"AmbientOcclusionMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],AmbientOcclusion:{$isset:!0}},name:"AmbientOcclusionAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Clearcoat",type:"Separator",if:{MaterialType:"Physical"}},{datatype:"Float",defaultValue:0,displayName:"Intensity",maxValue:1,minValue:0,name:"ClearcoatLevel",type:"Attribute",widget:"Slider",if:{MaterialType:"Physical"}},{displayName:"Clearcoat map",linkableTypes:["Image"],type:"Link",usageAs:"Clearcoat",if:{MaterialType:"Physical"}},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{MaterialType:"Physical",Clearcoat:{$isset:!0}},name:"ClearcoatWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{MaterialType:"Physical",Clearcoat:{$isset:!0}},name:"ClearcoatWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{MaterialType:"Physical",Clearcoat:{$isset:!0}},name:"ClearcoatMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{MaterialType:"Physical",Clearcoat:{$isset:!0}},name:"ClearcoatMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{MaterialType:"Physical",Clearcoat:{$isset:!0}},name:"ClearcoatAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{displayName:"Normal map",linkableTypes:["Image"],type:"Link",usageAs:"ClearcoatNormalMap",if:{MaterialType:"Physical"}},{datatype:"Vector2d",defaultValue:{x:1,y:1},displayName:"Normal scale",if:{MaterialType:"Physical",ClearcoatNormalMap:{$isset:!0}},maxValue:10,minValue:0,name:"ClearcoatNormalScale2d",type:"Attribute",widget:"Slider"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Normal H-wrapping",if:{MaterialType:"Physical",ClearcoatNormalMap:{$isset:!0}},name:"ClearcoatNormalWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Normal V-wrapping",if:{MaterialType:"Physical",ClearcoatNormalMap:{$isset:!0}},name:"ClearcoatNormalWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Normal mag filter",if:{MaterialType:"Physical",ClearcoatNormalMap:{$isset:!0}},name:"ClearcoatNormalMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Normal min Filter",if:{MaterialType:"Physical",ClearcoatNormalMap:{$isset:!0}},name:"ClearcoatNormalMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Normal Anisotropy",if:{MaterialType:"Physical",ClearcoatNormalMap:{$isset:!0}},name:"ClearcoatNormalAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Roughness intensity",maxValue:1,minValue:0,name:"ClearcoatRoughness",type:"Attribute",widget:"Slider",if:{MaterialType:"Physical"}},{displayName:"Roughness map",linkableTypes:["Image"],type:"Link",usageAs:"ClearcoatRoughnessMap"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Roughness H-wrapping",if:{MaterialType:"Physical",ClearcoatRoughnessMap:{$isset:!0}},name:"ClearcoatRoughnessWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Roughness V-wrapping",if:{MaterialType:"Physical",ClearcoatRoughnessMap:{$isset:!0}},name:"ClearcoatRoughnessWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Roughness mag filter",if:{MaterialType:"Physical",ClearcoatRoughnessMap:{$isset:!0}},name:"ClearcoatRoughnessMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Roughness min Filter",if:{MaterialType:"Physical",ClearcoatRoughnessMap:{$isset:!0}},name:"ClearcoatRoughnessMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Roughness Anisotropy",if:{MaterialType:"Physical",ClearcoatRoughnessMap:{$isset:!0}},name:"ClearcoatRoughnessAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Reflections and Refractions",type:"Separator",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Float",defaultValue:.98,displayName:"Refraction ratio",if:{$or:[{MaterialType:"Basic"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]},minValue:0,maxValue:1,name:"RefractionRatio",type:"Attribute"},{datatype:"Float",defaultValue:.5,displayName:"Reflectivity",maxValue:1,minValue:0,name:"Reflectivity",type:"Attribute",widget:"Slider",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Float",defaultValue:1.5,displayName:"Index of refraction",maxValue:2.333,minValue:1,name:"IndexOfRefraction",type:"Attribute",widget:"Slider",if:{MaterialType:"Physical"}},{label:"Environment",type:"Separator",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{displayName:"Environment map",linkableTypes:["HDR Image"],type:"Link",usageAs:"Environment",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Float",defaultValue:1,displayName:"Intensity",if:{$or:[{MaterialType:"Physical"}],Environment:{$isset:!0}},maxValue:10,minValue:0,name:"EnvironmentIntensity",type:"Attribute",widget:"Slider"},{datatype:"Enum",defaultValue:"Multiply",info:"How to combine the result of the surface's color with the environment map, if any. If mix is chosen, the .reflectivity is used to blend between the two colors.",displayName:"Surface combination",name:"SurfaceEnvironmentCombination",options:["Multiply","Mix","Add"],type:"Attribute",if:{$or:[{MaterialType:"Lambert"},{MaterialType:"Basic"},{MaterialType:"Phong"}]}},{label:"Thickness",type:"Separator",if:{MaterialType:"Physical"}},{datatype:"Float",defaultValue:0,displayName:"Thickness",minValue:0,name:"Thickness",type:"Attribute",if:{MaterialType:"Physical"}},{displayName:"Thickness map",linkableTypes:["Image"],type:"Link",usageAs:"ThicknessMap",if:{MaterialType:"Physical"}},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{MaterialType:"Physical",ThicknessMap:{$isset:!0}},name:"ThicknessWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{MaterialType:"Physical",ThicknessMap:{$isset:!0}},name:"ThicknessWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{MaterialType:"Physical",ThicknessMap:{$isset:!0}},name:"ThicknessMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{MaterialType:"Physical",ThicknessMap:{$isset:!0}},name:"ThicknessMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{MaterialType:"Physical",ThicknessMap:{$isset:!0}},name:"ThicknessAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Displacement",type:"Separator",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{displayName:"Displacement map",linkableTypes:["Image"],type:"Link",usageAs:"Displacement",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Float",defaultValue:.1,displayName:"Scale",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Displacement:{$isset:!0}},maxValue:10,minValue:0,name:"DisplacementScale",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:0,displayName:"Bias",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Displacement:{$isset:!0}},name:"DisplacementBias",type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Displacement:{$isset:!0}},name:"DisplacementWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Displacement:{$isset:!0}},name:"DisplacementWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Displacement:{$isset:!0}},name:"DisplacementMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Displacement:{$isset:!0}},name:"DisplacementMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Displacement:{$isset:!0}},name:"DisplacementAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Lightmaps",type:"Separator",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{displayName:"Light map",linkableTypes:["Image"],type:"Link",usageAs:"LightMap",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Float",defaultValue:1,displayName:"Intensity",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],LightMap:{$isset:!0}},maxValue:100,minValue:0,name:"LightMapIntensity",type:"Attribute",widget:"Slider"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],LightMap:{$isset:!0}},name:"LightMapWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],LightMap:{$isset:!0}},name:"LightMapWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],LightMap:{$isset:!0}},name:"LightMapMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],LightMap:{$isset:!0}},name:"LightMapMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],LightMap:{$isset:!0}},name:"LightMapAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Specular map options",type:"Separator",if:{$or:[{MaterialType:"Basic"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Float",defaultValue:30,displayName:"Shininess",minValue:0,name:"Shininess",type:"Attribute",widget:"Slider",if:{$or:[{MaterialType:"Phong"}]}},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},if:{MaterialType:"Phong"},displayName:"Specular color",name:"SpecularColor",type:"Attribute"},{displayName:"Specular map",linkableTypes:["Image"],if:{$or:[{MaterialType:"Basic"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]},type:"Link",usageAs:"SpecularMap"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{$or:[{MaterialType:"Basic"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],SpecularMap:{$isset:!0}},name:"SpecularWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{$or:[{MaterialType:"Basic"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],SpecularMap:{$isset:!0}},name:"SpecularWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{$or:[{MaterialType:"Basic"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],SpecularMap:{$isset:!0}},name:"SpecularMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{$or:[{MaterialType:"Basic"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],SpecularMap:{$isset:!0}},name:"SpecularMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{$or:[{MaterialType:"Basic"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],SpecularMap:{$isset:!0}},name:"SpecularAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Transmission",type:"Separator",if:{MaterialType:"Physical"}},{datatype:"Float",defaultValue:0,displayName:"Intensity",maxValue:1,minValue:0,name:"Transmission",type:"Attribute",widget:"Slider",if:{MaterialType:"Physical"}},{displayName:"Transmission map",linkableTypes:["Image"],type:"Link",usageAs:"TransmissionMap",if:{MaterialType:"Physical"}},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{MaterialType:"Physical",TransmissionMap:{$isset:!0}},name:"TransmissionWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{MaterialType:"Physical",TransmissionMap:{$isset:!0}},name:"TransmissionWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{MaterialType:"Physical",TransmissionMap:{$isset:!0}},name:"TransmissionMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{MaterialType:"Physical",TransmissionMap:{$isset:!0}},name:"TransmissionMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{MaterialType:"Physical",TransmissionMap:{$isset:!0}},name:"TransmissionAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Blending",type:"Separator"},{datatype:"Enum",defaultValue:"Normal",displayName:"Mode",name:"Blending",options:["None","Normal","Additive","Subtractive","Multiply","Custom"],type:"Attribute"},{datatype:"Enum",defaultValue:"Source alpha",displayName:"Source",name:"BlendSrc",options:["Zero","One","Source color","One minus source color","Source alpha","One minus source alpha","Destination alpha","One minus destination alpha","Destination color","One minus destination color","Source alpha saturate"],type:"Attribute",if:{Blending:"Custom"}},{datatype:"Enum",defaultValue:"One minus source alpha",displayName:"Destination",name:"BlendDest",options:["Zero","One","Source color","One minus source color","Source alpha","One minus source alpha","Destination alpha","One minus destination alpha","Destination color","One minus destination color"],type:"Attribute",if:{Blending:"Custom"}},{datatype:"Enum",defaultValue:"Add",displayName:"Equation",name:"BlendEquation",options:["Add","Subtract","Reverse subtract","Min","Max"],type:"Attribute",if:{Blending:"Custom"}},{label:"Depth test",type:"Separator"},{datatype:"Boolean",defaultValue:!0,displayName:"Active",name:"DepthTest",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Write",if:{DepthTest:!0},name:"DepthWrite",type:"Attribute"},{datatype:"Enum",defaultValue:"Less/equal",displayName:"Mode",if:{DepthTest:!0},name:"DepthMode",options:["Never","Always","Less","Less/equal","Greater/equal","Greater","Not equal"],type:"Attribute"},{label:"Culling",type:"Separator"},{datatype:"Enum",defaultValue:"Back",displayName:"Mode",name:"Culling",options:["Front","Back","Off"],type:"Attribute"},{label:"Flat shading",type:"Separator",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Boolean",defaultValue:!1,displayName:"Active",name:"FlatShading",type:"Attribute",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{label:"Wireframe",type:"Separator",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Shader"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Boolean",defaultValue:!1,displayName:"Wireframe",name:"Wireframe",type:"Attribute",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Shader"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}}],name:"Material",updateRequiresThumbRefresh:!0,creatableEmpty:!0},{_id:{$oid:"5e6a1ad189707feef9173394"},contentTypes:["model/obj","model/gltf-binary","model/vnd.usdz+zip","model/draco","model/ply","model/fbx"],fieldSets:[],fields:[{linkableTypes:["Material"],type:"Link",usageAs:"Material"},{doesNotAffectThumbnail:!0,linkableTypes:["Mesh"],loadingManager:"ignore",preload:!1,type:"Link",usageAs:"USDZ"},{doesNotAffectThumbnail:!0,linkableTypes:["Mesh"],loadingManager:"ignore",preload:!1,type:"Link",usageAs:"GLB"},{datatype:"Vector3d",defaultValue:{x:0,y:0,z:0},name:"Pivot",type:"Attribute"},{datatype:"Transform",defaultValue:{position:{x:0,y:0,z:0},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},name:"DefaultTransform",displayName:"Default transform",type:"Attribute"}],name:"Mesh",updateRequiresThumbRefresh:!0,creatableEmpty:!1},{_id:{$oid:"5e6a1ad189707feef9173396"},contentTypes:[""],fields:[{label:"Camera & Composition",type:"Separator"},{datatype:"Enum",defaultValue:"Automatic user controllable camera",displayName:"Camera mode",info:"Camera to render during playback. The main camera is the one with the 'mainCamera' Tag or if only one camera exists, that is the one. Composer setting will render whatever the composition defines.",name:"CameraMode",options:["Automatic user controllable camera","Main camera","Composer"],type:"Attribute"},{linkableTypes:["Composition"],type:"Link",if:{CameraMode:"Composer"},usageAs:"Composition",mandatory:!0},{label:"Environment & Background",type:"Separator"},{datatype:"Enum",defaultValue:"None",displayName:"Background mode",name:"BackgroundMode",options:["None","Color","Image","Environment map","Shader"],type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Background blurriness",if:{BackgroundMode:"Environment map"},maxValue:1,minValue:0,name:"BackgroundBlurriness",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:1,displayName:"Background intensity",if:{$or:[{BackgroundMode:"Image"},{BackgroundMode:"Environment map"}]},maxValue:10,minValue:0,name:"BackgroundIntensity",type:"Attribute",widget:"Slider"},{displayName:"Background shader",if:{BackgroundMode:"Shader"},linkableTypes:["Background Shader"],type:"Link",usageAs:"BackgroundShader",mandatory:!0},{displayName:"Background image",if:{BackgroundMode:"Image"},linkableTypes:["Image"],type:"Link",usageAs:"Background",mandatory:!0},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},displayName:"Background color",if:{BackgroundMode:"Color"},name:"BackgroundColor",type:"Attribute"},{displayName:"Environment map",linkableTypes:["HDR Image"],type:"Link",usageAs:"Environment"},{datatype:"Float",defaultValue:1,displayName:"Environment intensity",maxValue:10,minValue:0,name:"EnvironmentIntensity",type:"Attribute",widget:"Slider"},{datatype:"Color",defaultValue:{a:255,b:0,g:0,r:0},displayName:"Clear color",name:"ClearColor",type:"Attribute"},{label:"Rendering",type:"Separator",collapsed:!1},{datatype:"Enum",defaultValue:"PCF Shadow Map",displayName:"Shadow type",name:"ShadowType",options:["Basic Shadow Map","PCF Shadow Map","VSM Shadow Map"],type:"Attribute"}],name:"Scene",updateRequiresThumbRefresh:!0,inherits:"Prefab",creatableEmpty:!0},{_id:{$oid:"5e6a1ad189707fcef4252336"},contentTypes:[""],fieldSets:[{fields:[{label:"3D Object",type:"Separator"},{datatype:"Boolean",defaultValue:!0,displayName:"Active",info:"Indicates if the 3D object is currently active or inactive. When set to true, the object is active.",name:"Active",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Static",info:"A Boolean attribute indicating whether the 3D object is static or not. Static objects can and will never be transformed during runtime.",name:"Static",type:"Attribute"},{datatype:"String",defaultValue:"",displayName:"Name",info:"Specifies the name of the 3D object. This is used for identification and reference in the scene.",name:"Name",type:"Attribute"},{datatype:"Transform",defaultValue:{position:{x:0,y:0,z:0},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},info:"Describes the object's transformation attributes including its position, rotation, and scale in the 3D space.",name:"Transform",type:"Attribute"},{type:"Label",text:"Changing scale in transforms for physics enabled objects is not recommended. Not all objects fully support it. Keep it at least uniform!",labelType:"warning",if:{"PhysicsEnabled?":!0,$or:[{"Transform.scale.x":{$not:1}},{"Transform.scale.y":{$not:1}},{"Transform.scale.z":{$not:1}}]}},{datatype:"Layers",defaultValue:[0],info:"Defines the layers that the 3D object is part of. Layers are used for managing object interactions and visibility in the scene.",name:"Layers",type:"Attribute"},{datatype:"Tags",defaultValue:[],info:"Lists tags associated with the 3D object. Tags are useful for categorizing and searching objects in the scene.",name:"Tags",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Receive shadow",info:"Determines whether the object can receive shadows from other objects. Set to true if the object should display shadows cast upon it.",name:"ReceiveShadow",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Cast shadow",info:"Controls whether the object casts shadows in the presence of light sources. Set to true to enable shadow casting from this object.",name:"CastShadow",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Rendered",info:"Indicates if the 3D object is being rendered.",name:"Rendered",type:"Attribute"}],name:"3dObjectDefault"},{fields:[{label:"3D Object",type:"Separator"},{datatype:"Boolean",defaultValue:!0,displayName:"Active",info:"A Boolean attribute indicating whether the 3D object is active or not. When set to true, the object is considered active in the scene.",name:"Active",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Static",info:"A Boolean attribute indicating whether the 3D object is static or not. Static objects can and will never be transformed during runtime.",name:"Static",type:"Attribute"},{datatype:"String",defaultValue:"",displayName:"Name",info:"A string attribute representing the name of the 3D object. It is used to identify and reference the object within the scene.",name:"Name",type:"Attribute"},{datatype:"Transform",defaultValue:{position:{x:0,y:0,z:0},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},info:"Specifies the transformation properties of the 3D object, including its position, rotation, and scale in the scene.",name:"Transform",type:"Attribute"},{datatype:"Layers",defaultValue:[0],info:"Determines the layers the 3D object belongs to. Layers are used to organize objects in the scene for various purposes like rendering and interaction.",name:"Layers",type:"Attribute"},{datatype:"Tags",defaultValue:[],info:"A list of tags associated with the 3D object. Tags are used for categorizing and identifying objects for scripting and scene management.",name:"Tags",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Rendered",info:"Indicates if the 3D object is being rendered.",name:"Rendered",type:"Attribute"}],name:"3dObjectNoShadows"},{fields:[{label:"Physics",type:"Separator"},{datatype:"Boolean",defaultValue:!1,displayName:"Physics enabled",info:"A Boolean attribute that determines whether physics properties are applied to the object. Disabling it turns off physics calculations.",name:"PhysicsEnabled",type:"Attribute"},{datatype:"Enum",defaultValue:"Rigid body",displayName:"Body type",if:{PhysicsEnabled:!0},name:"BodyType",options:["Rigid body","Soft body","Ghost object"],type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Separate subobjects",if:{BodyType:"Rigid body",PhysicsEnabled:!0},info:"When adding all subobjects of the mesh separately, they will all act individually. We lose however also the possibility to control and watch them as a single object. The configured mass will be distributed among all subobjects",name:"SeparateSubobjects",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Mass",if:{BodyType:{$not:"Ghost object"},PhysicsEnabled:!0},info:"Specifies the mass of the object as a float value. The mass must be a non-negative value.",minValue:0,name:"Mass",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Pressure",if:{BodyType:"Soft body",PhysicsEnabled:!0},info:"Specifies the pressure of the soft body as a float value. The pressure must be a non-negative value.",minValue:0,name:"Pressure",type:"Attribute"},{datatype:"Float",defaultValue:.01,displayName:"Damping",if:{BodyType:"Soft body",PhysicsEnabled:!0},info:"Specifies the damping of the soft body.",minValue:0,name:"Damping",type:"Attribute"},{datatype:"Float",defaultValue:.04,displayName:"Margin",if:{BodyType:{$not:"Ghost object"},PhysicsEnabled:!0},info:"Defines the margin of the object for physics calculations as a float value. The margin is a non-negative value.",minValue:0,name:"Margin",type:"Attribute"},{datatype:"Float",defaultValue:.1,displayName:"Restitution",if:{BodyType:{$not:"Ghost object"},PhysicsEnabled:!0},info:"Determines the restitution (bounciness) of the object. It's a float value affecting how the object bounces upon impact.",name:"Restitution",type:"Attribute"},{datatype:"Float",defaultValue:.1,displayName:"Friction",if:{BodyType:{$not:"Ghost object"},PhysicsEnabled:!0},info:"Sets the friction coefficient of the object. It's a float value, affecting how the object slides against other surfaces.",name:"Friction",type:"Attribute"},{datatype:"Float",defaultValue:.1,displayName:"Spinning friction",if:{BodyType:{$not:"Ghost object"},PhysicsEnabled:!0},info:"Defines the spinning friction of the object as a float value, affecting the object's rotational resistance.",name:"SpinningFriction",type:"Attribute"},{datatype:"Float",defaultValue:.1,displayName:"Rolling friction",if:{BodyType:{$not:"Ghost object"},PhysicsEnabled:!0},info:"Specifies the rolling friction of the object. It's a float value that influences how the object rolls over surfaces.",name:"RollingFriction",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Linear damping",if:{BodyType:"Rigid body",PhysicsEnabled:!0},info:"Sets the linear damping.",name:"LinearDamping",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Angular damping",if:{BodyType:"Rigid body",PhysicsEnabled:!0},info:"Sets the angular damping.",name:"AngularDamping",type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:1,y:1,z:1},displayName:"Linear factor",if:{BodyType:"Rigid body",PhysicsEnabled:!0},info:"A Vector3d value that defines the linear factor of the object in terms of x, y, and z axes, controlling how the object moves linearly.",name:"LinearFactor",type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:0,y:0,z:0},displayName:"Linear velocity",if:{BodyType:"Rigid body",PhysicsEnabled:!0},info:"Defines the object's linear velocity using a Vector3d value, representing the velocity along the x, y, and z axes.",name:"LinearVelocity",type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:1,y:1,z:1},displayName:"Angular factor",if:{BodyType:"Rigid body",PhysicsEnabled:!0},info:"A Vector3d attribute that specifies the angular factor of the object, influencing the object's rotation around each axis.",name:"AngularFactor",type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:0,y:0,z:0},displayName:"Angular velocity",if:{BodyType:"Rigid body",PhysicsEnabled:!0},info:"Sets the angular velocity of the object using a Vector3d value, affecting the object's rotational speed.",name:"AngularVelocity",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Is kinematic",if:{BodyType:"Rigid body",PhysicsEnabled:!0,SeparateSubobjects:!1},info:"A Boolean attribute that makes the object kinematic when true, meaning it will not be affected by physics but can still affect other objects.",name:"IsKinematic",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Disable deactivation",if:{BodyType:{$not:"Ghost object"},PhysicsEnabled:!0,$or:[{IsKinematic:!1},{BodyType:"Soft body"}]},info:"When set to true, object will be simulated in physics forever. Otherwise it will be deactivated when not moving anymore",name:"DisableDeactivation",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Watch collisions",if:{BodyType:{$not:"Ghost object"},PhysicsEnabled:!0,SeparateSubobjects:!1},info:"When set to true, enables monitoring of collisions involving the object.",name:"WatchCollisions",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Report contact points",if:{BodyType:{$not:"Ghost object"},PhysicsEnabled:!0,SeparateSubobjects:!1},info:"If set to true, collision events will contain the exact contact points. Only enable if you really need it as it costs performance.",name:"ReportContactPoints",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Filter potential collisions",if:{BodyType:{$not:"Ghost object"},PhysicsEnabled:!0,SeparateSubobjects:!1},info:"The physics engine might report collisions without contact points in cases where objects get close. Filter these out by setting this.",name:"FilterPotentialCollisions",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Watch linear velocity",if:{BodyType:{$not:"Ghost object"},PhysicsEnabled:!0,SeparateSubobjects:!1},info:"Enables the tracking of changes in the object's linear velocity when set to true.",name:"WatchLinearVelocity",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Watch angular velocity",if:{BodyType:{$not:"Ghost object"},PhysicsEnabled:!0,SeparateSubobjects:!1},info:"Allows for the monitoring of changes in the object's angular velocity when enabled.",name:"WatchAngularVelocity",type:"Attribute"},{if:{BodyType:{$not:"Soft body"},PhysicsEnabled:!0},label:"Collider",type:"Separator"},{datatype:"Enum",defaultValue:"Self",displayName:"Collider type",if:{BodyType:{$not:"Soft body"},PhysicsEnabled:!0},name:"ColliderType",options:["Self","Bounding Box","Bounding Sphere","Bounding Cylinder","Capsule","Convex Hull","Custom Mesh"],type:"Attribute"},{datatype:"Enum",defaultValue:"Derive from mesh",displayName:"Capsule size",if:{BodyType:{$not:"Soft body"},ColliderType:"Capsule",PhysicsEnabled:!0},name:"CapsuleSize",options:["Derive from mesh","Manual"],type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Capsule height",if:{BodyType:{$not:"Soft body"},ColliderType:"Capsule",CapsuleSize:"Manual",PhysicsEnabled:!0},name:"CapsuleHeight",minValue:0,type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Capsule radius",if:{BodyType:{$not:"Soft body"},ColliderType:"Capsule",CapsuleSize:"Manual",PhysicsEnabled:!0},name:"CapsuleRadius",minValue:0,type:"Attribute"},{displayName:"Collider mesh",if:{BodyType:{$not:"Soft body"},ColliderType:"Custom Mesh",PhysicsEnabled:!0},linkableTypes:["Mesh","Mesh Collection"],type:"Link",usageAs:"ColliderMesh",mandatory:!0},{datatype:"Enum",defaultValue:"",displayName:"Collection entry",if:{BodyType:{$not:"Soft body"},ColliderType:"Custom Mesh",PhysicsEnabled:!0,$optionsexist:!0},name:"ColliderMeshCollectionEntry",options:[],type:"Attribute"}],name:"Physics"},{fields:[{datatype:"Enum",defaultValue:"Single",displayName:"Source type",name:"SourceType",options:["Single","Collection"],type:"Attribute"},{displayName:"Audio item",if:{SourceType:"Single"},linkableTypes:["Audio"],type:"Link",usageAs:"AudioItem"},{displayName:"Audio collection",if:{SourceType:"Collection"},linkableTypes:["Audio Collection"],type:"Link",usageAs:"AudioCollectionItem"},{datatype:"Enum",defaultValue:"",displayName:"Collection entry",if:{SourceType:"Collection"},name:"AudioCollectionEntry",options:[],type:"Attribute"}],name:"AudioLink"},{fields:[{displayName:"Mesh item",linkableTypes:["Mesh","Mesh Collection"],type:"Link",usageAs:"Mesh",mandatory:!0},{datatype:"Enum",defaultValue:"",displayName:"Collection entry",if:{$optionsexist:!0},name:"MeshCollectionEntry",options:[],type:"Attribute"}],name:"MeshLink"}],fields:[{childTypes:[{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Mesh specific fields",type:"Separator"},{name:"MeshLink",type:"FieldSet"},{datatype:"Enum",defaultValue:"Pivot",name:"OriginMode",displayName:"Origin mode",if:{$or:[{MeshCollectionEntry:{$isset:!0}},{Mesh:{$isset:!0}}]},options:["Pivot","Center","Custom"],type:"Attribute"},{name:"CustomPivot",displayName:"Custom Pivot",type:"Attribute",datatype:"Vector3d",if:{OriginMode:"Custom"},defaultValue:{x:0,y:0,z:0}},{datatype:"Animations",defaultValue:[],displayName:"Animations",if:{$or:[{MeshCollectionEntry:{$isset:!0}},{Mesh:{$isset:!0}}]},name:"Animations",type:"Attribute"},{name:"Physics",type:"FieldSet"}],mainItemField:"Mesh",typeName:"Mesh"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"ScriptedMesh specific fields",type:"Separator"},{displayName:"Material(s)",linkableTypes:["Material","Material Collection"],type:"Link",usageAs:"Materials"},{datatype:"Boolean",defaultValue:!1,displayName:"Indexed",info:"Indicates if the geometry buffer is indexed.",name:"Indexed",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Have positions",info:"Add a position attribute to the mesh.",name:"HavePositions",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Have normals",info:"Add a normal attribute to the mesh.",name:"HaveNormals",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Have colors",info:"Add a color attribute to the mesh.",name:"HaveColors",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Have UV Coords",info:"Add a UV texture coordinate attribute to the mesh.",name:"HaveUVs",type:"Attribute"},{name:"Physics",type:"FieldSet"}],typeName:"ScriptedMesh"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Splats specific fields",type:"Separator"},{linkableTypes:["Gaussian Splats"],type:"Link",usageAs:"Splats",mandatory:!0}],mainItemField:"Splats",typeName:"GaussianSplats"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Prefab specific fields",type:"Separator"},{linkableTypes:["Scene","Prefab"],type:"Link",usageAs:"Prefab",mandatory:!0}],mainItemField:"Prefab",typeName:"Prefab"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Points specific fields",type:"Separator"},{name:"MeshLink",type:"FieldSet"}],mainItemField:"Mesh",typeName:"Points"},{fields:[{name:"3dObjectNoShadows",type:"FieldSet"},{label:"Lightsource specific fields",type:"Separator"},{datatype:"Enum",defaultValue:"Point",name:"Type",options:["Point","Directional","Ambient","Hemisphere","Spot"],type:"Attribute"},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},name:"Color",type:"Attribute"},{datatype:"Color",defaultValue:{a:255,b:64,g:64,r:64},displayName:"Ground color (Hemisphere)",if:{Type:"Hemisphere"},name:"GroundColor",type:"Attribute"},{datatype:"Float",defaultValue:10,minValue:0,name:"Intensity",type:"Attribute"},{datatype:"Float",defaultValue:100,if:{$or:[{Type:"Spot"},{Type:"Point"}]},minValue:0,name:"Distance",type:"Attribute"},{datatype:"Float",defaultValue:2,if:{$or:[{Type:"Spot"},{Type:"Point"}]},minValue:1,name:"Decay",type:"Attribute"},{datatype:"Float",defaultValue:.5,displayName:"Angle",if:{Type:"Spot"},maxValue:1.57,minValue:0,name:"Angle",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Penumbra",if:{Type:"Spot"},maxValue:1,minValue:0,name:"Penumbra",type:"Attribute"},{datatype:"Node",defaultValue:null,displayName:"Target",if:{$or:[{Type:"Spot"},{Type:"Directional"}]},name:"Target",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Cast shadows",name:"CastShadows",type:"Attribute",if:{$or:[{Type:"Point"},{Type:"Directional"},{Type:"Spot"}]}},{datatype:"Float",defaultValue:0,displayName:"Shadow bias",if:{CastShadows:!0,$or:[{Type:"Point"},{Type:"Directional"},{Type:"Spot"}]},maxValue:1,minValue:-1,name:"ShadowBias",type:"Attribute",widget:"Slider"},{datatype:"Enum",defaultValue:512,displayName:"Shadow size",if:{CastShadows:!0,$or:[{Type:"Point"},{Type:"Directional"},{Type:"Spot"}]},name:"ShadowSize",options:[128,256,512,1024,2048],type:"Attribute"},{datatype:"Float",defaultValue:.5,displayName:"Shadow camera near",if:{CastShadows:!0,$or:[{Type:"Point"},{Type:"Directional"},{Type:"Spot"}]},minValue:0,name:"ShadowCameraNear",type:"Attribute"},{datatype:"Float",defaultValue:500,displayName:"Shadow camera far",if:{CastShadows:!0,$or:[{Type:"Point"},{Type:"Directional"},{Type:"Spot"}]},minValue:0,name:"ShadowCameraFar",type:"Attribute"},{datatype:"Float",defaultValue:10,displayName:"Shadow area width",if:{CastShadows:!0,Type:"Directional"},minValue:1,name:"ShadowAreaWidth",type:"Attribute"},{datatype:"Float",defaultValue:10,displayName:"Shadow area height",if:{CastShadows:!0,Type:"Directional"},minValue:1,name:"ShadowAreaHeight",type:"Attribute"},{datatype:"Float",defaultValue:4,displayName:"Shadow radius",minValue:0,name:"ShadowRadius",type:"Attribute",if:{CastShadows:!0,$or:[{Type:"Point"},{Type:"Directional"},{Type:"Spot"}]}},{datatype:"Integer",defaultValue:8,displayName:"VSM blur samples",maxValue:32,minValue:1,name:"VsmBlurSamples",type:"Attribute",if:{CastShadows:!0,$or:[{Type:"Point"},{Type:"Directional"},{Type:"Spot"}]}}],typeName:"Lightsource"},{fields:[{label:"3D Object Fields",type:"Separator"},{datatype:"Boolean",defaultValue:!0,displayName:"Active",info:"Indicates if the 3D object is currently active or inactive. When set to true, the object is active.",name:"Active",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Static",info:"A Boolean attribute indicating whether the 3D object is static or not. Static objects can and will never be transformed during runtime.",name:"Static",type:"Attribute"},{datatype:"String",defaultValue:"",displayName:"Name",info:"Specifies the name of the 3D object. This is used for identification and reference in the scene.",name:"Name",type:"Attribute"},{datatype:"Transform",defaultValue:{position:{x:0,y:0,z:0},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},info:"Describes the object's transformation attributes including its position, rotation, and scale in the 3D space.",name:"Transform",type:"Attribute"},{datatype:"Layers",defaultValue:[],name:"Cullmode",info:"Defines the layers that are not visible to the camera.",displayName:"Cull mode",type:"Attribute"},{datatype:"Tags",defaultValue:[],info:"Lists tags associated with the 3D object. Tags are useful for categorizing and searching objects in the scene.",name:"Tags",type:"Attribute"},{label:"Camera specific fields",type:"Separator"},{datatype:"Enum",defaultValue:"Perspective",name:"Type",options:["Perspective","Orthographic"],type:"Attribute"},{datatype:"Float",defaultValue:60,displayName:"Field of view",if:{Type:"Perspective"},maxValue:360,minValue:1,name:"FieldOfView",type:"Attribute"},{datatype:"Float",defaultValue:-1,displayName:"Left",if:{Type:"Orthographic"},name:"Left",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Right",if:{Type:"Orthographic"},name:"Right",type:"Attribute"},{datatype:"Float",defaultValue:-1,displayName:"Top",if:{Type:"Orthographic"},name:"Top",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Bottom",if:{Type:"Orthographic"},name:"Bottom",type:"Attribute"},{datatype:"Float",defaultValue:.1,displayName:"Near plane",minValue:0,name:"NearPlane",type:"Attribute"},{datatype:"Float",defaultValue:1e3,displayName:"Far plane",minValue:0,name:"FarPlane",type:"Attribute"},{datatype:"Enum",defaultValue:"Free",name:"Mode",options:["Free","Look at"],type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:0,y:0,z:0},if:{Mode:"Look at"},name:"LookAt",type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:0,y:1,z:0},displayName:"Up vector",if:{Mode:"Look at"},name:"UpVector",type:"Attribute"}],typeName:"Camera"},{fields:[{name:"3dObjectNoShadows",type:"FieldSet"}],typeName:"Group"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Box specific fields",type:"Separator"},{linkableTypes:["Material"],type:"Link",usageAs:"Material"},{datatype:"Vector3d",defaultValue:{x:1,y:1,z:1},name:"Size",type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:1,y:1,z:1},name:"Segments",type:"Attribute"},{datatype:"Vector2d",defaultValue:{x:1,y:1},displayName:"UV Scale",name:"UVScale",type:"Attribute"},{name:"Physics",type:"FieldSet"}],typeName:"Box"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"GridMap specific fields",type:"Separator"},{linkableTypes:["GridMap"],type:"Link",usageAs:"GridMap"},{name:"Physics",type:"FieldSet"}],typeName:"GridMap"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Ribbon specific fields",type:"Separator"},{linkableTypes:["Material"],type:"Link",usageAs:"Material"},{datatype:"Integer",defaultValue:16,displayName:"Ring vertex count",minValue:3,maxValue:256,name:"RingVertexCount",type:"Attribute"},{datatype:"Integer",defaultValue:16,displayName:"Path steps",minValue:2,name:"PathStepCount",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Start time",minValue:0,name:"StartTime",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"End time",minValue:0,name:"EndTime",type:"Attribute"},{datatype:"Vector2d",defaultValue:{x:1,y:1},displayName:"UV Scale",name:"UVScale",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Closed",name:"Closed",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Add caps",name:"AddCaps",if:{Closed:!1},type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Vertex colors",name:"VertexColors",type:"Attribute"},{label:"Ring formulas",type:"Separator",presets:[{name:"Circle",fields:{RingFormulaX:"cos(theta) * 0.5",RingFormulaY:"0",RingFormulaZ:"sin(theta) * 0.5"}}]},{datatype:"Formula",defaultValue:"cos(theta) * 0.5",displayName:"X",name:"RingFormulaX",type:"Attribute"},{datatype:"Formula",defaultValue:"0",displayName:"Y",name:"RingFormulaY",type:"Attribute"},{datatype:"Formula",defaultValue:"sin(theta) * 0.5",displayName:"Z",name:"RingFormulaZ",type:"Attribute"},{label:"Path formulas",type:"Separator"},{datatype:"Formula",defaultValue:"0",displayName:"X",name:"PathFormulaX",type:"Attribute"},{datatype:"Formula",defaultValue:"sin(t)",displayName:"Y",name:"PathFormulaY",type:"Attribute"},{datatype:"Formula",defaultValue:"t",displayName:"Z",name:"PathFormulaZ",type:"Attribute"},{label:"Color formulas",type:"Separator",if:{VertexColors:!0}},{datatype:"Formula",defaultValue:"abs(sin(t))",displayName:"R",name:"ColorFormulaR",type:"Attribute",if:{VertexColors:!0}},{datatype:"Formula",defaultValue:"0",displayName:"G",name:"ColorFormulaG",type:"Attribute",if:{VertexColors:!0}},{datatype:"Formula",defaultValue:"abs(cos(t))",displayName:"B",name:"ColorFormulaB",type:"Attribute",if:{VertexColors:!0}},{label:"Other formulas",type:"Separator"},{datatype:"Formula",defaultValue:"1 + 0.3 * sin(t * 2)",displayName:"Scale",name:"ScaleFormula",type:"Attribute"},{datatype:"Formula",defaultValue:"t * PI * 2",displayName:"Twist",name:"TwistFormula",type:"Attribute"},{name:"Physics",type:"FieldSet"}],typeName:"Ribbon"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Billboard Specific Fields",type:"Separator"},{linkableTypes:["Material"],type:"Link",usageAs:"Material",mandatory:!0},{datatype:"Text",defaultValue:"Text",displayName:"Text",name:"Text",type:"Attribute"},{datatype:"Enum",defaultValue:"center",displayName:"Text Alignment",info:"The alignment of the text",name:"TextAlign",options:["left","center","right"],type:"Attribute"},{linkableTypes:["Font"],type:"Link",usageAs:"Font"},{datatype:"Boolean",defaultValue:!0,displayName:"Size Attenuation",info:"Scales the Billboard with respect to distance to the camera.",name:"SizeAttenuation",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Size",minValue:0,name:"Size",type:"Attribute"},{datatype:"Float",defaultValue:2,displayName:"Text Stroke Width",info:"The width of the border of the text.",maxValue:100,minValue:0,name:"TextStrokeWidth",type:"Attribute"},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},displayName:"Text Stroke Color",info:"The color of the border of the text.",name:"TextStrokeColor",type:"Attribute"},{datatype:"Color",defaultValue:{a:255,b:0,g:0,r:0},displayName:"Text color",info:"The infill color of the text.",name:"TextColor",type:"Attribute"},{datatype:"Vector2d",defaultValue:{x:5,y:5},displayName:"Padding",info:"Two values controlling the vertical and horizontal padding size. Higher values increase the size of the padding.",name:"Padding",type:"Attribute"},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},displayName:"Padding color",info:"The background color of the padding section.",name:"BackgroundColor",type:"Attribute"},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},displayName:"Padding Line Color",info:"The color of the border delimited by the padding.",name:"BackgroundStrokeColor",type:"Attribute"},{datatype:"Integer",defaultValue:1,displayName:"Padding Line Width",info:"The width of the border of the padding section.",minValue:0,name:"BackgroundStrokeWidth",type:"Attribute"},{datatype:"Vector2d",defaultValue:{x:2,y:2},displayName:"Border",info:"Two values controlling the vertical and horizontal border size. Higher values increase the size of the border.",name:"BorderWidth",type:"Attribute"},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},displayName:"Border Color",info:"The background color of the border section.",name:"BorderBackgroundColor",type:"Attribute"},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},displayName:"Border Line Color",info:"The color of the outer border of the sprite.",name:"BorderStrokeColor",type:"Attribute"},{datatype:"Integer",defaultValue:1,displayName:"Border Line Width",info:"The width of the outer border.",minValue:0,name:"BorderStrokeWidth",type:"Attribute"},{datatype:"Integer",defaultValue:2,displayName:"Outer Radius",info:"The outer radius of the sprite. Higher values increase the roundness.",minValue:0,name:"OuterRadius",type:"Attribute"},{datatype:"Integer",defaultValue:2,displayName:"Inner Radius",info:"The inner radius of the sprite. Higher values increase the roundness.",minValue:0,name:"InnerRadius",type:"Attribute"},{datatype:"Vector2d",defaultValue:{x:1,y:1},displayName:"UV Scale",name:"UVScale",type:"Attribute"}],typeName:"Billboard"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Cone specific fields",type:"Separator"},{linkableTypes:["Material"],type:"Link",usageAs:"Material"},{datatype:"Float",defaultValue:1,displayName:"Radius",minValue:0,name:"Radius",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Height",minValue:0,name:"Height",type:"Attribute"},{datatype:"Integer",defaultValue:8,displayName:"Radial segments",minValue:1,name:"RadialSegments",type:"Attribute"},{datatype:"Integer",defaultValue:1,displayName:"Height segments",minValue:1,name:"HeightSegments",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Open ended",name:"OpenEnded",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Theta start",maxValue:360,minValue:0,name:"ThetaStart",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:360,displayName:"Theta length",maxValue:360,minValue:0,name:"ThetaLength",type:"Attribute",widget:"Slider"},{datatype:"Vector2d",defaultValue:{x:1,y:1},displayName:"UV Scale",name:"UVScale",type:"Attribute"},{name:"Physics",type:"FieldSet"}],typeName:"Cone"},{fields:[{name:"3dObjectNoShadows",type:"FieldSet"},{label:"Lod specific fields",type:"Separator"},{datatype:"String",defaultValue:"0,2,4,6,8,10",displayName:"Distances",name:"Distances",type:"Attribute"}],typeName:"Lod"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Cylinder specific fields",type:"Separator"},{linkableTypes:["Material"],type:"Link",usageAs:"Material"},{datatype:"Float",defaultValue:1,displayName:"Radius top",minValue:0,name:"RadiusTop",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Radius bottom",minValue:0,name:"RadiusBottom",type:"Attribute"},{datatype:"Integer",defaultValue:8,displayName:"Radial segments",minValue:1,name:"RadialSegments",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Height",minValue:0,name:"Height",type:"Attribute"},{datatype:"Integer",defaultValue:1,displayName:"Height segments",minValue:1,name:"HeightSegments",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Open ended",name:"OpenEnded",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Theta start",maxValue:360,minValue:0,name:"ThetaStart",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:360,displayName:"Theta length",maxValue:360,minValue:0,name:"ThetaLength",type:"Attribute",widget:"Slider"},{datatype:"Vector2d",defaultValue:{x:1,y:1},displayName:"UV Scale",name:"UVScale",type:"Attribute"},{name:"Physics",type:"FieldSet"}],typeName:"Cylinder"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Plane specific fields",type:"Separator"},{linkableTypes:["Material"],type:"Link",usageAs:"Material"},{datatype:"Float",defaultValue:1,displayName:"Width",minValue:0,name:"Width",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Height",minValue:0,name:"Height",type:"Attribute"},{datatype:"Integer",defaultValue:1,displayName:"Width segments",minValue:1,name:"WidthSegments",type:"Attribute"},{datatype:"Integer",defaultValue:1,displayName:"Height segments",minValue:1,name:"HeightSegments",type:"Attribute"},{datatype:"Vector2d",defaultValue:{x:1,y:1},displayName:"UV Scale",name:"UVScale",type:"Attribute"},{name:"Physics",type:"FieldSet"}],typeName:"Plane"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Ring specific fields",type:"Separator"},{linkableTypes:["Material"],type:"Link",usageAs:"Material"},{datatype:"Float",defaultValue:.5,displayName:"Inner radius",minValue:0,name:"InnerRadius",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Outer radius",minValue:0,name:"OuterRadius",type:"Attribute"},{datatype:"Integer",defaultValue:8,displayName:"Theta segments",minValue:3,name:"ThetaSegments",type:"Attribute"},{datatype:"Integer",defaultValue:1,displayName:"Phi segments",minValue:1,name:"PhiSegments",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Theta start",maxValue:360,minValue:0,name:"ThetaStart",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:360,displayName:"Theta length",maxValue:360,minValue:0,name:"ThetaLength",type:"Attribute",widget:"Slider"},{datatype:"Vector2d",defaultValue:{x:1,y:1},displayName:"UV Scale",name:"UVScale",type:"Attribute"},{name:"Physics",type:"FieldSet"}],typeName:"Ring"},{fields:[{name:"3dObjectNoShadows",type:"FieldSet"},{label:"Particles Editor Fields",type:"Separator"},{datatype:"Boolean",defaultValue:!1,displayName:"Preview",info:"Previews the particle system by playing it in the editor.",name:"RunPreview",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Show Emitter Preview",info:"Shows a preview of the particle system's emitter.",name:"ShowHelper",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Pause",info:"Pauses the particle system.",name:"Pause",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Kill All Particles",info:"Kills all the alive particles in the system.",name:"KillAllParticles",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Restart",info:"Hard restart of the particle system. It kills all particles, clean all data and reset the simulation time.",name:"Restart",type:"Attribute"},{displayName:"Particle System",label:"Particle System Configuration File",linkableTypes:["Particles"],type:"Link",usageAs:"ParticleData",mandatory:!0}],typeName:"ParticleSystem"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"CircleShadow specific fields",type:"Separator"},{datatype:"Float",defaultValue:1,displayName:"Size",minValue:0,name:"Size",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Strength",maxValue:1,minValue:0,name:"Strength",type:"Attribute",widget:"Slider"}],typeName:"CircleShadow"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Sphere specific fields",type:"Separator"},{linkableTypes:["Material"],type:"Link",usageAs:"Material"},{datatype:"Float",defaultValue:1,displayName:"Radius",minValue:0,name:"Radius",type:"Attribute"},{datatype:"Integer",defaultValue:8,displayName:"Width segments",minValue:3,name:"WidthSegments",type:"Attribute"},{datatype:"Integer",defaultValue:6,displayName:"Height segments",minValue:2,name:"HeightSegments",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Phi start",maxValue:360,minValue:0,name:"PhiStart",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:360,displayName:"Phi length",maxValue:360,minValue:0,name:"PhiLength",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:0,displayName:"Theta start",maxValue:360,minValue:0,name:"ThetaStart",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:180,displayName:"Theta length",maxValue:180,minValue:0,name:"ThetaLength",type:"Attribute",widget:"Slider"},{datatype:"Vector2d",defaultValue:{x:1,y:1},displayName:"UV Scale",name:"UVScale",type:"Attribute"},{name:"Physics",type:"FieldSet"}],typeName:"Sphere"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Text specific fields",type:"Separator"},{linkableTypes:["Material"],type:"Link",usageAs:"Material"},{datatype:"String",defaultValue:"Text",name:"Text",type:"Attribute"},{datatype:"Enum",defaultValue:"center",displayName:"Horizontal Alignment",info:"Horizontal text positioning",name:"HorizontalAlign",options:["left","center","right"],type:"Attribute"},{datatype:"Enum",defaultValue:"baseline",displayName:"Vertical Alignment",info:"Vertical text positioning",name:"VerticalAlign",options:["baseline","top","middle","bottom"],type:"Attribute"},{linkableTypes:["Font"],type:"Link",usageAs:"Font"},{datatype:"Float",defaultValue:1,name:"Size",type:"Attribute"},{datatype:"Float",defaultValue:1,name:"Height",type:"Attribute"},{datatype:"Integer",defaultValue:12,displayName:"Curve segments",name:"CurveSegments",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Bevel enabled",name:"BevelEnabled",type:"Attribute"},{datatype:"Float",defaultValue:.1,displayName:"Bevel thickness",name:"BevelThickness",type:"Attribute"},{datatype:"Float",defaultValue:.03,displayName:"Bevel size",name:"BevelSize",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Bevel offset",name:"BevelOffset",type:"Attribute"},{datatype:"Integer",defaultValue:3,displayName:"Bevel segments",name:"BevelSegments",type:"Attribute"},{datatype:"Vector2d",defaultValue:{x:1,y:1},displayName:"UV Scale",name:"UVScale",type:"Attribute"},{name:"Physics",type:"FieldSet"}],typeName:"Text"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Torus specific fields",type:"Separator"},{linkableTypes:["Material"],type:"Link",usageAs:"Material"},{datatype:"Float",defaultValue:1,displayName:"Radius",minValue:0,name:"Radius",type:"Attribute"},{datatype:"Float",defaultValue:.4,displayName:"Tube",minValue:0,name:"Tube",type:"Attribute"},{datatype:"Integer",defaultValue:8,displayName:"Radial segments",minValue:3,name:"RadialSegments",type:"Attribute"},{datatype:"Integer",defaultValue:16,displayName:"Tubular segments",minValue:2,name:"TubularSegments",type:"Attribute"},{datatype:"Float",defaultValue:360,displayName:"Arc",maxValue:360,minValue:0,name:"Arc",type:"Attribute",widget:"Slider"},{datatype:"Vector2d",defaultValue:{x:1,y:1},displayName:"UV Scale",name:"UVScale",type:"Attribute"},{name:"Physics",type:"FieldSet"}],typeName:"Torus"},{fields:[{label:"3D Object Fields",type:"Separator"},{datatype:"Boolean",defaultValue:!0,displayName:"Active",name:"Active",type:"Attribute"},{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Layers",defaultValue:[0],name:"Layers",type:"Attribute"},{datatype:"Tags",defaultValue:[],name:"Tags",type:"Attribute"},{label:"Sky specific fields",type:"Separator"},{datatype:"Float",defaultValue:1e3,name:"Size",type:"Attribute"},{datatype:"Float",defaultValue:10,displayName:"Turbidity",maxValue:20,minValue:1,name:"Turbidity",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:2,displayName:"Rayleigh",maxValue:4,minValue:0,name:"Rayleigh",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:.005,displayName:"Mie coefficient",maxValue:1,minValue:0,name:"MieCoefficient",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:.8,displayName:"Mie directional G",maxValue:1,minValue:0,name:"MieDirectionalG",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:.49,displayName:"Inclination",maxValue:1,minValue:0,name:"Inclination",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:.25,displayName:"Azimuth",maxValue:1,minValue:0,name:"Azimuth",type:"Attribute",widget:"Slider"}],typeName:"Sky"},{fields:[{label:"3D Object Fields",type:"Separator"},{datatype:"Boolean",defaultValue:!0,displayName:"Active",name:"Active",type:"Attribute"},{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Transform",defaultValue:{position:{x:0,y:0,z:0},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},name:"Transform",type:"Attribute"},{datatype:"Tags",defaultValue:[],name:"Tags",type:"Attribute"},{label:"Audio listener specific fields",type:"Separator"},{datatype:"Float",defaultValue:1,name:"Gain",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Time delta",name:"TimeDelta",type:"Attribute"}],maxInstances:1,typeName:"AudioListener"},{fields:[{label:"3D Object Fields",type:"Separator"},{datatype:"Boolean",defaultValue:!0,displayName:"Active",name:"Active",type:"Attribute"},{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Transform",defaultValue:{position:{x:0,y:0,z:0},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},name:"Transform",type:"Attribute"},{datatype:"Tags",defaultValue:[],name:"Tags",type:"Attribute"},{label:"Positional audio specific fields",type:"Separator"},{name:"AudioLink",type:"FieldSet"},{datatype:"Boolean",defaultValue:!1,displayName:"Autoplay",name:"Autoplay",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Loop",name:"Loop",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Loop section",name:"LoopSection",type:"Attribute",if:{Loop:!0}},{datatype:"Float",defaultValue:0,displayName:"Loop start",minValue:0,name:"LoopStart",type:"Attribute",widget:"Slider",if:{Loop:!0,LoopSection:!0}},{datatype:"Float",displayName:"Loop end",defaultValue:1,minValue:0,name:"LoopEnd",type:"Attribute",widget:"Slider",if:{Loop:!0,LoopSection:!0}},{datatype:"Float",defaultValue:1,displayName:"Volume",minValue:0,name:"Volume",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Panning",maxValue:1,minValue:-1,name:"Panning",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:0,displayName:"Duration",minValue:0,name:"Duration",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Detune",name:"Detune",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Playback rate",minValue:0,name:"PlaybackRate",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Offset",maxValue:1,minValue:0,name:"Offset",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Ref distance",minValue:0,name:"RefDistance",type:"Attribute"},{datatype:"Float",defaultValue:1e4,displayName:"Max distance",minValue:0,name:"MaxDistance",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Rolloff factor",minValue:0,name:"RolloffFactor",type:"Attribute"},{datatype:"Enum",defaultValue:"Inverse",displayName:"Distance model",name:"DistanceModel",options:["Linear","Inverse","Exponential"],type:"Attribute"},{datatype:"Enum",defaultValue:"Omnidirectional",displayName:"Direction",name:"Direction",options:["Omnidirectional","Directional"],type:"Attribute"},{datatype:"Float",defaultValue:90,displayName:"Cone inner angle",if:{Direction:"Directional"},maxValue:360,minValue:0,name:"ConeInnerAngle",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:180,displayName:"Cone outer angle",if:{Direction:"Directional"},maxValue:360,minValue:0,name:"ConeOuterAngle",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:.2,displayName:"Cone outer gain",if:{Direction:"Directional"},maxValue:1,minValue:0,name:"ConeOuterGain",type:"Attribute",widget:"Slider"}],typeName:"PositionalAudio"},{fields:[{label:"3D Object Fields",type:"Separator"},{datatype:"Boolean",defaultValue:!0,displayName:"Active",name:"Active",type:"Attribute"},{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Tags",defaultValue:[],name:"Tags",type:"Attribute"},{label:"Audio specific fields",type:"Separator"},{name:"AudioLink",type:"FieldSet"},{datatype:"Boolean",defaultValue:!1,displayName:"Autoplay",name:"Autoplay",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Loop",name:"Loop",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Loop section",name:"LoopSection",type:"Attribute",if:{Loop:!0}},{datatype:"Float",defaultValue:0,displayName:"Loop start",minValue:0,name:"LoopStart",type:"Attribute",widget:"Slider",if:{Loop:!0,LoopSection:!0}},{datatype:"Float",displayName:"Loop end",defaultValue:1,minValue:0,name:"LoopEnd",type:"Attribute",widget:"Slider",if:{Loop:!0,LoopSection:!0}},{datatype:"Float",defaultValue:1,displayName:"Volume",minValue:0,name:"Volume",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Panning",maxValue:1,minValue:-1,name:"Panning",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:0,displayName:"Duration",minValue:0,name:"Duration",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Detune",name:"Detune",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Playback rate",minValue:0,name:"PlaybackRate",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Offset",maxValue:1,minValue:0,name:"Offset",type:"Attribute"}],typeName:"Audio"},{fields:[{name:"3dObjectNoShadows",type:"FieldSet"},{label:"Vehicle specific fields",type:"Separator"},{datatype:"Node",defaultValue:null,displayName:"Chassis node",name:"ChassisNode",type:"Attribute"},{elementName:"Wheel",fields:[{datatype:"Node",defaultValue:null,displayName:"Wheel node",name:"WheelNode",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Is Front",name:"IsFront",type:"Attribute"},{label:"Wheel config",type:"Separator",collapsed:!0},{datatype:"Float",defaultValue:.6,displayName:"Suspension rest length",name:"SuspensionRestLength",type:"Attribute"},{datatype:"Float",defaultValue:20,displayName:"Suspension stiffness",name:"SuspensionStiffness",type:"Attribute"},{datatype:"Float",defaultValue:2.3,displayName:"Suspension damping",name:"SuspensionDamping",type:"Attribute"},{datatype:"Float",defaultValue:4.4,displayName:"Suspension compression",name:"SuspensionCompression",type:"Attribute"},{datatype:"Float",defaultValue:1e3,displayName:"Friction",name:"Friction",type:"Attribute"},{datatype:"Float",defaultValue:.2,displayName:"Roll influence",name:"RollInfluence",type:"Attribute"},{datatype:"Float",defaultValue:.1,displayName:"Radius",name:"Radius",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Acceleration",name:"Acceleration",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Brakes",name:"Brakes",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Steering",name:"Steering",type:"Attribute"}],name:"Wheels",type:"List"}],typeName:"Vehicle"},{fields:[{name:"3dObjectNoShadows",type:"FieldSet"},{label:"Constraint specific fields",type:"Separator"},{datatype:"Enum",defaultValue:"",displayName:"Type",name:"Type",options:["Point to Point","Hinge","Slider","Cone twist"],type:"Attribute"},{datatype:"Node",defaultValue:null,displayName:"First node",name:"FirstNode",type:"Attribute"},{datatype:"Node",defaultValue:null,displayName:"Second node",name:"SecondNode",type:"Attribute"}],typeName:"Constraint"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"NavMesh specific fields",type:"Separator"},{datatype:"Enum",defaultValue:"Solo",displayName:"Type",name:"Type",options:["Solo","Tiled","Tile cache"],info:"For simple static scenes, use solo. For large maps use tiled, for large and/or dynamic maps, use tile cache",type:"Attribute"},{datatype:"Enum",defaultValue:"From children",displayName:"Mode",name:"Mode",options:["From children","From tags","From layers"],type:"Attribute"},{datatype:"Layers",defaultValue:[0],displayName:"Navmesh layers",info:"Selects which layers are added to the navmesh",name:"NavmeshLayers",type:"Attribute",if:{Mode:"From layers"}},{datatype:"Tags",defaultValue:[],info:"Selects meshes to add to the navmesh based on tag.",displayName:"Navmesh tags",name:"NavmeshTags",type:"Attribute",if:{Mode:"From tags"}},{datatype:"Boolean",defaultValue:!1,displayName:"Auto generate",name:"AutoGenerate",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Always render helper",name:"AlwaysRenderHelper",type:"Attribute"},{datatype:"Button",defaultValue:!1,displayName:"Regenerate now",name:"RegenerateNow",type:"Attribute"},{datatype:"Float",defaultValue:0,minValue:0,displayName:"Border size",name:"BorderSize",type:"Attribute"},{datatype:"Float",defaultValue:.2,minValue:.01,displayName:"Voxel cell height",name:"CellHeight",type:"Attribute",info:"Needs to resolve step/climb height cleanly."},{datatype:"Float",defaultValue:.2,minValue:.01,displayName:"Voxel cell size",name:"CellSize",type:"Attribute",info:"Smaller = more detail. Around 0.2m for human‑scale"},{datatype:"Integer",defaultValue:256,minValue:1,displayName:"Chunky tri mesh tris per chunk",name:"ChunkyTriMeshTrisPerChunk",type:"Attribute",if:{Type:"Tiled"}},{datatype:"Float",defaultValue:6,minValue:.01,displayName:"Detail sample dist",name:"DetailSampleDist",type:"Attribute"},{datatype:"Float",defaultValue:1,minValue:0,displayName:"Detail sample max error",name:"DetailSampleMaxError",type:"Attribute"},{datatype:"Integer",defaultValue:4,minValue:1,displayName:"Expected layers per tile",name:"ExpectedLayersPerTile",type:"Attribute",if:{Type:"Tile Cache"}},{datatype:"Integer",defaultValue:128,minValue:1,displayName:"Max obstacles",name:"MaxObstacles",type:"Attribute",if:{Type:"Tile Cache"}},{datatype:"Float",defaultValue:12,minValue:.01,displayName:"Max edge length",name:"MaxEdgeLen",type:"Attribute"},{datatype:"Float",defaultValue:1.3,minValue:0,displayName:"Max simplification error",name:"MaxSimplificationError",type:"Attribute",info:"Allowed contour deviation from source before another vertex is kept"},{datatype:"Integer",defaultValue:6,minValue:3,displayName:"Max vertices per poly",name:"MaxVertsPerPoly",type:"Attribute"},{datatype:"Float",defaultValue:20,minValue:.01,displayName:"Merge region area",name:"MergeRegionArea",type:"Attribute"},{datatype:"Float",defaultValue:8,minValue:.01,displayName:"Min region area",name:"MinRegionArea",type:"Attribute"},{datatype:"Float",defaultValue:2,minValue:0,displayName:"Walkable climb",name:"WalkableClimb",type:"Attribute",info:"Maximum step height"},{datatype:"Float",defaultValue:2,minValue:0,displayName:"Walkable height",name:"WalkableHeight",type:"Attribute",info:"Required head‑clearance. Must be at least the height of the characters."},{datatype:"Float",defaultValue:.5,minValue:.01,displayName:"Walkable radius",name:"WalkableRadius",type:"Attribute",info:"Clearance from walls/obstacles"},{datatype:"Float",defaultValue:60,minValue:0,maxValue:360,displayName:"Walkable slope angle",name:"WalkableSlopeAngle",type:"Attribute",info:"Steepest walkable slope"},{datatype:"Boolean",defaultValue:!0,displayName:"Build BV Tree",name:"BuildBvTree",info:"",type:"Attribute",if:{$or:[{Type:"Solo"},{Type:"Tiled"}]}},{datatype:"Integer",defaultValue:32,minValue:1,displayName:"Tile size",name:"TileSize",type:"Attribute",info:"The size of the tiles to be used. Typically you will want to stay in the range 32 - 64. Sizes outside this range might result in unexpected behaviour",if:{$or:[{Type:"Tiled"},{Type:"Tile cache"}]}},{label:"Crowd fields",type:"Separator"},{datatype:"Boolean",defaultValue:!0,displayName:"Enable crowd",name:"EnableCrowd",type:"Attribute"},{datatype:"Integer",defaultValue:100,minValue:1,displayName:"Max agent count",name:"MaxAgentCount",type:"Attribute"},{datatype:"Float",defaultValue:1,minValue:.01,displayName:"Max agent radius",name:"MaxAgentRadius",type:"Attribute"}],typeName:"NavMesh"}],name:"Scenegraph",type:"Tree"}],name:"Prefab",updateRequiresThumbRefresh:!0},{_id:{$oid:"5e6a1ad189707feef9173397"},contentTypes:["text/x-lua"],fieldSets:[],fields:[],name:"Script",updateRequiresThumbRefresh:!1,creatableEmpty:!0},{_id:{$oid:"5e6a1ad189707f2ef9133396"},contentTypes:[],fieldSets:[],fields:[{childTypes:[{displayName:"Camera",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"String",defaultValue:"",displayName:"Tag",info:"Tag of the camera to render",name:"Tag",type:"Attribute"},{datatype:"Layers",defaultValue:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31],displayName:"Layers",info:"Selects which layers are rendered by the camera. Overrides scene Camera node 'Cull mode' field.",name:"Layers",type:"Attribute"},{datatype:"Float",defaultValue:100,displayName:"Width",info:"Width in percent to render",name:"Width",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:100,displayName:"Height",info:"Height in percent to render",name:"Height",type:"Attribute",widget:"Slider"}],inputs:[],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"},{displayName:"Depth output",name:"DepthOutput",type:"GrayImage"},{displayName:"Depth Comparison output",name:"DepthComparisonOutput",type:"GrayImage"},{displayName:"Normal output",name:"NormalOutput",type:"RGBImage"},{displayName:"Camera Output",name:"CameraOutput",type:"Attribute"}],typeName:"camera"},{displayName:"Merge",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Enum",defaultValue:"Alpha",displayName:"Blending Mode",name:"BlendingMode",options:["Add","Alpha","Average","Color","Color Burn","Color Dodge","Darken","Difference","Divide","Exclusion","Hard Light","Hard Mix","Hue","Invert","Invert RGB","Lighten","Linear Burn","Linear Dodge","Linear Light","Luminosity","Multiply","Negation","Normal","Overlay","Pin Light","Reflect","Saturation","Screen","Soft Light","Set","Src","Subtract","Vivid Light"],type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Blend amount",info:"Adjusts how strongly the blending mode affects the final result.",maxValue:1,minValue:0,name:"Opacity",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:0,displayName:"Offset X",info:"Horizontal offset for the secondary input (relative to composition resolution). Positive values move right, negative left. Percentage-based for resolution independence.",maxValue:100,minValue:-100,name:"OffsetX",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Offset Y",info:"Vertical offset for the secondary input (relative to composition resolution). Positive values move up, negative down. Percentage-based for resolution independence.",maxValue:100,minValue:-100,name:"OffsetY",type:"Attribute"},{datatype:"Float",defaultValue:100,displayName:"Width",info:"Horizontal scale of the secondary input as percentage of composition width. 100% maintains original aspect ratio when Height is also 100%. Values <100% shrink, >100% stretch.",maxValue:100,minValue:0,name:"Width",type:"Attribute"},{datatype:"Float",defaultValue:100,displayName:"Height",info:"Vertical scale of the secondary input as percentage of composition height. 100% maintains original aspect ratio when Width is also 100%. Values <100% shrink, >100% stretch.",maxValue:100,minValue:0,name:"Height",type:"Attribute"}],inputs:[{displayName:"Color input 1",name:"ColorInput1",types:["RGBImage"]},{displayName:"Color input 2",name:"ColorInput2",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"merge"},{displayName:"SSAO",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Float",defaultValue:.2,displayName:"Radius",minValue:.01,name:"Radius",type:"Attribute"},{datatype:"Integer",defaultValue:8,displayName:"Samples",maxValue:32,minValue:8,name:"Samples",type:"Attribute"},{datatype:"Float",defaultValue:.001,displayName:"Bias",minValue:.001,name:"Bias",type:"Attribute"},{datatype:"Float",defaultValue:2,displayName:"Intensity",minValue:0,name:"Intensity",type:"Attribute"},{datatype:"Float",defaultValue:.07,displayName:"Max distance",minValue:.01,name:"MaxDistance",type:"Attribute"}],inputs:[{displayName:"Depth input",name:"DepthInput",types:["GrayImage"]},{displayName:"Normal input",name:"NormalInput",types:["RGBImage"]},{displayName:"Camera Input",name:"CameraInput",types:["Attribute"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"ssao"},{displayName:"FXAA",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"fxaa"},{displayName:"Bloom",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Float",defaultValue:1.5,displayName:"Strength",maxValue:10,minValue:0,name:"Strength",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:.4,displayName:"Radius",maxValue:1,minValue:0,name:"Radius",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:.8,displayName:"Threshold",info:"Minimum luminance required for a pixel to contribute to bloom. Pixels darker than this value are suppressed, while brighter pixels contribute to the blur.",maxValue:1,minValue:0,name:"Threshold",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:.4,displayName:"Soft Knee",info:"Creates a smooth transition around the threshold to avoid harsh cutoffs. Higher values produce a more gradual blend between non-blooming and blooming pixels.",maxValue:1,minValue:0,name:"SoftKnee",type:"Attribute",widget:"Slider"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"bloom"},{displayName:"Outline",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Edge Strength",maxValue:5,minValue:0,name:"EdgeStrength",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:.5,displayName:"Edge Width",maxValue:2,minValue:.1,name:"EdgeWidth",type:"Attribute",widget:"Slider"},{datatype:"Color",defaultValue:{r:255,g:0,b:0,a:255},displayName:"Edge Color",name:"EdgeColor",type:"Attribute"},{datatype:"Enum",defaultValue:"Add",displayName:"Blending Mode",name:"BlendingMode",options:["Add","Alpha","Average","Color","Color Burn","Color Dodge","Darken","Difference","Divide","Exclusion","Hard Light","Hard Mix","Hue","Invert","Invert RGB","Lighten","Linear Burn","Linear Dodge","Linear Light","Luminosity","Multiply","Negation","Normal","Overlay","Pin Light","Reflect","Saturation","Screen","Soft Light","Set","Src","Subtract","Vivid Light"],type:"Attribute"},{datatype:"Float",defaultValue:.25,displayName:"Opacity",name:"Opacity",maxValue:1,minValue:0,type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]},{displayName:"Depth Comparison input",name:"DepthComparisonInput",types:["GrayImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"outline"},{displayName:"Film",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Float",defaultValue:.05,displayName:"Noise intensity",maxValue:1,minValue:0,name:"NoiseIntensity",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:0,displayName:"Scanlines intensity",maxValue:1,minValue:0,name:"ScanlinesIntensity",type:"Attribute",widget:"Slider"},{datatype:"Integer",defaultValue:0,displayName:"Scanlines count",maxValue:1e3,minValue:0,name:"ScanlinesCount",type:"Attribute",widget:"Slider"},{datatype:"Boolean",defaultValue:!1,displayName:"Grayscale",name:"Grayscale",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Animated",name:"Animated",type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"film"},{displayName:"Fog",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Color",defaultValue:{r:255,g:0,b:0,a:255},displayName:"Color",name:"Color",type:"Attribute"},{datatype:"Enum",defaultValue:"Camera Depth",displayName:"Direction",name:"Direction",type:"Attribute",options:["Camera Depth","X","Y","Z"],info:"Defines the ray along which the fog is evaluated. 'Camera Depth' applies fog based on distance from the camera view direction (distances should be non-negative). 'X', 'Y', and 'Z' apply fog along the corresponding world-space axis; distances may be positive or negative depending on where the fog volume should begin and end."},{datatype:"Enum",defaultValue:"Linear",displayName:"Type",name:"Type",type:"Attribute",options:["Linear","Exponential","Exponential Squared"]},{datatype:"Float",defaultValue:1,displayName:"Start Distance",name:"StartDistance",type:"Attribute",info:"Distance along the selected fog ray where the fog begins to accumulate. Must be >= 0 when using Camera Depth."},{datatype:"Float",defaultValue:1e3,displayName:"End Distance",name:"EndDistance",type:"Attribute",info:"Distance along the selected fog ray where the fog reaches maximum density. Must be >= 0 when using Camera Depth."},{datatype:"Float",defaultValue:.0025,displayName:"Density",minValue:1e-5,maxValue:1,name:"Density",type:"Attribute",step:.1,if:{$or:[{FogType:"Exponential"},{FogType:"Exponential Squared"}]}},{datatype:"Boolean",defaultValue:!0,displayName:"Enable Noise",name:"EnableNoise",info:"Adds animated noise to the fog to create more natural variation.",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Noise Scale",minValue:.001,name:"NoiseScale",type:"Attribute",step:1,if:{EnableFogNoise:!0}},{datatype:"Float",defaultValue:.1,displayName:"Noise Speed",maxValue:1,minValue:0,name:"NoiseSpeed",type:"Attribute",step:.1,if:{EnableFogNoise:!0}},{datatype:"Float",defaultValue:.5,displayName:"Noise Amount",maxValue:1,minValue:0,name:"NoiseAmount",type:"Attribute",step:.1,if:{EnableFogNoise:!0}},{datatype:"Float",defaultValue:0,maxValue:1,displayName:"Sky Density",info:"Controls the amount of fog applied to the sky.",name:"SkyDensity",type:"Attribute",step:.1}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]},{displayName:"Depth input",name:"DepthInput",types:["DepthBuffer"]},{displayName:"Camera input",name:"CameraInput",types:["Camera"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"fog"},{displayName:"Sepia",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Enum",defaultValue:"Normal",displayName:"Blending Mode",name:"BlendingMode",options:["Add","Alpha","Average","Color","Color Burn","Color Dodge","Darken","Difference","Divide","Exclusion","Hard Light","Hard Mix","Hue","Invert","Invert RGB","Lighten","Linear Burn","Linear Dodge","Linear Light","Luminosity","Multiply","Negation","Normal","Overlay","Pin Light","Reflect","Saturation","Screen","Soft Light","Set","Src","Subtract","Vivid Light"],type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Opacity",name:"Opacity",maxValue:1,minValue:0,type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"sepia"},{displayName:"Vignette",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Enum",defaultValue:"Normal",displayName:"Blending Mode",name:"BlendingMode",options:["Add","Alpha","Average","Color","Color Burn","Color Dodge","Darken","Difference","Divide","Exclusion","Hard Light","Hard Mix","Hue","Invert","Invert RGB","Lighten","Linear Burn","Linear Dodge","Linear Light","Luminosity","Multiply","Negation","Normal","Overlay","Pin Light","Reflect","Saturation","Screen","Soft Light","Set","Src","Subtract","Vivid Light"],type:"Attribute"},{datatype:"Float",defaultValue:.9,displayName:"Opacity",name:"Opacity",maxValue:1,minValue:0,type:"Attribute"},{datatype:"Float",defaultValue:.4,displayName:"Amount",maxValue:1,minValue:0,name:"Amount",type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"vignette"},{displayName:"Blur",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Amount",maxValue:10,minValue:0,name:"Amount",type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"blur"},{displayName:"Scanline",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Float",defaultValue:.5,displayName:"Density",maxValue:1,minValue:0,name:"Density",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:.01,displayName:"Scroll Speed",maxValue:1,minValue:0,name:"ScrollSpeed",type:"Attribute",widget:"Slider"},{datatype:"Enum",defaultValue:"Overlay",displayName:"Blending Mode",name:"BlendingMode",options:["Add","Alpha","Average","Color","Color Burn","Color Dodge","Darken","Difference","Divide","Exclusion","Hard Light","Hard Mix","Hue","Invert","Invert RGB","Lighten","Linear Burn","Linear Dodge","Linear Light","Luminosity","Multiply","Negation","Normal","Overlay","Pin Light","Reflect","Saturation","Screen","Soft Light","Set","Src","Subtract","Vivid Light"],type:"Attribute"},{datatype:"Float",defaultValue:.25,displayName:"Opacity",name:"Opacity",maxValue:1,minValue:0,type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"scanline"},{displayName:"Shockwave",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Continuous",info:"Whether or not new shockwaves will emit as soon as the previous shockwave ended.",name:"Continuous",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Delay",minValue:0,name:"Delay",info:"How long to wait between shockwave emissions.",type:"Attribute",if:{Continuous:!1}},{datatype:"Integer",defaultValue:5,displayName:"Amount",minValue:0,name:"Amount",info:"The number of shockwaves.",type:"Attribute",if:{Continuous:!1}},{datatype:"Vector3d",defaultValue:{x:0,y:0,z:0},displayName:"Center",info:"The center in world coordinates of the shockwave effect.",name:"Center",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Size",maxValue:100,minValue:.001,name:"Size",type:"Attribute"},{datatype:"Float",defaultValue:2,displayName:"Speed",maxValue:100,minValue:.001,name:"Speed",type:"Attribute"},{datatype:"Float",defaultValue:-.2,displayName:"Radius",maxValue:10,minValue:-10,name:"Radius",type:"Attribute"},{datatype:"Float",defaultValue:.2,displayName:"Maximum Radius",maxValue:10,minValue:0,name:"MaxRadius",type:"Attribute"},{datatype:"Float",defaultValue:10,displayName:"Wave Size",maxValue:100,minValue:1,name:"WaveSize",type:"Attribute"},{datatype:"Float",defaultValue:.05,displayName:"Amplitude",maxValue:10,minValue:0,name:"Amplitude",type:"Attribute"},{datatype:"Enum",defaultValue:"Screen",displayName:"Blending Mode",name:"BlendingMode",options:["Add","Alpha","Average","Color","Color Burn","Color Dodge","Darken","Difference","Divide","Exclusion","Hard Light","Hard Mix","Hue","Invert","Invert RGB","Lighten","Linear Burn","Linear Dodge","Linear Light","Luminosity","Multiply","Negation","Normal","Overlay","Pin Light","Reflect","Saturation","Screen","Soft Light","Set","Src","Subtract","Vivid Light"],type:"Attribute"},{datatype:"Float",defaultValue:.75,displayName:"Opacity",name:"Opacity",maxValue:1,minValue:0,type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Enable Debug",name:"Debug",type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]},{displayName:"Camera Input",name:"CameraInput",types:["Attribute"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"shockwave"},{displayName:"Pixelation",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Float",defaultValue:10,displayName:"Granularity",maxValue:100,minValue:1,name:"Granularity",type:"Attribute",widget:"Slider"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"pixelation"},{displayName:"Adjust",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Brightness",maxValue:10,minValue:-10,name:"Brightness",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Contrast",maxValue:10,minValue:-10,name:"Contrast",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Hue",maxValue:6.283,minValue:0,name:"Hue",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Saturation",maxValue:1,minValue:-1,name:"Saturation",type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"adjust"},{displayName:"Chromatic abberation",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Amount",maxValue:10,minValue:0,name:"Amount",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Red factor",maxValue:1,minValue:0,name:"RedFactor",type:"Attribute"},{datatype:"Float",defaultValue:.5,displayName:"Green factor",maxValue:1,minValue:0,name:"GreenFactor",type:"Attribute"},{datatype:"Float",defaultValue:.25,displayName:"Blue factor",maxValue:1,minValue:0,name:"BlueFactor",type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"chromaticAbberation"},{displayName:"Color Depth",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Integer",defaultValue:16,displayName:"Bit Depth",maxValue:32,minValue:1,name:"bitDepth",type:"Attribute"},{datatype:"Enum",defaultValue:"Normal",displayName:"Blending Mode",name:"BlendingMode",options:["Add","Alpha","Average","Color","Color Burn","Color Dodge","Darken","Difference","Divide","Exclusion","Hard Light","Hard Mix","Hue","Invert","Invert RGB","Lighten","Linear Burn","Linear Dodge","Linear Light","Luminosity","Multiply","Negation","Normal","Overlay","Pin Light","Reflect","Saturation","Screen","Soft Light","Set","Src","Subtract","Vivid Light"],type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Blend amount",info:"Amount of blending. Only valid for additive and subtractive modes",maxValue:1,minValue:0,name:"Opacity",type:"Attribute",widget:"Slider"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"colorDepth"},{displayName:"Depth Of Field",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"String",defaultValue:"",displayName:"Focus Target",name:"FocusTarget",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"World Focus Distance",minValue:0,name:"WorldFocusDistance",type:"Attribute"},{datatype:"Float",defaultValue:5,displayName:"World Focus Range",minValue:0,name:"WorldFocusRange",type:"Attribute"},{datatype:"Integer",defaultValue:4,displayName:"Kawase Blur Kernel Size",maxValue:10,minValue:0,name:"Kernel",type:"Attribute"},{datatype:"Float",defaultValue:.5,displayName:"Bokeh Scale",maxValue:25,minValue:0,name:"BokehScale",type:"Attribute"},{datatype:"Float",defaultValue:.75,displayName:"Resolution Scale",maxValue:1,minValue:0,name:"ResolutionScale",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Enable Debug",name:"Debug",type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]},{displayName:"Depth input",name:"DepthInput",types:["GrayImage"]},{displayName:"Camera Input",name:"CameraInput",types:["Attribute"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"depthoffield"},{displayName:"Glitch",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Vector2d",defaultValue:{x:.3,y:1},displayName:"Strength",info:"Two values controlling the maximum and minimum strength of the glitch effect.",name:"Strength",type:"Attribute"},{datatype:"Float",defaultValue:.1,displayName:"Columns",maxValue:1,minValue:0,name:"Columns",type:"Attribute"},{datatype:"Vector2d",defaultValue:{x:0,y:2.5},displayName:"Delay",info:"Two values controlling the duration of the delay of the glitch effect.",name:"Delay",type:"Attribute"},{datatype:"Vector2d",defaultValue:{x:0,y:3},displayName:"Duration",info:"Two values controlling the duration of the glitch effect.",name:"Duration",type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"glitch"},{displayName:"God Rays",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"String",defaultValue:"",type:"Attribute",displayName:"Light Source",name:"SunTag"},{datatype:"Float",defaultValue:1,displayName:"Size",minValue:.01,maxValue:10,name:"Size",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Density",minValue:.01,maxValue:1,name:"Density",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Decay",minValue:.01,maxValue:1,name:"Decay",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Weight",minValue:.01,maxValue:1,name:"Weight",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Exposure",minValue:.01,maxValue:1,name:"Exposure",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"MaximumIntensity",minValue:.01,maxValue:1,name:"MaximumIntensity",type:"Attribute"},{datatype:"Integer",defaultValue:60,displayName:"Samples",minValue:0,name:"Samples",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Blur Rays",name:"BlurRays",type:"Attribute"},{datatype:"Integer",defaultValue:2,displayName:"Kernel Size",info:"The number of kernel applied on the God Rays. A higher number yields to a better blur effect at higher computational cost",maxValue:10,minValue:0,name:"Kernel",if:{BlurRays:!0},type:"Attribute"},{datatype:"Float",defaultValue:.5,displayName:"Resolution Scale",info:"A higher resolution yields a more realistic result at higher computational cost",maxValue:1,minValue:0,name:"ResolutionScale",type:"Attribute"},{datatype:"Enum",defaultValue:"Screen",displayName:"Blending Mode",name:"BlendingMode",options:["Add","Alpha","Average","Color","Color Burn","Color Dodge","Darken","Difference","Divide","Exclusion","Hard Light","Hard Mix","Hue","Invert","Invert RGB","Lighten","Linear Burn","Linear Dodge","Linear Light","Luminosity","Multiply","Negation","Normal","Overlay","Pin Light","Reflect","Saturation","Screen","Soft Light","Set","Src","Subtract","Vivid Light"],type:"Attribute"},{datatype:"Float",defaultValue:.25,displayName:"Opacity",name:"Opacity",maxValue:1,minValue:0,type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Enable Debug",name:"Debug",type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]},{displayName:"Depth input",name:"DepthInput",types:["GrayImage"]},{displayName:"Camera Input",name:"CameraInput",types:["Attribute"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"godrays"},{displayName:"Kawase Blur",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Integer",defaultValue:2,displayName:"Kernel Size",info:"The number of kernel applied on the effect. A higher number yields to a better blur effect at higher computational cost",maxValue:10,minValue:0,name:"Kernel",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Scale",info:"The strenth of the blur effect.",maxValue:1,minValue:0,name:"Scale",type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"kawaseblur"},{displayName:"Radial blur",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Amount",maxValue:10,minValue:0,name:"Amount",type:"Attribute"},{datatype:"Vector2d",defaultValue:{x:.5,y:.5},displayName:"Center",name:"Center",type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"radialBlur"},{displayName:"Tone Mapping",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Enum",defaultValue:"LINEAR",displayName:"Mode",name:"TonemappingMode",options:["LINEAR","REINHARD","REINHARD2","REINHARD2_ADAPTIVE","UNCHARTED2","ACES_FILMIC","AGX","NEUTRAL"],type:"Attribute"},{datatype:"Integer",defaultValue:256,displayName:"Luminance Map Width. Must be a power of 2.",minValue:1,name:"LuminanceMapWidth",type:"Attribute",if:{TonemappingMode:"REINHARD2_ADAPTIVE"}},{datatype:"Integer",defaultValue:256,displayName:"Luminance Map Height. Must be a power of 2.",if:{TonemappingMode:"REINHARD2_ADAPTIVE"},minValue:1,name:"LuminanceMapHeight",type:"Attribute"},{datatype:"Float",defaultValue:4,displayName:"Maximum Luminance",minValue:0,maxValue:20,name:"MaxLuminance",type:"Attribute"},{datatype:"Float",defaultValue:.01,displayName:"Minimum Luminance",minValue:0,maxValue:3,name:"MinLuminance",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Average Luminance",minValue:0,maxValue:1,name:"MeanLuminance",type:"Attribute"},{datatype:"Float",defaultValue:.6,displayName:"Middle Grey",maxValue:1,minValue:0,name:"MiddleGrey",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Adaptation Rate",minValue:0,name:"AdaptationRate",type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"tonemapping"},{displayName:"Output",fields:[{datatype:"String",defaultValue:"Output",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Integer",defaultValue:256,displayName:"Target width",minValue:1,name:"DesiredWidth",type:"Attribute",info:"This is the width of the render target in case the composition is used in a material albedo slot."},{datatype:"Integer",defaultValue:256,displayName:"Target height",minValue:1,name:"DesiredHeight",type:"Attribute",info:"This is the height of the render target in case the composition is used in a material albedo slot."}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[],typeName:"output"}],name:"NodeGraph",type:"NodeGraph"}],name:"Composition",updateRequiresThumbRefresh:!1,creatableEmpty:!0},{_id:{$oid:"5e6a1ad189707f2ef9147396"},contentTypes:[],fieldSets:[],fields:[],name:"Behavior",updateRequiresThumbRefresh:!1,creatableEmpty:!1},{_id:{$oid:"5e6a1ad189707feef9173398"},contentTypes:["text/x-glsl"],fieldSets:[],fields:[{datatype:"Enum",defaultValue:1,displayName:"GLSL Version",name:"GLSLVersion",options:[1,3],type:"Attribute"},{datatype:"Enum",defaultValue:"Full",displayName:"Resolution",name:"Resolution",options:["Full","Half","Quarter"],type:"Attribute"},{displayName:"Texture Channel 1",linkableTypes:["Image"],type:"Link",usageAs:"TexChannel1"},{displayName:"Texture Channel 2",linkableTypes:["Image"],type:"Link",usageAs:"TexChannel2"},{displayName:"Texture Channel 3",linkableTypes:["Image"],type:"Link",usageAs:"TexChannel3"},{displayName:"Texture Channel 4",linkableTypes:["Image"],type:"Link",usageAs:"TexChannel4"}],name:"Background Shader",updateRequiresThumbRefresh:!1,creatableEmpty:!0},{_id:{$oid:"5e6a1ad189707feef9173399"},contentTypes:["video/mp4","video/webm"],fieldSets:[],fields:[{datatype:"Enum",defaultValue:"Linear",displayName:"Encoding",name:"Encoding",options:["Linear","sRGB"],type:"Attribute"}],name:"Video",creatableEmpty:!1},{_id:{$oid:"5e8c9d5c02a37596bb1fd5b6"},contentTypes:[""],fieldSets:[],fields:[{elementName:"Item",fields:[{datatype:"String",defaultValue:"",displayName:"Description",name:"Description",type:"Attribute"},{type:"Link",usageAs:"Item",mandatory:!0}],name:"Items",type:"List"}],name:"Collection",creatableEmpty:!0},{_id:{$oid:"5e8c9d5c02a33596bb53d5b6"},contentTypes:[""],fieldSets:[],fields:[{displayName:"Audio items",elementName:"AudioItem",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{linkableTypes:["Audio"],type:"Link",usageAs:"Audio",mandatory:!0}],name:"AudioItems",type:"List"}],name:"Audio Collection",creatableEmpty:!0},{_id:{$oid:"5e8c9d5c01a32576bb53d5b6"},contentTypes:[""],fieldSets:[],fields:[{displayName:"Mesh items",elementName:"MeshItem",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{linkableTypes:["Mesh"],type:"Link",usageAs:"Mesh",mandatory:!0}],name:"MeshItems",type:"List"}],name:"Mesh Collection",creatableEmpty:!0},{_id:{$oid:"5e8c9d5c0233596cb31d5ba2"},contentTypes:[""],fieldSets:[],fields:[{displayName:"Material items",elementName:"MaterialItem",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{linkableTypes:["Material"],type:"Link",usageAs:"Material",mandatory:!0}],name:"MaterialItems",type:"List"}],name:"Material Collection",creatableEmpty:!0},{_id:{$oid:"5edf2f6edc25bdf4e5723e52"},contentTypes:["text/x-yaml"],fieldSets:[],fields:[{displayName:"Material collections",elementName:"Material Collection",fields:[{linkableTypes:["Material Collection"],type:"Link",usageAs:"MaterialCollection",displayName:"Material Collection",mandatory:!0}],name:"MaterialCollections",type:"List"},{displayName:"Mesh collections",elementName:"Mesh Collection",fields:[{linkableTypes:["Mesh Collection"],type:"Link",usageAs:"MeshCollection",displayName:"Mesh Collection",mandatory:!0}],name:"MeshCollections",type:"List"}],name:"GridMap",creatableEmpty:!0},{_id:{$oid:"60827c20d3f7a631e71522cc"},contentTypes:[],fieldSets:[],fields:[],name:"Dataset",creatableEmpty:!1},{_id:{$oid:"62133ff41302cfcd0d9a2346"},contentTypes:["text/x-glsl"],fieldSets:[],fields:[],name:"Pixel Shader",updateRequiresThumbRefresh:!1,creatableEmpty:!0},{_id:{$oid:"62133ffb1302cf53ef9a234e"},contentTypes:["text/x-glsl"],fieldSets:[],fields:[],name:"Vertex Shader",updateRequiresThumbRefresh:!1,creatableEmpty:!0},{_id:{$oid:"62a83a1ef46738fe096fd7e3"},contentTypes:["application/zip"],fieldSets:[],fields:[],name:"Archive",updateRequiresThumbRefresh:!1,creatableEmpty:!1},{_id:{$oid:"640076f0e49250ab06ea4aec"},contentTypes:["font/ttf","font/otf"],fieldSets:[],fields:[],name:"Font",updateRequiresThumbRefresh:!0,creatableEmpty:!1},{_id:{$oid:"6463df676055450cac673d90"},contentTypes:[],fieldSets:[],fields:[{label:"General Settings",type:"Separator"},{datatype:"Integer",defaultValue:1e3,displayName:"Maximum Number of Particles",info:"The maximum number of particles that can exist at the same time in the simulation.",minValue:0,name:"MaxParticles",type:"Attribute"},{datatype:"Float",defaultValue:-1,displayName:"Duration",info:"Duration (in seconds) the particle system runs. Use -1 for infinite duration.",minValue:-1,name:"Duration",type:"Attribute"},{datatype:"Enum",defaultValue:"Local",displayName:"Coordinate System",info:"Defines whether particle movement is relative to the emitter's local space or the global world space.",name:"SystemCoordinates",options:["Local","World"],type:"Attribute"},{label:"Emission Settings",type:"Separator",collapsed:!0},{datatype:"Boolean",defaultValue:!1,displayName:"Emit All At Once",info:"Emit all particles immediately when the simulation starts.",name:"EmitAllAtOnce",type:"Attribute"},{datatype:"Float",defaultValue:128,minValue:0,displayName:"Spawn amount",if:{EmitAllAtOnce:!1},info:"The number of particles emitted each time the emitter spawns.",name:"SpawnAmount",type:"Attribute"},{datatype:"Float",defaultValue:1,minValue:0,displayName:"Spawn Interval",info:"The time, in seconds, between each consecutive spawn of particles.",if:{EmitAllAtOnce:!1},name:"SpawnRate",type:"Attribute"},{datatype:"Float",defaultValue:-1,minValue:-1,displayName:"Number of Emissions",info:"Total number of spawn events before emission stops; after this number of emissions, no more particles will be emitted.",if:{EmitAllAtOnce:!1},name:"MaximumEmissions",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Continuous emission",info:"If enabled, particles in each emission spawn gradually over time instead of instantly.",if:{EmitAllAtOnce:!1},name:"ContinuousEmissionFlag",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Auto Respawn",info:"Automatically respawn particles when they die.",name:"Respawn",type:"Attribute",if:{EmitAllAtOnce:!0}},{label:"Size Settings",type:"Separator",collapsed:!0},{datatype:"Enum",defaultValue:"Constant",options:["Constant","Variable","Velocity"],displayName:"Scaling Mode",info:"Determines how particle size changes over their lifetime: constant size, variable scaling, or based on velocity.",name:"ScaleMode",type:"Attribute"},{datatype:"Float",defaultValue:10,displayName:"Base Size",info:"The size of the particles at emission",minValue:0,name:"ParticleInitialSize",type:"Attribute"},{datatype:"Float",defaultValue:15,displayName:"Final Size",info:"The size particles reach at the end of their lifetime. If particles die early, they may not reach their final size.",minValue:0,name:"ParticleFinalSize",type:"Attribute",if:{ScaleMode:"Variable"}},{datatype:"Float",displayName:"Scale Randomness",name:"ScaleRandomness",defaultValue:.1,minValue:0,maxValue:1,info:"Random variation applied to scale curve values."},{datatype:"Enum",defaultValue:"Linear",options:["Linear","Exponential","Inverse Exponential","Ease-in, Ease-out"],displayName:"Interpolation Function",info:"Interpolation method for scaling particles over their lifetime.",type:"Attribute",name:"ScaleFunction",if:{ScaleMode:"Variable"}},{datatype:"Float",defaultValue:.5,minValue:0,maxValue:5,if:{ScaleMode:"Variable",$or:[{ScaleFunction:"Exponential"},{ScaleFunction:"Inverse Exponential"},{ScaleFunction:"Ease-in, Ease-out"}]},displayName:"Interpolation Rate",name:"ApproachSize",info:"Controls the rate at which particles scale over time based on the interpolation modes.",type:"Attribute"},{label:"Velocity Settings",type:"Separator",collapsed:!0},{datatype:"Enum",defaultValue:"Constant",options:["Constant","Variable"],displayName:"Velocity Mode",info:"Determines if particles maintain a constant velocity or change velocity over their lifetime.",name:"VelocityMode",type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:0,y:0,z:0},displayName:"Initial Velocity",info:"The starting velocity of particles when emitted.",name:"InitialVelocity",type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:0,y:0,z:0},displayName:"Final Velocity",info:"The velocity particles will reach by the end of their lifetime. Used only when Velocity Mode is set to Variable.",name:"FinalVelocity",type:"Attribute",if:{VelocityMode:"Variable"}},{datatype:"Enum",defaultValue:"Linear",options:["Linear","Exponential","Inverse Exponential","Ease-in, Ease-out"],displayName:"Interpolation Function",info:"Defines the interpolation method for velocity changes over the particle’s lifetime.",name:"VelocityFunction",type:"Attribute",if:{VelocityMode:"Variable"}},{datatype:"Float",defaultValue:.5,displayName:"Interpolation Rate",info:"Controls the rate at which particles transition from initial to final velocity for the interpolation modes.",maxValue:5,minValue:0,name:"FinalVelocityApproach",type:"Attribute",if:{VelocityMode:"Variable",$or:[{VelocityFunction:"Exponential"},{VelocityFunction:"Inverse Exponential"},{VelocityFunction:"Ease-in, Ease-out"}]}},{datatype:"Float",defaultValue:0,displayName:"Spread",info:"Randomly offsets the emission angle (in degrees) from the base direction. A value of 360° emits particles uniformly in all directions. Requires Initial Velocity not be a 0-vector to have any effect.",maxValue:360,minValue:0,name:"Spread",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Angular Velocity",info:"The speed at which particles rotate around their center of mass, in radians per second.",minValue:0,name:"AngularVelocity",type:"Attribute",if:{$or:[{ParticleType:"Texture"},{ParticleType:"Sprite"}]}},{datatype:"Enum",defaultValue:"Clockwise",options:["Clockwise","Anticlockwise"],displayName:"Rotation Direction",info:"Controls the rotation direction of particles.",name:"AngularDirection",type:"Attribute",if:{$or:[{ParticleType:"Texture"},{ParticleType:"Sprite"}]}},{datatype:"Float",defaultValue:0,displayName:"Rotation Randomness",info:"Random variation applied to particle angular velocity. 0 = all particles rotate at the same speed, 1 = each particle can vary ±100% of base angular velocity.",minValue:0,maxValue:1,name:"RotationRandomness",type:"Attribute",if:{$or:[{ParticleType:"Texture"},{ParticleType:"Sprite"}]}},{label:"Force Settings",type:"Separator",collapsed:!0},{datatype:"Float",defaultValue:0,displayName:"Drift",info:"A random velocity added to particles in all directions to simulate drifting motion.",name:"Drift",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Gravity",info:"A constant acceleration applied to particles after emission, simulating gravity. Positive values pull particles downward; negative values pull them upward.",name:"Gravity",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Tangential Velocity",info:"Applies a tangential velocity to particles, causing them to orbit the center point along the defined orbital plane.",name:"OrbitalVelocity",type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:0,y:0,z:0},displayName:"Orbit Center",info:"The point in 3D space around which particles orbit.",name:"OrbitalCenterPoint",type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:0,y:1,z:0},displayName:"Orbital Plane",info:"A vector normal that defines the orientation of the orbital plane. Particles orbit around an axis perpendicular to this vector. Should be normalized (length = 1), but normalization is not enforced.",name:"OrbitalPlane",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Orbital Decay",info:"Causes particles to gradually spiral inward toward the orbital center over time.",name:"OrbitalDecay",type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:0,y:0,z:0},displayName:"Target",info:"A 3D point in space that particles are attracted to.",name:"Target",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Target Force",info:"The strength of the attraction force pulling particles toward the target. Set to 0 to disable.",name:"TargetForce",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Kill on target",info:"If enabled, particles are deleted once they reach the target position.",name:"TargetDeleteFlag",type:"Attribute"},{datatype:"Float",defaultValue:.1,if:{TargetDeleteFlag:!0},displayName:"Target Deletion Threshold",info:"The distance from the target at which particles are deleted.",minValue:0,name:"TargetDeletionThreshold",type:"Attribute"},{label:"Life Settings",type:"Separator",collapsed:!0},{datatype:"Float",defaultValue:10,displayName:"Life",info:"Time in seconds each particle remains alive before disappearing.",minValue:0,name:"Life",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Life Randomness",info:"Adds randomness, in seconds, to particle lifetimes. Each particle's life is calculated as: life + random(0 to 1) x life randomness.",minValue:0,name:"LifeRandomness",type:"Attribute"},{label:"Texture and Color Settings",type:"Separator",collapsed:!0},{datatype:"Enum",defaultValue:"Base",name:"ParticleType",info:"Defines the rendering style of particles: Base (simple points), Texture (image-based), or Sprite (animated images).",options:["Base","Texture","Sprite"],type:"Attribute"},{displayName:"Texture",info:"Image used as the particle’s texture.",if:{$or:[{ParticleType:"Texture"},{ParticleType:"Sprite"}]},linkableTypes:["Image"],type:"Link",usageAs:"ParticleTexture"},{datatype:"Boolean",defaultValue:!0,displayName:"Circular Mask",info:"Applies a circular alpha mask to the texture or sprite, making only the circular area visible while masking out the corners.",name:"useCircularMask",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Texture hue",info:"Amount of hue shift applied to the particle texture, expressed as a normalized value from 0 to 1, where 0 corresponds to 0 radians (0°) and 1 corresponds to 2π radians (360°).",minValue:0,maxValue:1,name:"TextureHue",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,name:"TextureBlending",displayName:"Texture Blending",info:"If enabled, blends the particle texture with the background or other particles for smoother visuals.",if:{$or:[{ParticleType:"Texture"},{ParticleType:"Sprite"}]},type:"Attribute"},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},displayName:"Particle Color",info:"Base color applied to particles at emission.",if:{$or:[{ParticleType:"Base"},{TextureBlending:!0}]},name:"Color",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Use Final Color",info:"Enable color transition so particles interpolate to a specified final color at the end of their lifetime.",if:{$or:[{ParticleType:"Base"},{TextureBlending:!0}]},name:"EnableFinalColor",type:"Attribute"},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},displayName:"Final Color",info:"The color particles interpolate to at the end of their life.",if:{EnableFinalColor:!0,$or:[{ParticleType:"Base"},{TextureBlending:!0}]},name:"FinalColor",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Random Color Factor",info:"Linearly blends each particle's color with a unique random tint. 0 = no randomness, 1 = full random color.",if:{$or:[{ParticleType:"Base"},{TextureBlending:!0}]},minValue:0,maxValue:1,name:"RandomColorFactor",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Enable Sprite Fade",if:{ParticleType:"Sprite"},info:"Allows the sprite to smoothly fade in and fade, creating a softer transition.",name:"EnableSpriteFade",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Roll Sprite Texture With Particle's Life",if:{ParticleType:"Sprite"},info:"Enable the sprite to animate by rolling through its frames based on the particle's lifetime.",name:"RollSpriteWithLife",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Sprite Speed",if:{ParticleType:"Sprite",RollSpriteWithLife:!1},info:"Speed, in frames per seconds, at which the sprite animation advances over time.",minValue:0,name:"SpriteSpeed",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Sprite Cols",if:{ParticleType:"Sprite"},info:"Number of horizontal frames (columns) in the sprite sheet. Must be specified manually. Incorrect values may cause improper animation.",minValue:1,name:"SpriteColumns",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Sprite Rows",if:{ParticleType:"Sprite"},info:"Number of vertical frames (rows) in the sprite sheet. Must be specified manually. Incorrect values may cause improper animation.",minValue:1,name:"SpriteRows",type:"Attribute"},{label:"Blending Settings",type:"Separator",collapsed:!0},{datatype:"Enum",defaultValue:"Normal",displayName:"Blending Mode",name:"BlendingMode",options:["Add","Multiply","Negation","Normal","Subtract"],type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Blend amount",info:"Adjusts how strongly the blending mode affects the final result.",maxValue:1,minValue:0,name:"Opacity",type:"Attribute",widget:"Slider"},{label:"Fade Settings",type:"Separator",collapsed:!0},{datatype:"Enum",defaultValue:"Constant",options:["Constant","Variable"],displayName:"Fading Mode",info:"Determines how particle opacity changes: constant transparency, fade over lifetime, or based on velocity.",name:"FadeMode",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Initial Opacity",info:"The opacity of particles when they are first emitted (0.0 = transparent, 1.0 = opaque)",minValue:0,maxValue:1,name:"ParticleInitialOpacity",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Final Opacity",info:"The opacity particles reach at the end of their lifetime. Creates fade-out effect when lower than initial opacity.",minValue:0,maxValue:1,name:"ParticleFinalOpacity",type:"Attribute",if:{FadeMode:"Variable"}},{datatype:"Enum",defaultValue:"Linear",options:["Linear","Exponential","Inverse Exponential","Ease-in, Ease-out"],displayName:"Fade Interpolation",info:"Controls how smoothly particles fade between initial and final opacity over their lifetime.",type:"Attribute",name:"FadeFunction",if:{FadeMode:"Variable"}},{datatype:"Float",defaultValue:1,minValue:.1,maxValue:5,if:{FadeMode:"Variable",$or:[{FadeFunction:"Exponential"},{FadeFunction:"Inverse Exponential"},{FadeFunction:"Ease-in, Ease-out"}]},displayName:"Fade Rate",name:"FadeApproach",info:"Controls how quickly the fade transition occurs. Higher values create sharper transitions, lower values create gentler fades.",type:"Attribute"},{label:"Emission Settings",type:"Separator",collapsed:!0},{datatype:"Enum",defaultValue:"Box",name:"EmitterShape",displayName:"Emitter Shape",info:"Defines the geometric shape from which particles are emitted.",options:["Point","Box","Sphere","Hemisphere","Torus","Cone","Circle","Edge"],type:"Attribute"},{datatype:"Enum",defaultValue:"Volume",name:"EmitterTypeSurfaceVolumeNormal",displayName:"Emitter Type",info:"Specifies whether particles are emitted from the surface, volume, or along the normals of the shape.",options:["Surface","Volume","Normals"],if:{$or:[{EmitterShape:"Box"},{EmitterShape:"Sphere"},{EmitterShape:"Cone"}]},type:"Attribute"},{datatype:"Enum",defaultValue:"Volume",name:"EmitterTypeSurfaceVolume",info:"Specifies whether particles are emitted from the surface or volume of the shape.",displayName:"Emitter Type",options:["Surface","Volume"],if:{$or:[{EmitterShape:"Hemisphere"},{EmitterShape:"Torus"}]},type:"Attribute"},{datatype:"Float",defaultValue:10,displayName:"Velocity Along Normals.",info:"Speed at which particles are emitted along the surface normals.",if:{EmitterTypeSurfaceVolumeNormal:"Normals"},minValue:0,name:"NormalsVelocity",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"The size of the emitter.",info:"Defines the size of the emitter.",if:{$or:[{EmitterShape:"Box"}]},minValue:0,name:"EmitterSize",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"The radius of the emitter.",if:{$or:[{EmitterShape:"Torus"},{EmitterShape:"Cone"},{EmitterShape:"Sphere"},{EmitterShape:"Hemisphere"},{EmitterShape:"Circle"}]},minValue:0,name:"EmitterRadius",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"The outer radius of the emitter",if:{$or:[{EmitterShape:"Torus"}]},minValue:0,name:"EmitterOuterRadius",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"The height of the emitter",if:{$or:[{EmitterShape:"Cone"},{EmitterShape:"Edge"}]},minValue:0,name:"EmitterHeight",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"The width of the emitter.",if:{$or:[{EmitterShape:"Edge"}]},minValue:0,name:"EmitterWidth",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Round Tip",if:{$or:[{EmitterShape:"Cone"}]},info:"Round the tip of the cone instead of using a sharp point.",name:"EmitterRoundTip",type:"Attribute"},{label:"Bounding Box Settings",type:"Separator",collapsed:!0},{datatype:"Boolean",defaultValue:!1,displayName:"Enable Bounding Box",info:"Enable a bounding box to restrict particles within a defined 3D area.",name:"EnableBBox",type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:10,y:10,z:10},info:"Coordinates of the bounding box's maximum corner (upper-right-front).",name:"BBoxMax",displayName:"Bounding Box Maximum Corner",if:{EnableBBox:!0},type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:0,y:0,z:0},info:"Coordinates of the bounding box's minimum corner (lower-left-back).",name:"BBoxMin",displayName:"Bounding Box Minimum Corner",if:{EnableBBox:!0},type:"Attribute"},{label:"Curl Noise Settings",type:"Separator",collapsed:!0},{datatype:"Boolean",defaultValue:!1,displayName:"Enable Curl Noise",info:"Toggle curl noise effect on particles to simulate turbulent, swirling particle behavior.",name:"NoiseFlag",type:"Attribute"},{datatype:"NoisePreview",if:{NoiseFlag:!0},displayName:"Noise Preview",info:"Visual preview of the curl noise pattern applied to the particle system.",name:"NoisePreview",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Noise Strength",if:{NoiseFlag:!0},info:"Controls the intensity of the noise.",name:"NoiseStrength",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Noise Frequency",if:{NoiseFlag:!0},info:"Determines the smoothness of the noise: lower values produce smooth, slow variations; higher values produce rapid, detailed changes.",name:"NoiseFrequency",type:"Attribute"},{datatype:"Integer",defaultValue:1,displayName:"Noise Octaves",if:{NoiseFlag:!0},info:"Number of noise layers combined to create complexity. Higher octaves add detail but reduce performance.",name:"NoiseOctaves",type:"Attribute"}],name:"Particles",updateRequiresThumbRefresh:!1,creatableEmpty:!0}];function C(e,t=!1){let a=x.find((t=>t.name===e));if(!a)return null;if(a=structuredClone(a),a.fields=a.fields||[],a.fieldSets=a.fieldSets||[],t&&a.inherits){const e=C(a.inherits,!0);e&&(a.fields=[...e.fields,...a.fields],a.fieldSets=[...e.fieldSets,...a.fieldSets])}return a}var I="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function V(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function E(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var F,D={exports:{}};var R=(F||(F=1,function(e){e.exports=function(){var t,a;function n(){return t.apply(null,arguments)}function i(e){t=e}function r(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function s(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function o(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function l(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(o(e,t))return!1;return!0}function u(e){return void 0===e}function c(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function d(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function p(e,t){var a,n=[],i=e.length;for(a=0;a<i;++a)n.push(t(e[a],a));return n}function h(e,t){for(var a in t)o(t,a)&&(e[a]=t[a]);return o(t,"toString")&&(e.toString=t.toString),o(t,"valueOf")&&(e.valueOf=t.valueOf),e}function f(e,t,a,n){return qa(e,t,a,n,!0).utc()}function m(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function y(e){return null==e._pf&&(e._pf=m()),e._pf}function g(e){var t=null,n=!1,i=e._d&&!isNaN(e._d.getTime());return i&&(t=y(e),n=a.call(t.parsedDateParts,(function(e){return null!=e})),i=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n),e._strict&&(i=i&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour)),null!=Object.isFrozen&&Object.isFrozen(e)?i:(e._isValid=i,e._isValid)}function b(e){var t=f(NaN);return null!=e?h(y(t),e):y(t).userInvalidated=!0,t}a=Array.prototype.some?Array.prototype.some:function(e){var t,a=Object(this),n=a.length>>>0;for(t=0;t<n;t++)if(t in a&&e.call(this,a[t],t,a))return!0;return!1};var v=n.momentProperties=[],_=!1;function w(e,t){var a,n,i,r=v.length;if(u(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),u(t._i)||(e._i=t._i),u(t._f)||(e._f=t._f),u(t._l)||(e._l=t._l),u(t._strict)||(e._strict=t._strict),u(t._tzm)||(e._tzm=t._tzm),u(t._isUTC)||(e._isUTC=t._isUTC),u(t._offset)||(e._offset=t._offset),u(t._pf)||(e._pf=y(t)),u(t._locale)||(e._locale=t._locale),r>0)for(a=0;a<r;a++)u(i=t[n=v[a]])||(e[n]=i);return e}function A(e){w(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===_&&(_=!0,n.updateOffset(this),_=!1)}function k(e){return e instanceof A||null!=e&&null!=e._isAMomentObject}function S(e){!1===n.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function N(e,t){var a=!0;return h((function(){if(null!=n.deprecationHandler&&n.deprecationHandler(null,e),a){var i,r,s,l=[],u=arguments.length;for(r=0;r<u;r++){if(i="","object"==typeof arguments[r]){for(s in i+="\n["+r+"] ",arguments[0])o(arguments[0],s)&&(i+=s+": "+arguments[0][s]+", ");i=i.slice(0,-2)}else i=arguments[r];l.push(i)}S(e+"\nArguments: "+Array.prototype.slice.call(l).join("")+"\n"+(new Error).stack),a=!1}return t.apply(this,arguments)}),t)}var T,M={};function x(e,t){null!=n.deprecationHandler&&n.deprecationHandler(e,t),M[e]||(S(t),M[e]=!0)}function C(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function I(e){var t,a;for(a in e)o(e,a)&&(C(t=e[a])?this[a]=t:this["_"+a]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function V(e,t){var a,n=h({},e);for(a in t)o(t,a)&&(s(e[a])&&s(t[a])?(n[a]={},h(n[a],e[a]),h(n[a],t[a])):null!=t[a]?n[a]=t[a]:delete n[a]);for(a in e)o(e,a)&&!o(t,a)&&s(e[a])&&(n[a]=h({},n[a]));return n}function F(e){null!=e&&this.set(e)}n.suppressDeprecationWarnings=!1,n.deprecationHandler=null,T=Object.keys?Object.keys:function(e){var t,a=[];for(t in e)o(e,t)&&a.push(t);return a};var D={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function R(e,t,a){var n=this._calendar[e]||this._calendar.sameElse;return C(n)?n.call(t,a):n}function L(e,t,a){var n=""+Math.abs(e),i=t-n.length;return(e>=0?a?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+n}var P=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,B=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,O={},$={};function U(e,t,a,n){var i=n;"string"==typeof n&&(i=function(){return this[n]()}),e&&($[e]=i),t&&($[t[0]]=function(){return L(i.apply(this,arguments),t[1],t[2])}),a&&($[a]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function j(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function z(e){var t,a,n=e.match(P);for(t=0,a=n.length;t<a;t++)$[n[t]]?n[t]=$[n[t]]:n[t]=j(n[t]);return function(t){var i,r="";for(i=0;i<a;i++)r+=C(n[i])?n[i].call(t,e):n[i];return r}}function W(e,t){return e.isValid()?(t=Y(t,e.localeData()),O[t]=O[t]||z(t),O[t](e)):e.localeData().invalidDate()}function Y(e,t){var a=5;function n(e){return t.longDateFormat(e)||e}for(B.lastIndex=0;a>=0&&B.test(e);)e=e.replace(B,n),B.lastIndex=0,a-=1;return e}var H={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function G(e){var t=this._longDateFormat[e],a=this._longDateFormat[e.toUpperCase()];return t||!a?t:(this._longDateFormat[e]=a.match(P).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])}var q="Invalid date";function Z(){return this._invalidDate}var J="%d",K=/\d{1,2}/;function X(e){return this._ordinal.replace("%d",e)}var Q={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function ee(e,t,a,n){var i=this._relativeTime[a];return C(i)?i(e,t,a,n):i.replace(/%d/i,e)}function te(e,t){var a=this._relativeTime[e>0?"future":"past"];return C(a)?a(t):a.replace(/%s/i,t)}var ae={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function ne(e){return"string"==typeof e?ae[e]||ae[e.toLowerCase()]:void 0}function ie(e){var t,a,n={};for(a in e)o(e,a)&&(t=ne(a))&&(n[t]=e[a]);return n}var re={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function se(e){var t,a=[];for(t in e)o(e,t)&&a.push({unit:t,priority:re[t]});return a.sort((function(e,t){return e.priority-t.priority})),a}var oe,le=/\d/,ue=/\d\d/,ce=/\d{3}/,de=/\d{4}/,pe=/[+-]?\d{6}/,he=/\d\d?/,fe=/\d\d\d\d?/,me=/\d\d\d\d\d\d?/,ye=/\d{1,3}/,ge=/\d{1,4}/,be=/[+-]?\d{1,6}/,ve=/\d+/,_e=/[+-]?\d+/,we=/Z|[+-]\d\d:?\d\d/gi,Ae=/Z|[+-]\d\d(?::?\d\d)?/gi,ke=/[+-]?\d+(\.\d{1,3})?/,Se=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Ne=/^[1-9]\d?/,Te=/^([1-9]\d|\d)/;function Me(e,t,a){oe[e]=C(t)?t:function(e,n){return e&&a?a:t}}function xe(e,t){return o(oe,e)?oe[e](t._strict,t._locale):new RegExp(Ce(e))}function Ce(e){return Ie(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,a,n,i){return t||a||n||i})))}function Ie(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Ve(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function Ee(e){var t=+e,a=0;return 0!==t&&isFinite(t)&&(a=Ve(t)),a}oe={};var Fe={};function De(e,t){var a,n,i=t;for("string"==typeof e&&(e=[e]),c(t)&&(i=function(e,a){a[t]=Ee(e)}),n=e.length,a=0;a<n;a++)Fe[e[a]]=i}function Re(e,t){De(e,(function(e,a,n,i){n._w=n._w||{},t(e,n._w,n,i)}))}function Le(e,t,a){null!=t&&o(Fe,e)&&Fe[e](t,a._a,a,e)}function Pe(e){return e%4==0&&e%100!=0||e%400==0}var Be=0,Oe=1,$e=2,Ue=3,je=4,ze=5,We=6,Ye=7,He=8;function Ge(e){return Pe(e)?366:365}U("Y",0,0,(function(){var e=this.year();return e<=9999?L(e,4):"+"+e})),U(0,["YY",2],0,(function(){return this.year()%100})),U(0,["YYYY",4],0,"year"),U(0,["YYYYY",5],0,"year"),U(0,["YYYYYY",6,!0],0,"year"),Me("Y",_e),Me("YY",he,ue),Me("YYYY",ge,de),Me("YYYYY",be,pe),Me("YYYYYY",be,pe),De(["YYYYY","YYYYYY"],Be),De("YYYY",(function(e,t){t[Be]=2===e.length?n.parseTwoDigitYear(e):Ee(e)})),De("YY",(function(e,t){t[Be]=n.parseTwoDigitYear(e)})),De("Y",(function(e,t){t[Be]=parseInt(e,10)})),n.parseTwoDigitYear=function(e){return Ee(e)+(Ee(e)>68?1900:2e3)};var qe,Ze=Ke("FullYear",!0);function Je(){return Pe(this.year())}function Ke(e,t){return function(a){return null!=a?(Qe(this,e,a),n.updateOffset(this,t),this):Xe(this,e)}}function Xe(e,t){if(!e.isValid())return NaN;var a=e._d,n=e._isUTC;switch(t){case"Milliseconds":return n?a.getUTCMilliseconds():a.getMilliseconds();case"Seconds":return n?a.getUTCSeconds():a.getSeconds();case"Minutes":return n?a.getUTCMinutes():a.getMinutes();case"Hours":return n?a.getUTCHours():a.getHours();case"Date":return n?a.getUTCDate():a.getDate();case"Day":return n?a.getUTCDay():a.getDay();case"Month":return n?a.getUTCMonth():a.getMonth();case"FullYear":return n?a.getUTCFullYear():a.getFullYear();default:return NaN}}function Qe(e,t,a){var n,i,r,s,o;if(e.isValid()&&!isNaN(a)){switch(n=e._d,i=e._isUTC,t){case"Milliseconds":return void(i?n.setUTCMilliseconds(a):n.setMilliseconds(a));case"Seconds":return void(i?n.setUTCSeconds(a):n.setSeconds(a));case"Minutes":return void(i?n.setUTCMinutes(a):n.setMinutes(a));case"Hours":return void(i?n.setUTCHours(a):n.setHours(a));case"Date":return void(i?n.setUTCDate(a):n.setDate(a));case"FullYear":break;default:return}r=a,s=e.month(),o=29!==(o=e.date())||1!==s||Pe(r)?o:28,i?n.setUTCFullYear(r,s,o):n.setFullYear(r,s,o)}}function et(e){return C(this[e=ne(e)])?this[e]():this}function tt(e,t){if("object"==typeof e){var a,n=se(e=ie(e)),i=n.length;for(a=0;a<i;a++)this[n[a].unit](e[n[a].unit])}else if(C(this[e=ne(e)]))return this[e](t);return this}function at(e,t){return(e%t+t)%t}function nt(e,t){if(isNaN(e)||isNaN(t))return NaN;var a=at(t,12);return e+=(t-a)/12,1===a?Pe(e)?29:28:31-a%7%2}qe=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},U("M",["MM",2],"Mo",(function(){return this.month()+1})),U("MMM",0,0,(function(e){return this.localeData().monthsShort(this,e)})),U("MMMM",0,0,(function(e){return this.localeData().months(this,e)})),Me("M",he,Ne),Me("MM",he,ue),Me("MMM",(function(e,t){return t.monthsShortRegex(e)})),Me("MMMM",(function(e,t){return t.monthsRegex(e)})),De(["M","MM"],(function(e,t){t[Oe]=Ee(e)-1})),De(["MMM","MMMM"],(function(e,t,a,n){var i=a._locale.monthsParse(e,n,a._strict);null!=i?t[Oe]=i:y(a).invalidMonth=e}));var it="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),rt="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),st=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,ot=Se,lt=Se;function ut(e,t){return e?r(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||st).test(t)?"format":"standalone"][e.month()]:r(this._months)?this._months:this._months.standalone}function ct(e,t){return e?r(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[st.test(t)?"format":"standalone"][e.month()]:r(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function dt(e,t,a){var n,i,r,s=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)r=f([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(r,"").toLocaleLowerCase();return a?"MMM"===t?-1!==(i=qe.call(this._shortMonthsParse,s))?i:null:-1!==(i=qe.call(this._longMonthsParse,s))?i:null:"MMM"===t?-1!==(i=qe.call(this._shortMonthsParse,s))||-1!==(i=qe.call(this._longMonthsParse,s))?i:null:-1!==(i=qe.call(this._longMonthsParse,s))||-1!==(i=qe.call(this._shortMonthsParse,s))?i:null}function pt(e,t,a){var n,i,r;if(this._monthsParseExact)return dt.call(this,e,t,a);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(i=f([2e3,n]),a&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),a||this._monthsParse[n]||(r="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[n]=new RegExp(r.replace(".",""),"i")),a&&"MMMM"===t&&this._longMonthsParse[n].test(e))return n;if(a&&"MMM"===t&&this._shortMonthsParse[n].test(e))return n;if(!a&&this._monthsParse[n].test(e))return n}}function ht(e,t){if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=Ee(t);else if(!c(t=e.localeData().monthsParse(t)))return e;var a=t,n=e.date();return n=n<29?n:Math.min(n,nt(e.year(),a)),e._isUTC?e._d.setUTCMonth(a,n):e._d.setMonth(a,n),e}function ft(e){return null!=e?(ht(this,e),n.updateOffset(this,!0),this):Xe(this,"Month")}function mt(){return nt(this.year(),this.month())}function yt(e){return this._monthsParseExact?(o(this,"_monthsRegex")||bt.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(o(this,"_monthsShortRegex")||(this._monthsShortRegex=ot),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function gt(e){return this._monthsParseExact?(o(this,"_monthsRegex")||bt.call(this),e?this._monthsStrictRegex:this._monthsRegex):(o(this,"_monthsRegex")||(this._monthsRegex=lt),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function bt(){function e(e,t){return t.length-e.length}var t,a,n,i,r=[],s=[],o=[];for(t=0;t<12;t++)a=f([2e3,t]),n=Ie(this.monthsShort(a,"")),i=Ie(this.months(a,"")),r.push(n),s.push(i),o.push(i),o.push(n);r.sort(e),s.sort(e),o.sort(e),this._monthsRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")","i")}function vt(e,t,a,n,i,r,s){var o;return e<100&&e>=0?(o=new Date(e+400,t,a,n,i,r,s),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,a,n,i,r,s),o}function _t(e){var t,a;return e<100&&e>=0?((a=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,a)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function wt(e,t,a){var n=7+t-a;return-(7+_t(e,0,n).getUTCDay()-t)%7+n-1}function At(e,t,a,n,i){var r,s,o=1+7*(t-1)+(7+a-n)%7+wt(e,n,i);return o<=0?s=Ge(r=e-1)+o:o>Ge(e)?(r=e+1,s=o-Ge(e)):(r=e,s=o),{year:r,dayOfYear:s}}function kt(e,t,a){var n,i,r=wt(e.year(),t,a),s=Math.floor((e.dayOfYear()-r-1)/7)+1;return s<1?n=s+St(i=e.year()-1,t,a):s>St(e.year(),t,a)?(n=s-St(e.year(),t,a),i=e.year()+1):(i=e.year(),n=s),{week:n,year:i}}function St(e,t,a){var n=wt(e,t,a),i=wt(e+1,t,a);return(Ge(e)-n+i)/7}function Nt(e){return kt(e,this._week.dow,this._week.doy).week}U("w",["ww",2],"wo","week"),U("W",["WW",2],"Wo","isoWeek"),Me("w",he,Ne),Me("ww",he,ue),Me("W",he,Ne),Me("WW",he,ue),Re(["w","ww","W","WW"],(function(e,t,a,n){t[n.substr(0,1)]=Ee(e)}));var Tt={dow:0,doy:6};function Mt(){return this._week.dow}function xt(){return this._week.doy}function Ct(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function It(e){var t=kt(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function Vt(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}function Et(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Ft(e,t){return e.slice(t,7).concat(e.slice(0,t))}U("d",0,"do","day"),U("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),U("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),U("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),U("e",0,0,"weekday"),U("E",0,0,"isoWeekday"),Me("d",he),Me("e",he),Me("E",he),Me("dd",(function(e,t){return t.weekdaysMinRegex(e)})),Me("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),Me("dddd",(function(e,t){return t.weekdaysRegex(e)})),Re(["dd","ddd","dddd"],(function(e,t,a,n){var i=a._locale.weekdaysParse(e,n,a._strict);null!=i?t.d=i:y(a).invalidWeekday=e})),Re(["d","e","E"],(function(e,t,a,n){t[n]=Ee(e)}));var Dt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Rt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Lt="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Pt=Se,Bt=Se,Ot=Se;function $t(e,t){var a=r(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Ft(a,this._week.dow):e?a[e.day()]:a}function Ut(e){return!0===e?Ft(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function jt(e){return!0===e?Ft(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function zt(e,t,a){var n,i,r,s=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)r=f([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(r,"").toLocaleLowerCase();return a?"dddd"===t?-1!==(i=qe.call(this._weekdaysParse,s))?i:null:"ddd"===t?-1!==(i=qe.call(this._shortWeekdaysParse,s))?i:null:-1!==(i=qe.call(this._minWeekdaysParse,s))?i:null:"dddd"===t?-1!==(i=qe.call(this._weekdaysParse,s))||-1!==(i=qe.call(this._shortWeekdaysParse,s))||-1!==(i=qe.call(this._minWeekdaysParse,s))?i:null:"ddd"===t?-1!==(i=qe.call(this._shortWeekdaysParse,s))||-1!==(i=qe.call(this._weekdaysParse,s))||-1!==(i=qe.call(this._minWeekdaysParse,s))?i:null:-1!==(i=qe.call(this._minWeekdaysParse,s))||-1!==(i=qe.call(this._weekdaysParse,s))||-1!==(i=qe.call(this._shortWeekdaysParse,s))?i:null}function Wt(e,t,a){var n,i,r;if(this._weekdaysParseExact)return zt.call(this,e,t,a);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(i=f([2e3,1]).day(n),a&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(r="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[n]=new RegExp(r.replace(".",""),"i")),a&&"dddd"===t&&this._fullWeekdaysParse[n].test(e))return n;if(a&&"ddd"===t&&this._shortWeekdaysParse[n].test(e))return n;if(a&&"dd"===t&&this._minWeekdaysParse[n].test(e))return n;if(!a&&this._weekdaysParse[n].test(e))return n}}function Yt(e){if(!this.isValid())return null!=e?this:NaN;var t=Xe(this,"Day");return null!=e?(e=Vt(e,this.localeData()),this.add(e-t,"d")):t}function Ht(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function Gt(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=Et(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function qt(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||Kt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(o(this,"_weekdaysRegex")||(this._weekdaysRegex=Pt),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function Zt(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||Kt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(o(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Bt),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Jt(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||Kt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(o(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ot),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Kt(){function e(e,t){return t.length-e.length}var t,a,n,i,r,s=[],o=[],l=[],u=[];for(t=0;t<7;t++)a=f([2e3,1]).day(t),n=Ie(this.weekdaysMin(a,"")),i=Ie(this.weekdaysShort(a,"")),r=Ie(this.weekdays(a,"")),s.push(n),o.push(i),l.push(r),u.push(n),u.push(i),u.push(r);s.sort(e),o.sort(e),l.sort(e),u.sort(e),this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Xt(){return this.hours()%12||12}function Qt(){return this.hours()||24}function ea(e,t){U(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function ta(e,t){return t._meridiemParse}function aa(e){return"p"===(e+"").toLowerCase().charAt(0)}U("H",["HH",2],0,"hour"),U("h",["hh",2],0,Xt),U("k",["kk",2],0,Qt),U("hmm",0,0,(function(){return""+Xt.apply(this)+L(this.minutes(),2)})),U("hmmss",0,0,(function(){return""+Xt.apply(this)+L(this.minutes(),2)+L(this.seconds(),2)})),U("Hmm",0,0,(function(){return""+this.hours()+L(this.minutes(),2)})),U("Hmmss",0,0,(function(){return""+this.hours()+L(this.minutes(),2)+L(this.seconds(),2)})),ea("a",!0),ea("A",!1),Me("a",ta),Me("A",ta),Me("H",he,Te),Me("h",he,Ne),Me("k",he,Ne),Me("HH",he,ue),Me("hh",he,ue),Me("kk",he,ue),Me("hmm",fe),Me("hmmss",me),Me("Hmm",fe),Me("Hmmss",me),De(["H","HH"],Ue),De(["k","kk"],(function(e,t,a){var n=Ee(e);t[Ue]=24===n?0:n})),De(["a","A"],(function(e,t,a){a._isPm=a._locale.isPM(e),a._meridiem=e})),De(["h","hh"],(function(e,t,a){t[Ue]=Ee(e),y(a).bigHour=!0})),De("hmm",(function(e,t,a){var n=e.length-2;t[Ue]=Ee(e.substr(0,n)),t[je]=Ee(e.substr(n)),y(a).bigHour=!0})),De("hmmss",(function(e,t,a){var n=e.length-4,i=e.length-2;t[Ue]=Ee(e.substr(0,n)),t[je]=Ee(e.substr(n,2)),t[ze]=Ee(e.substr(i)),y(a).bigHour=!0})),De("Hmm",(function(e,t,a){var n=e.length-2;t[Ue]=Ee(e.substr(0,n)),t[je]=Ee(e.substr(n))})),De("Hmmss",(function(e,t,a){var n=e.length-4,i=e.length-2;t[Ue]=Ee(e.substr(0,n)),t[je]=Ee(e.substr(n,2)),t[ze]=Ee(e.substr(i))}));var na=/[ap]\.?m?\.?/i,ia=Ke("Hours",!0);function ra(e,t,a){return e>11?a?"pm":"PM":a?"am":"AM"}var sa,oa={calendar:D,longDateFormat:H,invalidDate:q,ordinal:J,dayOfMonthOrdinalParse:K,relativeTime:Q,months:it,monthsShort:rt,week:Tt,weekdays:Dt,weekdaysMin:Lt,weekdaysShort:Rt,meridiemParse:na},la={},ua={};function ca(e,t){var a,n=Math.min(e.length,t.length);for(a=0;a<n;a+=1)if(e[a]!==t[a])return a;return n}function da(e){return e?e.toLowerCase().replace("_","-"):e}function pa(e){for(var t,a,n,i,r=0;r<e.length;){for(t=(i=da(e[r]).split("-")).length,a=(a=da(e[r+1]))?a.split("-"):null;t>0;){if(n=fa(i.slice(0,t).join("-")))return n;if(a&&a.length>=t&&ca(i,a)>=t-1)break;t--}r++}return sa}function ha(e){return!(!e||!e.match("^[^/\\\\]*$"))}function fa(t){var a=null;if(void 0===la[t]&&e&&e.exports&&ha(t))try{a=sa._abbr,E("./locale/"+t),ma(a)}catch(e){la[t]=null}return la[t]}function ma(e,t){var a;return e&&((a=u(t)?ba(e):ya(e,t))?sa=a:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),sa._abbr}function ya(e,t){if(null!==t){var a,n=oa;if(t.abbr=e,null!=la[e])x("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=la[e]._config;else if(null!=t.parentLocale)if(null!=la[t.parentLocale])n=la[t.parentLocale]._config;else{if(null==(a=fa(t.parentLocale)))return ua[t.parentLocale]||(ua[t.parentLocale]=[]),ua[t.parentLocale].push({name:e,config:t}),null;n=a._config}return la[e]=new F(V(n,t)),ua[e]&&ua[e].forEach((function(e){ya(e.name,e.config)})),ma(e),la[e]}return delete la[e],null}function ga(e,t){if(null!=t){var a,n,i=oa;null!=la[e]&&null!=la[e].parentLocale?la[e].set(V(la[e]._config,t)):(null!=(n=fa(e))&&(i=n._config),t=V(i,t),null==n&&(t.abbr=e),(a=new F(t)).parentLocale=la[e],la[e]=a),ma(e)}else null!=la[e]&&(null!=la[e].parentLocale?(la[e]=la[e].parentLocale,e===ma()&&ma(e)):null!=la[e]&&delete la[e]);return la[e]}function ba(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return sa;if(!r(e)){if(t=fa(e))return t;e=[e]}return pa(e)}function va(){return T(la)}function _a(e){var t,a=e._a;return a&&-2===y(e).overflow&&(t=a[Oe]<0||a[Oe]>11?Oe:a[$e]<1||a[$e]>nt(a[Be],a[Oe])?$e:a[Ue]<0||a[Ue]>24||24===a[Ue]&&(0!==a[je]||0!==a[ze]||0!==a[We])?Ue:a[je]<0||a[je]>59?je:a[ze]<0||a[ze]>59?ze:a[We]<0||a[We]>999?We:-1,y(e)._overflowDayOfYear&&(t<Be||t>$e)&&(t=$e),y(e)._overflowWeeks&&-1===t&&(t=Ye),y(e)._overflowWeekday&&-1===t&&(t=He),y(e).overflow=t),e}var wa=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Aa=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ka=/Z|[+-]\d\d(?::?\d\d)?/,Sa=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Na=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Ta=/^\/?Date\((-?\d+)/i,Ma=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,xa={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ca(e){var t,a,n,i,r,s,o=e._i,l=wa.exec(o)||Aa.exec(o),u=Sa.length,c=Na.length;if(l){for(y(e).iso=!0,t=0,a=u;t<a;t++)if(Sa[t][1].exec(l[1])){i=Sa[t][0],n=!1!==Sa[t][2];break}if(null==i)return void(e._isValid=!1);if(l[3]){for(t=0,a=c;t<a;t++)if(Na[t][1].exec(l[3])){r=(l[2]||" ")+Na[t][0];break}if(null==r)return void(e._isValid=!1)}if(!n&&null!=r)return void(e._isValid=!1);if(l[4]){if(!ka.exec(l[4]))return void(e._isValid=!1);s="Z"}e._f=i+(r||"")+(s||""),Ua(e)}else e._isValid=!1}function Ia(e,t,a,n,i,r){var s=[Va(e),rt.indexOf(t),parseInt(a,10),parseInt(n,10),parseInt(i,10)];return r&&s.push(parseInt(r,10)),s}function Va(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function Ea(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Fa(e,t,a){return!e||Rt.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(y(a).weekdayMismatch=!0,a._isValid=!1,!1)}function Da(e,t,a){if(e)return xa[e];if(t)return 0;var n=parseInt(a,10),i=n%100;return(n-i)/100*60+i}function Ra(e){var t,a=Ma.exec(Ea(e._i));if(a){if(t=Ia(a[4],a[3],a[2],a[5],a[6],a[7]),!Fa(a[1],t,e))return;e._a=t,e._tzm=Da(a[8],a[9],a[10]),e._d=_t.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),y(e).rfc2822=!0}else e._isValid=!1}function La(e){var t=Ta.exec(e._i);null===t?(Ca(e),!1===e._isValid&&(delete e._isValid,Ra(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:n.createFromInputFallback(e)))):e._d=new Date(+t[1])}function Pa(e,t,a){return null!=e?e:null!=t?t:a}function Ba(e){var t=new Date(n.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Oa(e){var t,a,n,i,r,s=[];if(!e._d){for(n=Ba(e),e._w&&null==e._a[$e]&&null==e._a[Oe]&&$a(e),null!=e._dayOfYear&&(r=Pa(e._a[Be],n[Be]),(e._dayOfYear>Ge(r)||0===e._dayOfYear)&&(y(e)._overflowDayOfYear=!0),a=_t(r,0,e._dayOfYear),e._a[Oe]=a.getUTCMonth(),e._a[$e]=a.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=s[t]=n[t];for(;t<7;t++)e._a[t]=s[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[Ue]&&0===e._a[je]&&0===e._a[ze]&&0===e._a[We]&&(e._nextDay=!0,e._a[Ue]=0),e._d=(e._useUTC?_t:vt).apply(null,s),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Ue]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(y(e).weekdayMismatch=!0)}}function $a(e){var t,a,n,i,r,s,o,l,u;null!=(t=e._w).GG||null!=t.W||null!=t.E?(r=1,s=4,a=Pa(t.GG,e._a[Be],kt(Za(),1,4).year),n=Pa(t.W,1),((i=Pa(t.E,1))<1||i>7)&&(l=!0)):(r=e._locale._week.dow,s=e._locale._week.doy,u=kt(Za(),r,s),a=Pa(t.gg,e._a[Be],u.year),n=Pa(t.w,u.week),null!=t.d?((i=t.d)<0||i>6)&&(l=!0):null!=t.e?(i=t.e+r,(t.e<0||t.e>6)&&(l=!0)):i=r),n<1||n>St(a,r,s)?y(e)._overflowWeeks=!0:null!=l?y(e)._overflowWeekday=!0:(o=At(a,n,i,r,s),e._a[Be]=o.year,e._dayOfYear=o.dayOfYear)}function Ua(e){if(e._f!==n.ISO_8601)if(e._f!==n.RFC_2822){e._a=[],y(e).empty=!0;var t,a,i,r,s,o,l,u=""+e._i,c=u.length,d=0;for(l=(i=Y(e._f,e._locale).match(P)||[]).length,t=0;t<l;t++)r=i[t],(a=(u.match(xe(r,e))||[])[0])&&((s=u.substr(0,u.indexOf(a))).length>0&&y(e).unusedInput.push(s),u=u.slice(u.indexOf(a)+a.length),d+=a.length),$[r]?(a?y(e).empty=!1:y(e).unusedTokens.push(r),Le(r,a,e)):e._strict&&!a&&y(e).unusedTokens.push(r);y(e).charsLeftOver=c-d,u.length>0&&y(e).unusedInput.push(u),e._a[Ue]<=12&&!0===y(e).bigHour&&e._a[Ue]>0&&(y(e).bigHour=void 0),y(e).parsedDateParts=e._a.slice(0),y(e).meridiem=e._meridiem,e._a[Ue]=ja(e._locale,e._a[Ue],e._meridiem),null!==(o=y(e).era)&&(e._a[Be]=e._locale.erasConvertYear(o,e._a[Be])),Oa(e),_a(e)}else Ra(e);else Ca(e)}function ja(e,t,a){var n;return null==a?t:null!=e.meridiemHour?e.meridiemHour(t,a):null!=e.isPM?((n=e.isPM(a))&&t<12&&(t+=12),n||12!==t||(t=0),t):t}function za(e){var t,a,n,i,r,s,o=!1,l=e._f.length;if(0===l)return y(e).invalidFormat=!0,void(e._d=new Date(NaN));for(i=0;i<l;i++)r=0,s=!1,t=w({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],Ua(t),g(t)&&(s=!0),r+=y(t).charsLeftOver,r+=10*y(t).unusedTokens.length,y(t).score=r,o?r<n&&(n=r,a=t):(null==n||r<n||s)&&(n=r,a=t,s&&(o=!0));h(e,a||t)}function Wa(e){if(!e._d){var t=ie(e._i),a=void 0===t.day?t.date:t.day;e._a=p([t.year,t.month,a,t.hour,t.minute,t.second,t.millisecond],(function(e){return e&&parseInt(e,10)})),Oa(e)}}function Ya(e){var t=new A(_a(Ha(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Ha(e){var t=e._i,a=e._f;return e._locale=e._locale||ba(e._l),null===t||void 0===a&&""===t?b({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),k(t)?new A(_a(t)):(d(t)?e._d=t:r(a)?za(e):a?Ua(e):Ga(e),g(e)||(e._d=null),e))}function Ga(e){var t=e._i;u(t)?e._d=new Date(n.now()):d(t)?e._d=new Date(t.valueOf()):"string"==typeof t?La(e):r(t)?(e._a=p(t.slice(0),(function(e){return parseInt(e,10)})),Oa(e)):s(t)?Wa(e):c(t)?e._d=new Date(t):n.createFromInputFallback(e)}function qa(e,t,a,n,i){var o={};return!0!==t&&!1!==t||(n=t,t=void 0),!0!==a&&!1!==a||(n=a,a=void 0),(s(e)&&l(e)||r(e)&&0===e.length)&&(e=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=i,o._l=a,o._i=e,o._f=t,o._strict=n,Ya(o)}function Za(e,t,a,n){return qa(e,t,a,n,!1)}n.createFromInputFallback=N("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",(function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))})),n.ISO_8601=function(){},n.RFC_2822=function(){};var Ja=N("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Za.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:b()})),Ka=N("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Za.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:b()}));function Xa(e,t){var a,n;if(1===t.length&&r(t[0])&&(t=t[0]),!t.length)return Za();for(a=t[0],n=1;n<t.length;++n)t[n].isValid()&&!t[n][e](a)||(a=t[n]);return a}function Qa(){return Xa("isBefore",[].slice.call(arguments,0))}function en(){return Xa("isAfter",[].slice.call(arguments,0))}var tn=function(){return Date.now?Date.now():+new Date},an=["year","quarter","month","week","day","hour","minute","second","millisecond"];function nn(e){var t,a,n=!1,i=an.length;for(t in e)if(o(e,t)&&(-1===qe.call(an,t)||null!=e[t]&&isNaN(e[t])))return!1;for(a=0;a<i;++a)if(e[an[a]]){if(n)return!1;parseFloat(e[an[a]])!==Ee(e[an[a]])&&(n=!0)}return!0}function rn(){return this._isValid}function sn(){return Cn(NaN)}function on(e){var t=ie(e),a=t.year||0,n=t.quarter||0,i=t.month||0,r=t.week||t.isoWeek||0,s=t.day||0,o=t.hour||0,l=t.minute||0,u=t.second||0,c=t.millisecond||0;this._isValid=nn(t),this._milliseconds=+c+1e3*u+6e4*l+1e3*o*60*60,this._days=+s+7*r,this._months=+i+3*n+12*a,this._data={},this._locale=ba(),this._bubble()}function ln(e){return e instanceof on}function un(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function cn(e,t,a){var n,i=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),s=0;for(n=0;n<i;n++)Ee(e[n])!==Ee(t[n])&&s++;return s+r}function dn(e,t){U(e,0,0,(function(){var e=this.utcOffset(),a="+";return e<0&&(e=-e,a="-"),a+L(~~(e/60),2)+t+L(~~e%60,2)}))}dn("Z",":"),dn("ZZ",""),Me("Z",Ae),Me("ZZ",Ae),De(["Z","ZZ"],(function(e,t,a){a._useUTC=!0,a._tzm=hn(Ae,e)}));var pn=/([\+\-]|\d\d)/gi;function hn(e,t){var a,n,i=(t||"").match(e);return null===i?null:0===(n=60*(a=((i[i.length-1]||[])+"").match(pn)||["-",0,0])[1]+Ee(a[2]))?0:"+"===a[0]?n:-n}function fn(e,t){var a,i;return t._isUTC?(a=t.clone(),i=(k(e)||d(e)?e.valueOf():Za(e).valueOf())-a.valueOf(),a._d.setTime(a._d.valueOf()+i),n.updateOffset(a,!1),a):Za(e).local()}function mn(e){return-Math.round(e._d.getTimezoneOffset())}function yn(e,t,a){var i,r=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=hn(Ae,e)))return this}else Math.abs(e)<16&&!a&&(e*=60);return!this._isUTC&&t&&(i=mn(this)),this._offset=e,this._isUTC=!0,null!=i&&this.add(i,"m"),r!==e&&(!t||this._changeInProgress?Dn(this,Cn(e-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,n.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?r:mn(this)}function gn(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function bn(e){return this.utcOffset(0,e)}function vn(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(mn(this),"m")),this}function _n(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=hn(we,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this}function wn(e){return!!this.isValid()&&(e=e?Za(e).utcOffset():0,(this.utcOffset()-e)%60==0)}function An(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function kn(){if(!u(this._isDSTShifted))return this._isDSTShifted;var e,t={};return w(t,this),(t=Ha(t))._a?(e=t._isUTC?f(t._a):Za(t._a),this._isDSTShifted=this.isValid()&&cn(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Sn(){return!!this.isValid()&&!this._isUTC}function Nn(){return!!this.isValid()&&this._isUTC}function Tn(){return!!this.isValid()&&this._isUTC&&0===this._offset}n.updateOffset=function(){};var Mn=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,xn=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Cn(e,t){var a,n,i,r=e,s=null;return ln(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:c(e)||!isNaN(+e)?(r={},t?r[t]=+e:r.milliseconds=+e):(s=Mn.exec(e))?(a="-"===s[1]?-1:1,r={y:0,d:Ee(s[$e])*a,h:Ee(s[Ue])*a,m:Ee(s[je])*a,s:Ee(s[ze])*a,ms:Ee(un(1e3*s[We]))*a}):(s=xn.exec(e))?(a="-"===s[1]?-1:1,r={y:In(s[2],a),M:In(s[3],a),w:In(s[4],a),d:In(s[5],a),h:In(s[6],a),m:In(s[7],a),s:In(s[8],a)}):null==r?r={}:"object"==typeof r&&("from"in r||"to"in r)&&(i=En(Za(r.from),Za(r.to)),(r={}).ms=i.milliseconds,r.M=i.months),n=new on(r),ln(e)&&o(e,"_locale")&&(n._locale=e._locale),ln(e)&&o(e,"_isValid")&&(n._isValid=e._isValid),n}function In(e,t){var a=e&&parseFloat(e.replace(",","."));return(isNaN(a)?0:a)*t}function Vn(e,t){var a={};return a.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(a.months,"M").isAfter(t)&&--a.months,a.milliseconds=+t-+e.clone().add(a.months,"M"),a}function En(e,t){var a;return e.isValid()&&t.isValid()?(t=fn(t,e),e.isBefore(t)?a=Vn(e,t):((a=Vn(t,e)).milliseconds=-a.milliseconds,a.months=-a.months),a):{milliseconds:0,months:0}}function Fn(e,t){return function(a,n){var i;return null===n||isNaN(+n)||(x(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=a,a=n,n=i),Dn(this,Cn(a,n),e),this}}function Dn(e,t,a,i){var r=t._milliseconds,s=un(t._days),o=un(t._months);e.isValid()&&(i=null==i||i,o&&ht(e,Xe(e,"Month")+o*a),s&&Qe(e,"Date",Xe(e,"Date")+s*a),r&&e._d.setTime(e._d.valueOf()+r*a),i&&n.updateOffset(e,s||o))}Cn.fn=on.prototype,Cn.invalid=sn;var Rn=Fn(1,"add"),Ln=Fn(-1,"subtract");function Pn(e){return"string"==typeof e||e instanceof String}function Bn(e){return k(e)||d(e)||Pn(e)||c(e)||$n(e)||On(e)||null==e}function On(e){var t,a,n=s(e)&&!l(e),i=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],u=r.length;for(t=0;t<u;t+=1)a=r[t],i=i||o(e,a);return n&&i}function $n(e){var t=r(e),a=!1;return t&&(a=0===e.filter((function(t){return!c(t)&&Pn(e)})).length),t&&a}function Un(e){var t,a,n=s(e)&&!l(e),i=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<r.length;t+=1)a=r[t],i=i||o(e,a);return n&&i}function jn(e,t){var a=e.diff(t,"days",!0);return a<-6?"sameElse":a<-1?"lastWeek":a<0?"lastDay":a<1?"sameDay":a<2?"nextDay":a<7?"nextWeek":"sameElse"}function zn(e,t){1===arguments.length&&(arguments[0]?Bn(arguments[0])?(e=arguments[0],t=void 0):Un(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var a=e||Za(),i=fn(a,this).startOf("day"),r=n.calendarFormat(this,i)||"sameElse",s=t&&(C(t[r])?t[r].call(this,a):t[r]);return this.format(s||this.localeData().calendar(r,this,Za(a)))}function Wn(){return new A(this)}function Yn(e,t){var a=k(e)?e:Za(e);return!(!this.isValid()||!a.isValid())&&("millisecond"===(t=ne(t)||"millisecond")?this.valueOf()>a.valueOf():a.valueOf()<this.clone().startOf(t).valueOf())}function Hn(e,t){var a=k(e)?e:Za(e);return!(!this.isValid()||!a.isValid())&&("millisecond"===(t=ne(t)||"millisecond")?this.valueOf()<a.valueOf():this.clone().endOf(t).valueOf()<a.valueOf())}function Gn(e,t,a,n){var i=k(e)?e:Za(e),r=k(t)?t:Za(t);return!!(this.isValid()&&i.isValid()&&r.isValid())&&("("===(n=n||"()")[0]?this.isAfter(i,a):!this.isBefore(i,a))&&(")"===n[1]?this.isBefore(r,a):!this.isAfter(r,a))}function qn(e,t){var a,n=k(e)?e:Za(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=ne(t)||"millisecond")?this.valueOf()===n.valueOf():(a=n.valueOf(),this.clone().startOf(t).valueOf()<=a&&a<=this.clone().endOf(t).valueOf()))}function Zn(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Jn(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Kn(e,t,a){var n,i,r;if(!this.isValid())return NaN;if(!(n=fn(e,this)).isValid())return NaN;switch(i=6e4*(n.utcOffset()-this.utcOffset()),t=ne(t)){case"year":r=Xn(this,n)/12;break;case"month":r=Xn(this,n);break;case"quarter":r=Xn(this,n)/3;break;case"second":r=(this-n)/1e3;break;case"minute":r=(this-n)/6e4;break;case"hour":r=(this-n)/36e5;break;case"day":r=(this-n-i)/864e5;break;case"week":r=(this-n-i)/6048e5;break;default:r=this-n}return a?r:Ve(r)}function Xn(e,t){if(e.date()<t.date())return-Xn(t,e);var a=12*(t.year()-e.year())+(t.month()-e.month()),n=e.clone().add(a,"months");return-(a+(t-n<0?(t-n)/(n-e.clone().add(a-1,"months")):(t-n)/(e.clone().add(a+1,"months")-n)))||0}function Qn(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ei(e){if(!this.isValid())return null;var t=!0!==e,a=t?this.clone().utc():this;return a.year()<0||a.year()>9999?W(a,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):C(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",W(a,"Z")):W(a,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function ti(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,a,n,i="moment",r="";return this.isLocal()||(i=0===this.utcOffset()?"moment.utc":"moment.parseZone",r="Z"),e="["+i+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a="-MM-DD[T]HH:mm:ss.SSS",n=r+'[")]',this.format(e+t+a+n)}function ai(e){e||(e=this.isUtc()?n.defaultFormatUtc:n.defaultFormat);var t=W(this,e);return this.localeData().postformat(t)}function ni(e,t){return this.isValid()&&(k(e)&&e.isValid()||Za(e).isValid())?Cn({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ii(e){return this.from(Za(),e)}function ri(e,t){return this.isValid()&&(k(e)&&e.isValid()||Za(e).isValid())?Cn({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function si(e){return this.to(Za(),e)}function oi(e){var t;return void 0===e?this._locale._abbr:(null!=(t=ba(e))&&(this._locale=t),this)}n.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",n.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var li=N("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(e){return void 0===e?this.localeData():this.locale(e)}));function ui(){return this._locale}var ci=1e3,di=60*ci,pi=60*di,hi=3506328*pi;function fi(e,t){return(e%t+t)%t}function mi(e,t,a){return e<100&&e>=0?new Date(e+400,t,a)-hi:new Date(e,t,a).valueOf()}function yi(e,t,a){return e<100&&e>=0?Date.UTC(e+400,t,a)-hi:Date.UTC(e,t,a)}function gi(e){var t,a;if(void 0===(e=ne(e))||"millisecond"===e||!this.isValid())return this;switch(a=this._isUTC?yi:mi,e){case"year":t=a(this.year(),0,1);break;case"quarter":t=a(this.year(),this.month()-this.month()%3,1);break;case"month":t=a(this.year(),this.month(),1);break;case"week":t=a(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=a(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=a(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=fi(t+(this._isUTC?0:this.utcOffset()*di),pi);break;case"minute":t=this._d.valueOf(),t-=fi(t,di);break;case"second":t=this._d.valueOf(),t-=fi(t,ci)}return this._d.setTime(t),n.updateOffset(this,!0),this}function bi(e){var t,a;if(void 0===(e=ne(e))||"millisecond"===e||!this.isValid())return this;switch(a=this._isUTC?yi:mi,e){case"year":t=a(this.year()+1,0,1)-1;break;case"quarter":t=a(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=a(this.year(),this.month()+1,1)-1;break;case"week":t=a(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=a(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=a(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=pi-fi(t+(this._isUTC?0:this.utcOffset()*di),pi)-1;break;case"minute":t=this._d.valueOf(),t+=di-fi(t,di)-1;break;case"second":t=this._d.valueOf(),t+=ci-fi(t,ci)-1}return this._d.setTime(t),n.updateOffset(this,!0),this}function vi(){return this._d.valueOf()-6e4*(this._offset||0)}function _i(){return Math.floor(this.valueOf()/1e3)}function wi(){return new Date(this.valueOf())}function Ai(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function ki(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Si(){return this.isValid()?this.toISOString():null}function Ni(){return g(this)}function Ti(){return h({},y(this))}function Mi(){return y(this).overflow}function xi(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Ci(e,t){var a,i,r,s=this._eras||ba("en")._eras;for(a=0,i=s.length;a<i;++a)switch("string"==typeof s[a].since&&(r=n(s[a].since).startOf("day"),s[a].since=r.valueOf()),typeof s[a].until){case"undefined":s[a].until=1/0;break;case"string":r=n(s[a].until).startOf("day").valueOf(),s[a].until=r.valueOf()}return s}function Ii(e,t,a){var n,i,r,s,o,l=this.eras();for(e=e.toUpperCase(),n=0,i=l.length;n<i;++n)if(r=l[n].name.toUpperCase(),s=l[n].abbr.toUpperCase(),o=l[n].narrow.toUpperCase(),a)switch(t){case"N":case"NN":case"NNN":if(s===e)return l[n];break;case"NNNN":if(r===e)return l[n];break;case"NNNNN":if(o===e)return l[n]}else if([r,s,o].indexOf(e)>=0)return l[n]}function Vi(e,t){var a=e.since<=e.until?1:-1;return void 0===t?n(e.since).year():n(e.since).year()+(t-e.offset)*a}function Ei(){var e,t,a,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e){if(a=this.clone().startOf("day").valueOf(),n[e].since<=a&&a<=n[e].until)return n[e].name;if(n[e].until<=a&&a<=n[e].since)return n[e].name}return""}function Fi(){var e,t,a,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e){if(a=this.clone().startOf("day").valueOf(),n[e].since<=a&&a<=n[e].until)return n[e].narrow;if(n[e].until<=a&&a<=n[e].since)return n[e].narrow}return""}function Di(){var e,t,a,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e){if(a=this.clone().startOf("day").valueOf(),n[e].since<=a&&a<=n[e].until)return n[e].abbr;if(n[e].until<=a&&a<=n[e].since)return n[e].abbr}return""}function Ri(){var e,t,a,i,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(a=r[e].since<=r[e].until?1:-1,i=this.clone().startOf("day").valueOf(),r[e].since<=i&&i<=r[e].until||r[e].until<=i&&i<=r[e].since)return(this.year()-n(r[e].since).year())*a+r[e].offset;return this.year()}function Li(e){return o(this,"_erasNameRegex")||zi.call(this),e?this._erasNameRegex:this._erasRegex}function Pi(e){return o(this,"_erasAbbrRegex")||zi.call(this),e?this._erasAbbrRegex:this._erasRegex}function Bi(e){return o(this,"_erasNarrowRegex")||zi.call(this),e?this._erasNarrowRegex:this._erasRegex}function Oi(e,t){return t.erasAbbrRegex(e)}function $i(e,t){return t.erasNameRegex(e)}function Ui(e,t){return t.erasNarrowRegex(e)}function ji(e,t){return t._eraYearOrdinalRegex||ve}function zi(){var e,t,a,n,i,r=[],s=[],o=[],l=[],u=this.eras();for(e=0,t=u.length;e<t;++e)a=Ie(u[e].name),n=Ie(u[e].abbr),i=Ie(u[e].narrow),s.push(a),r.push(n),o.push(i),l.push(a),l.push(n),l.push(i);this._erasRegex=new RegExp("^("+l.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+s.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+o.join("|")+")","i")}function Wi(e,t){U(0,[e,e.length],0,t)}function Yi(e){return Ki.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Hi(e){return Ki.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Gi(){return St(this.year(),1,4)}function qi(){return St(this.isoWeekYear(),1,4)}function Zi(){var e=this.localeData()._week;return St(this.year(),e.dow,e.doy)}function Ji(){var e=this.localeData()._week;return St(this.weekYear(),e.dow,e.doy)}function Ki(e,t,a,n,i){var r;return null==e?kt(this,n,i).year:(t>(r=St(e,n,i))&&(t=r),Xi.call(this,e,t,a,n,i))}function Xi(e,t,a,n,i){var r=At(e,t,a,n,i),s=_t(r.year,0,r.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}function Qi(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}U("N",0,0,"eraAbbr"),U("NN",0,0,"eraAbbr"),U("NNN",0,0,"eraAbbr"),U("NNNN",0,0,"eraName"),U("NNNNN",0,0,"eraNarrow"),U("y",["y",1],"yo","eraYear"),U("y",["yy",2],0,"eraYear"),U("y",["yyy",3],0,"eraYear"),U("y",["yyyy",4],0,"eraYear"),Me("N",Oi),Me("NN",Oi),Me("NNN",Oi),Me("NNNN",$i),Me("NNNNN",Ui),De(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,a,n){var i=a._locale.erasParse(e,n,a._strict);i?y(a).era=i:y(a).invalidEra=e})),Me("y",ve),Me("yy",ve),Me("yyy",ve),Me("yyyy",ve),Me("yo",ji),De(["y","yy","yyy","yyyy"],Be),De(["yo"],(function(e,t,a,n){var i;a._locale._eraYearOrdinalRegex&&(i=e.match(a._locale._eraYearOrdinalRegex)),a._locale.eraYearOrdinalParse?t[Be]=a._locale.eraYearOrdinalParse(e,i):t[Be]=parseInt(e,10)})),U(0,["gg",2],0,(function(){return this.weekYear()%100})),U(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),Wi("gggg","weekYear"),Wi("ggggg","weekYear"),Wi("GGGG","isoWeekYear"),Wi("GGGGG","isoWeekYear"),Me("G",_e),Me("g",_e),Me("GG",he,ue),Me("gg",he,ue),Me("GGGG",ge,de),Me("gggg",ge,de),Me("GGGGG",be,pe),Me("ggggg",be,pe),Re(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,a,n){t[n.substr(0,2)]=Ee(e)})),Re(["gg","GG"],(function(e,t,a,i){t[i]=n.parseTwoDigitYear(e)})),U("Q",0,"Qo","quarter"),Me("Q",le),De("Q",(function(e,t){t[Oe]=3*(Ee(e)-1)})),U("D",["DD",2],"Do","date"),Me("D",he,Ne),Me("DD",he,ue),Me("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),De(["D","DD"],$e),De("Do",(function(e,t){t[$e]=Ee(e.match(he)[0])}));var er=Ke("Date",!0);function tr(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}U("DDD",["DDDD",3],"DDDo","dayOfYear"),Me("DDD",ye),Me("DDDD",ce),De(["DDD","DDDD"],(function(e,t,a){a._dayOfYear=Ee(e)})),U("m",["mm",2],0,"minute"),Me("m",he,Te),Me("mm",he,ue),De(["m","mm"],je);var ar=Ke("Minutes",!1);U("s",["ss",2],0,"second"),Me("s",he,Te),Me("ss",he,ue),De(["s","ss"],ze);var nr,ir,rr=Ke("Seconds",!1);for(U("S",0,0,(function(){return~~(this.millisecond()/100)})),U(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),U(0,["SSS",3],0,"millisecond"),U(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),U(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),U(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),U(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),U(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),U(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),Me("S",ye,le),Me("SS",ye,ue),Me("SSS",ye,ce),nr="SSSS";nr.length<=9;nr+="S")Me(nr,ve);function sr(e,t){t[We]=Ee(1e3*("0."+e))}for(nr="S";nr.length<=9;nr+="S")De(nr,sr);function or(){return this._isUTC?"UTC":""}function lr(){return this._isUTC?"Coordinated Universal Time":""}ir=Ke("Milliseconds",!1),U("z",0,0,"zoneAbbr"),U("zz",0,0,"zoneName");var ur=A.prototype;function cr(e){return Za(1e3*e)}function dr(){return Za.apply(null,arguments).parseZone()}function pr(e){return e}ur.add=Rn,ur.calendar=zn,ur.clone=Wn,ur.diff=Kn,ur.endOf=bi,ur.format=ai,ur.from=ni,ur.fromNow=ii,ur.to=ri,ur.toNow=si,ur.get=et,ur.invalidAt=Mi,ur.isAfter=Yn,ur.isBefore=Hn,ur.isBetween=Gn,ur.isSame=qn,ur.isSameOrAfter=Zn,ur.isSameOrBefore=Jn,ur.isValid=Ni,ur.lang=li,ur.locale=oi,ur.localeData=ui,ur.max=Ka,ur.min=Ja,ur.parsingFlags=Ti,ur.set=tt,ur.startOf=gi,ur.subtract=Ln,ur.toArray=Ai,ur.toObject=ki,ur.toDate=wi,ur.toISOString=ei,ur.inspect=ti,"undefined"!=typeof Symbol&&null!=Symbol.for&&(ur[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),ur.toJSON=Si,ur.toString=Qn,ur.unix=_i,ur.valueOf=vi,ur.creationData=xi,ur.eraName=Ei,ur.eraNarrow=Fi,ur.eraAbbr=Di,ur.eraYear=Ri,ur.year=Ze,ur.isLeapYear=Je,ur.weekYear=Yi,ur.isoWeekYear=Hi,ur.quarter=ur.quarters=Qi,ur.month=ft,ur.daysInMonth=mt,ur.week=ur.weeks=Ct,ur.isoWeek=ur.isoWeeks=It,ur.weeksInYear=Zi,ur.weeksInWeekYear=Ji,ur.isoWeeksInYear=Gi,ur.isoWeeksInISOWeekYear=qi,ur.date=er,ur.day=ur.days=Yt,ur.weekday=Ht,ur.isoWeekday=Gt,ur.dayOfYear=tr,ur.hour=ur.hours=ia,ur.minute=ur.minutes=ar,ur.second=ur.seconds=rr,ur.millisecond=ur.milliseconds=ir,ur.utcOffset=yn,ur.utc=bn,ur.local=vn,ur.parseZone=_n,ur.hasAlignedHourOffset=wn,ur.isDST=An,ur.isLocal=Sn,ur.isUtcOffset=Nn,ur.isUtc=Tn,ur.isUTC=Tn,ur.zoneAbbr=or,ur.zoneName=lr,ur.dates=N("dates accessor is deprecated. Use date instead.",er),ur.months=N("months accessor is deprecated. Use month instead",ft),ur.years=N("years accessor is deprecated. Use year instead",Ze),ur.zone=N("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",gn),ur.isDSTShifted=N("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",kn);var hr=F.prototype;function fr(e,t,a,n){var i=ba(),r=f().set(n,t);return i[a](r,e)}function mr(e,t,a){if(c(e)&&(t=e,e=void 0),e=e||"",null!=t)return fr(e,t,a,"month");var n,i=[];for(n=0;n<12;n++)i[n]=fr(e,n,a,"month");return i}function yr(e,t,a,n){"boolean"==typeof e?(c(t)&&(a=t,t=void 0),t=t||""):(a=t=e,e=!1,c(t)&&(a=t,t=void 0),t=t||"");var i,r=ba(),s=e?r._week.dow:0,o=[];if(null!=a)return fr(t,(a+s)%7,n,"day");for(i=0;i<7;i++)o[i]=fr(t,(i+s)%7,n,"day");return o}function gr(e,t){return mr(e,t,"months")}function br(e,t){return mr(e,t,"monthsShort")}function vr(e,t,a){return yr(e,t,a,"weekdays")}function _r(e,t,a){return yr(e,t,a,"weekdaysShort")}function wr(e,t,a){return yr(e,t,a,"weekdaysMin")}hr.calendar=R,hr.longDateFormat=G,hr.invalidDate=Z,hr.ordinal=X,hr.preparse=pr,hr.postformat=pr,hr.relativeTime=ee,hr.pastFuture=te,hr.set=I,hr.eras=Ci,hr.erasParse=Ii,hr.erasConvertYear=Vi,hr.erasAbbrRegex=Pi,hr.erasNameRegex=Li,hr.erasNarrowRegex=Bi,hr.months=ut,hr.monthsShort=ct,hr.monthsParse=pt,hr.monthsRegex=gt,hr.monthsShortRegex=yt,hr.week=Nt,hr.firstDayOfYear=xt,hr.firstDayOfWeek=Mt,hr.weekdays=$t,hr.weekdaysMin=jt,hr.weekdaysShort=Ut,hr.weekdaysParse=Wt,hr.weekdaysRegex=qt,hr.weekdaysShortRegex=Zt,hr.weekdaysMinRegex=Jt,hr.isPM=aa,hr.meridiem=ra,ma("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===Ee(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),n.lang=N("moment.lang is deprecated. Use moment.locale instead.",ma),n.langData=N("moment.langData is deprecated. Use moment.localeData instead.",ba);var Ar=Math.abs;function kr(){var e=this._data;return this._milliseconds=Ar(this._milliseconds),this._days=Ar(this._days),this._months=Ar(this._months),e.milliseconds=Ar(e.milliseconds),e.seconds=Ar(e.seconds),e.minutes=Ar(e.minutes),e.hours=Ar(e.hours),e.months=Ar(e.months),e.years=Ar(e.years),this}function Sr(e,t,a,n){var i=Cn(t,a);return e._milliseconds+=n*i._milliseconds,e._days+=n*i._days,e._months+=n*i._months,e._bubble()}function Nr(e,t){return Sr(this,e,t,1)}function Tr(e,t){return Sr(this,e,t,-1)}function Mr(e){return e<0?Math.floor(e):Math.ceil(e)}function xr(){var e,t,a,n,i,r=this._milliseconds,s=this._days,o=this._months,l=this._data;return r>=0&&s>=0&&o>=0||r<=0&&s<=0&&o<=0||(r+=864e5*Mr(Ir(o)+s),s=0,o=0),l.milliseconds=r%1e3,e=Ve(r/1e3),l.seconds=e%60,t=Ve(e/60),l.minutes=t%60,a=Ve(t/60),l.hours=a%24,s+=Ve(a/24),o+=i=Ve(Cr(s)),s-=Mr(Ir(i)),n=Ve(o/12),o%=12,l.days=s,l.months=o,l.years=n,this}function Cr(e){return 4800*e/146097}function Ir(e){return 146097*e/4800}function Vr(e){if(!this.isValid())return NaN;var t,a,n=this._milliseconds;if("month"===(e=ne(e))||"quarter"===e||"year"===e)switch(t=this._days+n/864e5,a=this._months+Cr(t),e){case"month":return a;case"quarter":return a/3;case"year":return a/12}else switch(t=this._days+Math.round(Ir(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return 24*t+n/36e5;case"minute":return 1440*t+n/6e4;case"second":return 86400*t+n/1e3;case"millisecond":return Math.floor(864e5*t)+n;default:throw new Error("Unknown unit "+e)}}function Er(e){return function(){return this.as(e)}}var Fr=Er("ms"),Dr=Er("s"),Rr=Er("m"),Lr=Er("h"),Pr=Er("d"),Br=Er("w"),Or=Er("M"),$r=Er("Q"),Ur=Er("y"),jr=Fr;function zr(){return Cn(this)}function Wr(e){return e=ne(e),this.isValid()?this[e+"s"]():NaN}function Yr(e){return function(){return this.isValid()?this._data[e]:NaN}}var Hr=Yr("milliseconds"),Gr=Yr("seconds"),qr=Yr("minutes"),Zr=Yr("hours"),Jr=Yr("days"),Kr=Yr("months"),Xr=Yr("years");function Qr(){return Ve(this.days()/7)}var es=Math.round,ts={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function as(e,t,a,n,i){return i.relativeTime(t||1,!!a,e,n)}function ns(e,t,a,n){var i=Cn(e).abs(),r=es(i.as("s")),s=es(i.as("m")),o=es(i.as("h")),l=es(i.as("d")),u=es(i.as("M")),c=es(i.as("w")),d=es(i.as("y")),p=r<=a.ss&&["s",r]||r<a.s&&["ss",r]||s<=1&&["m"]||s<a.m&&["mm",s]||o<=1&&["h"]||o<a.h&&["hh",o]||l<=1&&["d"]||l<a.d&&["dd",l];return null!=a.w&&(p=p||c<=1&&["w"]||c<a.w&&["ww",c]),(p=p||u<=1&&["M"]||u<a.M&&["MM",u]||d<=1&&["y"]||["yy",d])[2]=t,p[3]=+e>0,p[4]=n,as.apply(null,p)}function is(e){return void 0===e?es:"function"==typeof e&&(es=e,!0)}function rs(e,t){return void 0!==ts[e]&&(void 0===t?ts[e]:(ts[e]=t,"s"===e&&(ts.ss=t-1),!0))}function ss(e,t){if(!this.isValid())return this.localeData().invalidDate();var a,n,i=!1,r=ts;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(i=e),"object"==typeof t&&(r=Object.assign({},ts,t),null!=t.s&&null==t.ss&&(r.ss=t.s-1)),n=ns(this,!i,r,a=this.localeData()),i&&(n=a.pastFuture(+this,n)),a.postformat(n)}var os=Math.abs;function ls(e){return(e>0)-(e<0)||+e}function us(){if(!this.isValid())return this.localeData().invalidDate();var e,t,a,n,i,r,s,o,l=os(this._milliseconds)/1e3,u=os(this._days),c=os(this._months),d=this.asSeconds();return d?(e=Ve(l/60),t=Ve(e/60),l%=60,e%=60,a=Ve(c/12),c%=12,n=l?l.toFixed(3).replace(/\.?0+$/,""):"",i=d<0?"-":"",r=ls(this._months)!==ls(d)?"-":"",s=ls(this._days)!==ls(d)?"-":"",o=ls(this._milliseconds)!==ls(d)?"-":"",i+"P"+(a?r+a+"Y":"")+(c?r+c+"M":"")+(u?s+u+"D":"")+(t||e||l?"T":"")+(t?o+t+"H":"")+(e?o+e+"M":"")+(l?o+n+"S":"")):"P0D"}var cs=on.prototype;return cs.isValid=rn,cs.abs=kr,cs.add=Nr,cs.subtract=Tr,cs.as=Vr,cs.asMilliseconds=Fr,cs.asSeconds=Dr,cs.asMinutes=Rr,cs.asHours=Lr,cs.asDays=Pr,cs.asWeeks=Br,cs.asMonths=Or,cs.asQuarters=$r,cs.asYears=Ur,cs.valueOf=jr,cs._bubble=xr,cs.clone=zr,cs.get=Wr,cs.milliseconds=Hr,cs.seconds=Gr,cs.minutes=qr,cs.hours=Zr,cs.days=Jr,cs.weeks=Qr,cs.months=Kr,cs.years=Xr,cs.humanize=ss,cs.toISOString=us,cs.toString=us,cs.toJSON=us,cs.locale=oi,cs.localeData=ui,cs.toIsoString=N("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",us),cs.lang=li,U("X",0,0,"unix"),U("x",0,0,"valueOf"),Me("x",_e),Me("X",ke),De("X",(function(e,t,a){a._d=new Date(1e3*parseFloat(e))})),De("x",(function(e,t,a){a._d=new Date(Ee(e))})),
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("short-unique-id"),require("axios"),require("axios-retry"),require("isomorphic-ws"),require("form-data"),require("jszip")):"function"==typeof define&&define.amd?define(["exports","short-unique-id","axios","axios-retry","isomorphic-ws","form-data","jszip"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["lemonate-gateway"]={},e["short-unique-id"],e.axios,e["axios-retry"],e["isomorphic-ws"],e["form-data"],e.jszip)}(this,(function(e,t,a,n,i,r,s){"use strict";class o{func;owner;constructor(e,t){this.func=e,this.owner=t}}class l{_debugMode=!1;_listeners=new Map;_onceListeners=new Map;_catchAllListeners=[];_capturedEvents=new Map;_capturedAccumulatedDuration=0;constructor(){}setDebugMode(e){this._debugMode&&!e&&(console.log("Captured events: ",this._capturedEvents),console.log(`Total duration: ${this._capturedAccumulatedDuration}ms`)),this._debugMode=e,this._capturedEvents=new Map,this._capturedAccumulatedDuration=0}$clear(){this._listeners.clear(),this._onceListeners.clear()}clearCatchAllListeners(){this._catchAllListeners=[]}listenerCount(e){let t=0;return t+=this._listeners.get(e)?.length||0,t+=this._onceListeners.get(e)?.length||0,t}$hasListener(e){return this.listenerCount(e)>0}$catchAll(e,t){this._catchAllListeners.push(new o(e,t))}$on(e,t,a){let n;this._listeners.has(e)?n=this._listeners.get(e):(n=[],this._listeners.set(e,n)),n.push(new o(t,a))}$once(e,t,a){let n;this._onceListeners.has(e)?n=this._onceListeners.get(e):(n=[],this._onceListeners.set(e,n)),n.push(new o(t,a))}$off(e,t,a){let n=0;if(this._listeners.has(e)){n+=this._listeners.get(e).removeByFilterFunc((e=>e.func===t&&e.owner===a))}if(this._onceListeners.has(e)){n+=this._onceListeners.get(e).removeByFilterFunc((e=>e.func===t&&e.owner===a))}return n}$offByOwner(e,t){let a=0;if(this._listeners.has(e)){a+=this._listeners.get(e).removeByFilterFunc((e=>e.owner===t))}if(this._onceListeners.has(e)){a+=this._onceListeners.get(e).removeByFilterFunc((e=>e.owner===t))}return a}$emitSync(e,...t){const a=[],n=performance.now();let i=0;try{for(const n of this._catchAllListeners.values())try{const r=n.func.call(n.owner,e,...t);r&&r.then&&a.push(r),i++}catch(e){console.error(e)}if(this._listeners.has(e)){const n=this._listeners.get(e);for(const e of n)try{const n=e.func.call(e.owner,...t);n&&n.then&&a.push(n),i++}catch(e){console.error(e)}}if(this._onceListeners.has(e)){const n=this._onceListeners.get(e);for(const e of n)try{const n=e.func.call(e.owner,...t);n&&n.then&&a.push(n),i++}catch(e){console.error(e)}this._onceListeners.set(e,[])}}catch(e){console.error(e)}if(this._debugMode&&"log"!==e){const t=performance.now(),r=Math.floor(t-n);let s=this._capturedEvents.get(e);s?(s.count++,s.duration+=r,s.promises+=a.length,s.sentTo+=i):(s={eventType:e,count:1,duration:r,promises:a.length,sentTo:i},this._capturedEvents.set(e,s)),r>3&&console.log(`Expensive event ${e}: ${r}ms`)}return a.length>0?Promise.all(a):null}$emit(e,...t){return new Promise((a=>{a(this.$emitSync(e,...t))}))}}const u=new l;class c{type;itemId;elementId;target;prop;value;oldValue;createdAt=Date.now();moveTargetArray;moveTargetArrayIndex;moveTargetElementId;start;length;position;elementsToDelete;field;fieldId;isLink;bundleIndex=0;_undoFunction;_redoFunction;constructor(e,t,a,n,i,r,s){this.type=e,this.itemId=t,this.elementId=a,this.target=n,this.prop=i,this.value=r,this.oldValue=s}async undo(){this._undoFunction&&await this._undoFunction()}async redo(){this._redoFunction&&await this._redoFunction()}setUndoFunction(e){this._undoFunction=e}setRedoFunction(e){this._redoFunction=e}setMoveTarget(e,t,a){this.moveTargetArray=e,this.moveTargetArrayIndex=t,this.moveTargetElementId=a}setRange(e,t){this.start=e,this.length=t}setPosition(e){this.position=e}setElementsToDelete(e){this.elementsToDelete=e}setField(e){this.field=e}setFieldId(e){this.fieldId=e}setIsLink(e){this.isLink=e}clone(){return Object.assign(new c,this)}isWithinMergeDeltaOf(e,t){return Math.abs(e.createdAt-this.createdAt)<=t}isMergeableWith(e,t){if(!this.isWithinMergeDeltaOf(e,t))return!1;const a=e.type===this.type&&e.itemId===this.itemId&&e.elementId===this.elementId&&e.target===this.target&&e.prop===this.prop,n=void 0!==e.value&&void 0!==e.oldValue&&void 0===e.start&&void 0===e.length&&void 0===e.position&&void 0===e.elementsToDelete;return a&&n}merge(e,t){if(!this.isMergeableWith(e,t))return null;let a=this.clone();return a.value=e.value,a.createdAt=e.createdAt,a._redoFunction=e._redoFunction,a}}const d=new t({dictionary:"hex",length:12});let p=(new Date).valueOf();var h={createItemOrBlockID:function(){return d.rnd()},createFieldID:function(){return(p++).toString()},createGUID:function(){return d.rnd()},createGeneratedItemId:function(){return"gen_"+this.createGUID()},toUserFriendlyName:function(e){return e.replace(/_./g,(e=>e.charAt(1).toUpperCase())).replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^(.)/,(e=>e.toUpperCase()))},assert:function(e,t){e||console.error(`ASSERTION FAILED: '${e}' is untrue: ${t}`)},matchItemIdAndObject:(e,t)=>!(!e||!t)&&(e._id===t||e===t._id),getDepth(e,t=new WeakSet){if(null===e||"object"!=typeof e)return 1;const a=e;if(t.has(a))return 0;t.add(a);const n=Array.isArray(a)?a:Object.values(a);let i=0;for(const e of n){const a=this.getDepth(e,t);a>i&&(i=a)}return 1+i},areValuesEqual(e,t,a=3){if(e===t)return!0;if("number"==typeof e&&"number"==typeof t)return isNaN(e)&&isNaN(t);if(null==e||null==t||typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;if(e._id&&e._id!==t._id)return!1;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(let i of n){if(!Object.prototype.hasOwnProperty.call(t,i))return!1;if(a>0&&!this.areValuesEqual(e[i],t[i],a-1))return!1}return!0},startTimer(e){const t=Date.now();return e&&console.log(`[TIMER] - ${e}`),function(e){const a=Date.now()-t;e?console.log(`[TIMER] - ${e}: ${a}ms`):console.log(`[TIMER] - ${a}ms`)}},dataURItoBlob(e){const t=e.split(",")[0].split(":")[1].split(";")[0],a=atob(e.split(",")[1]),n=[];for(let e=0;e<a.length;e++)n.push(a.charCodeAt(e));return new Blob([new Uint8Array(n)],{type:t})},xmur3(e){let t=1779033703^e.length;for(let a=0;a<e.length;a++)t=Math.imul(t^e.charCodeAt(a),3432918353),t=t<<13|t>>>19;return()=>(t=Math.imul(t^t>>>16,2246822507),t=Math.imul(t^t>>>13,3266489909),t^=t>>>16,t>>>0)},mulberry32:e=>()=>{let t=e+=1831565813;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296},hslToRgb(e,t,a){const n=(1-Math.abs(2*a-1))*t,i=e/60,r=n*(1-Math.abs(i%2-1));let[s,o,l]=[0,0,0];[s,o,l]=i>=0&&i<1?[n,r,0]:i<2?[r,n,0]:i<3?[0,n,r]:i<4?[0,r,n]:i<5?[r,0,n]:[n,0,r];const u=a-n/2;return[Math.round(255*(s+u)),Math.round(255*(o+u)),Math.round(255*(l+u))]},rgbToHex:(e,t,a)=>"#"+[e,t,a].map((e=>e.toString(16).padStart(2,"0"))).join(""),colorFromString(e,t={}){const{minS:a=.72,maxS:n=.97,minL:i=.48,maxL:r=.62,return:s="hex"}=t,o=this.xmur3(e)(),l=this.mulberry32(o),u=Math.floor(360*l()),c=a+l()*(n-a),d=i+l()*(r-i);if("hsl"===s)return`hsl(${u} ${Math.round(100*c)}% ${Math.round(100*d)}%)`;const[p,h,f]=this.hslToRgb(u,c,d);return"rgb"===s?`rgb(${p}, ${h}, ${f})`:this.rgbToHex(p,h,f)},async downloadFile(e,t){if(e.startsWith("blob:")){const t=await fetch(e),a=await t.blob();return{data:a,mimeType:a.type}}return a.get(e,{responseType:"blob",onDownloadProgress:e=>{if(t&&e.total){const a=Math.round(100*e.loaded/e.total);t(a,e.total,e.loaded)}}})}};const f=new Set(["dependantFields","conditionFields","dependenciesInitialized","_hidden","_updateConditions"]),m=new Set(["__proto__","__ob__","isSelected","isDirty","options","_hidden","_updateConditions","dependantFields","conditionFields","separatorFields","dependenciesInitialized","order","inject","type","datatype","minValue","maxValue","id","_id","linkableTypes","info"]),y=new Set(["isSelected","isDirty","_hidden","_updateConditions","options","dependantFields","conditionFields","separatorFields","dependenciesInitialized","id","_id","linkableTypes","info"]);class g{suppressDirty=!1;undoManager;_promises=[];_capturePromises=!1;_profiledEvents=[];_profiling=!1;_profilerStartTime=0;_profiledCount=0;static _instance;static get instance(){return this._instance||(this._instance=new this)}constructor(){}suppressDirtyFlag(e){this.suppressDirty=e}setUndoManager(e){this.undoManager=e}isUndoManagerActive(){return this.undoManager?.getEnabled()}_postUndoManagerEvent(e){this.undoManager&&(y.has(e.prop)||this.undoManager.event(e))}setItemDirty(e,t,a,n){this.suppressDirty||e.isDirty||a===n||m.has(t)||e.markDirty()}capturePromise(e){try{return this._capturePromises=!0,e(),Promise.all(this._promises)}finally{this._capturePromises=!1,this._promises=[]}}startProfiling(){this._profiling=!0,this._profiledEvents=[],this._profiledCount=0,this._profilerStartTime=performance.now(),u.setDebugMode(!0)}endProfiling(){const e=performance.now()-this._profilerStartTime;u.setDebugMode(!1),console.log("Profiled events: ",this._profiledEvents),console.log(`Profiling took ${e}ms`)}_addPromise(e){this._capturePromises&&this._promises.push(e)}_proxyObject(e,t,a,n){const i=this;if(!e)throw"_proxyObject(): Object is not defined. Cannot create proxy!";if(!a)throw"_proxyObject(): Item is not defined. Cannot create proxy!";if(!n)throw"_proxyObject(): Options is not defined. Cannot create proxy!";return new Proxy(e,{set:function(r,s,o){if(f.has(s))return Reflect.set(r,s,o);const l=performance.now();let d=i.isUndoManagerActive();const p=Reflect.get(r,s);if(h.areValuesEqual(p,o))return!0;let m=Reflect.set(r,s,o);function y(i,o){const l=new c(n.proxyEventTypeName,a._id,t?t.id:null,r,s,i,o);return n.isField&&(l.setField(e.name),l.setFieldId(e.id)),void 0!==n.isLink&&l.setIsLink(n.isLink),l}n.changeDoesNotMakeItemDirty||(h.matchItemIdAndObject(p,o)?d=!1:i.setItemDirty(a,s,p,o));const g=y(o,p);d&&(g.setUndoFunction((()=>{Reflect.set(r,s,g.oldValue);const e=y(g.oldValue,g.value);u.$emitSync("proxy:valueChange",e),n.changeEventFunc(e)})),g.setRedoFunction((()=>{Reflect.set(r,s,g.value);const e=y(g.value,g.oldValue);u.$emitSync("proxy:valueChange",e),n.changeEventFunc(e)}))),n.changeEventFunc(g),d&&i._postUndoManagerEvent(g),u.$emitSync("proxy:valueChange",g);const b=performance.now();return i._profiledCount++,i._profiledEvents.push({event:g,type:"object",duration:b-l}),m}})}_proxyArray(e,t,a,n){const i=this;if(!e)throw"_proxyArray(): Array is not defined. Cannot create proxy!";if(!a)throw"_proxyArray(): Item is not defined. Cannot create proxy!";if(!n)throw"_proxyArray(): Options is not defined. Cannot create proxy!";return new Proxy(e,{set(e,r,s){const o=performance.now(),l=Reflect.get(e,r);let d=Reflect.set(e,r,s);if("length"!==r&&"__proto__"!==r){const p=i.isUndoManagerActive();function h(i,s){const o=new c("arraySetValue",a._id,t?t.id:null,e,r,i,s);return n.field&&(o.setField(n.field.name),o.setFieldId(n.field.id)),o}n.changeDoesNotMakeItemDirty||i.setItemDirty(a,r,l,s);const f=h(s,l);p&&(f.setUndoFunction((()=>{const t=h(f.oldValue,f.value),a=parseInt(r);if(void 0===f.oldValue&&e.length-1===a){const n=e.pop();t.setElementsToDelete([n]),t.setRange(a,1)}else Reflect.set(e,r,f.oldValue);u.$emitSync("proxy:valueChange",t),n.deleteEventFunc(t)})),f.setRedoFunction((()=>{Reflect.set(e,r,f.value);const t=h(f.value,f.oldValue);u.$emitSync("proxy:valueChange",t),n.addEventFunc(t)}))),n.addEventFunc(f),p&&i._postUndoManagerEvent(f),u.$emitSync("proxy:valueChange",f);const m=performance.now();i._profiledCount++,i._profiledEvents.push({event:f,type:"set_array",duration:m-o})}return d},get(r,s){if("splice"===s){const e=Reflect.get(r,s);return function(...o){const l=o[0],d=o[1],p=[];for(let e=l;e<l+d;e++){const t=r[e];p.push(t)}function h(e,i,s){const o=new c("arraySpliceRemove",a._id,t?t.id:null,r);return n.field&&(o.setField(n.field.name),o.setFieldId(n.field.id)),o.setRange(e,i),o.setElementsToDelete(s),o}function f(e,i){const o=new c("arraySpliceAdd",a._id,t?t.id:null,r,s,i);return n.field&&(o.setField(n.field.name),o.setFieldId(n.field.id)),o.setPosition(e),o}if(e.apply(r,o),i.setItemDirty(a,s,!0,!1),d>0&&o.length<3){const e=i.isUndoManagerActive(),t=h(l,d,p);e&&(t.setUndoFunction((()=>{r.splice(l,0,...p);const e=f(l,p);u.$emitSync("proxy:valueChange",e),n.addEventFunc(e)})),t.setRedoFunction((()=>{r.splice(l,d);const e=h(l,d,p);u.$emitSync("proxy:valueChange",e),n.deleteEventFunc(e)}))),n.deleteEventFunc(t),e&&i._postUndoManagerEvent(t),u.$emitSync("proxy:valueChange",t)}else if(o.length>2){const e=o.slice(2),t=f(l,e);t.setPosition(l),t.setUndoFunction((()=>{r.splice(l,e.length);const t=h(l,e.length,e);u.$emitSync("proxy:valueChange",t),n.deleteEventFunc(t)})),t.setRedoFunction((()=>{r.splice(l,0,...e);const t=f(l,e);u.$emitSync("proxy:valueChange",t),n.addEventFunc(t)})),n.addEventFunc(t),i._postUndoManagerEvent(t),u.$emitSync("proxy:valueChange",t)}}}return"moveToArray"===s?function(e,o,l){const d=r,p=t,{array:h,element:f}=o.getTargetArrayAndElement();function m(e,t,a,n){n=void 0===n?a.length:n;const i=Reflect.get(e,"splice").apply(e,[t,1]);if(i.length>0){const e=i[0];return Reflect.get(a,"splice").apply(a,[n,0,e]),e}return null}const y=m(d,e,h,l);if(y){function g(e,n,i,r,s,o){const l=new c("arrayMoveToArray",a._id,t?t.id:null,e,void 0,o);return l.setRange(n,1),l.setMoveTarget(i,r,s?s.id:null),l}i.setItemDirty(a,s,!0,!1);const b=i.isUndoManagerActive(),v=g(d,e,o,l,f,y);b&&(v.setUndoFunction((()=>{const t=m(h,l,d,e),a=g(o,l,d,e,p,t);u.$emitSync("proxy:valueChange",a),n.moveEventFunc(a)})),v.setRedoFunction((()=>{const t=m(d,e,h,l),a=g(d,e,o,l,f,t);u.$emitSync("proxy:valueChange",a),n.moveEventFunc(a)}))),n.moveEventFunc(v),b&&i._postUndoManagerEvent(v),u.$emitSync("proxy:valueChange",v)}}:"getTargetArrayAndElement"===s?function(){return{array:e,element:t}}:("move"===s&&console.warn("'move' prop is not implemented in Proxifier"),Reflect.get(r,s))}})}proxyBlockArray(e,t,a){return this._proxyArray(e,t,a,{addEventFunc:e=>{this._addPromise(u.$emit("itemRepo:blockAdded",e))},deleteEventFunc:e=>{this._addPromise(u.$emit("itemRepo:blockDeleted",e))},moveEventFunc:e=>{this._addPromise(u.$emit("itemRepo:blockMoved",e))}})}proxyListArray(e,t,a){return this._proxyArray(e,null,a,{field:t,addEventFunc:function(e){u.$emit("itemRepo:listEntryAdded",e)},deleteEventFunc:function(e){u.$emit("itemRepo:listEntryDeleted",e)}})}proxyScriptArray(e,t,a){return this._proxyArray(e,t,a,{addEventFunc:function(e){u.$emit("itemRepo:scriptAdded",e)},deleteEventFunc:function(e){u.$emit("itemRepo:scriptDeleted",e)}})}proxyBlock(e,t){return this._proxyObject(e,e,t,{isLink:!0,changeEventFunc:function(e){u.$emit("itemRepo:fieldChanged",e),u.$emit("itemRepo:linkChanged",e)},proxyEventTypeName:"blockSetValue"})}proxyGraphBlock(e,t){return this._proxyObject(e,e,t,{isLink:!0,changeEventFunc:function(e){u.$emit("itemRepo:graphNodeChanged",e)},proxyEventTypeName:"blockSetValue"})}proxyGraphBlockArray(e,t){return this._proxyArray(e,t,t,{addEventFunc:function(e){u.$emit("itemRepo:graphNodeAdded",e)},deleteEventFunc:function(e){u.$emit("itemRepo:graphNodeDeleted",e)}})}proxyConnection(e,t){return this._proxyObject(e,t,t,{changeEventFunc:function(e){u.$emit("itemRepo:graphConnectionChanged",e)},proxyEventTypeName:"connectionSetValue"})}proxyConnectionArray(e,t){return this._proxyArray(e,e,t,{addEventFunc:function(e){u.$emit("itemRepo:graphConnectionAdded",e)},deleteEventFunc:function(e){u.$emit("itemRepo:graphConnectionDeleted",e)}})}proxyItemField(e,t){const a="Link"===e.type;return this._proxyObject(e,null,t,{isLink:a,isField:!0,changeEventFunc:function(e){u.$emit("itemRepo:fieldChanged",e),a&&u.$emit("itemRepo:linkChanged",e)},proxyEventTypeName:"itemFieldSetValue"})}proxyGraphBlockField(e,t,a){return this._proxyObject(e,t,a,{isLink:"Link"===e.type,isField:!0,changeEventFunc:function(e){u.$emit("itemRepo:graphNodeFieldChanged",e)},proxyEventTypeName:"blockFieldSetValue"})}proxyBlockField(e,t,a){const n="Link"===e.type;return this._proxyObject(e,t,a,{isLink:n,isField:!0,changeEventFunc:function(e){u.$emit("itemRepo:fieldChanged",e),n&&u.$emit("itemRepo:linkChanged",e)},proxyEventTypeName:"blockFieldSetValue"})}proxyScriptItem(e,t,a){return this._proxyObject(e,t,a,{isLink:!0,changeEventFunc:function(e){u.$emit("itemRepo:scriptItemChanged",e)},proxyEventTypeName:"scriptItemSetValue"})}proxyScriptFieldsArray(e,t,a){return this._proxyArray(e,t,a,{addEventFunc:function(e){u.$emit("itemRepo:scriptFieldAdded",e)},deleteEventFunc:function(e){u.$emit("itemRepo:scriptFieldDeleted",e)},changeDoesNotMakeItemDirty:!0})}proxyScriptField(e,t,a){return this._proxyObject(e,t,a,{isLink:!1,isField:!0,changeEventFunc:function(e){u.$emit("itemRepo:scriptFieldChanged",e)},proxyEventTypeName:"itemScriptFieldSetValue",changeDoesNotMakeItemDirty:!1})}proxyCustomFieldsArray(e,t){return this._proxyArray(e,null,t,{addEventFunc:function(e){u.$emit("itemRepo:customFieldAdded",e)},deleteEventFunc:function(e){u.$emit("itemRepo:customFieldDeleted",e)},changeDoesNotMakeItemDirty:!0})}proxyCustomField(e,t){return this._proxyObject(e,null,t,{isLink:!1,isField:!0,changeEventFunc:function(e){u.$emit("itemRepo:customFieldChanged",e)},proxyEventTypeName:"itemCustomFieldSetValue",changeDoesNotMakeItemDirty:!1})}}class b{level;name;times;durations=[];childrenMap=new Map;children=[];parent;constructor(e,t,a,n){this.name=e,this.level=t,this.times=[a],this.parent=n}}class v{startTime=0;endTime=0;startIteration=0;currentLevel=0;root=new b("root",0,0,void 0);currentEntry;active=!1;static _instance;static get instance(){return this._instance||(this._instance=new this)}constructor(){this.currentEntry=this.root}start(){this.startTime=performance.now(),this.startIteration=this.startTime,this.root=new b("root",0,0,void 0),this.currentEntry=this.root,this.currentLevel=0,this.active=!0}end(e=!1){this.active=!1,this.endTime=performance.now()-this.startTime,this.root.durations.push(this.endTime-this.root.times[0]),e&&this.printResults()}_iterate(e,t){e(t=t||this.root);for(const a of t.children)this._iterate(e,a)}getResults(){const e=[];function t(e){return Math.round(1e3*e)/1e3}function a(e){return e.reduce(((e,t)=>e+t),0)}return this._iterate((function(n){const i=t(a(n.times)/n.times.length),r=t(a(n.durations)/n.durations.length),s=t(a(n.durations)),o=t(s-n.children.reduce(((e,t)=>e+a(t.durations)),0));e.push({name:"".padStart(2*n.level," .")+n.name,executions:n.times.length,avgTimeStartMs:i,avgTimeEndMs:t(i+r),avgDurationMs:r,totalDurationMs:s,selfDurationMs:o})})),e}printResults(){console.table(this.getResults(),["name","executions","avgTimeStartMs","avgTimeEndMs","avgDurationMs","totalDurationMs","selfDurationMs"])}newIteration(){this.startIteration=performance.now(),this.currentLevel=0}async asyncBlock(e,t){if(!this.active)return t();let a;try{return a=this.beginBlock(e),await t()}finally{this.endBlock(a)}}block(e,t){if(!this.active)return t();let a;try{return a=this.beginBlock(e),t()}finally{this.endBlock(a)}}beginBlock(e){if(!this.active)return;this.currentLevel++;const t=performance.now()-this.startIteration;let a=this.currentEntry.childrenMap.get(e);return a?a.times.push(t):(a=new b(e,this.currentLevel,t,this.currentEntry),this.currentEntry.children.push(a),this.currentEntry.childrenMap.set(e,a)),this.currentEntry=a,a}endBlock(e){if(!e)return;const t=performance.now()-this.startIteration-e.times[e.times.length-1];e.durations.push(t),this.currentEntry=e.parent,this.currentLevel--}}class _ extends Error{constructor(e,t){super(e),t&&(this.name=t)}toString(){return this.name?`${this.name}: ${this.message}`:this.message}}class w extends _{constructor(e){super(e,"InvalidArgumentException")}}class A extends _{constructor(e){super(e,"RuntimeException")}}class k extends _{constructor(e){super(e,"LoaderException")}}class S extends _{constructor(e){super(e,"QuotaExceededException")}}class N extends _{constructor(e){super(e,"AccessDeniedException")}}let T=class{_id;name;folder;folderPath;links;attributes;userAttributes;filename;createdAt;updatedAt;version;filesize;hash;mimeType;type;packageType;createdBy;updatedBy;acl;visibility;properties;allowConversation;conversation;tags;contributors;description;shortDescription;userAttributeTemplate;categories;attachments;license;quotaUser;quotaGroup;itemSize;totalSize;flags;perceptiveHash;unpackagedSize;location;itemFlag;constructor(e){if(this._id=e._id,this.name=e.name,this.folder=e.folder,this.folderPath=e.folderPath,this.links=[],Array.isArray(e.links))for(const t of e.links)this.links.push({to:t.to,usage:t.usage});this.attributes=JSON.parse(JSON.stringify(e.attributes||{})),this.userAttributes=JSON.parse(JSON.stringify(e.userAttributes||{})),this.filename=e.filename,this.createdAt=e.createdAt,this.updatedAt=e.updatedAt,this.version={major:e.version?.major||0,minor:e.version?.minor||0,revision:e.version?.revision||1},this.filesize=e.filesize,this.hash=e.hash,this.mimeType=e.mimeType,this.type=e.type,this.packageType=e.packageType,this.createdBy=e.createdBy,this.updatedBy=e.updatedBy,this.acl=JSON.parse(JSON.stringify(e.acl||[])),this.visibility=e.visibility,this.properties=JSON.parse(JSON.stringify(e.properties||{})),this.allowConversation=e.allowConversation,this.conversation=e.conversation,this.tags=JSON.parse(JSON.stringify(e.tags||[])),this.contributors=JSON.parse(JSON.stringify(e.contributors||[])),this.description=e.description,this.shortDescription=e.shortDescription,this.userAttributeTemplate=e.userAttributeTemplate,this.categories=e.categories,this.attachments=JSON.parse(JSON.stringify(e.attachments||[])),this.license=e.license,this.quotaUser=e.quotaUser,this.quotaGroup=e.quotaGroup,this.itemSize=e.itemSize,this.totalSize=e.totalSize,this.flags=JSON.parse(JSON.stringify(e.flags||[])),this.perceptiveHash=e.perceptiveHash,this.unpackagedSize=e.unpackagedSize,this.location=e.location,this.itemFlag=JSON.parse(JSON.stringify(e.itemFlag||{}))}};class M extends T{links;thumbnails;fieldSets;fields;userFields;isAggregatedItem=!0;constructor(e){if(super(e),this.links=[],Array.isArray(e.links))for(const t of e.links)this.links.push({to:t.to,usage:t.usage,stopRecursion:t.stopRecursion});this.thumbnails=JSON.parse(JSON.stringify(e.thumbnails||[])),this.fieldSets=JSON.parse(JSON.stringify(e.fieldSets||[])),this.fields=JSON.parse(JSON.stringify(e.fields||[])),this.userFields=JSON.parse(JSON.stringify(e.userFields||[]))}}var x=[{_id:{$oid:"5e6a1ace89707feef5738292"},contentTypes:["model/splat"],fieldSets:[],fields:[],name:"Gaussian Splats",updateRequiresThumbRefresh:!0,creatableEmpty:!1},{_id:{$oid:"5e6a1ace89707feef3748569"},contentTypes:[],fieldSets:[],fields:[{label:"Scenes",type:"Separator"},{elementName:"Scene",fields:[{linkableTypes:["Scene"],type:"Link",usageAs:"Scene",mandatory:!0},{datatype:"Boolean",defaultValue:!0,displayName:"Load",name:"Load",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Active",if:{Load:!0},name:"Active",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Primary",name:"Primary",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Exclude in packages",name:"ExcludeInPackages",type:"Attribute"},{datatype:"Transform",defaultValue:{position:{x:0,y:0,z:0},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},name:"Transform",type:"Attribute"}],name:"Scenes",type:"List"},{label:"Variable Sets",type:"Separator",collapsed:!0},{displayName:"Variable sets",elementName:"Variable set",fields:[{displayName:"Variable set",linkableTypes:["Variable Set"],type:"Link",usageAs:"VariableSet",mandatory:!0},{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"}],name:"VariableSets",type:"List"},{label:"Graphics",type:"Separator",collapsed:!0},{datatype:"Enum",defaultValue:"Not defined",displayName:"Aspect ratio",info:"This determines the project's aspect ratio. If not defined, the game will run in the default aspect depending on platform and browser size",name:"AspectRatio",options:["Not defined","Standard (4:3)","Widescreen (16:9)","Ultrawide (21:9)","Custom"],type:"Attribute"},{datatype:"Float",defaultValue:1.3,minValue:.1,maxValue:10,displayName:"Custom Aspect",if:{AspectRatio:"Custom"},name:"CustomAspect",type:"Attribute"},{label:"Physics",type:"Separator",collapsed:!0},{datatype:"Boolean",defaultValue:!1,displayName:"Enabled",name:"PhysicsEnabled",type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:0,y:-9.81,z:0},displayName:"Gravity",if:{PhysicsEnabled:!0},name:"Gravity",type:"Attribute"},{datatype:"LayerMatrix",defaultValue:[[0]],displayName:"Collision matrix",if:{PhysicsEnabled:!0},info:"This controls which physics object interact with which others depending on their layers",name:"CollisionMatrix",type:"Attribute"},{datatype:"StringList",defaultValue:["Default","Terrain","TransparentFX","Water"],displayName:"Layer names",fixedLength:!0,info:"Names of the layers to use with all scenegraph nodes",name:"LayerNames",type:"Attribute"},{label:"Resources",type:"Separator",collapsed:!0},{datatype:"Enum",defaultValue:"After loading everything",displayName:"Start execution",info:"This controls when the engine will start execution of the project in the player",name:"StartExecution",options:["Right away","After loading minimum LOD","After loading everything"],type:"Attribute"},{label:"Controls",type:"Separator",collapsed:!0},{datatype:"Boolean",defaultValue:!1,displayName:"Automatic pointer lock",name:"AutomaticPointerLock",type:"Attribute",info:"Enabling this will cause the mouse pointer to be locked until Escape is pressed"},{label:"Canvas Fonts",type:"Separator",collapsed:!0},{displayName:"Canvas fonts",elementName:"Font",fields:[{displayName:"Font",linkableTypes:["Font"],type:"Link",usageAs:"Font",mandatory:!0}],name:"CanvasFonts",type:"List"}],name:"Project",recursiveLoadStopsHere:!0,updateRequiresThumbRefresh:!1,creatableEmpty:!1},{_id:{$oid:"5e6a1ace24a07f56f3742569"},contentTypes:[],fieldSets:[],fields:[{elementName:"Variable",fields:[{datatype:"String",defaultValue:"Name",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Enum",defaultValue:"Integer",displayName:"Type",name:"Type",options:["Integer","Float","String","Boolean"],type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Value",if:{Type:"Boolean"},name:"BooleanValue",type:"Attribute"},{datatype:"Integer",defaultValue:0,displayName:"Value",if:{Type:"Integer"},name:"IntegerValue",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Value",if:{Type:"Float"},name:"FloatValue",type:"Attribute"},{datatype:"String",defaultValue:"",displayName:"Value",if:{Type:"String"},name:"StringValue",type:"Attribute"}],name:"Variables",type:"List"}],name:"Variable Set",updateRequiresThumbRefresh:!1,creatableEmpty:!0},{_id:{$oid:"5e6a1ace89707feef9173386"},contentTypes:["audio/mpeg"],fieldSets:[],fields:[{datatype:"Float",defaultValue:1,displayName:"Volume",maxValue:1,minValue:0,name:"Volume",type:"Attribute",widget:"Slider"}],name:"Audio",updateRequiresThumbRefresh:!1,creatableEmpty:!1},{_id:{$oid:"5e6a1acf89707feef917338f"},contentTypes:["*"],fieldSets:[],fields:[],name:"Binary",creatableEmpty:!1},{_id:{$oid:"5e6a1acf89707feef917337f"},contentTypes:["application/vnd.lumino.package"],fieldSets:[],fields:[],name:"Package",creatableEmpty:!1},{_id:{$oid:"5e6a1ad189707feef9173391"},contentTypes:["image/vnd.radiance"],fieldSets:[],fields:[],name:"HDR Image",creatableEmpty:!1},{_id:{$oid:"5e6a1ad189707feef9173392"},contentTypes:["image/png","image/jpeg","image/avif","image/heif"],fieldSets:[],fields:[{datatype:"Enum",defaultValue:"Linear",displayName:"Encoding",name:"Encoding",options:["Linear","sRGB"],type:"Attribute"}],name:"Image",updateRequiresThumbRefresh:!0,creatableEmpty:!1},{_id:{$oid:"5e6a1ad189707feef9173393"},contentTypes:[""],fieldSets:[],fields:[{label:"Type",type:"Separator"},{datatype:"Enum",defaultValue:"Physical",displayName:"Material type",name:"MaterialType",options:["Physical","Shader","Point","Basic","Normal","Toon","Matcap","Lambert","Phong"],type:"Attribute"},{label:"Matcap material options",type:"Separator",if:{MaterialType:"Matcap"}},{displayName:"Matcap map",linkableTypes:["Image"],type:"Link",usageAs:"Matcap",if:{MaterialType:"Matcap"}},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{MaterialType:"Matcap",Matcap:{$isset:!0}},name:"MatcapWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{MaterialType:"Matcap",Matcap:{$isset:!0}},name:"MatcapWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{MaterialType:"Matcap",Matcap:{$isset:!0}},name:"MatcapMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{MaterialType:"Matcap",Matcap:{$isset:!0}},name:"MatcapMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{MaterialType:"Matcap",Matcap:{$isset:!0}},name:"MatcapAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Toon material options",type:"Separator",if:{MaterialType:"Toon"}},{displayName:"Gradient map",linkableTypes:["Image"],if:{MaterialType:"Toon"},type:"Link",usageAs:"Gradient"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{MaterialType:"Toon",Gradient:{$isset:!0}},name:"GradientWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{MaterialType:"Toon",Gradient:{$isset:!0}},name:"GradientWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Nearest",displayName:"Mag filter",if:{MaterialType:"Toon",Gradient:{$isset:!0}},name:"GradientMagFilter",options:["Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Nearest",displayName:"Min Filter",if:{MaterialType:"Toon",Gradient:{$isset:!0}},name:"GradientMinFilter",options:["Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{MaterialType:"Toon",Gradient:{$isset:!0}},name:"GradientAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Basic material options",type:"Separator",if:{MaterialType:"Basic"}},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},displayName:"Color",name:"EmissionColor",type:"Attribute",if:{MaterialType:"Basic"}},{label:"Custom shaders",type:"Separator",if:{MaterialType:"Shader"}},{displayName:"Vertex shader",linkableTypes:["Vertex Shader"],type:"Link",usageAs:"VertexShader",if:{MaterialType:"Shader"}},{displayName:"Pixel shader",linkableTypes:["Pixel Shader"],type:"Link",usageAs:"PixelShader",if:{MaterialType:"Shader"}},{label:"Point rendering",type:"Separator",if:{MaterialType:"Point"}},{datatype:"Float",defaultValue:1,displayName:"Size",if:{MaterialType:"Point"},minValue:0,name:"PointSize",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Size attenuation",if:{MaterialType:"Point"},name:"PointSizeAttenuation",type:"Attribute"},{label:"Attenuation",type:"Separator",if:{MaterialType:"Physical"}},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},displayName:"Color",info:"The color that white light turns into due to absorption when reaching the attenuation distance.",name:"AttenuationColor",type:"Attribute",if:{MaterialType:"Physical"}},{datatype:"Float",defaultValue:1e3,displayName:"Distance",info:"Density of the medium given as the average distance that light travels in the medium before interacting with a particle. The value is given in world space units, and must be greater than zero.",minValue:1e-5,name:"AttenuationDistance",type:"Attribute",if:{MaterialType:"Physical"}},{label:"Diffuse",type:"Separator",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},displayName:"Color",name:"DiffuseColor",type:"Attribute",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{displayName:"Albedo map",linkableTypes:["Image","Composition","Video"],type:"Link",usageAs:"Albedo",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Albedo:{$isset:!0}},name:"AlbedoWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Albedo:{$isset:!0}},name:"AlbedoWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Albedo:{$isset:!0}},name:"AlbedoMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Albedo:{$isset:!0}},name:"AlbedoMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Albedo:{$isset:!0}},name:"AlbedoAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Vertex Colors",name:"VertexColors",type:"Attribute"},{label:"Transparency",type:"Separator"},{datatype:"Float",defaultValue:0,displayName:"Alpha test",maxValue:1,minValue:0,name:"AlphaTest",type:"Attribute",widget:"Slider"},{datatype:"Boolean",defaultValue:!1,displayName:"Transparent",name:"Transparent",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Opacity",if:{Transparent:!0},maxValue:1,minValue:0,name:"Opacity",type:"Attribute",widget:"Slider"},{displayName:"Alpha map",linkableTypes:["Image"],type:"Link",usageAs:"Alpha",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Alpha:{$isset:!0}},name:"AlphaWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Alpha:{$isset:!0}},name:"AlphaWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Alpha:{$isset:!0}},name:"AlphaMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Alpha:{$isset:!0}},name:"AlphaMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Point"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Alpha:{$isset:!0}},name:"AlphaAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Emission",type:"Separator",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Color",defaultValue:{a:255,b:0,g:0,r:0},displayName:"Color",name:"EmissiveColor",type:"Attribute",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Float",defaultValue:1,displayName:"Intensity",maxValue:10,minValue:0,name:"EmissiveIntensity",type:"Attribute",widget:"Slider",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{displayName:"Emissive map",linkableTypes:["Image"],type:"Link",usageAs:"Emissive",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Emissive:{$isset:!0}},name:"EmissiveWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Emissive:{$isset:!0}},name:"EmissiveWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Emissive:{$isset:!0}},name:"EmissiveMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Emissive:{$isset:!0}},name:"EmissiveMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Emissive:{$isset:!0}},name:"EmissiveAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Sheen",type:"Separator",if:{MaterialType:"Physical"}},{datatype:"Float",defaultValue:0,displayName:"Sheen",maxValue:1,minValue:0,name:"Sheen",type:"Attribute",if:{MaterialType:"Physical"}},{datatype:"Float",defaultValue:0,displayName:"Sheen roughness",maxValue:1,minValue:0,name:"SheenRoughness",type:"Attribute",if:{MaterialType:"Physical"}},{displayName:"Sheen roughness map",linkableTypes:["Image"],type:"Link",usageAs:"SheenRoughnessMap",if:{MaterialType:"Physical"}},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{MaterialType:"Physical",SheenRoughnessMap:{$isset:!0}},name:"SheenRoughnessWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{MaterialType:"Physical",SheenRoughnessMap:{$isset:!0}},name:"SheenRoughnessWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{MaterialType:"Physical",SheenRoughnessMap:{$isset:!0}},name:"SheenRoughnessMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{MaterialType:"Physical",SheenRoughnessMap:{$isset:!0}},name:"SheenRoughnessMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{MaterialType:"Physical",SheenRoughnessMap:{$isset:!0}},name:"SheenRoughnessAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},displayName:"Sheen color",name:"SheenColor",type:"Attribute",if:{MaterialType:"Physical"}},{displayName:"Sheen color map",linkableTypes:["Image"],type:"Link",usageAs:"SheenColorMap",if:{MaterialType:"Physical"}},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{MaterialType:"Physical",SheenColorMap:{$isset:!0}},name:"SheenColorWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{MaterialType:"Physical",SheenColorMap:{$isset:!0}},name:"SheenColorWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{MaterialType:"Physical",SheenColorMap:{$isset:!0}},name:"SheenColorMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{MaterialType:"Physical",SheenColorMap:{$isset:!0}},name:"SheenColorMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{MaterialType:"Physical",SheenColorMap:{$isset:!0}},name:"SheenColorAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Normal",type:"Separator",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{displayName:"Normal map",linkableTypes:["Image"],type:"Link",usageAs:"Normal",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Vector2d",defaultValue:{x:1,y:1},displayName:"Scale",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Normal:{$isset:!0}},maxValue:10,minValue:0,name:"NormalScale2d",type:"Attribute"},{datatype:"Enum",defaultValue:"TangentSpace",displayName:"Type",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Normal:{$isset:!0}},name:"NormalType",options:["TangentSpace","ObjectSpace"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Normal:{$isset:!0}},name:"NormalWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Normal:{$isset:!0}},name:"NormalWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Normal:{$isset:!0}},name:"NormalMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Normal:{$isset:!0}},name:"NormalMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Normal:{$isset:!0}},name:"NormalAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Roughness",type:"Separator",if:{MaterialType:"Physical"}},{datatype:"Float",defaultValue:1,displayName:"Roughness Intensity",maxValue:1,minValue:0,name:"RoughnessIntensity",type:"Attribute",widget:"Slider",if:{MaterialType:"Physical"}},{displayName:"Roughness map",linkableTypes:["Image"],type:"Link",usageAs:"Roughness",if:{MaterialType:"Physical"}},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{Roughness:{$isset:!0}},name:"RoughnessWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{Roughness:{$isset:!0}},name:"RoughnessWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{Roughness:{$isset:!0}},name:"RoughnessMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{Roughness:{$isset:!0}},name:"RoughnessMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{MaterialType:"Physical",Roughness:{$isset:!0}},name:"RoughnessAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Metalness",type:"Separator",if:{MaterialType:"Physical"}},{datatype:"Float",defaultValue:1,displayName:"Metalness Intensity",maxValue:1,minValue:0,name:"MetalnessIntensity",type:"Attribute",widget:"Slider",if:{MaterialType:"Physical"}},{displayName:"Metalness map",linkableTypes:["Image"],type:"Link",usageAs:"Metalness",if:{MaterialType:"Physical"}},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{Metalness:{$isset:!0}},name:"MetalnessWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{Metalness:{$isset:!0}},name:"MetalnessWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{Metalness:{$isset:!0}},name:"MetalnessMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{Metalness:{$isset:!0}},name:"MetalnessMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{MaterialType:"Physical",Metalness:{$isset:!0}},name:"MetalnessAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Specular",type:"Separator",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"}]}},{datatype:"Float",defaultValue:1,displayName:"Specular intensity",maxValue:1,minValue:0,name:"SpecularIntensity",type:"Attribute",widget:"Slider",if:{MaterialType:"Physical"}},{displayName:"Specular intensity map",linkableTypes:["Image"],type:"Link",usageAs:"SpecularIntensityMap",if:{MaterialType:"Physical"}},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{MaterialType:"Physical",SpecularIntensityMap:{$isset:!0}},name:"SpecularIntensityWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{MaterialType:"Physical",SpecularIntensityMap:{$isset:!0}},name:"SpecularIntensityWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{MaterialType:"Physical",SpecularIntensityMap:{$isset:!0}},name:"SpecularIntensityMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{MaterialType:"Physical",SpecularIntensityMap:{$isset:!0}},name:"SpecularIntensityMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{MaterialType:"Physical",SpecularIntensityMap:{$isset:!0}},name:"SpecularIntensityAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},if:{MaterialType:"Physical"},displayName:"Specular color",name:"SpecularColor",type:"Attribute"},{displayName:"Specular color map",linkableTypes:["Image"],if:{MaterialType:"Physical"},type:"Link",usageAs:"SpecularColorMap"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{MaterialType:"Physical",SpecularColorMap:{$isset:!0}},name:"SpecularColorWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{MaterialType:"Physical",SpecularColorMap:{$isset:!0}},name:"SpecularColorWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{MaterialType:"Physical",SpecularColorMap:{$isset:!0}},name:"SpecularColorMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{MaterialType:"Physical",SpecularColorMap:{$isset:!0}},name:"SpecularColorMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{MaterialType:"Physical",SpecularColorMap:{$isset:!0}},name:"SpecularColorAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Ambient occlusion",type:"Separator",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{displayName:"Ambient occlusion map",linkableTypes:["Image"],type:"Link",usageAs:"AmbientOcclusion",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Float",defaultValue:1,displayName:"Intensity",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],AmbientOcclusion:{$isset:!0}},maxValue:10,minValue:0,name:"AmbientOcclusionIntensity",type:"Attribute",widget:"Slider"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],AmbientOcclusion:{$isset:!0}},name:"AmbientOcclusionWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],AmbientOcclusion:{$isset:!0}},name:"AmbientOcclusionWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],AmbientOcclusion:{$isset:!0}},name:"AmbientOcclusionMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],AmbientOcclusion:{$isset:!0}},name:"AmbientOcclusionMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],AmbientOcclusion:{$isset:!0}},name:"AmbientOcclusionAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Clearcoat",type:"Separator",if:{MaterialType:"Physical"}},{datatype:"Float",defaultValue:0,displayName:"Intensity",maxValue:1,minValue:0,name:"ClearcoatLevel",type:"Attribute",widget:"Slider",if:{MaterialType:"Physical"}},{displayName:"Clearcoat map",linkableTypes:["Image"],type:"Link",usageAs:"Clearcoat",if:{MaterialType:"Physical"}},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{MaterialType:"Physical",Clearcoat:{$isset:!0}},name:"ClearcoatWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{MaterialType:"Physical",Clearcoat:{$isset:!0}},name:"ClearcoatWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{MaterialType:"Physical",Clearcoat:{$isset:!0}},name:"ClearcoatMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{MaterialType:"Physical",Clearcoat:{$isset:!0}},name:"ClearcoatMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{MaterialType:"Physical",Clearcoat:{$isset:!0}},name:"ClearcoatAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{displayName:"Normal map",linkableTypes:["Image"],type:"Link",usageAs:"ClearcoatNormalMap",if:{MaterialType:"Physical"}},{datatype:"Vector2d",defaultValue:{x:1,y:1},displayName:"Normal scale",if:{MaterialType:"Physical",ClearcoatNormalMap:{$isset:!0}},maxValue:10,minValue:0,name:"ClearcoatNormalScale2d",type:"Attribute",widget:"Slider"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Normal H-wrapping",if:{MaterialType:"Physical",ClearcoatNormalMap:{$isset:!0}},name:"ClearcoatNormalWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Normal V-wrapping",if:{MaterialType:"Physical",ClearcoatNormalMap:{$isset:!0}},name:"ClearcoatNormalWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Normal mag filter",if:{MaterialType:"Physical",ClearcoatNormalMap:{$isset:!0}},name:"ClearcoatNormalMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Normal min Filter",if:{MaterialType:"Physical",ClearcoatNormalMap:{$isset:!0}},name:"ClearcoatNormalMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Normal Anisotropy",if:{MaterialType:"Physical",ClearcoatNormalMap:{$isset:!0}},name:"ClearcoatNormalAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Roughness intensity",maxValue:1,minValue:0,name:"ClearcoatRoughness",type:"Attribute",widget:"Slider",if:{MaterialType:"Physical"}},{displayName:"Roughness map",linkableTypes:["Image"],type:"Link",usageAs:"ClearcoatRoughnessMap"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Roughness H-wrapping",if:{MaterialType:"Physical",ClearcoatRoughnessMap:{$isset:!0}},name:"ClearcoatRoughnessWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Roughness V-wrapping",if:{MaterialType:"Physical",ClearcoatRoughnessMap:{$isset:!0}},name:"ClearcoatRoughnessWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Roughness mag filter",if:{MaterialType:"Physical",ClearcoatRoughnessMap:{$isset:!0}},name:"ClearcoatRoughnessMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Roughness min Filter",if:{MaterialType:"Physical",ClearcoatRoughnessMap:{$isset:!0}},name:"ClearcoatRoughnessMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Roughness Anisotropy",if:{MaterialType:"Physical",ClearcoatRoughnessMap:{$isset:!0}},name:"ClearcoatRoughnessAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Reflections and Refractions",type:"Separator",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Float",defaultValue:.98,displayName:"Refraction ratio",if:{$or:[{MaterialType:"Basic"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]},minValue:0,maxValue:1,name:"RefractionRatio",type:"Attribute"},{datatype:"Float",defaultValue:.5,displayName:"Reflectivity",maxValue:1,minValue:0,name:"Reflectivity",type:"Attribute",widget:"Slider",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Float",defaultValue:1.5,displayName:"Index of refraction",maxValue:2.333,minValue:1,name:"IndexOfRefraction",type:"Attribute",widget:"Slider",if:{MaterialType:"Physical"}},{label:"Environment",type:"Separator",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{displayName:"Environment map",linkableTypes:["HDR Image"],type:"Link",usageAs:"Environment",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Float",defaultValue:1,displayName:"Intensity",if:{$or:[{MaterialType:"Physical"}],Environment:{$isset:!0}},maxValue:10,minValue:0,name:"EnvironmentIntensity",type:"Attribute",widget:"Slider"},{datatype:"Enum",defaultValue:"Multiply",info:"How to combine the result of the surface's color with the environment map, if any. If mix is chosen, the .reflectivity is used to blend between the two colors.",displayName:"Surface combination",name:"SurfaceEnvironmentCombination",options:["Multiply","Mix","Add"],type:"Attribute",if:{$or:[{MaterialType:"Lambert"},{MaterialType:"Basic"},{MaterialType:"Phong"}]}},{label:"Thickness",type:"Separator",if:{MaterialType:"Physical"}},{datatype:"Float",defaultValue:0,displayName:"Thickness",minValue:0,name:"Thickness",type:"Attribute",if:{MaterialType:"Physical"}},{displayName:"Thickness map",linkableTypes:["Image"],type:"Link",usageAs:"ThicknessMap",if:{MaterialType:"Physical"}},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{MaterialType:"Physical",ThicknessMap:{$isset:!0}},name:"ThicknessWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{MaterialType:"Physical",ThicknessMap:{$isset:!0}},name:"ThicknessWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{MaterialType:"Physical",ThicknessMap:{$isset:!0}},name:"ThicknessMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{MaterialType:"Physical",ThicknessMap:{$isset:!0}},name:"ThicknessMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{MaterialType:"Physical",ThicknessMap:{$isset:!0}},name:"ThicknessAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Displacement",type:"Separator",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{displayName:"Displacement map",linkableTypes:["Image"],type:"Link",usageAs:"Displacement",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Float",defaultValue:.1,displayName:"Scale",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Displacement:{$isset:!0}},maxValue:10,minValue:0,name:"DisplacementScale",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:0,displayName:"Bias",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Displacement:{$isset:!0}},name:"DisplacementBias",type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Displacement:{$isset:!0}},name:"DisplacementWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Displacement:{$isset:!0}},name:"DisplacementWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Displacement:{$isset:!0}},name:"DisplacementMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Displacement:{$isset:!0}},name:"DisplacementMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],Displacement:{$isset:!0}},name:"DisplacementAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Lightmaps",type:"Separator",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{displayName:"Light map",linkableTypes:["Image"],type:"Link",usageAs:"LightMap",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Float",defaultValue:1,displayName:"Intensity",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],LightMap:{$isset:!0}},maxValue:100,minValue:0,name:"LightMapIntensity",type:"Attribute",widget:"Slider"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],LightMap:{$isset:!0}},name:"LightMapWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],LightMap:{$isset:!0}},name:"LightMapWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],LightMap:{$isset:!0}},name:"LightMapMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],LightMap:{$isset:!0}},name:"LightMapMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Toon"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],LightMap:{$isset:!0}},name:"LightMapAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Specular map options",type:"Separator",if:{$or:[{MaterialType:"Basic"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Float",defaultValue:30,displayName:"Shininess",minValue:0,name:"Shininess",type:"Attribute",widget:"Slider",if:{$or:[{MaterialType:"Phong"}]}},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},if:{MaterialType:"Phong"},displayName:"Specular color",name:"SpecularColor",type:"Attribute"},{displayName:"Specular map",linkableTypes:["Image"],if:{$or:[{MaterialType:"Basic"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]},type:"Link",usageAs:"SpecularMap"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{$or:[{MaterialType:"Basic"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],SpecularMap:{$isset:!0}},name:"SpecularWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{$or:[{MaterialType:"Basic"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],SpecularMap:{$isset:!0}},name:"SpecularWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{$or:[{MaterialType:"Basic"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],SpecularMap:{$isset:!0}},name:"SpecularMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{$or:[{MaterialType:"Basic"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],SpecularMap:{$isset:!0}},name:"SpecularMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{$or:[{MaterialType:"Basic"},{MaterialType:"Lambert"},{MaterialType:"Phong"}],SpecularMap:{$isset:!0}},name:"SpecularAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Transmission",type:"Separator",if:{MaterialType:"Physical"}},{datatype:"Float",defaultValue:0,displayName:"Intensity",maxValue:1,minValue:0,name:"Transmission",type:"Attribute",widget:"Slider",if:{MaterialType:"Physical"}},{displayName:"Transmission map",linkableTypes:["Image"],type:"Link",usageAs:"TransmissionMap",if:{MaterialType:"Physical"}},{datatype:"Enum",defaultValue:"Repeat",displayName:"Horiz. wrapping",if:{MaterialType:"Physical",TransmissionMap:{$isset:!0}},name:"TransmissionWrapS",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Repeat",displayName:"Vert. wrapping",if:{MaterialType:"Physical",TransmissionMap:{$isset:!0}},name:"TransmissionWrapT",options:["Repeat","Clamp to edge","Mirrored repeat"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Mag filter",if:{MaterialType:"Physical",TransmissionMap:{$isset:!0}},name:"TransmissionMagFilter",options:["Linear","Nearest"],type:"Attribute"},{datatype:"Enum",defaultValue:"Linear, Mipmap linear",displayName:"Min Filter",if:{MaterialType:"Physical",TransmissionMap:{$isset:!0}},name:"TransmissionMinFilter",options:["Nearest","Nearest, Mipmap nearest","Nearest, Mipmap linear","Linear","Linear, Mipmap nearest","Linear, Mipmap linear"],type:"Attribute"},{datatype:"Enum",defaultValue:"1x",displayName:"Anisotropy",if:{MaterialType:"Physical",TransmissionMap:{$isset:!0}},name:"TransmissionAnisotropy",options:["1x","2x","4x","8x","16x"],type:"Attribute"},{label:"Blending",type:"Separator"},{datatype:"Enum",defaultValue:"Normal",displayName:"Mode",name:"Blending",options:["None","Normal","Additive","Subtractive","Multiply","Custom"],type:"Attribute"},{datatype:"Enum",defaultValue:"Source alpha",displayName:"Source",name:"BlendSrc",options:["Zero","One","Source color","One minus source color","Source alpha","One minus source alpha","Destination alpha","One minus destination alpha","Destination color","One minus destination color","Source alpha saturate"],type:"Attribute",if:{Blending:"Custom"}},{datatype:"Enum",defaultValue:"One minus source alpha",displayName:"Destination",name:"BlendDest",options:["Zero","One","Source color","One minus source color","Source alpha","One minus source alpha","Destination alpha","One minus destination alpha","Destination color","One minus destination color"],type:"Attribute",if:{Blending:"Custom"}},{datatype:"Enum",defaultValue:"Add",displayName:"Equation",name:"BlendEquation",options:["Add","Subtract","Reverse subtract","Min","Max"],type:"Attribute",if:{Blending:"Custom"}},{label:"Depth test",type:"Separator"},{datatype:"Boolean",defaultValue:!0,displayName:"Active",name:"DepthTest",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Write",if:{DepthTest:!0},name:"DepthWrite",type:"Attribute"},{datatype:"Enum",defaultValue:"Less/equal",displayName:"Mode",if:{DepthTest:!0},name:"DepthMode",options:["Never","Always","Less","Less/equal","Greater/equal","Greater","Not equal"],type:"Attribute"},{label:"Culling",type:"Separator"},{datatype:"Enum",defaultValue:"Back",displayName:"Mode",name:"Culling",options:["Front","Back","Off"],type:"Attribute"},{label:"Flat shading",type:"Separator",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Boolean",defaultValue:!1,displayName:"Active",name:"FlatShading",type:"Attribute",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Normal"},{MaterialType:"Matcap"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{label:"Wireframe",type:"Separator",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Shader"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}},{datatype:"Boolean",defaultValue:!1,displayName:"Wireframe",name:"Wireframe",type:"Attribute",if:{$or:[{MaterialType:"Physical"},{MaterialType:"Basic"},{MaterialType:"Normal"},{MaterialType:"Toon"},{MaterialType:"Shader"},{MaterialType:"Lambert"},{MaterialType:"Phong"}]}}],name:"Material",updateRequiresThumbRefresh:!0,creatableEmpty:!0},{_id:{$oid:"5e6a1ad189707feef9173394"},contentTypes:["model/obj","model/gltf-binary","model/vnd.usdz+zip","model/draco","model/ply","model/fbx"],fieldSets:[],fields:[{linkableTypes:["Material"],type:"Link",usageAs:"Material"},{doesNotAffectThumbnail:!0,linkableTypes:["Mesh"],loadingManager:"ignore",preload:!1,type:"Link",usageAs:"USDZ"},{doesNotAffectThumbnail:!0,linkableTypes:["Mesh"],loadingManager:"ignore",preload:!1,type:"Link",usageAs:"GLB"},{datatype:"Vector3d",defaultValue:{x:0,y:0,z:0},name:"Pivot",type:"Attribute"},{datatype:"Transform",defaultValue:{position:{x:0,y:0,z:0},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},name:"DefaultTransform",displayName:"Default transform",type:"Attribute"}],name:"Mesh",updateRequiresThumbRefresh:!0,creatableEmpty:!1},{_id:{$oid:"5e6a1ad189707feef9173396"},contentTypes:[""],fields:[{label:"Camera & Composition",type:"Separator"},{datatype:"Enum",defaultValue:"Automatic user controllable camera",displayName:"Camera mode",info:"Camera to render during playback. The main camera is the one with the 'mainCamera' Tag or if only one camera exists, that is the one. Composer setting will render whatever the composition defines.",name:"CameraMode",options:["Automatic user controllable camera","Main camera","Composer"],type:"Attribute"},{linkableTypes:["Composition"],type:"Link",if:{CameraMode:"Composer"},usageAs:"Composition",mandatory:!0},{label:"Environment & Background",type:"Separator"},{datatype:"Enum",defaultValue:"None",displayName:"Background mode",name:"BackgroundMode",options:["None","Color","Image","Environment map","Shader"],type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Background blurriness",if:{BackgroundMode:"Environment map"},maxValue:1,minValue:0,name:"BackgroundBlurriness",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:1,displayName:"Background intensity",if:{$or:[{BackgroundMode:"Image"},{BackgroundMode:"Environment map"}]},maxValue:10,minValue:0,name:"BackgroundIntensity",type:"Attribute",widget:"Slider"},{displayName:"Background shader",if:{BackgroundMode:"Shader"},linkableTypes:["Background Shader"],type:"Link",usageAs:"BackgroundShader",mandatory:!0},{displayName:"Background image",if:{BackgroundMode:"Image"},linkableTypes:["Image"],type:"Link",usageAs:"Background",mandatory:!0},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},displayName:"Background color",if:{BackgroundMode:"Color"},name:"BackgroundColor",type:"Attribute"},{displayName:"Environment map",linkableTypes:["HDR Image"],type:"Link",usageAs:"Environment"},{datatype:"Float",defaultValue:1,displayName:"Environment intensity",maxValue:10,minValue:0,name:"EnvironmentIntensity",type:"Attribute",widget:"Slider"},{datatype:"Color",defaultValue:{a:255,b:0,g:0,r:0},displayName:"Clear color",name:"ClearColor",type:"Attribute"},{label:"Rendering",type:"Separator",collapsed:!1},{datatype:"Enum",defaultValue:"PCF Shadow Map",displayName:"Shadow type",name:"ShadowType",options:["Basic Shadow Map","PCF Shadow Map","VSM Shadow Map"],type:"Attribute"}],name:"Scene",updateRequiresThumbRefresh:!0,inherits:"Prefab",creatableEmpty:!0},{_id:{$oid:"5e6a1ad189707fcef4252336"},contentTypes:[""],fieldSets:[{fields:[{label:"3D Object",type:"Separator"},{datatype:"Boolean",defaultValue:!0,displayName:"Active",info:"Indicates if the 3D object is currently active or inactive. When set to true, the object is active.",name:"Active",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Static",info:"A Boolean attribute indicating whether the 3D object is static or not. Static objects can and will never be transformed during runtime.",name:"Static",type:"Attribute"},{datatype:"String",defaultValue:"",displayName:"Name",info:"Specifies the name of the 3D object. This is used for identification and reference in the scene.",name:"Name",type:"Attribute"},{datatype:"Transform",defaultValue:{position:{x:0,y:0,z:0},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},info:"Describes the object's transformation attributes including its position, rotation, and scale in the 3D space.",name:"Transform",type:"Attribute"},{type:"Label",text:"Changing scale in transforms for physics enabled objects is not recommended. Not all objects fully support it. Keep it at least uniform!",labelType:"warning",if:{"PhysicsEnabled?":!0,$or:[{"Transform.scale.x":{$not:1}},{"Transform.scale.y":{$not:1}},{"Transform.scale.z":{$not:1}}]}},{datatype:"Layers",defaultValue:[0],info:"Defines the layers that the 3D object is part of. Layers are used for managing object interactions and visibility in the scene.",name:"Layers",type:"Attribute"},{datatype:"Tags",defaultValue:[],info:"Lists tags associated with the 3D object. Tags are useful for categorizing and searching objects in the scene.",name:"Tags",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Receive shadow",info:"Determines whether the object can receive shadows from other objects. Set to true if the object should display shadows cast upon it.",name:"ReceiveShadow",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Cast shadow",info:"Controls whether the object casts shadows in the presence of light sources. Set to true to enable shadow casting from this object.",name:"CastShadow",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Rendered",info:"Indicates if the 3D object is being rendered.",name:"Rendered",type:"Attribute"}],name:"3dObjectDefault"},{fields:[{label:"3D Object",type:"Separator"},{datatype:"Boolean",defaultValue:!0,displayName:"Active",info:"A Boolean attribute indicating whether the 3D object is active or not. When set to true, the object is considered active in the scene.",name:"Active",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Static",info:"A Boolean attribute indicating whether the 3D object is static or not. Static objects can and will never be transformed during runtime.",name:"Static",type:"Attribute"},{datatype:"String",defaultValue:"",displayName:"Name",info:"A string attribute representing the name of the 3D object. It is used to identify and reference the object within the scene.",name:"Name",type:"Attribute"},{datatype:"Transform",defaultValue:{position:{x:0,y:0,z:0},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},info:"Specifies the transformation properties of the 3D object, including its position, rotation, and scale in the scene.",name:"Transform",type:"Attribute"},{datatype:"Layers",defaultValue:[0],info:"Determines the layers the 3D object belongs to. Layers are used to organize objects in the scene for various purposes like rendering and interaction.",name:"Layers",type:"Attribute"},{datatype:"Tags",defaultValue:[],info:"A list of tags associated with the 3D object. Tags are used for categorizing and identifying objects for scripting and scene management.",name:"Tags",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Rendered",info:"Indicates if the 3D object is being rendered.",name:"Rendered",type:"Attribute"}],name:"3dObjectNoShadows"},{fields:[{label:"Physics",type:"Separator"},{datatype:"Boolean",defaultValue:!1,displayName:"Physics enabled",info:"A Boolean attribute that determines whether physics properties are applied to the object. Disabling it turns off physics calculations.",name:"PhysicsEnabled",type:"Attribute"},{datatype:"Enum",defaultValue:"Rigid body",displayName:"Body type",if:{PhysicsEnabled:!0},name:"BodyType",options:["Rigid body","Soft body","Ghost object"],type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Separate subobjects",if:{BodyType:"Rigid body",PhysicsEnabled:!0},info:"When adding all subobjects of the mesh separately, they will all act individually. We lose however also the possibility to control and watch them as a single object. The configured mass will be distributed among all subobjects",name:"SeparateSubobjects",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Mass",if:{BodyType:{$not:"Ghost object"},PhysicsEnabled:!0},info:"Specifies the mass of the object as a float value. The mass must be a non-negative value.",minValue:0,name:"Mass",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Pressure",if:{BodyType:"Soft body",PhysicsEnabled:!0},info:"Specifies the pressure of the soft body as a float value. The pressure must be a non-negative value.",minValue:0,name:"Pressure",type:"Attribute"},{datatype:"Float",defaultValue:.01,displayName:"Damping",if:{BodyType:"Soft body",PhysicsEnabled:!0},info:"Specifies the damping of the soft body.",minValue:0,name:"Damping",type:"Attribute"},{datatype:"Float",defaultValue:.04,displayName:"Margin",if:{BodyType:{$not:"Ghost object"},PhysicsEnabled:!0},info:"Defines the margin of the object for physics calculations as a float value. The margin is a non-negative value.",minValue:0,name:"Margin",type:"Attribute"},{datatype:"Float",defaultValue:.1,displayName:"Restitution",if:{BodyType:{$not:"Ghost object"},PhysicsEnabled:!0},info:"Determines the restitution (bounciness) of the object. It's a float value affecting how the object bounces upon impact.",name:"Restitution",type:"Attribute"},{datatype:"Float",defaultValue:.1,displayName:"Friction",if:{BodyType:{$not:"Ghost object"},PhysicsEnabled:!0},info:"Sets the friction coefficient of the object. It's a float value, affecting how the object slides against other surfaces.",name:"Friction",type:"Attribute"},{datatype:"Float",defaultValue:.1,displayName:"Spinning friction",if:{BodyType:{$not:"Ghost object"},PhysicsEnabled:!0},info:"Defines the spinning friction of the object as a float value, affecting the object's rotational resistance.",name:"SpinningFriction",type:"Attribute"},{datatype:"Float",defaultValue:.1,displayName:"Rolling friction",if:{BodyType:{$not:"Ghost object"},PhysicsEnabled:!0},info:"Specifies the rolling friction of the object. It's a float value that influences how the object rolls over surfaces.",name:"RollingFriction",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Linear damping",if:{BodyType:"Rigid body",PhysicsEnabled:!0},info:"Sets the linear damping.",name:"LinearDamping",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Angular damping",if:{BodyType:"Rigid body",PhysicsEnabled:!0},info:"Sets the angular damping.",name:"AngularDamping",type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:1,y:1,z:1},displayName:"Linear factor",if:{BodyType:"Rigid body",PhysicsEnabled:!0},info:"A Vector3d value that defines the linear factor of the object in terms of x, y, and z axes, controlling how the object moves linearly.",name:"LinearFactor",type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:0,y:0,z:0},displayName:"Linear velocity",if:{BodyType:"Rigid body",PhysicsEnabled:!0},info:"Defines the object's linear velocity using a Vector3d value, representing the velocity along the x, y, and z axes.",name:"LinearVelocity",type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:1,y:1,z:1},displayName:"Angular factor",if:{BodyType:"Rigid body",PhysicsEnabled:!0},info:"A Vector3d attribute that specifies the angular factor of the object, influencing the object's rotation around each axis.",name:"AngularFactor",type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:0,y:0,z:0},displayName:"Angular velocity",if:{BodyType:"Rigid body",PhysicsEnabled:!0},info:"Sets the angular velocity of the object using a Vector3d value, affecting the object's rotational speed.",name:"AngularVelocity",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Is kinematic",if:{BodyType:"Rigid body",PhysicsEnabled:!0,SeparateSubobjects:!1},info:"A Boolean attribute that makes the object kinematic when true, meaning it will not be affected by physics but can still affect other objects.",name:"IsKinematic",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Disable deactivation",if:{BodyType:{$not:"Ghost object"},PhysicsEnabled:!0,$or:[{IsKinematic:!1},{BodyType:"Soft body"}]},info:"When set to true, object will be simulated in physics forever. Otherwise it will be deactivated when not moving anymore",name:"DisableDeactivation",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Watch collisions",if:{BodyType:{$not:"Ghost object"},PhysicsEnabled:!0,SeparateSubobjects:!1},info:"When set to true, enables monitoring of collisions involving the object.",name:"WatchCollisions",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Report contact points",if:{BodyType:{$not:"Ghost object"},PhysicsEnabled:!0,SeparateSubobjects:!1},info:"If set to true, collision events will contain the exact contact points. Only enable if you really need it as it costs performance.",name:"ReportContactPoints",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Filter potential collisions",if:{BodyType:{$not:"Ghost object"},PhysicsEnabled:!0,SeparateSubobjects:!1},info:"The physics engine might report collisions without contact points in cases where objects get close. Filter these out by setting this.",name:"FilterPotentialCollisions",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Watch linear velocity",if:{BodyType:{$not:"Ghost object"},PhysicsEnabled:!0,SeparateSubobjects:!1},info:"Enables the tracking of changes in the object's linear velocity when set to true.",name:"WatchLinearVelocity",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Watch angular velocity",if:{BodyType:{$not:"Ghost object"},PhysicsEnabled:!0,SeparateSubobjects:!1},info:"Allows for the monitoring of changes in the object's angular velocity when enabled.",name:"WatchAngularVelocity",type:"Attribute"},{if:{BodyType:{$not:"Soft body"},PhysicsEnabled:!0},label:"Collider",type:"Separator"},{datatype:"Enum",defaultValue:"Self",displayName:"Collider type",if:{BodyType:{$not:"Soft body"},PhysicsEnabled:!0},name:"ColliderType",options:["Self","Bounding Box","Bounding Sphere","Bounding Cylinder","Capsule","Convex Hull","Custom Mesh"],type:"Attribute"},{datatype:"Enum",defaultValue:"Derive from mesh",displayName:"Capsule size",if:{BodyType:{$not:"Soft body"},ColliderType:"Capsule",PhysicsEnabled:!0},name:"CapsuleSize",options:["Derive from mesh","Manual"],type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Capsule height",if:{BodyType:{$not:"Soft body"},ColliderType:"Capsule",CapsuleSize:"Manual",PhysicsEnabled:!0},name:"CapsuleHeight",minValue:0,type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Capsule radius",if:{BodyType:{$not:"Soft body"},ColliderType:"Capsule",CapsuleSize:"Manual",PhysicsEnabled:!0},name:"CapsuleRadius",minValue:0,type:"Attribute"},{displayName:"Collider mesh",if:{BodyType:{$not:"Soft body"},ColliderType:"Custom Mesh",PhysicsEnabled:!0},linkableTypes:["Mesh","Mesh Collection"],type:"Link",usageAs:"ColliderMesh",mandatory:!0},{datatype:"Enum",defaultValue:"",displayName:"Collection entry",if:{BodyType:{$not:"Soft body"},ColliderType:"Custom Mesh",PhysicsEnabled:!0,$optionsexist:!0},name:"ColliderMeshCollectionEntry",options:[],type:"Attribute"}],name:"Physics"},{fields:[{datatype:"Enum",defaultValue:"Single",displayName:"Source type",name:"SourceType",options:["Single","Collection"],type:"Attribute"},{displayName:"Audio item",if:{SourceType:"Single"},linkableTypes:["Audio"],type:"Link",usageAs:"AudioItem"},{displayName:"Audio collection",if:{SourceType:"Collection"},linkableTypes:["Audio Collection"],type:"Link",usageAs:"AudioCollectionItem"},{datatype:"Enum",defaultValue:"",displayName:"Collection entry",if:{SourceType:"Collection"},name:"AudioCollectionEntry",options:[],type:"Attribute"}],name:"AudioLink"},{fields:[{displayName:"Mesh item",linkableTypes:["Mesh","Mesh Collection"],type:"Link",usageAs:"Mesh",mandatory:!0},{datatype:"Enum",defaultValue:"",displayName:"Collection entry",if:{$optionsexist:!0},name:"MeshCollectionEntry",options:[],type:"Attribute"}],name:"MeshLink"}],fields:[{childTypes:[{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Mesh specific fields",type:"Separator"},{name:"MeshLink",type:"FieldSet"},{datatype:"Enum",defaultValue:"Pivot",name:"OriginMode",displayName:"Origin mode",if:{$or:[{MeshCollectionEntry:{$isset:!0}},{Mesh:{$isset:!0}}]},options:["Pivot","Center","Custom"],type:"Attribute"},{name:"CustomPivot",displayName:"Custom Pivot",type:"Attribute",datatype:"Vector3d",if:{OriginMode:"Custom"},defaultValue:{x:0,y:0,z:0}},{datatype:"Animations",defaultValue:[],displayName:"Animations",if:{$or:[{MeshCollectionEntry:{$isset:!0}},{Mesh:{$isset:!0}}]},name:"Animations",type:"Attribute"},{name:"Physics",type:"FieldSet"}],mainItemField:"Mesh",typeName:"Mesh"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"ScriptedMesh specific fields",type:"Separator"},{displayName:"Material(s)",linkableTypes:["Material","Material Collection"],type:"Link",usageAs:"Materials"},{datatype:"Boolean",defaultValue:!1,displayName:"Indexed",info:"Indicates if the geometry buffer is indexed.",name:"Indexed",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Have positions",info:"Add a position attribute to the mesh.",name:"HavePositions",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Have normals",info:"Add a normal attribute to the mesh.",name:"HaveNormals",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Have colors",info:"Add a color attribute to the mesh.",name:"HaveColors",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Have UV Coords",info:"Add a UV texture coordinate attribute to the mesh.",name:"HaveUVs",type:"Attribute"},{name:"Physics",type:"FieldSet"}],typeName:"ScriptedMesh"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Splats specific fields",type:"Separator"},{linkableTypes:["Gaussian Splats"],type:"Link",usageAs:"Splats",mandatory:!0}],mainItemField:"Splats",typeName:"GaussianSplats"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Prefab specific fields",type:"Separator"},{linkableTypes:["Scene","Prefab"],type:"Link",usageAs:"Prefab",mandatory:!0}],mainItemField:"Prefab",typeName:"Prefab"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Points specific fields",type:"Separator"},{name:"MeshLink",type:"FieldSet"}],mainItemField:"Mesh",typeName:"Points"},{fields:[{name:"3dObjectNoShadows",type:"FieldSet"},{label:"Lightsource specific fields",type:"Separator"},{datatype:"Enum",defaultValue:"Point",name:"Type",options:["Point","Directional","Ambient","Hemisphere","Spot"],type:"Attribute"},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},name:"Color",type:"Attribute"},{datatype:"Color",defaultValue:{a:255,b:64,g:64,r:64},displayName:"Ground color (Hemisphere)",if:{Type:"Hemisphere"},name:"GroundColor",type:"Attribute"},{datatype:"Float",defaultValue:10,minValue:0,name:"Intensity",type:"Attribute"},{datatype:"Float",defaultValue:100,if:{$or:[{Type:"Spot"},{Type:"Point"}]},minValue:0,name:"Distance",type:"Attribute"},{datatype:"Float",defaultValue:2,if:{$or:[{Type:"Spot"},{Type:"Point"}]},minValue:1,name:"Decay",type:"Attribute"},{datatype:"Float",defaultValue:.5,displayName:"Angle",if:{Type:"Spot"},maxValue:1.57,minValue:0,name:"Angle",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Penumbra",if:{Type:"Spot"},maxValue:1,minValue:0,name:"Penumbra",type:"Attribute"},{datatype:"Node",defaultValue:null,displayName:"Target",if:{$or:[{Type:"Spot"},{Type:"Directional"}]},name:"Target",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Cast shadows",name:"CastShadows",type:"Attribute",if:{$or:[{Type:"Point"},{Type:"Directional"},{Type:"Spot"}]}},{datatype:"Float",defaultValue:0,displayName:"Shadow bias",if:{CastShadows:!0,$or:[{Type:"Point"},{Type:"Directional"},{Type:"Spot"}]},maxValue:1,minValue:-1,name:"ShadowBias",type:"Attribute",widget:"Slider"},{datatype:"Enum",defaultValue:512,displayName:"Shadow size",if:{CastShadows:!0,$or:[{Type:"Point"},{Type:"Directional"},{Type:"Spot"}]},name:"ShadowSize",options:[128,256,512,1024,2048],type:"Attribute"},{datatype:"Float",defaultValue:.5,displayName:"Shadow camera near",if:{CastShadows:!0,$or:[{Type:"Point"},{Type:"Directional"},{Type:"Spot"}]},minValue:0,name:"ShadowCameraNear",type:"Attribute"},{datatype:"Float",defaultValue:500,displayName:"Shadow camera far",if:{CastShadows:!0,$or:[{Type:"Point"},{Type:"Directional"},{Type:"Spot"}]},minValue:0,name:"ShadowCameraFar",type:"Attribute"},{datatype:"Float",defaultValue:10,displayName:"Shadow area width",if:{CastShadows:!0,Type:"Directional"},minValue:1,name:"ShadowAreaWidth",type:"Attribute"},{datatype:"Float",defaultValue:10,displayName:"Shadow area height",if:{CastShadows:!0,Type:"Directional"},minValue:1,name:"ShadowAreaHeight",type:"Attribute"},{datatype:"Float",defaultValue:4,displayName:"Shadow radius",minValue:0,name:"ShadowRadius",type:"Attribute",if:{CastShadows:!0,$or:[{Type:"Point"},{Type:"Directional"},{Type:"Spot"}]}},{datatype:"Integer",defaultValue:8,displayName:"VSM blur samples",maxValue:32,minValue:1,name:"VsmBlurSamples",type:"Attribute",if:{CastShadows:!0,$or:[{Type:"Point"},{Type:"Directional"},{Type:"Spot"}]}}],typeName:"Lightsource"},{fields:[{label:"3D Object Fields",type:"Separator"},{datatype:"Boolean",defaultValue:!0,displayName:"Active",info:"Indicates if the 3D object is currently active or inactive. When set to true, the object is active.",name:"Active",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Static",info:"A Boolean attribute indicating whether the 3D object is static or not. Static objects can and will never be transformed during runtime.",name:"Static",type:"Attribute"},{datatype:"String",defaultValue:"",displayName:"Name",info:"Specifies the name of the 3D object. This is used for identification and reference in the scene.",name:"Name",type:"Attribute"},{datatype:"Transform",defaultValue:{position:{x:0,y:0,z:0},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},info:"Describes the object's transformation attributes including its position, rotation, and scale in the 3D space.",name:"Transform",type:"Attribute"},{datatype:"Layers",defaultValue:[],name:"Cullmode",info:"Defines the layers that are not visible to the camera.",displayName:"Cull mode",type:"Attribute"},{datatype:"Tags",defaultValue:[],info:"Lists tags associated with the 3D object. Tags are useful for categorizing and searching objects in the scene.",name:"Tags",type:"Attribute"},{label:"Camera specific fields",type:"Separator"},{datatype:"Enum",defaultValue:"Perspective",name:"Type",options:["Perspective","Orthographic"],type:"Attribute"},{datatype:"Float",defaultValue:60,displayName:"Field of view",if:{Type:"Perspective"},maxValue:360,minValue:1,name:"FieldOfView",type:"Attribute"},{datatype:"Float",defaultValue:-1,displayName:"Left",if:{Type:"Orthographic"},name:"Left",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Right",if:{Type:"Orthographic"},name:"Right",type:"Attribute"},{datatype:"Float",defaultValue:-1,displayName:"Top",if:{Type:"Orthographic"},name:"Top",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Bottom",if:{Type:"Orthographic"},name:"Bottom",type:"Attribute"},{datatype:"Float",defaultValue:.1,displayName:"Near plane",minValue:0,name:"NearPlane",type:"Attribute"},{datatype:"Float",defaultValue:1e3,displayName:"Far plane",minValue:0,name:"FarPlane",type:"Attribute"},{datatype:"Enum",defaultValue:"Free",name:"Mode",options:["Free","Look at"],type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:0,y:0,z:0},if:{Mode:"Look at"},name:"LookAt",type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:0,y:1,z:0},displayName:"Up vector",if:{Mode:"Look at"},name:"UpVector",type:"Attribute"}],typeName:"Camera"},{fields:[{name:"3dObjectNoShadows",type:"FieldSet"}],typeName:"Group"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Box specific fields",type:"Separator"},{linkableTypes:["Material"],type:"Link",usageAs:"Material"},{datatype:"Vector3d",defaultValue:{x:1,y:1,z:1},name:"Size",type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:1,y:1,z:1},name:"Segments",type:"Attribute"},{datatype:"Vector2d",defaultValue:{x:1,y:1},displayName:"UV Scale",name:"UVScale",type:"Attribute"},{name:"Physics",type:"FieldSet"}],typeName:"Box"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"GridMap specific fields",type:"Separator"},{linkableTypes:["GridMap"],type:"Link",usageAs:"GridMap"},{name:"Physics",type:"FieldSet"}],typeName:"GridMap"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Ribbon specific fields",type:"Separator"},{linkableTypes:["Material"],type:"Link",usageAs:"Material"},{datatype:"Integer",defaultValue:16,displayName:"Ring vertex count",minValue:3,maxValue:256,name:"RingVertexCount",type:"Attribute"},{datatype:"Integer",defaultValue:16,displayName:"Path steps",minValue:2,name:"PathStepCount",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Start time",minValue:0,name:"StartTime",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"End time",minValue:0,name:"EndTime",type:"Attribute"},{datatype:"Vector2d",defaultValue:{x:1,y:1},displayName:"UV Scale",name:"UVScale",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Closed",name:"Closed",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Add caps",name:"AddCaps",if:{Closed:!1},type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Vertex colors",name:"VertexColors",type:"Attribute"},{label:"Ring formulas",type:"Separator",presets:[{name:"Circle",fields:{RingFormulaX:"cos(theta) * 0.5",RingFormulaY:"0",RingFormulaZ:"sin(theta) * 0.5"}}]},{datatype:"Formula",defaultValue:"cos(theta) * 0.5",displayName:"X",name:"RingFormulaX",type:"Attribute"},{datatype:"Formula",defaultValue:"0",displayName:"Y",name:"RingFormulaY",type:"Attribute"},{datatype:"Formula",defaultValue:"sin(theta) * 0.5",displayName:"Z",name:"RingFormulaZ",type:"Attribute"},{label:"Path formulas",type:"Separator"},{datatype:"Formula",defaultValue:"0",displayName:"X",name:"PathFormulaX",type:"Attribute"},{datatype:"Formula",defaultValue:"sin(t)",displayName:"Y",name:"PathFormulaY",type:"Attribute"},{datatype:"Formula",defaultValue:"t",displayName:"Z",name:"PathFormulaZ",type:"Attribute"},{label:"Color formulas",type:"Separator",if:{VertexColors:!0}},{datatype:"Formula",defaultValue:"abs(sin(t))",displayName:"R",name:"ColorFormulaR",type:"Attribute",if:{VertexColors:!0}},{datatype:"Formula",defaultValue:"0",displayName:"G",name:"ColorFormulaG",type:"Attribute",if:{VertexColors:!0}},{datatype:"Formula",defaultValue:"abs(cos(t))",displayName:"B",name:"ColorFormulaB",type:"Attribute",if:{VertexColors:!0}},{label:"Other formulas",type:"Separator"},{datatype:"Formula",defaultValue:"1 + 0.3 * sin(t * 2)",displayName:"Scale",name:"ScaleFormula",type:"Attribute"},{datatype:"Formula",defaultValue:"t * PI * 2",displayName:"Twist",name:"TwistFormula",type:"Attribute"},{name:"Physics",type:"FieldSet"}],typeName:"Ribbon"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Billboard Specific Fields",type:"Separator"},{linkableTypes:["Material"],type:"Link",usageAs:"Material",mandatory:!0},{datatype:"Text",defaultValue:"Text",displayName:"Text",name:"Text",type:"Attribute"},{datatype:"Enum",defaultValue:"center",displayName:"Text Alignment",info:"The alignment of the text",name:"TextAlign",options:["left","center","right"],type:"Attribute"},{linkableTypes:["Font"],type:"Link",usageAs:"Font"},{datatype:"Boolean",defaultValue:!0,displayName:"Size Attenuation",info:"Scales the Billboard with respect to distance to the camera.",name:"SizeAttenuation",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Size",minValue:0,name:"Size",type:"Attribute"},{datatype:"Float",defaultValue:2,displayName:"Text Stroke Width",info:"The width of the border of the text.",maxValue:100,minValue:0,name:"TextStrokeWidth",type:"Attribute"},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},displayName:"Text Stroke Color",info:"The color of the border of the text.",name:"TextStrokeColor",type:"Attribute"},{datatype:"Color",defaultValue:{a:255,b:0,g:0,r:0},displayName:"Text color",info:"The infill color of the text.",name:"TextColor",type:"Attribute"},{datatype:"Vector2d",defaultValue:{x:5,y:5},displayName:"Padding",info:"Two values controlling the vertical and horizontal padding size. Higher values increase the size of the padding.",name:"Padding",type:"Attribute"},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},displayName:"Padding color",info:"The background color of the padding section.",name:"BackgroundColor",type:"Attribute"},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},displayName:"Padding Line Color",info:"The color of the border delimited by the padding.",name:"BackgroundStrokeColor",type:"Attribute"},{datatype:"Integer",defaultValue:1,displayName:"Padding Line Width",info:"The width of the border of the padding section.",minValue:0,name:"BackgroundStrokeWidth",type:"Attribute"},{datatype:"Vector2d",defaultValue:{x:2,y:2},displayName:"Border",info:"Two values controlling the vertical and horizontal border size. Higher values increase the size of the border.",name:"BorderWidth",type:"Attribute"},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},displayName:"Border Color",info:"The background color of the border section.",name:"BorderBackgroundColor",type:"Attribute"},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},displayName:"Border Line Color",info:"The color of the outer border of the sprite.",name:"BorderStrokeColor",type:"Attribute"},{datatype:"Integer",defaultValue:1,displayName:"Border Line Width",info:"The width of the outer border.",minValue:0,name:"BorderStrokeWidth",type:"Attribute"},{datatype:"Integer",defaultValue:2,displayName:"Outer Radius",info:"The outer radius of the sprite. Higher values increase the roundness.",minValue:0,name:"OuterRadius",type:"Attribute"},{datatype:"Integer",defaultValue:2,displayName:"Inner Radius",info:"The inner radius of the sprite. Higher values increase the roundness.",minValue:0,name:"InnerRadius",type:"Attribute"},{datatype:"Vector2d",defaultValue:{x:1,y:1},displayName:"UV Scale",name:"UVScale",type:"Attribute"}],typeName:"Billboard"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Cone specific fields",type:"Separator"},{linkableTypes:["Material"],type:"Link",usageAs:"Material"},{datatype:"Float",defaultValue:1,displayName:"Radius",minValue:0,name:"Radius",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Height",minValue:0,name:"Height",type:"Attribute"},{datatype:"Integer",defaultValue:8,displayName:"Radial segments",minValue:1,name:"RadialSegments",type:"Attribute"},{datatype:"Integer",defaultValue:1,displayName:"Height segments",minValue:1,name:"HeightSegments",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Open ended",name:"OpenEnded",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Theta start",maxValue:360,minValue:0,name:"ThetaStart",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:360,displayName:"Theta length",maxValue:360,minValue:0,name:"ThetaLength",type:"Attribute",widget:"Slider"},{datatype:"Vector2d",defaultValue:{x:1,y:1},displayName:"UV Scale",name:"UVScale",type:"Attribute"},{name:"Physics",type:"FieldSet"}],typeName:"Cone"},{fields:[{name:"3dObjectNoShadows",type:"FieldSet"},{label:"Lod specific fields",type:"Separator"},{datatype:"String",defaultValue:"0,2,4,6,8,10",displayName:"Distances",name:"Distances",type:"Attribute"}],typeName:"Lod"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Cylinder specific fields",type:"Separator"},{linkableTypes:["Material"],type:"Link",usageAs:"Material"},{datatype:"Float",defaultValue:1,displayName:"Radius top",minValue:0,name:"RadiusTop",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Radius bottom",minValue:0,name:"RadiusBottom",type:"Attribute"},{datatype:"Integer",defaultValue:8,displayName:"Radial segments",minValue:1,name:"RadialSegments",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Height",minValue:0,name:"Height",type:"Attribute"},{datatype:"Integer",defaultValue:1,displayName:"Height segments",minValue:1,name:"HeightSegments",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Open ended",name:"OpenEnded",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Theta start",maxValue:360,minValue:0,name:"ThetaStart",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:360,displayName:"Theta length",maxValue:360,minValue:0,name:"ThetaLength",type:"Attribute",widget:"Slider"},{datatype:"Vector2d",defaultValue:{x:1,y:1},displayName:"UV Scale",name:"UVScale",type:"Attribute"},{name:"Physics",type:"FieldSet"}],typeName:"Cylinder"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Plane specific fields",type:"Separator"},{linkableTypes:["Material"],type:"Link",usageAs:"Material"},{datatype:"Float",defaultValue:1,displayName:"Width",minValue:0,name:"Width",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Height",minValue:0,name:"Height",type:"Attribute"},{datatype:"Integer",defaultValue:1,displayName:"Width segments",minValue:1,name:"WidthSegments",type:"Attribute"},{datatype:"Integer",defaultValue:1,displayName:"Height segments",minValue:1,name:"HeightSegments",type:"Attribute"},{datatype:"Vector2d",defaultValue:{x:1,y:1},displayName:"UV Scale",name:"UVScale",type:"Attribute"},{name:"Physics",type:"FieldSet"}],typeName:"Plane"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Ring specific fields",type:"Separator"},{linkableTypes:["Material"],type:"Link",usageAs:"Material"},{datatype:"Float",defaultValue:.5,displayName:"Inner radius",minValue:0,name:"InnerRadius",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Outer radius",minValue:0,name:"OuterRadius",type:"Attribute"},{datatype:"Integer",defaultValue:8,displayName:"Theta segments",minValue:3,name:"ThetaSegments",type:"Attribute"},{datatype:"Integer",defaultValue:1,displayName:"Phi segments",minValue:1,name:"PhiSegments",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Theta start",maxValue:360,minValue:0,name:"ThetaStart",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:360,displayName:"Theta length",maxValue:360,minValue:0,name:"ThetaLength",type:"Attribute",widget:"Slider"},{datatype:"Vector2d",defaultValue:{x:1,y:1},displayName:"UV Scale",name:"UVScale",type:"Attribute"},{name:"Physics",type:"FieldSet"}],typeName:"Ring"},{fields:[{name:"3dObjectNoShadows",type:"FieldSet"},{label:"Particles Editor Fields",type:"Separator"},{datatype:"Boolean",defaultValue:!1,displayName:"Preview",info:"Previews the particle system by playing it in the editor.",name:"RunPreview",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Show Emitter Preview",info:"Shows a preview of the particle system's emitter.",name:"ShowHelper",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Pause",info:"Pauses the particle system.",name:"Pause",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Kill All Particles",info:"Kills all the alive particles in the system.",name:"KillAllParticles",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Restart",info:"Hard restart of the particle system. It kills all particles, clean all data and reset the simulation time.",name:"Restart",type:"Attribute"},{displayName:"Particle System",label:"Particle System Configuration File",linkableTypes:["Particles"],type:"Link",usageAs:"ParticleData",mandatory:!0}],typeName:"ParticleSystem"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"CircleShadow specific fields",type:"Separator"},{datatype:"Float",defaultValue:1,displayName:"Size",minValue:0,name:"Size",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Strength",maxValue:1,minValue:0,name:"Strength",type:"Attribute",widget:"Slider"}],typeName:"CircleShadow"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Sphere specific fields",type:"Separator"},{linkableTypes:["Material"],type:"Link",usageAs:"Material"},{datatype:"Float",defaultValue:1,displayName:"Radius",minValue:0,name:"Radius",type:"Attribute"},{datatype:"Integer",defaultValue:8,displayName:"Width segments",minValue:3,name:"WidthSegments",type:"Attribute"},{datatype:"Integer",defaultValue:6,displayName:"Height segments",minValue:2,name:"HeightSegments",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Phi start",maxValue:360,minValue:0,name:"PhiStart",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:360,displayName:"Phi length",maxValue:360,minValue:0,name:"PhiLength",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:0,displayName:"Theta start",maxValue:360,minValue:0,name:"ThetaStart",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:180,displayName:"Theta length",maxValue:180,minValue:0,name:"ThetaLength",type:"Attribute",widget:"Slider"},{datatype:"Vector2d",defaultValue:{x:1,y:1},displayName:"UV Scale",name:"UVScale",type:"Attribute"},{name:"Physics",type:"FieldSet"}],typeName:"Sphere"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Text specific fields",type:"Separator"},{linkableTypes:["Material"],type:"Link",usageAs:"Material"},{datatype:"String",defaultValue:"Text",name:"Text",type:"Attribute"},{datatype:"Enum",defaultValue:"center",displayName:"Horizontal Alignment",info:"Horizontal text positioning",name:"HorizontalAlign",options:["left","center","right"],type:"Attribute"},{datatype:"Enum",defaultValue:"baseline",displayName:"Vertical Alignment",info:"Vertical text positioning",name:"VerticalAlign",options:["baseline","top","middle","bottom"],type:"Attribute"},{linkableTypes:["Font"],type:"Link",usageAs:"Font"},{datatype:"Float",defaultValue:1,name:"Size",type:"Attribute"},{datatype:"Float",defaultValue:1,name:"Height",type:"Attribute"},{datatype:"Integer",defaultValue:12,displayName:"Curve segments",name:"CurveSegments",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Bevel enabled",name:"BevelEnabled",type:"Attribute"},{datatype:"Float",defaultValue:.1,displayName:"Bevel thickness",name:"BevelThickness",type:"Attribute"},{datatype:"Float",defaultValue:.03,displayName:"Bevel size",name:"BevelSize",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Bevel offset",name:"BevelOffset",type:"Attribute"},{datatype:"Integer",defaultValue:3,displayName:"Bevel segments",name:"BevelSegments",type:"Attribute"},{datatype:"Vector2d",defaultValue:{x:1,y:1},displayName:"UV Scale",name:"UVScale",type:"Attribute"},{name:"Physics",type:"FieldSet"}],typeName:"Text"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"Torus specific fields",type:"Separator"},{linkableTypes:["Material"],type:"Link",usageAs:"Material"},{datatype:"Float",defaultValue:1,displayName:"Radius",minValue:0,name:"Radius",type:"Attribute"},{datatype:"Float",defaultValue:.4,displayName:"Tube",minValue:0,name:"Tube",type:"Attribute"},{datatype:"Integer",defaultValue:8,displayName:"Radial segments",minValue:3,name:"RadialSegments",type:"Attribute"},{datatype:"Integer",defaultValue:16,displayName:"Tubular segments",minValue:2,name:"TubularSegments",type:"Attribute"},{datatype:"Float",defaultValue:360,displayName:"Arc",maxValue:360,minValue:0,name:"Arc",type:"Attribute",widget:"Slider"},{datatype:"Vector2d",defaultValue:{x:1,y:1},displayName:"UV Scale",name:"UVScale",type:"Attribute"},{name:"Physics",type:"FieldSet"}],typeName:"Torus"},{fields:[{label:"3D Object Fields",type:"Separator"},{datatype:"Boolean",defaultValue:!0,displayName:"Active",name:"Active",type:"Attribute"},{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Layers",defaultValue:[0],name:"Layers",type:"Attribute"},{datatype:"Tags",defaultValue:[],name:"Tags",type:"Attribute"},{label:"Sky specific fields",type:"Separator"},{datatype:"Float",defaultValue:1e3,name:"Size",type:"Attribute"},{datatype:"Float",defaultValue:10,displayName:"Turbidity",maxValue:20,minValue:1,name:"Turbidity",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:2,displayName:"Rayleigh",maxValue:4,minValue:0,name:"Rayleigh",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:.005,displayName:"Mie coefficient",maxValue:1,minValue:0,name:"MieCoefficient",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:.8,displayName:"Mie directional G",maxValue:1,minValue:0,name:"MieDirectionalG",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:.49,displayName:"Inclination",maxValue:1,minValue:0,name:"Inclination",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:.25,displayName:"Azimuth",maxValue:1,minValue:0,name:"Azimuth",type:"Attribute",widget:"Slider"}],typeName:"Sky"},{fields:[{label:"3D Object Fields",type:"Separator"},{datatype:"Boolean",defaultValue:!0,displayName:"Active",name:"Active",type:"Attribute"},{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Transform",defaultValue:{position:{x:0,y:0,z:0},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},name:"Transform",type:"Attribute"},{datatype:"Tags",defaultValue:[],name:"Tags",type:"Attribute"},{label:"Audio listener specific fields",type:"Separator"},{datatype:"Float",defaultValue:1,name:"Gain",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Time delta",name:"TimeDelta",type:"Attribute"}],maxInstances:1,typeName:"AudioListener"},{fields:[{label:"3D Object Fields",type:"Separator"},{datatype:"Boolean",defaultValue:!0,displayName:"Active",name:"Active",type:"Attribute"},{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Transform",defaultValue:{position:{x:0,y:0,z:0},rotation:{w:1,x:0,y:0,z:0},scale:{x:1,y:1,z:1}},name:"Transform",type:"Attribute"},{datatype:"Tags",defaultValue:[],name:"Tags",type:"Attribute"},{label:"Positional audio specific fields",type:"Separator"},{name:"AudioLink",type:"FieldSet"},{datatype:"Boolean",defaultValue:!1,displayName:"Autoplay",name:"Autoplay",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Loop",name:"Loop",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Loop section",name:"LoopSection",type:"Attribute",if:{Loop:!0}},{datatype:"Float",defaultValue:0,displayName:"Loop start",minValue:0,name:"LoopStart",type:"Attribute",widget:"Slider",if:{Loop:!0,LoopSection:!0}},{datatype:"Float",displayName:"Loop end",defaultValue:1,minValue:0,name:"LoopEnd",type:"Attribute",widget:"Slider",if:{Loop:!0,LoopSection:!0}},{datatype:"Float",defaultValue:1,displayName:"Volume",minValue:0,name:"Volume",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Panning",maxValue:1,minValue:-1,name:"Panning",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:0,displayName:"Duration",minValue:0,name:"Duration",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Detune",name:"Detune",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Playback rate",minValue:0,name:"PlaybackRate",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Offset",maxValue:1,minValue:0,name:"Offset",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Ref distance",minValue:0,name:"RefDistance",type:"Attribute"},{datatype:"Float",defaultValue:1e4,displayName:"Max distance",minValue:0,name:"MaxDistance",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Rolloff factor",minValue:0,name:"RolloffFactor",type:"Attribute"},{datatype:"Enum",defaultValue:"Inverse",displayName:"Distance model",name:"DistanceModel",options:["Linear","Inverse","Exponential"],type:"Attribute"},{datatype:"Enum",defaultValue:"Omnidirectional",displayName:"Direction",name:"Direction",options:["Omnidirectional","Directional"],type:"Attribute"},{datatype:"Float",defaultValue:90,displayName:"Cone inner angle",if:{Direction:"Directional"},maxValue:360,minValue:0,name:"ConeInnerAngle",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:180,displayName:"Cone outer angle",if:{Direction:"Directional"},maxValue:360,minValue:0,name:"ConeOuterAngle",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:.2,displayName:"Cone outer gain",if:{Direction:"Directional"},maxValue:1,minValue:0,name:"ConeOuterGain",type:"Attribute",widget:"Slider"}],typeName:"PositionalAudio"},{fields:[{label:"3D Object Fields",type:"Separator"},{datatype:"Boolean",defaultValue:!0,displayName:"Active",name:"Active",type:"Attribute"},{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Tags",defaultValue:[],name:"Tags",type:"Attribute"},{label:"Audio specific fields",type:"Separator"},{name:"AudioLink",type:"FieldSet"},{datatype:"Boolean",defaultValue:!1,displayName:"Autoplay",name:"Autoplay",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Loop",name:"Loop",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Loop section",name:"LoopSection",type:"Attribute",if:{Loop:!0}},{datatype:"Float",defaultValue:0,displayName:"Loop start",minValue:0,name:"LoopStart",type:"Attribute",widget:"Slider",if:{Loop:!0,LoopSection:!0}},{datatype:"Float",displayName:"Loop end",defaultValue:1,minValue:0,name:"LoopEnd",type:"Attribute",widget:"Slider",if:{Loop:!0,LoopSection:!0}},{datatype:"Float",defaultValue:1,displayName:"Volume",minValue:0,name:"Volume",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Panning",maxValue:1,minValue:-1,name:"Panning",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:0,displayName:"Duration",minValue:0,name:"Duration",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Detune",name:"Detune",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Playback rate",minValue:0,name:"PlaybackRate",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Offset",maxValue:1,minValue:0,name:"Offset",type:"Attribute"}],typeName:"Audio"},{fields:[{name:"3dObjectNoShadows",type:"FieldSet"},{label:"Vehicle specific fields",type:"Separator"},{datatype:"Node",defaultValue:null,displayName:"Chassis node",name:"ChassisNode",type:"Attribute"},{elementName:"Wheel",fields:[{datatype:"Node",defaultValue:null,displayName:"Wheel node",name:"WheelNode",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Is Front",name:"IsFront",type:"Attribute"},{label:"Wheel config",type:"Separator",collapsed:!0},{datatype:"Float",defaultValue:.6,displayName:"Suspension rest length",name:"SuspensionRestLength",type:"Attribute"},{datatype:"Float",defaultValue:20,displayName:"Suspension stiffness",name:"SuspensionStiffness",type:"Attribute"},{datatype:"Float",defaultValue:2.3,displayName:"Suspension damping",name:"SuspensionDamping",type:"Attribute"},{datatype:"Float",defaultValue:4.4,displayName:"Suspension compression",name:"SuspensionCompression",type:"Attribute"},{datatype:"Float",defaultValue:1e3,displayName:"Friction",name:"Friction",type:"Attribute"},{datatype:"Float",defaultValue:.2,displayName:"Roll influence",name:"RollInfluence",type:"Attribute"},{datatype:"Float",defaultValue:.1,displayName:"Radius",name:"Radius",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Acceleration",name:"Acceleration",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Brakes",name:"Brakes",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Steering",name:"Steering",type:"Attribute"}],name:"Wheels",type:"List"}],typeName:"Vehicle"},{fields:[{name:"3dObjectNoShadows",type:"FieldSet"},{label:"Constraint specific fields",type:"Separator"},{datatype:"Enum",defaultValue:"",displayName:"Type",name:"Type",options:["Point to Point","Hinge","Slider","Cone twist"],type:"Attribute"},{datatype:"Node",defaultValue:null,displayName:"First node",name:"FirstNode",type:"Attribute"},{datatype:"Node",defaultValue:null,displayName:"Second node",name:"SecondNode",type:"Attribute"}],typeName:"Constraint"},{fields:[{name:"3dObjectDefault",type:"FieldSet"},{label:"NavMesh specific fields",type:"Separator"},{datatype:"Enum",defaultValue:"Solo",displayName:"Type",name:"Type",options:["Solo","Tiled","Tile cache"],info:"For simple static scenes, use solo. For large maps use tiled, for large and/or dynamic maps, use tile cache",type:"Attribute"},{datatype:"Enum",defaultValue:"From children",displayName:"Mode",name:"Mode",options:["From children","From tags","From layers"],type:"Attribute"},{datatype:"Layers",defaultValue:[0],displayName:"Navmesh layers",info:"Selects which layers are added to the navmesh",name:"NavmeshLayers",type:"Attribute",if:{Mode:"From layers"}},{datatype:"Tags",defaultValue:[],info:"Selects meshes to add to the navmesh based on tag.",displayName:"Navmesh tags",name:"NavmeshTags",type:"Attribute",if:{Mode:"From tags"}},{datatype:"Boolean",defaultValue:!1,displayName:"Auto generate",name:"AutoGenerate",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Always render helper",name:"AlwaysRenderHelper",type:"Attribute"},{datatype:"Button",defaultValue:!1,displayName:"Regenerate now",name:"RegenerateNow",type:"Attribute"},{datatype:"Float",defaultValue:0,minValue:0,displayName:"Border size",name:"BorderSize",type:"Attribute"},{datatype:"Float",defaultValue:.2,minValue:.01,displayName:"Voxel cell height",name:"CellHeight",type:"Attribute",info:"Needs to resolve step/climb height cleanly."},{datatype:"Float",defaultValue:.2,minValue:.01,displayName:"Voxel cell size",name:"CellSize",type:"Attribute",info:"Smaller = more detail. Around 0.2m for human‑scale"},{datatype:"Integer",defaultValue:256,minValue:1,displayName:"Chunky tri mesh tris per chunk",name:"ChunkyTriMeshTrisPerChunk",type:"Attribute",if:{Type:"Tiled"}},{datatype:"Float",defaultValue:6,minValue:.01,displayName:"Detail sample dist",name:"DetailSampleDist",type:"Attribute"},{datatype:"Float",defaultValue:1,minValue:0,displayName:"Detail sample max error",name:"DetailSampleMaxError",type:"Attribute"},{datatype:"Integer",defaultValue:4,minValue:1,displayName:"Expected layers per tile",name:"ExpectedLayersPerTile",type:"Attribute",if:{Type:"Tile Cache"}},{datatype:"Integer",defaultValue:128,minValue:1,displayName:"Max obstacles",name:"MaxObstacles",type:"Attribute",if:{Type:"Tile Cache"}},{datatype:"Float",defaultValue:12,minValue:.01,displayName:"Max edge length",name:"MaxEdgeLen",type:"Attribute"},{datatype:"Float",defaultValue:1.3,minValue:0,displayName:"Max simplification error",name:"MaxSimplificationError",type:"Attribute",info:"Allowed contour deviation from source before another vertex is kept"},{datatype:"Integer",defaultValue:6,minValue:3,displayName:"Max vertices per poly",name:"MaxVertsPerPoly",type:"Attribute"},{datatype:"Float",defaultValue:20,minValue:.01,displayName:"Merge region area",name:"MergeRegionArea",type:"Attribute"},{datatype:"Float",defaultValue:8,minValue:.01,displayName:"Min region area",name:"MinRegionArea",type:"Attribute"},{datatype:"Float",defaultValue:2,minValue:0,displayName:"Walkable climb",name:"WalkableClimb",type:"Attribute",info:"Maximum step height"},{datatype:"Float",defaultValue:2,minValue:0,displayName:"Walkable height",name:"WalkableHeight",type:"Attribute",info:"Required head‑clearance. Must be at least the height of the characters."},{datatype:"Float",defaultValue:.5,minValue:.01,displayName:"Walkable radius",name:"WalkableRadius",type:"Attribute",info:"Clearance from walls/obstacles"},{datatype:"Float",defaultValue:60,minValue:0,maxValue:360,displayName:"Walkable slope angle",name:"WalkableSlopeAngle",type:"Attribute",info:"Steepest walkable slope"},{datatype:"Boolean",defaultValue:!0,displayName:"Build BV Tree",name:"BuildBvTree",info:"",type:"Attribute",if:{$or:[{Type:"Solo"},{Type:"Tiled"}]}},{datatype:"Integer",defaultValue:32,minValue:1,displayName:"Tile size",name:"TileSize",type:"Attribute",info:"The size of the tiles to be used. Typically you will want to stay in the range 32 - 64. Sizes outside this range might result in unexpected behaviour",if:{$or:[{Type:"Tiled"},{Type:"Tile cache"}]}},{label:"Crowd fields",type:"Separator"},{datatype:"Boolean",defaultValue:!0,displayName:"Enable crowd",name:"EnableCrowd",type:"Attribute"},{datatype:"Integer",defaultValue:100,minValue:1,displayName:"Max agent count",name:"MaxAgentCount",type:"Attribute"},{datatype:"Float",defaultValue:1,minValue:.01,displayName:"Max agent radius",name:"MaxAgentRadius",type:"Attribute"}],typeName:"NavMesh"}],name:"Scenegraph",type:"Tree"}],name:"Prefab",updateRequiresThumbRefresh:!0},{_id:{$oid:"5e6a1ad189707feef9173397"},contentTypes:["text/x-lua"],fieldSets:[],fields:[],name:"Script",updateRequiresThumbRefresh:!1,creatableEmpty:!0},{_id:{$oid:"5e6a1ad189707f2ef9133396"},contentTypes:[],fieldSets:[],fields:[{childTypes:[{displayName:"Camera",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"String",defaultValue:"",displayName:"Tag",info:"Tag of the camera to render",name:"Tag",type:"Attribute"},{datatype:"Layers",defaultValue:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31],displayName:"Layers",info:"Selects which layers are rendered by the camera. Overrides scene Camera node 'Cull mode' field.",name:"Layers",type:"Attribute"},{datatype:"Float",defaultValue:100,displayName:"Width",info:"Width in percent to render",name:"Width",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:100,displayName:"Height",info:"Height in percent to render",name:"Height",type:"Attribute",widget:"Slider"}],inputs:[],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"},{displayName:"Depth output",name:"DepthOutput",type:"GrayImage"},{displayName:"Depth Comparison output",name:"DepthComparisonOutput",type:"GrayImage"},{displayName:"Normal output",name:"NormalOutput",type:"RGBImage"},{displayName:"Camera Output",name:"CameraOutput",type:"Attribute"}],typeName:"camera"},{displayName:"Merge",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Enum",defaultValue:"Alpha",displayName:"Blending Mode",name:"BlendingMode",options:["Add","Alpha","Average","Color","Color Burn","Color Dodge","Darken","Difference","Divide","Exclusion","Hard Light","Hard Mix","Hue","Invert","Invert RGB","Lighten","Linear Burn","Linear Dodge","Linear Light","Luminosity","Multiply","Negation","Normal","Overlay","Pin Light","Reflect","Saturation","Screen","Soft Light","Set","Src","Subtract","Vivid Light"],type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Opacity",info:"Adjusts how strongly the blending mode affects the final result.",maxValue:1,minValue:0,name:"Opacity",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:0,displayName:"Offset X",info:"Horizontal offset for the secondary input (relative to composition resolution). Positive values move right, negative left. Percentage-based for resolution independence.",maxValue:100,minValue:-100,name:"OffsetX",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Offset Y",info:"Vertical offset for the secondary input (relative to composition resolution). Positive values move up, negative down. Percentage-based for resolution independence.",maxValue:100,minValue:-100,name:"OffsetY",type:"Attribute"},{datatype:"Float",defaultValue:100,displayName:"Width",info:"Horizontal scale of the secondary input as percentage of composition width. 100% maintains original aspect ratio when Height is also 100%. Values <100% shrink, >100% stretch.",maxValue:100,minValue:0,name:"Width",type:"Attribute"},{datatype:"Float",defaultValue:100,displayName:"Height",info:"Vertical scale of the secondary input as percentage of composition height. 100% maintains original aspect ratio when Width is also 100%. Values <100% shrink, >100% stretch.",maxValue:100,minValue:0,name:"Height",type:"Attribute"}],inputs:[{displayName:"Color input 1",name:"ColorInput1",types:["RGBImage"]},{displayName:"Color input 2",name:"ColorInput2",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"merge"},{displayName:"SSAO",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Float",defaultValue:.2,displayName:"Radius",minValue:.01,name:"Radius",type:"Attribute"},{datatype:"Integer",defaultValue:8,displayName:"Samples",maxValue:32,minValue:8,name:"Samples",type:"Attribute"},{datatype:"Float",defaultValue:.001,displayName:"Bias",minValue:.001,name:"Bias",type:"Attribute"},{datatype:"Float",defaultValue:2,displayName:"Intensity",minValue:0,name:"Intensity",type:"Attribute"},{datatype:"Float",defaultValue:.07,displayName:"Max distance",minValue:.01,name:"MaxDistance",type:"Attribute"}],inputs:[{displayName:"Depth input",name:"DepthInput",types:["GrayImage"]},{displayName:"Normal input",name:"NormalInput",types:["RGBImage"]},{displayName:"Camera Input",name:"CameraInput",types:["Attribute"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"ssao"},{displayName:"FXAA",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"fxaa"},{displayName:"Bloom",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Float",defaultValue:1.5,displayName:"Strength",maxValue:10,minValue:0,name:"Strength",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:.4,displayName:"Radius",maxValue:1,minValue:0,name:"Radius",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:.8,displayName:"Threshold",info:"Minimum luminance required for a pixel to contribute to bloom. Pixels darker than this value are suppressed, while brighter pixels contribute to the blur.",maxValue:1,minValue:0,name:"Threshold",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:.4,displayName:"Soft Knee",info:"Creates a smooth transition around the threshold to avoid harsh cutoffs. Higher values produce a more gradual blend between non-blooming and blooming pixels.",maxValue:1,minValue:0,name:"SoftKnee",type:"Attribute",widget:"Slider"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"bloom"},{displayName:"Outline",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Edge Strength",maxValue:5,minValue:0,name:"EdgeStrength",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:.5,displayName:"Edge Width",maxValue:2,minValue:.1,name:"EdgeWidth",type:"Attribute",widget:"Slider"},{datatype:"Color",defaultValue:{r:255,g:0,b:0,a:255},displayName:"Edge Color",name:"EdgeColor",type:"Attribute"},{datatype:"Enum",defaultValue:"Add",displayName:"Blending Mode",name:"BlendingMode",options:["Add","Alpha","Average","Color","Color Burn","Color Dodge","Darken","Difference","Divide","Exclusion","Hard Light","Hard Mix","Hue","Invert","Invert RGB","Lighten","Linear Burn","Linear Dodge","Linear Light","Luminosity","Multiply","Negation","Normal","Overlay","Pin Light","Reflect","Saturation","Screen","Soft Light","Set","Src","Subtract","Vivid Light"],type:"Attribute"},{datatype:"Float",defaultValue:.25,displayName:"Opacity",name:"Opacity",maxValue:1,minValue:0,type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]},{displayName:"Depth Comparison input",name:"DepthComparisonInput",types:["GrayImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"outline"},{displayName:"Film",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Float",defaultValue:.05,displayName:"Noise intensity",maxValue:1,minValue:0,name:"NoiseIntensity",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:0,displayName:"Scanlines intensity",maxValue:1,minValue:0,name:"ScanlinesIntensity",type:"Attribute",widget:"Slider"},{datatype:"Integer",defaultValue:0,displayName:"Scanlines count",maxValue:1e3,minValue:0,name:"ScanlinesCount",type:"Attribute",widget:"Slider"},{datatype:"Boolean",defaultValue:!1,displayName:"Grayscale",name:"Grayscale",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Animated",name:"Animated",type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"film"},{displayName:"Fog",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Color",defaultValue:{r:255,g:0,b:0,a:255},displayName:"Color",name:"Color",type:"Attribute"},{datatype:"Enum",defaultValue:"Camera Depth",displayName:"Direction",name:"Direction",type:"Attribute",options:["Camera Depth","X","Y","Z"],info:"Defines the ray along which the fog is evaluated. 'Camera Depth' applies fog based on distance from the camera view direction (distances should be non-negative). 'X', 'Y', and 'Z' apply fog along the corresponding world-space axis; distances may be positive or negative depending on where the fog volume should begin and end."},{datatype:"Enum",defaultValue:"Linear",displayName:"Type",name:"Type",type:"Attribute",options:["Linear","Exponential","Exponential Squared"]},{datatype:"Float",defaultValue:1,displayName:"Start Distance",name:"StartDistance",type:"Attribute",info:"Distance along the selected fog ray where the fog begins to accumulate. Must be >= 0 when using Camera Depth."},{datatype:"Float",defaultValue:1e3,displayName:"End Distance",name:"EndDistance",type:"Attribute",info:"Distance along the selected fog ray where the fog reaches maximum density. Must be >= 0 when using Camera Depth."},{datatype:"Float",defaultValue:.0025,displayName:"Density",minValue:1e-5,maxValue:1,name:"Density",type:"Attribute",step:.1,if:{$or:[{FogType:"Exponential"},{FogType:"Exponential Squared"}]}},{datatype:"Boolean",defaultValue:!0,displayName:"Enable Noise",name:"EnableNoise",info:"Adds animated noise to the fog to create more natural variation.",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Noise Scale",minValue:.001,name:"NoiseScale",type:"Attribute",step:1,if:{EnableFogNoise:!0}},{datatype:"Float",defaultValue:.1,displayName:"Noise Speed",maxValue:1,minValue:0,name:"NoiseSpeed",type:"Attribute",step:.1,if:{EnableFogNoise:!0}},{datatype:"Float",defaultValue:.5,displayName:"Noise Amount",maxValue:1,minValue:0,name:"NoiseAmount",type:"Attribute",step:.1,if:{EnableFogNoise:!0}},{datatype:"Float",defaultValue:0,maxValue:1,displayName:"Sky Density",info:"Controls the amount of fog applied to the sky.",name:"SkyDensity",type:"Attribute",step:.1}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]},{displayName:"Depth input",name:"DepthInput",types:["DepthBuffer"]},{displayName:"Camera input",name:"CameraInput",types:["Camera"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"fog"},{displayName:"Sepia",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Enum",defaultValue:"Normal",displayName:"Blending Mode",name:"BlendingMode",options:["Add","Alpha","Average","Color","Color Burn","Color Dodge","Darken","Difference","Divide","Exclusion","Hard Light","Hard Mix","Hue","Invert","Invert RGB","Lighten","Linear Burn","Linear Dodge","Linear Light","Luminosity","Multiply","Negation","Normal","Overlay","Pin Light","Reflect","Saturation","Screen","Soft Light","Set","Src","Subtract","Vivid Light"],type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Opacity",name:"Opacity",maxValue:1,minValue:0,type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"sepia"},{displayName:"Vignette",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Enum",defaultValue:"Normal",displayName:"Blending Mode",name:"BlendingMode",options:["Add","Alpha","Average","Color","Color Burn","Color Dodge","Darken","Difference","Divide","Exclusion","Hard Light","Hard Mix","Hue","Invert","Invert RGB","Lighten","Linear Burn","Linear Dodge","Linear Light","Luminosity","Multiply","Negation","Normal","Overlay","Pin Light","Reflect","Saturation","Screen","Soft Light","Set","Src","Subtract","Vivid Light"],type:"Attribute"},{datatype:"Float",defaultValue:.9,displayName:"Opacity",name:"Opacity",maxValue:1,minValue:0,type:"Attribute"},{datatype:"Float",defaultValue:.4,displayName:"Amount",maxValue:1,minValue:0,name:"Amount",type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"vignette"},{displayName:"Blur",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Amount",maxValue:10,minValue:0,name:"Amount",type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"blur"},{displayName:"Scanline",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Float",defaultValue:.5,displayName:"Density",maxValue:1,minValue:0,name:"Density",type:"Attribute",widget:"Slider"},{datatype:"Float",defaultValue:.01,displayName:"Scroll Speed",maxValue:1,minValue:0,name:"ScrollSpeed",type:"Attribute",widget:"Slider"},{datatype:"Enum",defaultValue:"Overlay",displayName:"Blending Mode",name:"BlendingMode",options:["Add","Alpha","Average","Color","Color Burn","Color Dodge","Darken","Difference","Divide","Exclusion","Hard Light","Hard Mix","Hue","Invert","Invert RGB","Lighten","Linear Burn","Linear Dodge","Linear Light","Luminosity","Multiply","Negation","Normal","Overlay","Pin Light","Reflect","Saturation","Screen","Soft Light","Set","Src","Subtract","Vivid Light"],type:"Attribute"},{datatype:"Float",defaultValue:.25,displayName:"Opacity",name:"Opacity",maxValue:1,minValue:0,type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"scanline"},{displayName:"Shockwave",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Continuous",info:"Whether or not new shockwaves will emit as soon as the previous shockwave ended.",name:"Continuous",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Delay",minValue:0,name:"Delay",info:"How long to wait between shockwave emissions.",type:"Attribute",if:{Continuous:!1}},{datatype:"Integer",defaultValue:5,displayName:"Amount",minValue:0,name:"Amount",info:"The number of shockwaves.",type:"Attribute",if:{Continuous:!1}},{datatype:"Vector3d",defaultValue:{x:0,y:0,z:0},displayName:"Center",info:"The center in world coordinates of the shockwave effect.",name:"Center",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Size",maxValue:100,minValue:.001,name:"Size",type:"Attribute"},{datatype:"Float",defaultValue:2,displayName:"Speed",maxValue:100,minValue:.001,name:"Speed",type:"Attribute"},{datatype:"Float",defaultValue:-.2,displayName:"Radius",maxValue:10,minValue:-10,name:"Radius",type:"Attribute"},{datatype:"Float",defaultValue:.2,displayName:"Maximum Radius",maxValue:10,minValue:0,name:"MaxRadius",type:"Attribute"},{datatype:"Float",defaultValue:10,displayName:"Wave Size",maxValue:100,minValue:1,name:"WaveSize",type:"Attribute"},{datatype:"Float",defaultValue:.05,displayName:"Amplitude",maxValue:10,minValue:0,name:"Amplitude",type:"Attribute"},{datatype:"Enum",defaultValue:"Screen",displayName:"Blending Mode",name:"BlendingMode",options:["Add","Alpha","Average","Color","Color Burn","Color Dodge","Darken","Difference","Divide","Exclusion","Hard Light","Hard Mix","Hue","Invert","Invert RGB","Lighten","Linear Burn","Linear Dodge","Linear Light","Luminosity","Multiply","Negation","Normal","Overlay","Pin Light","Reflect","Saturation","Screen","Soft Light","Set","Src","Subtract","Vivid Light"],type:"Attribute"},{datatype:"Float",defaultValue:.75,displayName:"Opacity",name:"Opacity",maxValue:1,minValue:0,type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Enable Debug",name:"Debug",type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]},{displayName:"Camera Input",name:"CameraInput",types:["Attribute"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"shockwave"},{displayName:"Pixelation",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Float",defaultValue:10,displayName:"Granularity",maxValue:100,minValue:1,name:"Granularity",type:"Attribute",widget:"Slider"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"pixelation"},{displayName:"Adjust",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Brightness",maxValue:10,minValue:-10,name:"Brightness",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Contrast",maxValue:10,minValue:-10,name:"Contrast",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Hue",maxValue:6.283,minValue:0,name:"Hue",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Saturation",maxValue:1,minValue:-1,name:"Saturation",type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"adjust"},{displayName:"Chromatic abberation",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Amount",maxValue:10,minValue:0,name:"Amount",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Red factor",maxValue:1,minValue:0,name:"RedFactor",type:"Attribute"},{datatype:"Float",defaultValue:.5,displayName:"Green factor",maxValue:1,minValue:0,name:"GreenFactor",type:"Attribute"},{datatype:"Float",defaultValue:.25,displayName:"Blue factor",maxValue:1,minValue:0,name:"BlueFactor",type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"chromaticAbberation"},{displayName:"Color Depth",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Integer",defaultValue:16,displayName:"Bit Depth",maxValue:32,minValue:1,name:"bitDepth",type:"Attribute"},{datatype:"Enum",defaultValue:"Normal",displayName:"Blending Mode",name:"BlendingMode",options:["Add","Alpha","Average","Color","Color Burn","Color Dodge","Darken","Difference","Divide","Exclusion","Hard Light","Hard Mix","Hue","Invert","Invert RGB","Lighten","Linear Burn","Linear Dodge","Linear Light","Luminosity","Multiply","Negation","Normal","Overlay","Pin Light","Reflect","Saturation","Screen","Soft Light","Set","Src","Subtract","Vivid Light"],type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Opacity",info:"Controls blending. Only valid for additive and subtractive modes",maxValue:1,minValue:0,name:"Opacity",type:"Attribute",widget:"Slider"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"colorDepth"},{displayName:"Depth Of Field",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"String",defaultValue:"",displayName:"Focus Target",name:"FocusTarget",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"World Focus Distance",minValue:0,name:"WorldFocusDistance",type:"Attribute"},{datatype:"Float",defaultValue:5,displayName:"World Focus Range",minValue:0,name:"WorldFocusRange",type:"Attribute"},{datatype:"Integer",defaultValue:4,displayName:"Kawase Blur Kernel Size",maxValue:10,minValue:0,name:"Kernel",type:"Attribute"},{datatype:"Float",defaultValue:.5,displayName:"Bokeh Scale",maxValue:25,minValue:0,name:"BokehScale",type:"Attribute"},{datatype:"Float",defaultValue:.75,displayName:"Resolution Scale",maxValue:1,minValue:0,name:"ResolutionScale",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Enable Debug",name:"Debug",type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]},{displayName:"Depth input",name:"DepthInput",types:["GrayImage"]},{displayName:"Camera Input",name:"CameraInput",types:["Attribute"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"depthoffield"},{displayName:"Glitch",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Vector2d",defaultValue:{x:.3,y:1},displayName:"Strength",info:"Two values controlling the maximum and minimum strength of the glitch effect.",name:"Strength",type:"Attribute"},{datatype:"Float",defaultValue:.1,displayName:"Columns",maxValue:1,minValue:0,name:"Columns",type:"Attribute"},{datatype:"Vector2d",defaultValue:{x:0,y:2.5},displayName:"Delay",info:"Two values controlling the duration of the delay of the glitch effect.",name:"Delay",type:"Attribute"},{datatype:"Vector2d",defaultValue:{x:0,y:3},displayName:"Duration",info:"Two values controlling the duration of the glitch effect.",name:"Duration",type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"glitch"},{displayName:"God Rays",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"String",defaultValue:"",type:"Attribute",displayName:"Light Source",name:"SunTag"},{datatype:"Float",defaultValue:1,displayName:"Size",minValue:.01,maxValue:10,name:"Size",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Density",minValue:.01,maxValue:1,name:"Density",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Decay",minValue:.01,maxValue:1,name:"Decay",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Weight",minValue:.01,maxValue:1,name:"Weight",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Exposure",minValue:.01,maxValue:1,name:"Exposure",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"MaximumIntensity",minValue:.01,maxValue:1,name:"MaximumIntensity",type:"Attribute"},{datatype:"Integer",defaultValue:60,displayName:"Samples",minValue:0,name:"Samples",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Blur Rays",name:"BlurRays",type:"Attribute"},{datatype:"Integer",defaultValue:2,displayName:"Kernel Size",info:"The number of kernel applied on the God Rays. A higher number yields to a better blur effect at higher computational cost",maxValue:10,minValue:0,name:"Kernel",if:{BlurRays:!0},type:"Attribute"},{datatype:"Float",defaultValue:.5,displayName:"Resolution Scale",info:"A higher resolution yields a more realistic result at higher computational cost",maxValue:1,minValue:0,name:"ResolutionScale",type:"Attribute"},{datatype:"Enum",defaultValue:"Screen",displayName:"Blending Mode",name:"BlendingMode",options:["Add","Alpha","Average","Color","Color Burn","Color Dodge","Darken","Difference","Divide","Exclusion","Hard Light","Hard Mix","Hue","Invert","Invert RGB","Lighten","Linear Burn","Linear Dodge","Linear Light","Luminosity","Multiply","Negation","Normal","Overlay","Pin Light","Reflect","Saturation","Screen","Soft Light","Set","Src","Subtract","Vivid Light"],type:"Attribute"},{datatype:"Float",defaultValue:.25,displayName:"Opacity",name:"Opacity",maxValue:1,minValue:0,type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Enable Debug",name:"Debug",type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]},{displayName:"Depth input",name:"DepthInput",types:["GrayImage"]},{displayName:"Camera Input",name:"CameraInput",types:["Attribute"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"godrays"},{displayName:"Kawase Blur",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Integer",defaultValue:2,displayName:"Kernel Size",info:"The number of kernel applied on the effect. A higher number yields to a better blur effect at higher computational cost",maxValue:10,minValue:0,name:"Kernel",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Scale",info:"The strenth of the blur effect.",maxValue:1,minValue:0,name:"Scale",type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"kawaseblur"},{displayName:"Radial blur",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Amount",maxValue:10,minValue:0,name:"Amount",type:"Attribute"},{datatype:"Vector2d",defaultValue:{x:.5,y:.5},displayName:"Center",name:"Center",type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"radialBlur"},{displayName:"Tone Mapping",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Enabled",name:"Enabled",type:"Attribute"},{datatype:"Enum",defaultValue:"LINEAR",displayName:"Mode",name:"TonemappingMode",options:["LINEAR","REINHARD","REINHARD2","REINHARD2_ADAPTIVE","UNCHARTED2","ACES_FILMIC","AGX","NEUTRAL"],type:"Attribute"},{datatype:"Integer",defaultValue:256,displayName:"Luminance Map Width. Must be a power of 2.",minValue:1,name:"LuminanceMapWidth",type:"Attribute",if:{TonemappingMode:"REINHARD2_ADAPTIVE"}},{datatype:"Integer",defaultValue:256,displayName:"Luminance Map Height. Must be a power of 2.",if:{TonemappingMode:"REINHARD2_ADAPTIVE"},minValue:1,name:"LuminanceMapHeight",type:"Attribute"},{datatype:"Float",defaultValue:4,displayName:"Maximum Luminance",minValue:0,maxValue:20,name:"MaxLuminance",type:"Attribute"},{datatype:"Float",defaultValue:.01,displayName:"Minimum Luminance",minValue:0,maxValue:3,name:"MinLuminance",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Average Luminance",minValue:0,maxValue:1,name:"MeanLuminance",type:"Attribute"},{datatype:"Float",defaultValue:.6,displayName:"Middle Grey",maxValue:1,minValue:0,name:"MiddleGrey",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Adaptation Rate",minValue:0,name:"AdaptationRate",type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[{displayName:"Color output",name:"ColorOutput",type:"RGBImage"}],typeName:"tonemapping"},{displayName:"Output",fields:[{datatype:"String",defaultValue:"Output",displayName:"Name",name:"Name",type:"Attribute"},{datatype:"Integer",defaultValue:256,displayName:"Target width",minValue:1,name:"DesiredWidth",type:"Attribute",info:"This is the width of the render target in case the composition is used in a material albedo slot."},{datatype:"Integer",defaultValue:256,displayName:"Target height",minValue:1,name:"DesiredHeight",type:"Attribute",info:"This is the height of the render target in case the composition is used in a material albedo slot."}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[],typeName:"output"}],name:"NodeGraph",type:"NodeGraph"}],name:"Composition",updateRequiresThumbRefresh:!1,creatableEmpty:!0},{_id:{$oid:"5e6a1ad189707f2ef9147396"},contentTypes:[],fieldSets:[],fields:[],name:"Behavior",updateRequiresThumbRefresh:!1,creatableEmpty:!1},{_id:{$oid:"5e6a1ad189707feef9173398"},contentTypes:["text/x-glsl"],fieldSets:[],fields:[{datatype:"Enum",defaultValue:1,displayName:"GLSL Version",name:"GLSLVersion",options:[1,3],type:"Attribute"},{datatype:"Enum",defaultValue:"Full",displayName:"Resolution",name:"Resolution",options:["Full","Half","Quarter"],type:"Attribute"},{displayName:"Texture Channel 1",linkableTypes:["Image"],type:"Link",usageAs:"TexChannel1"},{displayName:"Texture Channel 2",linkableTypes:["Image"],type:"Link",usageAs:"TexChannel2"},{displayName:"Texture Channel 3",linkableTypes:["Image"],type:"Link",usageAs:"TexChannel3"},{displayName:"Texture Channel 4",linkableTypes:["Image"],type:"Link",usageAs:"TexChannel4"}],name:"Background Shader",updateRequiresThumbRefresh:!1,creatableEmpty:!0},{_id:{$oid:"5e6a1ad189707feef9173399"},contentTypes:["video/mp4","video/webm"],fieldSets:[],fields:[{datatype:"Enum",defaultValue:"Linear",displayName:"Encoding",name:"Encoding",options:["Linear","sRGB"],type:"Attribute"}],name:"Video",creatableEmpty:!1},{_id:{$oid:"5e8c9d5c02a37596bb1fd5b6"},contentTypes:[""],fieldSets:[],fields:[{elementName:"Item",fields:[{datatype:"String",defaultValue:"",displayName:"Description",name:"Description",type:"Attribute"},{type:"Link",usageAs:"Item",mandatory:!0}],name:"Items",type:"List"}],name:"Collection",creatableEmpty:!0},{_id:{$oid:"5e8c9d5c02a33596bb53d5b6"},contentTypes:[""],fieldSets:[],fields:[{displayName:"Audio items",elementName:"AudioItem",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{linkableTypes:["Audio"],type:"Link",usageAs:"Audio",mandatory:!0}],name:"AudioItems",type:"List"}],name:"Audio Collection",creatableEmpty:!0},{_id:{$oid:"5e8c9d5c01a32576bb53d5b6"},contentTypes:[""],fieldSets:[],fields:[{displayName:"Mesh items",elementName:"MeshItem",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{linkableTypes:["Mesh"],type:"Link",usageAs:"Mesh",mandatory:!0}],name:"MeshItems",type:"List"}],name:"Mesh Collection",creatableEmpty:!0},{_id:{$oid:"5e8c9d5c0233596cb31d5ba2"},contentTypes:[""],fieldSets:[],fields:[{displayName:"Material items",elementName:"MaterialItem",fields:[{datatype:"String",defaultValue:"",displayName:"Name",name:"Name",type:"Attribute"},{linkableTypes:["Material"],type:"Link",usageAs:"Material",mandatory:!0}],name:"MaterialItems",type:"List"}],name:"Material Collection",creatableEmpty:!0},{_id:{$oid:"5edf2f6edc25bdf4e5723e52"},contentTypes:["text/x-yaml"],fieldSets:[],fields:[{displayName:"Material collections",elementName:"Material Collection",fields:[{linkableTypes:["Material Collection"],type:"Link",usageAs:"MaterialCollection",displayName:"Material Collection",mandatory:!0}],name:"MaterialCollections",type:"List"},{displayName:"Mesh collections",elementName:"Mesh Collection",fields:[{linkableTypes:["Mesh Collection"],type:"Link",usageAs:"MeshCollection",displayName:"Mesh Collection",mandatory:!0}],name:"MeshCollections",type:"List"}],name:"GridMap",creatableEmpty:!0},{_id:{$oid:"60827c20d3f7a631e71522cc"},contentTypes:[],fieldSets:[],fields:[],name:"Dataset",creatableEmpty:!1},{_id:{$oid:"62133ff41302cfcd0d9a2346"},contentTypes:["text/x-glsl"],fieldSets:[],fields:[],name:"Pixel Shader",updateRequiresThumbRefresh:!1,creatableEmpty:!0},{_id:{$oid:"62133ffb1302cf53ef9a234e"},contentTypes:["text/x-glsl"],fieldSets:[],fields:[],name:"Vertex Shader",updateRequiresThumbRefresh:!1,creatableEmpty:!0},{_id:{$oid:"62a83a1ef46738fe096fd7e3"},contentTypes:["application/zip"],fieldSets:[],fields:[],name:"Archive",updateRequiresThumbRefresh:!1,creatableEmpty:!1},{_id:{$oid:"640076f0e49250ab06ea4aec"},contentTypes:["font/ttf","font/otf"],fieldSets:[],fields:[],name:"Font",updateRequiresThumbRefresh:!0,creatableEmpty:!1},{_id:{$oid:"6463df676055450cac673d90"},contentTypes:[],fieldSets:[],fields:[{label:"General Settings",type:"Separator"},{datatype:"Integer",defaultValue:1e3,displayName:"Maximum Number of Particles",info:"The maximum number of particles that can exist at the same time in the simulation.",minValue:0,name:"MaxParticles",type:"Attribute"},{datatype:"Float",defaultValue:-1,displayName:"Duration",info:"Duration (in seconds) the particle system runs. Use -1 for infinite duration.",minValue:-1,name:"Duration",type:"Attribute"},{datatype:"Enum",defaultValue:"Local",displayName:"Coordinate System",info:"Defines whether particle movement is relative to the emitter's local space or the global world space.",name:"SystemCoordinates",options:["Local","World"],type:"Attribute"},{label:"Emission Settings",type:"Separator",collapsed:!0},{datatype:"Boolean",defaultValue:!1,displayName:"Emit All At Once",info:"Emit all particles immediately when the simulation starts.",name:"EmitAllAtOnce",type:"Attribute"},{datatype:"Float",defaultValue:128,minValue:0,displayName:"Spawn amount",if:{EmitAllAtOnce:!1},info:"The number of particles emitted each time the emitter spawns.",name:"SpawnAmount",type:"Attribute"},{datatype:"Float",defaultValue:1,minValue:0,displayName:"Spawn Interval",info:"The time, in seconds, between each consecutive spawn of particles.",if:{EmitAllAtOnce:!1},name:"SpawnRate",type:"Attribute"},{datatype:"Float",defaultValue:-1,minValue:-1,displayName:"Number of Emissions",info:"Total number of spawn events before emission stops; after this number of emissions, no more particles will be emitted.",if:{EmitAllAtOnce:!1},name:"MaximumEmissions",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Continuous emission",info:"If enabled, particles in each emission spawn gradually over time instead of instantly.",if:{EmitAllAtOnce:!1},name:"ContinuousEmissionFlag",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Auto Respawn",info:"Automatically respawn particles when they die.",name:"Respawn",type:"Attribute",if:{EmitAllAtOnce:!0}},{label:"Size Settings",type:"Separator",collapsed:!0},{datatype:"Enum",defaultValue:"Constant",options:["Constant","Variable","Velocity"],displayName:"Scaling Mode",info:"Determines how particle size changes over their lifetime: constant size, variable scaling, or based on velocity.",name:"ScaleMode",type:"Attribute"},{datatype:"Float",defaultValue:10,displayName:"Base Size",info:"The size of the particles at emission",minValue:0,name:"ParticleInitialSize",type:"Attribute"},{datatype:"Float",defaultValue:15,displayName:"Final Size",info:"The size particles reach at the end of their lifetime. If particles die early, they may not reach their final size.",minValue:0,name:"ParticleFinalSize",type:"Attribute",if:{ScaleMode:"Variable"}},{datatype:"Float",displayName:"Scale Randomness",name:"ScaleRandomness",defaultValue:.1,minValue:0,maxValue:1,info:"Random variation applied to scale curve values."},{datatype:"Enum",defaultValue:"Linear",options:["Linear","Exponential","Inverse Exponential","Ease-in, Ease-out"],displayName:"Interpolation Function",info:"Interpolation method for scaling particles over their lifetime.",type:"Attribute",name:"ScaleFunction",if:{ScaleMode:"Variable"}},{datatype:"Float",defaultValue:.5,minValue:0,maxValue:5,if:{ScaleMode:"Variable",$or:[{ScaleFunction:"Exponential"},{ScaleFunction:"Inverse Exponential"},{ScaleFunction:"Ease-in, Ease-out"}]},displayName:"Interpolation Rate",name:"ApproachSize",info:"Controls the rate at which particles scale over time based on the interpolation modes.",type:"Attribute"},{label:"Velocity Settings",type:"Separator",collapsed:!0},{datatype:"Enum",defaultValue:"Constant",options:["Constant","Variable"],displayName:"Velocity Mode",info:"Determines if particles maintain a constant velocity or change velocity over their lifetime.",name:"VelocityMode",type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:0,y:0,z:0},displayName:"Initial Velocity",info:"The starting velocity of particles when emitted.",name:"InitialVelocity",type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:0,y:0,z:0},displayName:"Final Velocity",info:"The velocity particles will reach by the end of their lifetime. Used only when Velocity Mode is set to Variable.",name:"FinalVelocity",type:"Attribute",if:{VelocityMode:"Variable"}},{datatype:"Enum",defaultValue:"Linear",options:["Linear","Exponential","Inverse Exponential","Ease-in, Ease-out"],displayName:"Interpolation Function",info:"Defines the interpolation method for velocity changes over the particle’s lifetime.",name:"VelocityFunction",type:"Attribute",if:{VelocityMode:"Variable"}},{datatype:"Float",defaultValue:.5,displayName:"Interpolation Rate",info:"Controls the rate at which particles transition from initial to final velocity for the interpolation modes.",maxValue:5,minValue:0,name:"FinalVelocityApproach",type:"Attribute",if:{VelocityMode:"Variable",$or:[{VelocityFunction:"Exponential"},{VelocityFunction:"Inverse Exponential"},{VelocityFunction:"Ease-in, Ease-out"}]}},{datatype:"Float",defaultValue:0,displayName:"Spread",info:"Randomly offsets the emission angle (in degrees) from the base direction. A value of 360° emits particles uniformly in all directions. Requires Initial Velocity not be a 0-vector to have any effect.",maxValue:360,minValue:0,name:"Spread",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Angular Velocity",info:"The speed at which particles rotate around their center of mass, in radians per second.",minValue:0,name:"AngularVelocity",type:"Attribute",if:{$or:[{ParticleType:"Texture"},{ParticleType:"Sprite"}]}},{datatype:"Enum",defaultValue:"Clockwise",options:["Clockwise","Anticlockwise"],displayName:"Rotation Direction",info:"Controls the rotation direction of particles.",name:"AngularDirection",type:"Attribute",if:{$or:[{ParticleType:"Texture"},{ParticleType:"Sprite"}]}},{datatype:"Float",defaultValue:0,displayName:"Rotation Randomness",info:"Random variation applied to particle angular velocity. 0 = all particles rotate at the same speed, 1 = each particle can vary ±100% of base angular velocity.",minValue:0,maxValue:1,name:"RotationRandomness",type:"Attribute",if:{$or:[{ParticleType:"Texture"},{ParticleType:"Sprite"}]}},{label:"Force Settings",type:"Separator",collapsed:!0},{datatype:"Float",defaultValue:0,displayName:"Drift",info:"A random velocity added to particles in all directions to simulate drifting motion.",name:"Drift",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Gravity",info:"A constant acceleration applied to particles after emission, simulating gravity. Positive values pull particles downward; negative values pull them upward.",name:"Gravity",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Tangential Velocity",info:"Applies a tangential velocity to particles, causing them to orbit the center point along the defined orbital plane.",name:"OrbitalVelocity",type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:0,y:0,z:0},displayName:"Orbit Center",info:"The point in 3D space around which particles orbit.",name:"OrbitalCenterPoint",type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:0,y:1,z:0},displayName:"Orbital Plane",info:"A vector normal that defines the orientation of the orbital plane. Particles orbit around an axis perpendicular to this vector. Should be normalized (length = 1), but normalization is not enforced.",name:"OrbitalPlane",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Orbital Decay",info:"Causes particles to gradually spiral inward toward the orbital center over time.",name:"OrbitalDecay",type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:0,y:0,z:0},displayName:"Target",info:"A 3D point in space that particles are attracted to.",name:"Target",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Target Force",info:"The strength of the attraction force pulling particles toward the target. Set to 0 to disable.",name:"TargetForce",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Kill on target",info:"If enabled, particles are deleted once they reach the target position.",name:"TargetDeleteFlag",type:"Attribute"},{datatype:"Float",defaultValue:.1,if:{TargetDeleteFlag:!0},displayName:"Target Deletion Threshold",info:"The distance from the target at which particles are deleted.",minValue:0,name:"TargetDeletionThreshold",type:"Attribute"},{label:"Life Settings",type:"Separator",collapsed:!0},{datatype:"Float",defaultValue:10,displayName:"Life",info:"Time in seconds each particle remains alive before disappearing.",minValue:0,name:"Life",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Life Randomness",info:"Adds randomness, in seconds, to particle lifetimes. Each particle's life is calculated as: life + random(0 to 1) x life randomness.",minValue:0,name:"LifeRandomness",type:"Attribute"},{label:"Texture and Color Settings",type:"Separator",collapsed:!0},{datatype:"Enum",defaultValue:"Base",name:"ParticleType",info:"Defines the rendering style of particles: Base (simple points), Texture (image-based), or Sprite (animated images).",options:["Base","Texture","Sprite"],type:"Attribute"},{displayName:"Texture",info:"Image used as the particle’s texture.",if:{$or:[{ParticleType:"Texture"},{ParticleType:"Sprite"}]},linkableTypes:["Image"],type:"Link",usageAs:"ParticleTexture"},{datatype:"Boolean",defaultValue:!0,displayName:"Circular Mask",info:"Applies a circular alpha mask to the texture or sprite, making only the circular area visible while masking out the corners.",name:"useCircularMask",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Texture hue",info:"Amount of hue shift applied to the particle texture, expressed as a normalized value from 0 to 1, where 0 corresponds to 0 radians (0°) and 1 corresponds to 2π radians (360°).",minValue:0,maxValue:1,name:"TextureHue",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,name:"TextureBlending",displayName:"Texture Blending",info:"If enabled, blends the particle texture with the background or other particles for smoother visuals.",if:{$or:[{ParticleType:"Texture"},{ParticleType:"Sprite"}]},type:"Attribute"},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},displayName:"Particle Color",info:"Base color applied to particles at emission.",if:{$or:[{ParticleType:"Base"},{TextureBlending:!0}]},name:"Color",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Use Final Color",info:"Enable color transition so particles interpolate to a specified final color at the end of their lifetime.",if:{$or:[{ParticleType:"Base"},{TextureBlending:!0}]},name:"EnableFinalColor",type:"Attribute"},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},displayName:"Final Color",info:"The color particles interpolate to at the end of their life.",if:{EnableFinalColor:!0,$or:[{ParticleType:"Base"},{TextureBlending:!0}]},name:"FinalColor",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Random Color Factor",info:"Linearly blends each particle's color with a unique random tint. 0 = no randomness, 1 = full random color.",if:{$or:[{ParticleType:"Base"},{TextureBlending:!0}]},minValue:0,maxValue:1,name:"RandomColorFactor",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Enable Sprite Fade",if:{ParticleType:"Sprite"},info:"Allows the sprite to smoothly fade in and fade, creating a softer transition.",name:"EnableSpriteFade",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Roll Sprite Texture With Particle's Life",if:{ParticleType:"Sprite"},info:"Enable the sprite to animate by rolling through its frames based on the particle's lifetime.",name:"RollSpriteWithLife",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Sprite Speed",if:{ParticleType:"Sprite",RollSpriteWithLife:!1},info:"Speed, in frames per seconds, at which the sprite animation advances over time.",minValue:0,name:"SpriteSpeed",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Sprite Cols",if:{ParticleType:"Sprite"},info:"Number of horizontal frames (columns) in the sprite sheet. Must be specified manually. Incorrect values may cause improper animation.",minValue:1,name:"SpriteColumns",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Sprite Rows",if:{ParticleType:"Sprite"},info:"Number of vertical frames (rows) in the sprite sheet. Must be specified manually. Incorrect values may cause improper animation.",minValue:1,name:"SpriteRows",type:"Attribute"},{label:"Blending Settings",type:"Separator",collapsed:!0},{datatype:"Enum",defaultValue:"Normal",displayName:"Blending Mode",name:"BlendingMode",options:["Add","Multiply","Negation","Normal","Subtract"],type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Opacity",info:"Adjusts how strongly the blending mode affects the final result.",maxValue:1,minValue:0,name:"Opacity",type:"Attribute",widget:"Slider"},{label:"Fade Settings",type:"Separator",collapsed:!0},{datatype:"Enum",defaultValue:"Constant",options:["Constant","Variable"],displayName:"Fading Mode",info:"Determines how particle opacity changes: constant transparency, fade over lifetime, or based on velocity.",name:"FadeMode",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Initial Opacity",info:"The opacity of particles when they are first emitted (0.0 = transparent, 1.0 = opaque)",minValue:0,maxValue:1,name:"ParticleInitialOpacity",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Final Opacity",info:"The opacity particles reach at the end of their lifetime. Creates fade-out effect when lower than initial opacity.",minValue:0,maxValue:1,name:"ParticleFinalOpacity",type:"Attribute",if:{FadeMode:"Variable"}},{datatype:"Enum",defaultValue:"Linear",options:["Linear","Exponential","Inverse Exponential","Ease-in, Ease-out"],displayName:"Fade Interpolation",info:"Controls how smoothly particles fade between initial and final opacity over their lifetime.",type:"Attribute",name:"FadeFunction",if:{FadeMode:"Variable"}},{datatype:"Float",defaultValue:1,minValue:.1,maxValue:5,if:{FadeMode:"Variable",$or:[{FadeFunction:"Exponential"},{FadeFunction:"Inverse Exponential"},{FadeFunction:"Ease-in, Ease-out"}]},displayName:"Fade Rate",name:"FadeApproach",info:"Controls how quickly the fade transition occurs. Higher values create sharper transitions, lower values create gentler fades.",type:"Attribute"},{label:"Emission Settings",type:"Separator",collapsed:!0},{datatype:"Enum",defaultValue:"Box",name:"EmitterShape",displayName:"Emitter Shape",info:"Defines the geometric shape from which particles are emitted.",options:["Point","Box","Sphere","Hemisphere","Torus","Cone","Circle","Edge"],type:"Attribute"},{datatype:"Enum",defaultValue:"Volume",name:"EmitterTypeSurfaceVolumeNormal",displayName:"Emitter Type",info:"Specifies whether particles are emitted from the surface, volume, or along the normals of the shape.",options:["Surface","Volume","Normals"],if:{$or:[{EmitterShape:"Box"},{EmitterShape:"Sphere"},{EmitterShape:"Cone"}]},type:"Attribute"},{datatype:"Enum",defaultValue:"Volume",name:"EmitterTypeSurfaceVolume",info:"Specifies whether particles are emitted from the surface or volume of the shape.",displayName:"Emitter Type",options:["Surface","Volume"],if:{$or:[{EmitterShape:"Hemisphere"},{EmitterShape:"Torus"}]},type:"Attribute"},{datatype:"Float",defaultValue:10,displayName:"Velocity Along Normals.",info:"Speed at which particles are emitted along the surface normals.",if:{EmitterTypeSurfaceVolumeNormal:"Normals"},minValue:0,name:"NormalsVelocity",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"The size of the emitter.",info:"Defines the size of the emitter.",if:{$or:[{EmitterShape:"Box"}]},minValue:0,name:"EmitterSize",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"The radius of the emitter.",if:{$or:[{EmitterShape:"Torus"},{EmitterShape:"Cone"},{EmitterShape:"Sphere"},{EmitterShape:"Hemisphere"},{EmitterShape:"Circle"}]},minValue:0,name:"EmitterRadius",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"The outer radius of the emitter",if:{$or:[{EmitterShape:"Torus"}]},minValue:0,name:"EmitterOuterRadius",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"The height of the emitter",if:{$or:[{EmitterShape:"Cone"},{EmitterShape:"Edge"}]},minValue:0,name:"EmitterHeight",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"The width of the emitter.",if:{$or:[{EmitterShape:"Edge"}]},minValue:0,name:"EmitterWidth",type:"Attribute"},{datatype:"Boolean",defaultValue:!1,displayName:"Round Tip",if:{$or:[{EmitterShape:"Cone"}]},info:"Round the tip of the cone instead of using a sharp point.",name:"EmitterRoundTip",type:"Attribute"},{label:"Bounding Box Settings",type:"Separator",collapsed:!0},{datatype:"Boolean",defaultValue:!1,displayName:"Enable Bounding Box",info:"Enable a bounding box to restrict particles within a defined 3D area.",name:"EnableBBox",type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:10,y:10,z:10},info:"Coordinates of the bounding box's maximum corner (upper-right-front).",name:"BBoxMax",displayName:"Bounding Box Maximum Corner",if:{EnableBBox:!0},type:"Attribute"},{datatype:"Vector3d",defaultValue:{x:0,y:0,z:0},info:"Coordinates of the bounding box's minimum corner (lower-left-back).",name:"BBoxMin",displayName:"Bounding Box Minimum Corner",if:{EnableBBox:!0},type:"Attribute"},{label:"Curl Noise Settings",type:"Separator",collapsed:!0},{datatype:"Boolean",defaultValue:!1,displayName:"Enable Curl Noise",info:"Toggle curl noise effect on particles to simulate turbulent, swirling particle behavior.",name:"NoiseFlag",type:"Attribute"},{datatype:"NoisePreview",if:{NoiseFlag:!0},displayName:"Noise Preview",info:"Visual preview of the curl noise pattern applied to the particle system.",name:"NoisePreview",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Noise Strength",if:{NoiseFlag:!0},info:"Controls the intensity of the noise.",name:"NoiseStrength",type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Noise Frequency",if:{NoiseFlag:!0},info:"Determines the smoothness of the noise: lower values produce smooth, slow variations; higher values produce rapid, detailed changes.",name:"NoiseFrequency",type:"Attribute"},{datatype:"Integer",defaultValue:1,displayName:"Noise Octaves",if:{NoiseFlag:!0},info:"Number of noise layers combined to create complexity. Higher octaves add detail but reduce performance.",name:"NoiseOctaves",type:"Attribute"}],name:"Particles",updateRequiresThumbRefresh:!1,creatableEmpty:!0}];function C(e,t=!1){let a=x.find((t=>t.name===e));if(!a)return null;if(a=structuredClone(a),a.fields=a.fields||[],a.fieldSets=a.fieldSets||[],t&&a.inherits){const e=C(a.inherits,!0);e&&(a.fields=[...e.fields,...a.fields],a.fieldSets=[...e.fieldSets,...a.fieldSets])}return a}var I="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function V(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function E(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var F,D={exports:{}};var R=(F||(F=1,function(e){e.exports=function(){var t,a;function n(){return t.apply(null,arguments)}function i(e){t=e}function r(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function s(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function o(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function l(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(o(e,t))return!1;return!0}function u(e){return void 0===e}function c(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function d(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function p(e,t){var a,n=[],i=e.length;for(a=0;a<i;++a)n.push(t(e[a],a));return n}function h(e,t){for(var a in t)o(t,a)&&(e[a]=t[a]);return o(t,"toString")&&(e.toString=t.toString),o(t,"valueOf")&&(e.valueOf=t.valueOf),e}function f(e,t,a,n){return qa(e,t,a,n,!0).utc()}function m(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function y(e){return null==e._pf&&(e._pf=m()),e._pf}function g(e){var t=null,n=!1,i=e._d&&!isNaN(e._d.getTime());return i&&(t=y(e),n=a.call(t.parsedDateParts,(function(e){return null!=e})),i=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n),e._strict&&(i=i&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour)),null!=Object.isFrozen&&Object.isFrozen(e)?i:(e._isValid=i,e._isValid)}function b(e){var t=f(NaN);return null!=e?h(y(t),e):y(t).userInvalidated=!0,t}a=Array.prototype.some?Array.prototype.some:function(e){var t,a=Object(this),n=a.length>>>0;for(t=0;t<n;t++)if(t in a&&e.call(this,a[t],t,a))return!0;return!1};var v=n.momentProperties=[],_=!1;function w(e,t){var a,n,i,r=v.length;if(u(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),u(t._i)||(e._i=t._i),u(t._f)||(e._f=t._f),u(t._l)||(e._l=t._l),u(t._strict)||(e._strict=t._strict),u(t._tzm)||(e._tzm=t._tzm),u(t._isUTC)||(e._isUTC=t._isUTC),u(t._offset)||(e._offset=t._offset),u(t._pf)||(e._pf=y(t)),u(t._locale)||(e._locale=t._locale),r>0)for(a=0;a<r;a++)u(i=t[n=v[a]])||(e[n]=i);return e}function A(e){w(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===_&&(_=!0,n.updateOffset(this),_=!1)}function k(e){return e instanceof A||null!=e&&null!=e._isAMomentObject}function S(e){!1===n.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function N(e,t){var a=!0;return h((function(){if(null!=n.deprecationHandler&&n.deprecationHandler(null,e),a){var i,r,s,l=[],u=arguments.length;for(r=0;r<u;r++){if(i="","object"==typeof arguments[r]){for(s in i+="\n["+r+"] ",arguments[0])o(arguments[0],s)&&(i+=s+": "+arguments[0][s]+", ");i=i.slice(0,-2)}else i=arguments[r];l.push(i)}S(e+"\nArguments: "+Array.prototype.slice.call(l).join("")+"\n"+(new Error).stack),a=!1}return t.apply(this,arguments)}),t)}var T,M={};function x(e,t){null!=n.deprecationHandler&&n.deprecationHandler(e,t),M[e]||(S(t),M[e]=!0)}function C(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function I(e){var t,a;for(a in e)o(e,a)&&(C(t=e[a])?this[a]=t:this["_"+a]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function V(e,t){var a,n=h({},e);for(a in t)o(t,a)&&(s(e[a])&&s(t[a])?(n[a]={},h(n[a],e[a]),h(n[a],t[a])):null!=t[a]?n[a]=t[a]:delete n[a]);for(a in e)o(e,a)&&!o(t,a)&&s(e[a])&&(n[a]=h({},n[a]));return n}function F(e){null!=e&&this.set(e)}n.suppressDeprecationWarnings=!1,n.deprecationHandler=null,T=Object.keys?Object.keys:function(e){var t,a=[];for(t in e)o(e,t)&&a.push(t);return a};var D={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function R(e,t,a){var n=this._calendar[e]||this._calendar.sameElse;return C(n)?n.call(t,a):n}function L(e,t,a){var n=""+Math.abs(e),i=t-n.length;return(e>=0?a?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+n}var P=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,B=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,O={},$={};function U(e,t,a,n){var i=n;"string"==typeof n&&(i=function(){return this[n]()}),e&&($[e]=i),t&&($[t[0]]=function(){return L(i.apply(this,arguments),t[1],t[2])}),a&&($[a]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function j(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function z(e){var t,a,n=e.match(P);for(t=0,a=n.length;t<a;t++)$[n[t]]?n[t]=$[n[t]]:n[t]=j(n[t]);return function(t){var i,r="";for(i=0;i<a;i++)r+=C(n[i])?n[i].call(t,e):n[i];return r}}function W(e,t){return e.isValid()?(t=Y(t,e.localeData()),O[t]=O[t]||z(t),O[t](e)):e.localeData().invalidDate()}function Y(e,t){var a=5;function n(e){return t.longDateFormat(e)||e}for(B.lastIndex=0;a>=0&&B.test(e);)e=e.replace(B,n),B.lastIndex=0,a-=1;return e}var H={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function G(e){var t=this._longDateFormat[e],a=this._longDateFormat[e.toUpperCase()];return t||!a?t:(this._longDateFormat[e]=a.match(P).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])}var q="Invalid date";function Z(){return this._invalidDate}var J="%d",K=/\d{1,2}/;function X(e){return this._ordinal.replace("%d",e)}var Q={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function ee(e,t,a,n){var i=this._relativeTime[a];return C(i)?i(e,t,a,n):i.replace(/%d/i,e)}function te(e,t){var a=this._relativeTime[e>0?"future":"past"];return C(a)?a(t):a.replace(/%s/i,t)}var ae={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function ne(e){return"string"==typeof e?ae[e]||ae[e.toLowerCase()]:void 0}function ie(e){var t,a,n={};for(a in e)o(e,a)&&(t=ne(a))&&(n[t]=e[a]);return n}var re={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function se(e){var t,a=[];for(t in e)o(e,t)&&a.push({unit:t,priority:re[t]});return a.sort((function(e,t){return e.priority-t.priority})),a}var oe,le=/\d/,ue=/\d\d/,ce=/\d{3}/,de=/\d{4}/,pe=/[+-]?\d{6}/,he=/\d\d?/,fe=/\d\d\d\d?/,me=/\d\d\d\d\d\d?/,ye=/\d{1,3}/,ge=/\d{1,4}/,be=/[+-]?\d{1,6}/,ve=/\d+/,_e=/[+-]?\d+/,we=/Z|[+-]\d\d:?\d\d/gi,Ae=/Z|[+-]\d\d(?::?\d\d)?/gi,ke=/[+-]?\d+(\.\d{1,3})?/,Se=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Ne=/^[1-9]\d?/,Te=/^([1-9]\d|\d)/;function Me(e,t,a){oe[e]=C(t)?t:function(e,n){return e&&a?a:t}}function xe(e,t){return o(oe,e)?oe[e](t._strict,t._locale):new RegExp(Ce(e))}function Ce(e){return Ie(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,a,n,i){return t||a||n||i})))}function Ie(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Ve(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function Ee(e){var t=+e,a=0;return 0!==t&&isFinite(t)&&(a=Ve(t)),a}oe={};var Fe={};function De(e,t){var a,n,i=t;for("string"==typeof e&&(e=[e]),c(t)&&(i=function(e,a){a[t]=Ee(e)}),n=e.length,a=0;a<n;a++)Fe[e[a]]=i}function Re(e,t){De(e,(function(e,a,n,i){n._w=n._w||{},t(e,n._w,n,i)}))}function Le(e,t,a){null!=t&&o(Fe,e)&&Fe[e](t,a._a,a,e)}function Pe(e){return e%4==0&&e%100!=0||e%400==0}var Be=0,Oe=1,$e=2,Ue=3,je=4,ze=5,We=6,Ye=7,He=8;function Ge(e){return Pe(e)?366:365}U("Y",0,0,(function(){var e=this.year();return e<=9999?L(e,4):"+"+e})),U(0,["YY",2],0,(function(){return this.year()%100})),U(0,["YYYY",4],0,"year"),U(0,["YYYYY",5],0,"year"),U(0,["YYYYYY",6,!0],0,"year"),Me("Y",_e),Me("YY",he,ue),Me("YYYY",ge,de),Me("YYYYY",be,pe),Me("YYYYYY",be,pe),De(["YYYYY","YYYYYY"],Be),De("YYYY",(function(e,t){t[Be]=2===e.length?n.parseTwoDigitYear(e):Ee(e)})),De("YY",(function(e,t){t[Be]=n.parseTwoDigitYear(e)})),De("Y",(function(e,t){t[Be]=parseInt(e,10)})),n.parseTwoDigitYear=function(e){return Ee(e)+(Ee(e)>68?1900:2e3)};var qe,Ze=Ke("FullYear",!0);function Je(){return Pe(this.year())}function Ke(e,t){return function(a){return null!=a?(Qe(this,e,a),n.updateOffset(this,t),this):Xe(this,e)}}function Xe(e,t){if(!e.isValid())return NaN;var a=e._d,n=e._isUTC;switch(t){case"Milliseconds":return n?a.getUTCMilliseconds():a.getMilliseconds();case"Seconds":return n?a.getUTCSeconds():a.getSeconds();case"Minutes":return n?a.getUTCMinutes():a.getMinutes();case"Hours":return n?a.getUTCHours():a.getHours();case"Date":return n?a.getUTCDate():a.getDate();case"Day":return n?a.getUTCDay():a.getDay();case"Month":return n?a.getUTCMonth():a.getMonth();case"FullYear":return n?a.getUTCFullYear():a.getFullYear();default:return NaN}}function Qe(e,t,a){var n,i,r,s,o;if(e.isValid()&&!isNaN(a)){switch(n=e._d,i=e._isUTC,t){case"Milliseconds":return void(i?n.setUTCMilliseconds(a):n.setMilliseconds(a));case"Seconds":return void(i?n.setUTCSeconds(a):n.setSeconds(a));case"Minutes":return void(i?n.setUTCMinutes(a):n.setMinutes(a));case"Hours":return void(i?n.setUTCHours(a):n.setHours(a));case"Date":return void(i?n.setUTCDate(a):n.setDate(a));case"FullYear":break;default:return}r=a,s=e.month(),o=29!==(o=e.date())||1!==s||Pe(r)?o:28,i?n.setUTCFullYear(r,s,o):n.setFullYear(r,s,o)}}function et(e){return C(this[e=ne(e)])?this[e]():this}function tt(e,t){if("object"==typeof e){var a,n=se(e=ie(e)),i=n.length;for(a=0;a<i;a++)this[n[a].unit](e[n[a].unit])}else if(C(this[e=ne(e)]))return this[e](t);return this}function at(e,t){return(e%t+t)%t}function nt(e,t){if(isNaN(e)||isNaN(t))return NaN;var a=at(t,12);return e+=(t-a)/12,1===a?Pe(e)?29:28:31-a%7%2}qe=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},U("M",["MM",2],"Mo",(function(){return this.month()+1})),U("MMM",0,0,(function(e){return this.localeData().monthsShort(this,e)})),U("MMMM",0,0,(function(e){return this.localeData().months(this,e)})),Me("M",he,Ne),Me("MM",he,ue),Me("MMM",(function(e,t){return t.monthsShortRegex(e)})),Me("MMMM",(function(e,t){return t.monthsRegex(e)})),De(["M","MM"],(function(e,t){t[Oe]=Ee(e)-1})),De(["MMM","MMMM"],(function(e,t,a,n){var i=a._locale.monthsParse(e,n,a._strict);null!=i?t[Oe]=i:y(a).invalidMonth=e}));var it="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),rt="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),st=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,ot=Se,lt=Se;function ut(e,t){return e?r(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||st).test(t)?"format":"standalone"][e.month()]:r(this._months)?this._months:this._months.standalone}function ct(e,t){return e?r(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[st.test(t)?"format":"standalone"][e.month()]:r(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function dt(e,t,a){var n,i,r,s=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)r=f([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(r,"").toLocaleLowerCase();return a?"MMM"===t?-1!==(i=qe.call(this._shortMonthsParse,s))?i:null:-1!==(i=qe.call(this._longMonthsParse,s))?i:null:"MMM"===t?-1!==(i=qe.call(this._shortMonthsParse,s))||-1!==(i=qe.call(this._longMonthsParse,s))?i:null:-1!==(i=qe.call(this._longMonthsParse,s))||-1!==(i=qe.call(this._shortMonthsParse,s))?i:null}function pt(e,t,a){var n,i,r;if(this._monthsParseExact)return dt.call(this,e,t,a);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(i=f([2e3,n]),a&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),a||this._monthsParse[n]||(r="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[n]=new RegExp(r.replace(".",""),"i")),a&&"MMMM"===t&&this._longMonthsParse[n].test(e))return n;if(a&&"MMM"===t&&this._shortMonthsParse[n].test(e))return n;if(!a&&this._monthsParse[n].test(e))return n}}function ht(e,t){if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=Ee(t);else if(!c(t=e.localeData().monthsParse(t)))return e;var a=t,n=e.date();return n=n<29?n:Math.min(n,nt(e.year(),a)),e._isUTC?e._d.setUTCMonth(a,n):e._d.setMonth(a,n),e}function ft(e){return null!=e?(ht(this,e),n.updateOffset(this,!0),this):Xe(this,"Month")}function mt(){return nt(this.year(),this.month())}function yt(e){return this._monthsParseExact?(o(this,"_monthsRegex")||bt.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(o(this,"_monthsShortRegex")||(this._monthsShortRegex=ot),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function gt(e){return this._monthsParseExact?(o(this,"_monthsRegex")||bt.call(this),e?this._monthsStrictRegex:this._monthsRegex):(o(this,"_monthsRegex")||(this._monthsRegex=lt),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function bt(){function e(e,t){return t.length-e.length}var t,a,n,i,r=[],s=[],o=[];for(t=0;t<12;t++)a=f([2e3,t]),n=Ie(this.monthsShort(a,"")),i=Ie(this.months(a,"")),r.push(n),s.push(i),o.push(i),o.push(n);r.sort(e),s.sort(e),o.sort(e),this._monthsRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")","i")}function vt(e,t,a,n,i,r,s){var o;return e<100&&e>=0?(o=new Date(e+400,t,a,n,i,r,s),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,a,n,i,r,s),o}function _t(e){var t,a;return e<100&&e>=0?((a=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,a)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function wt(e,t,a){var n=7+t-a;return-(7+_t(e,0,n).getUTCDay()-t)%7+n-1}function At(e,t,a,n,i){var r,s,o=1+7*(t-1)+(7+a-n)%7+wt(e,n,i);return o<=0?s=Ge(r=e-1)+o:o>Ge(e)?(r=e+1,s=o-Ge(e)):(r=e,s=o),{year:r,dayOfYear:s}}function kt(e,t,a){var n,i,r=wt(e.year(),t,a),s=Math.floor((e.dayOfYear()-r-1)/7)+1;return s<1?n=s+St(i=e.year()-1,t,a):s>St(e.year(),t,a)?(n=s-St(e.year(),t,a),i=e.year()+1):(i=e.year(),n=s),{week:n,year:i}}function St(e,t,a){var n=wt(e,t,a),i=wt(e+1,t,a);return(Ge(e)-n+i)/7}function Nt(e){return kt(e,this._week.dow,this._week.doy).week}U("w",["ww",2],"wo","week"),U("W",["WW",2],"Wo","isoWeek"),Me("w",he,Ne),Me("ww",he,ue),Me("W",he,Ne),Me("WW",he,ue),Re(["w","ww","W","WW"],(function(e,t,a,n){t[n.substr(0,1)]=Ee(e)}));var Tt={dow:0,doy:6};function Mt(){return this._week.dow}function xt(){return this._week.doy}function Ct(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function It(e){var t=kt(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function Vt(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}function Et(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Ft(e,t){return e.slice(t,7).concat(e.slice(0,t))}U("d",0,"do","day"),U("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),U("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),U("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),U("e",0,0,"weekday"),U("E",0,0,"isoWeekday"),Me("d",he),Me("e",he),Me("E",he),Me("dd",(function(e,t){return t.weekdaysMinRegex(e)})),Me("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),Me("dddd",(function(e,t){return t.weekdaysRegex(e)})),Re(["dd","ddd","dddd"],(function(e,t,a,n){var i=a._locale.weekdaysParse(e,n,a._strict);null!=i?t.d=i:y(a).invalidWeekday=e})),Re(["d","e","E"],(function(e,t,a,n){t[n]=Ee(e)}));var Dt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Rt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Lt="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Pt=Se,Bt=Se,Ot=Se;function $t(e,t){var a=r(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Ft(a,this._week.dow):e?a[e.day()]:a}function Ut(e){return!0===e?Ft(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function jt(e){return!0===e?Ft(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function zt(e,t,a){var n,i,r,s=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)r=f([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(r,"").toLocaleLowerCase();return a?"dddd"===t?-1!==(i=qe.call(this._weekdaysParse,s))?i:null:"ddd"===t?-1!==(i=qe.call(this._shortWeekdaysParse,s))?i:null:-1!==(i=qe.call(this._minWeekdaysParse,s))?i:null:"dddd"===t?-1!==(i=qe.call(this._weekdaysParse,s))||-1!==(i=qe.call(this._shortWeekdaysParse,s))||-1!==(i=qe.call(this._minWeekdaysParse,s))?i:null:"ddd"===t?-1!==(i=qe.call(this._shortWeekdaysParse,s))||-1!==(i=qe.call(this._weekdaysParse,s))||-1!==(i=qe.call(this._minWeekdaysParse,s))?i:null:-1!==(i=qe.call(this._minWeekdaysParse,s))||-1!==(i=qe.call(this._weekdaysParse,s))||-1!==(i=qe.call(this._shortWeekdaysParse,s))?i:null}function Wt(e,t,a){var n,i,r;if(this._weekdaysParseExact)return zt.call(this,e,t,a);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(i=f([2e3,1]).day(n),a&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(r="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[n]=new RegExp(r.replace(".",""),"i")),a&&"dddd"===t&&this._fullWeekdaysParse[n].test(e))return n;if(a&&"ddd"===t&&this._shortWeekdaysParse[n].test(e))return n;if(a&&"dd"===t&&this._minWeekdaysParse[n].test(e))return n;if(!a&&this._weekdaysParse[n].test(e))return n}}function Yt(e){if(!this.isValid())return null!=e?this:NaN;var t=Xe(this,"Day");return null!=e?(e=Vt(e,this.localeData()),this.add(e-t,"d")):t}function Ht(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function Gt(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=Et(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function qt(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||Kt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(o(this,"_weekdaysRegex")||(this._weekdaysRegex=Pt),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function Zt(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||Kt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(o(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Bt),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Jt(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||Kt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(o(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ot),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Kt(){function e(e,t){return t.length-e.length}var t,a,n,i,r,s=[],o=[],l=[],u=[];for(t=0;t<7;t++)a=f([2e3,1]).day(t),n=Ie(this.weekdaysMin(a,"")),i=Ie(this.weekdaysShort(a,"")),r=Ie(this.weekdays(a,"")),s.push(n),o.push(i),l.push(r),u.push(n),u.push(i),u.push(r);s.sort(e),o.sort(e),l.sort(e),u.sort(e),this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Xt(){return this.hours()%12||12}function Qt(){return this.hours()||24}function ea(e,t){U(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function ta(e,t){return t._meridiemParse}function aa(e){return"p"===(e+"").toLowerCase().charAt(0)}U("H",["HH",2],0,"hour"),U("h",["hh",2],0,Xt),U("k",["kk",2],0,Qt),U("hmm",0,0,(function(){return""+Xt.apply(this)+L(this.minutes(),2)})),U("hmmss",0,0,(function(){return""+Xt.apply(this)+L(this.minutes(),2)+L(this.seconds(),2)})),U("Hmm",0,0,(function(){return""+this.hours()+L(this.minutes(),2)})),U("Hmmss",0,0,(function(){return""+this.hours()+L(this.minutes(),2)+L(this.seconds(),2)})),ea("a",!0),ea("A",!1),Me("a",ta),Me("A",ta),Me("H",he,Te),Me("h",he,Ne),Me("k",he,Ne),Me("HH",he,ue),Me("hh",he,ue),Me("kk",he,ue),Me("hmm",fe),Me("hmmss",me),Me("Hmm",fe),Me("Hmmss",me),De(["H","HH"],Ue),De(["k","kk"],(function(e,t,a){var n=Ee(e);t[Ue]=24===n?0:n})),De(["a","A"],(function(e,t,a){a._isPm=a._locale.isPM(e),a._meridiem=e})),De(["h","hh"],(function(e,t,a){t[Ue]=Ee(e),y(a).bigHour=!0})),De("hmm",(function(e,t,a){var n=e.length-2;t[Ue]=Ee(e.substr(0,n)),t[je]=Ee(e.substr(n)),y(a).bigHour=!0})),De("hmmss",(function(e,t,a){var n=e.length-4,i=e.length-2;t[Ue]=Ee(e.substr(0,n)),t[je]=Ee(e.substr(n,2)),t[ze]=Ee(e.substr(i)),y(a).bigHour=!0})),De("Hmm",(function(e,t,a){var n=e.length-2;t[Ue]=Ee(e.substr(0,n)),t[je]=Ee(e.substr(n))})),De("Hmmss",(function(e,t,a){var n=e.length-4,i=e.length-2;t[Ue]=Ee(e.substr(0,n)),t[je]=Ee(e.substr(n,2)),t[ze]=Ee(e.substr(i))}));var na=/[ap]\.?m?\.?/i,ia=Ke("Hours",!0);function ra(e,t,a){return e>11?a?"pm":"PM":a?"am":"AM"}var sa,oa={calendar:D,longDateFormat:H,invalidDate:q,ordinal:J,dayOfMonthOrdinalParse:K,relativeTime:Q,months:it,monthsShort:rt,week:Tt,weekdays:Dt,weekdaysMin:Lt,weekdaysShort:Rt,meridiemParse:na},la={},ua={};function ca(e,t){var a,n=Math.min(e.length,t.length);for(a=0;a<n;a+=1)if(e[a]!==t[a])return a;return n}function da(e){return e?e.toLowerCase().replace("_","-"):e}function pa(e){for(var t,a,n,i,r=0;r<e.length;){for(t=(i=da(e[r]).split("-")).length,a=(a=da(e[r+1]))?a.split("-"):null;t>0;){if(n=fa(i.slice(0,t).join("-")))return n;if(a&&a.length>=t&&ca(i,a)>=t-1)break;t--}r++}return sa}function ha(e){return!(!e||!e.match("^[^/\\\\]*$"))}function fa(t){var a=null;if(void 0===la[t]&&e&&e.exports&&ha(t))try{a=sa._abbr,E("./locale/"+t),ma(a)}catch(e){la[t]=null}return la[t]}function ma(e,t){var a;return e&&((a=u(t)?ba(e):ya(e,t))?sa=a:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),sa._abbr}function ya(e,t){if(null!==t){var a,n=oa;if(t.abbr=e,null!=la[e])x("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=la[e]._config;else if(null!=t.parentLocale)if(null!=la[t.parentLocale])n=la[t.parentLocale]._config;else{if(null==(a=fa(t.parentLocale)))return ua[t.parentLocale]||(ua[t.parentLocale]=[]),ua[t.parentLocale].push({name:e,config:t}),null;n=a._config}return la[e]=new F(V(n,t)),ua[e]&&ua[e].forEach((function(e){ya(e.name,e.config)})),ma(e),la[e]}return delete la[e],null}function ga(e,t){if(null!=t){var a,n,i=oa;null!=la[e]&&null!=la[e].parentLocale?la[e].set(V(la[e]._config,t)):(null!=(n=fa(e))&&(i=n._config),t=V(i,t),null==n&&(t.abbr=e),(a=new F(t)).parentLocale=la[e],la[e]=a),ma(e)}else null!=la[e]&&(null!=la[e].parentLocale?(la[e]=la[e].parentLocale,e===ma()&&ma(e)):null!=la[e]&&delete la[e]);return la[e]}function ba(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return sa;if(!r(e)){if(t=fa(e))return t;e=[e]}return pa(e)}function va(){return T(la)}function _a(e){var t,a=e._a;return a&&-2===y(e).overflow&&(t=a[Oe]<0||a[Oe]>11?Oe:a[$e]<1||a[$e]>nt(a[Be],a[Oe])?$e:a[Ue]<0||a[Ue]>24||24===a[Ue]&&(0!==a[je]||0!==a[ze]||0!==a[We])?Ue:a[je]<0||a[je]>59?je:a[ze]<0||a[ze]>59?ze:a[We]<0||a[We]>999?We:-1,y(e)._overflowDayOfYear&&(t<Be||t>$e)&&(t=$e),y(e)._overflowWeeks&&-1===t&&(t=Ye),y(e)._overflowWeekday&&-1===t&&(t=He),y(e).overflow=t),e}var wa=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Aa=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ka=/Z|[+-]\d\d(?::?\d\d)?/,Sa=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Na=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Ta=/^\/?Date\((-?\d+)/i,Ma=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,xa={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ca(e){var t,a,n,i,r,s,o=e._i,l=wa.exec(o)||Aa.exec(o),u=Sa.length,c=Na.length;if(l){for(y(e).iso=!0,t=0,a=u;t<a;t++)if(Sa[t][1].exec(l[1])){i=Sa[t][0],n=!1!==Sa[t][2];break}if(null==i)return void(e._isValid=!1);if(l[3]){for(t=0,a=c;t<a;t++)if(Na[t][1].exec(l[3])){r=(l[2]||" ")+Na[t][0];break}if(null==r)return void(e._isValid=!1)}if(!n&&null!=r)return void(e._isValid=!1);if(l[4]){if(!ka.exec(l[4]))return void(e._isValid=!1);s="Z"}e._f=i+(r||"")+(s||""),Ua(e)}else e._isValid=!1}function Ia(e,t,a,n,i,r){var s=[Va(e),rt.indexOf(t),parseInt(a,10),parseInt(n,10),parseInt(i,10)];return r&&s.push(parseInt(r,10)),s}function Va(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function Ea(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Fa(e,t,a){return!e||Rt.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(y(a).weekdayMismatch=!0,a._isValid=!1,!1)}function Da(e,t,a){if(e)return xa[e];if(t)return 0;var n=parseInt(a,10),i=n%100;return(n-i)/100*60+i}function Ra(e){var t,a=Ma.exec(Ea(e._i));if(a){if(t=Ia(a[4],a[3],a[2],a[5],a[6],a[7]),!Fa(a[1],t,e))return;e._a=t,e._tzm=Da(a[8],a[9],a[10]),e._d=_t.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),y(e).rfc2822=!0}else e._isValid=!1}function La(e){var t=Ta.exec(e._i);null===t?(Ca(e),!1===e._isValid&&(delete e._isValid,Ra(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:n.createFromInputFallback(e)))):e._d=new Date(+t[1])}function Pa(e,t,a){return null!=e?e:null!=t?t:a}function Ba(e){var t=new Date(n.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Oa(e){var t,a,n,i,r,s=[];if(!e._d){for(n=Ba(e),e._w&&null==e._a[$e]&&null==e._a[Oe]&&$a(e),null!=e._dayOfYear&&(r=Pa(e._a[Be],n[Be]),(e._dayOfYear>Ge(r)||0===e._dayOfYear)&&(y(e)._overflowDayOfYear=!0),a=_t(r,0,e._dayOfYear),e._a[Oe]=a.getUTCMonth(),e._a[$e]=a.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=s[t]=n[t];for(;t<7;t++)e._a[t]=s[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[Ue]&&0===e._a[je]&&0===e._a[ze]&&0===e._a[We]&&(e._nextDay=!0,e._a[Ue]=0),e._d=(e._useUTC?_t:vt).apply(null,s),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Ue]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(y(e).weekdayMismatch=!0)}}function $a(e){var t,a,n,i,r,s,o,l,u;null!=(t=e._w).GG||null!=t.W||null!=t.E?(r=1,s=4,a=Pa(t.GG,e._a[Be],kt(Za(),1,4).year),n=Pa(t.W,1),((i=Pa(t.E,1))<1||i>7)&&(l=!0)):(r=e._locale._week.dow,s=e._locale._week.doy,u=kt(Za(),r,s),a=Pa(t.gg,e._a[Be],u.year),n=Pa(t.w,u.week),null!=t.d?((i=t.d)<0||i>6)&&(l=!0):null!=t.e?(i=t.e+r,(t.e<0||t.e>6)&&(l=!0)):i=r),n<1||n>St(a,r,s)?y(e)._overflowWeeks=!0:null!=l?y(e)._overflowWeekday=!0:(o=At(a,n,i,r,s),e._a[Be]=o.year,e._dayOfYear=o.dayOfYear)}function Ua(e){if(e._f!==n.ISO_8601)if(e._f!==n.RFC_2822){e._a=[],y(e).empty=!0;var t,a,i,r,s,o,l,u=""+e._i,c=u.length,d=0;for(l=(i=Y(e._f,e._locale).match(P)||[]).length,t=0;t<l;t++)r=i[t],(a=(u.match(xe(r,e))||[])[0])&&((s=u.substr(0,u.indexOf(a))).length>0&&y(e).unusedInput.push(s),u=u.slice(u.indexOf(a)+a.length),d+=a.length),$[r]?(a?y(e).empty=!1:y(e).unusedTokens.push(r),Le(r,a,e)):e._strict&&!a&&y(e).unusedTokens.push(r);y(e).charsLeftOver=c-d,u.length>0&&y(e).unusedInput.push(u),e._a[Ue]<=12&&!0===y(e).bigHour&&e._a[Ue]>0&&(y(e).bigHour=void 0),y(e).parsedDateParts=e._a.slice(0),y(e).meridiem=e._meridiem,e._a[Ue]=ja(e._locale,e._a[Ue],e._meridiem),null!==(o=y(e).era)&&(e._a[Be]=e._locale.erasConvertYear(o,e._a[Be])),Oa(e),_a(e)}else Ra(e);else Ca(e)}function ja(e,t,a){var n;return null==a?t:null!=e.meridiemHour?e.meridiemHour(t,a):null!=e.isPM?((n=e.isPM(a))&&t<12&&(t+=12),n||12!==t||(t=0),t):t}function za(e){var t,a,n,i,r,s,o=!1,l=e._f.length;if(0===l)return y(e).invalidFormat=!0,void(e._d=new Date(NaN));for(i=0;i<l;i++)r=0,s=!1,t=w({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],Ua(t),g(t)&&(s=!0),r+=y(t).charsLeftOver,r+=10*y(t).unusedTokens.length,y(t).score=r,o?r<n&&(n=r,a=t):(null==n||r<n||s)&&(n=r,a=t,s&&(o=!0));h(e,a||t)}function Wa(e){if(!e._d){var t=ie(e._i),a=void 0===t.day?t.date:t.day;e._a=p([t.year,t.month,a,t.hour,t.minute,t.second,t.millisecond],(function(e){return e&&parseInt(e,10)})),Oa(e)}}function Ya(e){var t=new A(_a(Ha(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Ha(e){var t=e._i,a=e._f;return e._locale=e._locale||ba(e._l),null===t||void 0===a&&""===t?b({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),k(t)?new A(_a(t)):(d(t)?e._d=t:r(a)?za(e):a?Ua(e):Ga(e),g(e)||(e._d=null),e))}function Ga(e){var t=e._i;u(t)?e._d=new Date(n.now()):d(t)?e._d=new Date(t.valueOf()):"string"==typeof t?La(e):r(t)?(e._a=p(t.slice(0),(function(e){return parseInt(e,10)})),Oa(e)):s(t)?Wa(e):c(t)?e._d=new Date(t):n.createFromInputFallback(e)}function qa(e,t,a,n,i){var o={};return!0!==t&&!1!==t||(n=t,t=void 0),!0!==a&&!1!==a||(n=a,a=void 0),(s(e)&&l(e)||r(e)&&0===e.length)&&(e=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=i,o._l=a,o._i=e,o._f=t,o._strict=n,Ya(o)}function Za(e,t,a,n){return qa(e,t,a,n,!1)}n.createFromInputFallback=N("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",(function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))})),n.ISO_8601=function(){},n.RFC_2822=function(){};var Ja=N("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Za.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:b()})),Ka=N("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Za.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:b()}));function Xa(e,t){var a,n;if(1===t.length&&r(t[0])&&(t=t[0]),!t.length)return Za();for(a=t[0],n=1;n<t.length;++n)t[n].isValid()&&!t[n][e](a)||(a=t[n]);return a}function Qa(){return Xa("isBefore",[].slice.call(arguments,0))}function en(){return Xa("isAfter",[].slice.call(arguments,0))}var tn=function(){return Date.now?Date.now():+new Date},an=["year","quarter","month","week","day","hour","minute","second","millisecond"];function nn(e){var t,a,n=!1,i=an.length;for(t in e)if(o(e,t)&&(-1===qe.call(an,t)||null!=e[t]&&isNaN(e[t])))return!1;for(a=0;a<i;++a)if(e[an[a]]){if(n)return!1;parseFloat(e[an[a]])!==Ee(e[an[a]])&&(n=!0)}return!0}function rn(){return this._isValid}function sn(){return Cn(NaN)}function on(e){var t=ie(e),a=t.year||0,n=t.quarter||0,i=t.month||0,r=t.week||t.isoWeek||0,s=t.day||0,o=t.hour||0,l=t.minute||0,u=t.second||0,c=t.millisecond||0;this._isValid=nn(t),this._milliseconds=+c+1e3*u+6e4*l+1e3*o*60*60,this._days=+s+7*r,this._months=+i+3*n+12*a,this._data={},this._locale=ba(),this._bubble()}function ln(e){return e instanceof on}function un(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function cn(e,t,a){var n,i=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),s=0;for(n=0;n<i;n++)Ee(e[n])!==Ee(t[n])&&s++;return s+r}function dn(e,t){U(e,0,0,(function(){var e=this.utcOffset(),a="+";return e<0&&(e=-e,a="-"),a+L(~~(e/60),2)+t+L(~~e%60,2)}))}dn("Z",":"),dn("ZZ",""),Me("Z",Ae),Me("ZZ",Ae),De(["Z","ZZ"],(function(e,t,a){a._useUTC=!0,a._tzm=hn(Ae,e)}));var pn=/([\+\-]|\d\d)/gi;function hn(e,t){var a,n,i=(t||"").match(e);return null===i?null:0===(n=60*(a=((i[i.length-1]||[])+"").match(pn)||["-",0,0])[1]+Ee(a[2]))?0:"+"===a[0]?n:-n}function fn(e,t){var a,i;return t._isUTC?(a=t.clone(),i=(k(e)||d(e)?e.valueOf():Za(e).valueOf())-a.valueOf(),a._d.setTime(a._d.valueOf()+i),n.updateOffset(a,!1),a):Za(e).local()}function mn(e){return-Math.round(e._d.getTimezoneOffset())}function yn(e,t,a){var i,r=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=hn(Ae,e)))return this}else Math.abs(e)<16&&!a&&(e*=60);return!this._isUTC&&t&&(i=mn(this)),this._offset=e,this._isUTC=!0,null!=i&&this.add(i,"m"),r!==e&&(!t||this._changeInProgress?Dn(this,Cn(e-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,n.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?r:mn(this)}function gn(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function bn(e){return this.utcOffset(0,e)}function vn(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(mn(this),"m")),this}function _n(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=hn(we,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this}function wn(e){return!!this.isValid()&&(e=e?Za(e).utcOffset():0,(this.utcOffset()-e)%60==0)}function An(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function kn(){if(!u(this._isDSTShifted))return this._isDSTShifted;var e,t={};return w(t,this),(t=Ha(t))._a?(e=t._isUTC?f(t._a):Za(t._a),this._isDSTShifted=this.isValid()&&cn(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Sn(){return!!this.isValid()&&!this._isUTC}function Nn(){return!!this.isValid()&&this._isUTC}function Tn(){return!!this.isValid()&&this._isUTC&&0===this._offset}n.updateOffset=function(){};var Mn=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,xn=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Cn(e,t){var a,n,i,r=e,s=null;return ln(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:c(e)||!isNaN(+e)?(r={},t?r[t]=+e:r.milliseconds=+e):(s=Mn.exec(e))?(a="-"===s[1]?-1:1,r={y:0,d:Ee(s[$e])*a,h:Ee(s[Ue])*a,m:Ee(s[je])*a,s:Ee(s[ze])*a,ms:Ee(un(1e3*s[We]))*a}):(s=xn.exec(e))?(a="-"===s[1]?-1:1,r={y:In(s[2],a),M:In(s[3],a),w:In(s[4],a),d:In(s[5],a),h:In(s[6],a),m:In(s[7],a),s:In(s[8],a)}):null==r?r={}:"object"==typeof r&&("from"in r||"to"in r)&&(i=En(Za(r.from),Za(r.to)),(r={}).ms=i.milliseconds,r.M=i.months),n=new on(r),ln(e)&&o(e,"_locale")&&(n._locale=e._locale),ln(e)&&o(e,"_isValid")&&(n._isValid=e._isValid),n}function In(e,t){var a=e&&parseFloat(e.replace(",","."));return(isNaN(a)?0:a)*t}function Vn(e,t){var a={};return a.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(a.months,"M").isAfter(t)&&--a.months,a.milliseconds=+t-+e.clone().add(a.months,"M"),a}function En(e,t){var a;return e.isValid()&&t.isValid()?(t=fn(t,e),e.isBefore(t)?a=Vn(e,t):((a=Vn(t,e)).milliseconds=-a.milliseconds,a.months=-a.months),a):{milliseconds:0,months:0}}function Fn(e,t){return function(a,n){var i;return null===n||isNaN(+n)||(x(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=a,a=n,n=i),Dn(this,Cn(a,n),e),this}}function Dn(e,t,a,i){var r=t._milliseconds,s=un(t._days),o=un(t._months);e.isValid()&&(i=null==i||i,o&&ht(e,Xe(e,"Month")+o*a),s&&Qe(e,"Date",Xe(e,"Date")+s*a),r&&e._d.setTime(e._d.valueOf()+r*a),i&&n.updateOffset(e,s||o))}Cn.fn=on.prototype,Cn.invalid=sn;var Rn=Fn(1,"add"),Ln=Fn(-1,"subtract");function Pn(e){return"string"==typeof e||e instanceof String}function Bn(e){return k(e)||d(e)||Pn(e)||c(e)||$n(e)||On(e)||null==e}function On(e){var t,a,n=s(e)&&!l(e),i=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],u=r.length;for(t=0;t<u;t+=1)a=r[t],i=i||o(e,a);return n&&i}function $n(e){var t=r(e),a=!1;return t&&(a=0===e.filter((function(t){return!c(t)&&Pn(e)})).length),t&&a}function Un(e){var t,a,n=s(e)&&!l(e),i=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<r.length;t+=1)a=r[t],i=i||o(e,a);return n&&i}function jn(e,t){var a=e.diff(t,"days",!0);return a<-6?"sameElse":a<-1?"lastWeek":a<0?"lastDay":a<1?"sameDay":a<2?"nextDay":a<7?"nextWeek":"sameElse"}function zn(e,t){1===arguments.length&&(arguments[0]?Bn(arguments[0])?(e=arguments[0],t=void 0):Un(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var a=e||Za(),i=fn(a,this).startOf("day"),r=n.calendarFormat(this,i)||"sameElse",s=t&&(C(t[r])?t[r].call(this,a):t[r]);return this.format(s||this.localeData().calendar(r,this,Za(a)))}function Wn(){return new A(this)}function Yn(e,t){var a=k(e)?e:Za(e);return!(!this.isValid()||!a.isValid())&&("millisecond"===(t=ne(t)||"millisecond")?this.valueOf()>a.valueOf():a.valueOf()<this.clone().startOf(t).valueOf())}function Hn(e,t){var a=k(e)?e:Za(e);return!(!this.isValid()||!a.isValid())&&("millisecond"===(t=ne(t)||"millisecond")?this.valueOf()<a.valueOf():this.clone().endOf(t).valueOf()<a.valueOf())}function Gn(e,t,a,n){var i=k(e)?e:Za(e),r=k(t)?t:Za(t);return!!(this.isValid()&&i.isValid()&&r.isValid())&&("("===(n=n||"()")[0]?this.isAfter(i,a):!this.isBefore(i,a))&&(")"===n[1]?this.isBefore(r,a):!this.isAfter(r,a))}function qn(e,t){var a,n=k(e)?e:Za(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=ne(t)||"millisecond")?this.valueOf()===n.valueOf():(a=n.valueOf(),this.clone().startOf(t).valueOf()<=a&&a<=this.clone().endOf(t).valueOf()))}function Zn(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Jn(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Kn(e,t,a){var n,i,r;if(!this.isValid())return NaN;if(!(n=fn(e,this)).isValid())return NaN;switch(i=6e4*(n.utcOffset()-this.utcOffset()),t=ne(t)){case"year":r=Xn(this,n)/12;break;case"month":r=Xn(this,n);break;case"quarter":r=Xn(this,n)/3;break;case"second":r=(this-n)/1e3;break;case"minute":r=(this-n)/6e4;break;case"hour":r=(this-n)/36e5;break;case"day":r=(this-n-i)/864e5;break;case"week":r=(this-n-i)/6048e5;break;default:r=this-n}return a?r:Ve(r)}function Xn(e,t){if(e.date()<t.date())return-Xn(t,e);var a=12*(t.year()-e.year())+(t.month()-e.month()),n=e.clone().add(a,"months");return-(a+(t-n<0?(t-n)/(n-e.clone().add(a-1,"months")):(t-n)/(e.clone().add(a+1,"months")-n)))||0}function Qn(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ei(e){if(!this.isValid())return null;var t=!0!==e,a=t?this.clone().utc():this;return a.year()<0||a.year()>9999?W(a,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):C(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",W(a,"Z")):W(a,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function ti(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,a,n,i="moment",r="";return this.isLocal()||(i=0===this.utcOffset()?"moment.utc":"moment.parseZone",r="Z"),e="["+i+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a="-MM-DD[T]HH:mm:ss.SSS",n=r+'[")]',this.format(e+t+a+n)}function ai(e){e||(e=this.isUtc()?n.defaultFormatUtc:n.defaultFormat);var t=W(this,e);return this.localeData().postformat(t)}function ni(e,t){return this.isValid()&&(k(e)&&e.isValid()||Za(e).isValid())?Cn({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ii(e){return this.from(Za(),e)}function ri(e,t){return this.isValid()&&(k(e)&&e.isValid()||Za(e).isValid())?Cn({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function si(e){return this.to(Za(),e)}function oi(e){var t;return void 0===e?this._locale._abbr:(null!=(t=ba(e))&&(this._locale=t),this)}n.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",n.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var li=N("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(e){return void 0===e?this.localeData():this.locale(e)}));function ui(){return this._locale}var ci=1e3,di=60*ci,pi=60*di,hi=3506328*pi;function fi(e,t){return(e%t+t)%t}function mi(e,t,a){return e<100&&e>=0?new Date(e+400,t,a)-hi:new Date(e,t,a).valueOf()}function yi(e,t,a){return e<100&&e>=0?Date.UTC(e+400,t,a)-hi:Date.UTC(e,t,a)}function gi(e){var t,a;if(void 0===(e=ne(e))||"millisecond"===e||!this.isValid())return this;switch(a=this._isUTC?yi:mi,e){case"year":t=a(this.year(),0,1);break;case"quarter":t=a(this.year(),this.month()-this.month()%3,1);break;case"month":t=a(this.year(),this.month(),1);break;case"week":t=a(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=a(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=a(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=fi(t+(this._isUTC?0:this.utcOffset()*di),pi);break;case"minute":t=this._d.valueOf(),t-=fi(t,di);break;case"second":t=this._d.valueOf(),t-=fi(t,ci)}return this._d.setTime(t),n.updateOffset(this,!0),this}function bi(e){var t,a;if(void 0===(e=ne(e))||"millisecond"===e||!this.isValid())return this;switch(a=this._isUTC?yi:mi,e){case"year":t=a(this.year()+1,0,1)-1;break;case"quarter":t=a(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=a(this.year(),this.month()+1,1)-1;break;case"week":t=a(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=a(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=a(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=pi-fi(t+(this._isUTC?0:this.utcOffset()*di),pi)-1;break;case"minute":t=this._d.valueOf(),t+=di-fi(t,di)-1;break;case"second":t=this._d.valueOf(),t+=ci-fi(t,ci)-1}return this._d.setTime(t),n.updateOffset(this,!0),this}function vi(){return this._d.valueOf()-6e4*(this._offset||0)}function _i(){return Math.floor(this.valueOf()/1e3)}function wi(){return new Date(this.valueOf())}function Ai(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function ki(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Si(){return this.isValid()?this.toISOString():null}function Ni(){return g(this)}function Ti(){return h({},y(this))}function Mi(){return y(this).overflow}function xi(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Ci(e,t){var a,i,r,s=this._eras||ba("en")._eras;for(a=0,i=s.length;a<i;++a)switch("string"==typeof s[a].since&&(r=n(s[a].since).startOf("day"),s[a].since=r.valueOf()),typeof s[a].until){case"undefined":s[a].until=1/0;break;case"string":r=n(s[a].until).startOf("day").valueOf(),s[a].until=r.valueOf()}return s}function Ii(e,t,a){var n,i,r,s,o,l=this.eras();for(e=e.toUpperCase(),n=0,i=l.length;n<i;++n)if(r=l[n].name.toUpperCase(),s=l[n].abbr.toUpperCase(),o=l[n].narrow.toUpperCase(),a)switch(t){case"N":case"NN":case"NNN":if(s===e)return l[n];break;case"NNNN":if(r===e)return l[n];break;case"NNNNN":if(o===e)return l[n]}else if([r,s,o].indexOf(e)>=0)return l[n]}function Vi(e,t){var a=e.since<=e.until?1:-1;return void 0===t?n(e.since).year():n(e.since).year()+(t-e.offset)*a}function Ei(){var e,t,a,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e){if(a=this.clone().startOf("day").valueOf(),n[e].since<=a&&a<=n[e].until)return n[e].name;if(n[e].until<=a&&a<=n[e].since)return n[e].name}return""}function Fi(){var e,t,a,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e){if(a=this.clone().startOf("day").valueOf(),n[e].since<=a&&a<=n[e].until)return n[e].narrow;if(n[e].until<=a&&a<=n[e].since)return n[e].narrow}return""}function Di(){var e,t,a,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e){if(a=this.clone().startOf("day").valueOf(),n[e].since<=a&&a<=n[e].until)return n[e].abbr;if(n[e].until<=a&&a<=n[e].since)return n[e].abbr}return""}function Ri(){var e,t,a,i,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(a=r[e].since<=r[e].until?1:-1,i=this.clone().startOf("day").valueOf(),r[e].since<=i&&i<=r[e].until||r[e].until<=i&&i<=r[e].since)return(this.year()-n(r[e].since).year())*a+r[e].offset;return this.year()}function Li(e){return o(this,"_erasNameRegex")||zi.call(this),e?this._erasNameRegex:this._erasRegex}function Pi(e){return o(this,"_erasAbbrRegex")||zi.call(this),e?this._erasAbbrRegex:this._erasRegex}function Bi(e){return o(this,"_erasNarrowRegex")||zi.call(this),e?this._erasNarrowRegex:this._erasRegex}function Oi(e,t){return t.erasAbbrRegex(e)}function $i(e,t){return t.erasNameRegex(e)}function Ui(e,t){return t.erasNarrowRegex(e)}function ji(e,t){return t._eraYearOrdinalRegex||ve}function zi(){var e,t,a,n,i,r=[],s=[],o=[],l=[],u=this.eras();for(e=0,t=u.length;e<t;++e)a=Ie(u[e].name),n=Ie(u[e].abbr),i=Ie(u[e].narrow),s.push(a),r.push(n),o.push(i),l.push(a),l.push(n),l.push(i);this._erasRegex=new RegExp("^("+l.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+s.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+o.join("|")+")","i")}function Wi(e,t){U(0,[e,e.length],0,t)}function Yi(e){return Ki.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Hi(e){return Ki.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Gi(){return St(this.year(),1,4)}function qi(){return St(this.isoWeekYear(),1,4)}function Zi(){var e=this.localeData()._week;return St(this.year(),e.dow,e.doy)}function Ji(){var e=this.localeData()._week;return St(this.weekYear(),e.dow,e.doy)}function Ki(e,t,a,n,i){var r;return null==e?kt(this,n,i).year:(t>(r=St(e,n,i))&&(t=r),Xi.call(this,e,t,a,n,i))}function Xi(e,t,a,n,i){var r=At(e,t,a,n,i),s=_t(r.year,0,r.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}function Qi(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}U("N",0,0,"eraAbbr"),U("NN",0,0,"eraAbbr"),U("NNN",0,0,"eraAbbr"),U("NNNN",0,0,"eraName"),U("NNNNN",0,0,"eraNarrow"),U("y",["y",1],"yo","eraYear"),U("y",["yy",2],0,"eraYear"),U("y",["yyy",3],0,"eraYear"),U("y",["yyyy",4],0,"eraYear"),Me("N",Oi),Me("NN",Oi),Me("NNN",Oi),Me("NNNN",$i),Me("NNNNN",Ui),De(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,a,n){var i=a._locale.erasParse(e,n,a._strict);i?y(a).era=i:y(a).invalidEra=e})),Me("y",ve),Me("yy",ve),Me("yyy",ve),Me("yyyy",ve),Me("yo",ji),De(["y","yy","yyy","yyyy"],Be),De(["yo"],(function(e,t,a,n){var i;a._locale._eraYearOrdinalRegex&&(i=e.match(a._locale._eraYearOrdinalRegex)),a._locale.eraYearOrdinalParse?t[Be]=a._locale.eraYearOrdinalParse(e,i):t[Be]=parseInt(e,10)})),U(0,["gg",2],0,(function(){return this.weekYear()%100})),U(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),Wi("gggg","weekYear"),Wi("ggggg","weekYear"),Wi("GGGG","isoWeekYear"),Wi("GGGGG","isoWeekYear"),Me("G",_e),Me("g",_e),Me("GG",he,ue),Me("gg",he,ue),Me("GGGG",ge,de),Me("gggg",ge,de),Me("GGGGG",be,pe),Me("ggggg",be,pe),Re(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,a,n){t[n.substr(0,2)]=Ee(e)})),Re(["gg","GG"],(function(e,t,a,i){t[i]=n.parseTwoDigitYear(e)})),U("Q",0,"Qo","quarter"),Me("Q",le),De("Q",(function(e,t){t[Oe]=3*(Ee(e)-1)})),U("D",["DD",2],"Do","date"),Me("D",he,Ne),Me("DD",he,ue),Me("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),De(["D","DD"],$e),De("Do",(function(e,t){t[$e]=Ee(e.match(he)[0])}));var er=Ke("Date",!0);function tr(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}U("DDD",["DDDD",3],"DDDo","dayOfYear"),Me("DDD",ye),Me("DDDD",ce),De(["DDD","DDDD"],(function(e,t,a){a._dayOfYear=Ee(e)})),U("m",["mm",2],0,"minute"),Me("m",he,Te),Me("mm",he,ue),De(["m","mm"],je);var ar=Ke("Minutes",!1);U("s",["ss",2],0,"second"),Me("s",he,Te),Me("ss",he,ue),De(["s","ss"],ze);var nr,ir,rr=Ke("Seconds",!1);for(U("S",0,0,(function(){return~~(this.millisecond()/100)})),U(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),U(0,["SSS",3],0,"millisecond"),U(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),U(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),U(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),U(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),U(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),U(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),Me("S",ye,le),Me("SS",ye,ue),Me("SSS",ye,ce),nr="SSSS";nr.length<=9;nr+="S")Me(nr,ve);function sr(e,t){t[We]=Ee(1e3*("0."+e))}for(nr="S";nr.length<=9;nr+="S")De(nr,sr);function or(){return this._isUTC?"UTC":""}function lr(){return this._isUTC?"Coordinated Universal Time":""}ir=Ke("Milliseconds",!1),U("z",0,0,"zoneAbbr"),U("zz",0,0,"zoneName");var ur=A.prototype;function cr(e){return Za(1e3*e)}function dr(){return Za.apply(null,arguments).parseZone()}function pr(e){return e}ur.add=Rn,ur.calendar=zn,ur.clone=Wn,ur.diff=Kn,ur.endOf=bi,ur.format=ai,ur.from=ni,ur.fromNow=ii,ur.to=ri,ur.toNow=si,ur.get=et,ur.invalidAt=Mi,ur.isAfter=Yn,ur.isBefore=Hn,ur.isBetween=Gn,ur.isSame=qn,ur.isSameOrAfter=Zn,ur.isSameOrBefore=Jn,ur.isValid=Ni,ur.lang=li,ur.locale=oi,ur.localeData=ui,ur.max=Ka,ur.min=Ja,ur.parsingFlags=Ti,ur.set=tt,ur.startOf=gi,ur.subtract=Ln,ur.toArray=Ai,ur.toObject=ki,ur.toDate=wi,ur.toISOString=ei,ur.inspect=ti,"undefined"!=typeof Symbol&&null!=Symbol.for&&(ur[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),ur.toJSON=Si,ur.toString=Qn,ur.unix=_i,ur.valueOf=vi,ur.creationData=xi,ur.eraName=Ei,ur.eraNarrow=Fi,ur.eraAbbr=Di,ur.eraYear=Ri,ur.year=Ze,ur.isLeapYear=Je,ur.weekYear=Yi,ur.isoWeekYear=Hi,ur.quarter=ur.quarters=Qi,ur.month=ft,ur.daysInMonth=mt,ur.week=ur.weeks=Ct,ur.isoWeek=ur.isoWeeks=It,ur.weeksInYear=Zi,ur.weeksInWeekYear=Ji,ur.isoWeeksInYear=Gi,ur.isoWeeksInISOWeekYear=qi,ur.date=er,ur.day=ur.days=Yt,ur.weekday=Ht,ur.isoWeekday=Gt,ur.dayOfYear=tr,ur.hour=ur.hours=ia,ur.minute=ur.minutes=ar,ur.second=ur.seconds=rr,ur.millisecond=ur.milliseconds=ir,ur.utcOffset=yn,ur.utc=bn,ur.local=vn,ur.parseZone=_n,ur.hasAlignedHourOffset=wn,ur.isDST=An,ur.isLocal=Sn,ur.isUtcOffset=Nn,ur.isUtc=Tn,ur.isUTC=Tn,ur.zoneAbbr=or,ur.zoneName=lr,ur.dates=N("dates accessor is deprecated. Use date instead.",er),ur.months=N("months accessor is deprecated. Use month instead",ft),ur.years=N("years accessor is deprecated. Use year instead",Ze),ur.zone=N("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",gn),ur.isDSTShifted=N("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",kn);var hr=F.prototype;function fr(e,t,a,n){var i=ba(),r=f().set(n,t);return i[a](r,e)}function mr(e,t,a){if(c(e)&&(t=e,e=void 0),e=e||"",null!=t)return fr(e,t,a,"month");var n,i=[];for(n=0;n<12;n++)i[n]=fr(e,n,a,"month");return i}function yr(e,t,a,n){"boolean"==typeof e?(c(t)&&(a=t,t=void 0),t=t||""):(a=t=e,e=!1,c(t)&&(a=t,t=void 0),t=t||"");var i,r=ba(),s=e?r._week.dow:0,o=[];if(null!=a)return fr(t,(a+s)%7,n,"day");for(i=0;i<7;i++)o[i]=fr(t,(i+s)%7,n,"day");return o}function gr(e,t){return mr(e,t,"months")}function br(e,t){return mr(e,t,"monthsShort")}function vr(e,t,a){return yr(e,t,a,"weekdays")}function _r(e,t,a){return yr(e,t,a,"weekdaysShort")}function wr(e,t,a){return yr(e,t,a,"weekdaysMin")}hr.calendar=R,hr.longDateFormat=G,hr.invalidDate=Z,hr.ordinal=X,hr.preparse=pr,hr.postformat=pr,hr.relativeTime=ee,hr.pastFuture=te,hr.set=I,hr.eras=Ci,hr.erasParse=Ii,hr.erasConvertYear=Vi,hr.erasAbbrRegex=Pi,hr.erasNameRegex=Li,hr.erasNarrowRegex=Bi,hr.months=ut,hr.monthsShort=ct,hr.monthsParse=pt,hr.monthsRegex=gt,hr.monthsShortRegex=yt,hr.week=Nt,hr.firstDayOfYear=xt,hr.firstDayOfWeek=Mt,hr.weekdays=$t,hr.weekdaysMin=jt,hr.weekdaysShort=Ut,hr.weekdaysParse=Wt,hr.weekdaysRegex=qt,hr.weekdaysShortRegex=Zt,hr.weekdaysMinRegex=Jt,hr.isPM=aa,hr.meridiem=ra,ma("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===Ee(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),n.lang=N("moment.lang is deprecated. Use moment.locale instead.",ma),n.langData=N("moment.langData is deprecated. Use moment.localeData instead.",ba);var Ar=Math.abs;function kr(){var e=this._data;return this._milliseconds=Ar(this._milliseconds),this._days=Ar(this._days),this._months=Ar(this._months),e.milliseconds=Ar(e.milliseconds),e.seconds=Ar(e.seconds),e.minutes=Ar(e.minutes),e.hours=Ar(e.hours),e.months=Ar(e.months),e.years=Ar(e.years),this}function Sr(e,t,a,n){var i=Cn(t,a);return e._milliseconds+=n*i._milliseconds,e._days+=n*i._days,e._months+=n*i._months,e._bubble()}function Nr(e,t){return Sr(this,e,t,1)}function Tr(e,t){return Sr(this,e,t,-1)}function Mr(e){return e<0?Math.floor(e):Math.ceil(e)}function xr(){var e,t,a,n,i,r=this._milliseconds,s=this._days,o=this._months,l=this._data;return r>=0&&s>=0&&o>=0||r<=0&&s<=0&&o<=0||(r+=864e5*Mr(Ir(o)+s),s=0,o=0),l.milliseconds=r%1e3,e=Ve(r/1e3),l.seconds=e%60,t=Ve(e/60),l.minutes=t%60,a=Ve(t/60),l.hours=a%24,s+=Ve(a/24),o+=i=Ve(Cr(s)),s-=Mr(Ir(i)),n=Ve(o/12),o%=12,l.days=s,l.months=o,l.years=n,this}function Cr(e){return 4800*e/146097}function Ir(e){return 146097*e/4800}function Vr(e){if(!this.isValid())return NaN;var t,a,n=this._milliseconds;if("month"===(e=ne(e))||"quarter"===e||"year"===e)switch(t=this._days+n/864e5,a=this._months+Cr(t),e){case"month":return a;case"quarter":return a/3;case"year":return a/12}else switch(t=this._days+Math.round(Ir(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return 24*t+n/36e5;case"minute":return 1440*t+n/6e4;case"second":return 86400*t+n/1e3;case"millisecond":return Math.floor(864e5*t)+n;default:throw new Error("Unknown unit "+e)}}function Er(e){return function(){return this.as(e)}}var Fr=Er("ms"),Dr=Er("s"),Rr=Er("m"),Lr=Er("h"),Pr=Er("d"),Br=Er("w"),Or=Er("M"),$r=Er("Q"),Ur=Er("y"),jr=Fr;function zr(){return Cn(this)}function Wr(e){return e=ne(e),this.isValid()?this[e+"s"]():NaN}function Yr(e){return function(){return this.isValid()?this._data[e]:NaN}}var Hr=Yr("milliseconds"),Gr=Yr("seconds"),qr=Yr("minutes"),Zr=Yr("hours"),Jr=Yr("days"),Kr=Yr("months"),Xr=Yr("years");function Qr(){return Ve(this.days()/7)}var es=Math.round,ts={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function as(e,t,a,n,i){return i.relativeTime(t||1,!!a,e,n)}function ns(e,t,a,n){var i=Cn(e).abs(),r=es(i.as("s")),s=es(i.as("m")),o=es(i.as("h")),l=es(i.as("d")),u=es(i.as("M")),c=es(i.as("w")),d=es(i.as("y")),p=r<=a.ss&&["s",r]||r<a.s&&["ss",r]||s<=1&&["m"]||s<a.m&&["mm",s]||o<=1&&["h"]||o<a.h&&["hh",o]||l<=1&&["d"]||l<a.d&&["dd",l];return null!=a.w&&(p=p||c<=1&&["w"]||c<a.w&&["ww",c]),(p=p||u<=1&&["M"]||u<a.M&&["MM",u]||d<=1&&["y"]||["yy",d])[2]=t,p[3]=+e>0,p[4]=n,as.apply(null,p)}function is(e){return void 0===e?es:"function"==typeof e&&(es=e,!0)}function rs(e,t){return void 0!==ts[e]&&(void 0===t?ts[e]:(ts[e]=t,"s"===e&&(ts.ss=t-1),!0))}function ss(e,t){if(!this.isValid())return this.localeData().invalidDate();var a,n,i=!1,r=ts;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(i=e),"object"==typeof t&&(r=Object.assign({},ts,t),null!=t.s&&null==t.ss&&(r.ss=t.s-1)),n=ns(this,!i,r,a=this.localeData()),i&&(n=a.pastFuture(+this,n)),a.postformat(n)}var os=Math.abs;function ls(e){return(e>0)-(e<0)||+e}function us(){if(!this.isValid())return this.localeData().invalidDate();var e,t,a,n,i,r,s,o,l=os(this._milliseconds)/1e3,u=os(this._days),c=os(this._months),d=this.asSeconds();return d?(e=Ve(l/60),t=Ve(e/60),l%=60,e%=60,a=Ve(c/12),c%=12,n=l?l.toFixed(3).replace(/\.?0+$/,""):"",i=d<0?"-":"",r=ls(this._months)!==ls(d)?"-":"",s=ls(this._days)!==ls(d)?"-":"",o=ls(this._milliseconds)!==ls(d)?"-":"",i+"P"+(a?r+a+"Y":"")+(c?r+c+"M":"")+(u?s+u+"D":"")+(t||e||l?"T":"")+(t?o+t+"H":"")+(e?o+e+"M":"")+(l?o+n+"S":"")):"P0D"}var cs=on.prototype;return cs.isValid=rn,cs.abs=kr,cs.add=Nr,cs.subtract=Tr,cs.as=Vr,cs.asMilliseconds=Fr,cs.asSeconds=Dr,cs.asMinutes=Rr,cs.asHours=Lr,cs.asDays=Pr,cs.asWeeks=Br,cs.asMonths=Or,cs.asQuarters=$r,cs.asYears=Ur,cs.valueOf=jr,cs._bubble=xr,cs.clone=zr,cs.get=Wr,cs.milliseconds=Hr,cs.seconds=Gr,cs.minutes=qr,cs.hours=Zr,cs.days=Jr,cs.weeks=Qr,cs.months=Kr,cs.years=Xr,cs.humanize=ss,cs.toISOString=us,cs.toString=us,cs.toJSON=us,cs.locale=oi,cs.localeData=ui,cs.toIsoString=N("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",us),cs.lang=li,U("X",0,0,"unix"),U("x",0,0,"valueOf"),Me("x",_e),Me("X",ke),De("X",(function(e,t,a){a._d=new Date(1e3*parseFloat(e))})),De("x",(function(e,t,a){a._d=new Date(Ee(e))})),
2
2
  //! moment.js
3
3
  n.version="2.30.1",i(Za),n.fn=ur,n.min=Qa,n.max=en,n.now=tn,n.utc=f,n.unix=cr,n.months=gr,n.isDate=d,n.locale=ma,n.invalid=b,n.duration=Cn,n.isMoment=k,n.weekdays=vr,n.parseZone=dr,n.localeData=ba,n.isDuration=ln,n.monthsShort=br,n.weekdaysMin=wr,n.defineLocale=ya,n.updateLocale=ga,n.locales=va,n.weekdaysShort=_r,n.normalizeUnits=ne,n.relativeTimeRounding=is,n.relativeTimeThreshold=rs,n.calendarFormat=jn,n.prototype=ur,n.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},n}()}(D)),D.exports),L=V(R);class P{apiClient;debug;apiCalls=[];apiCallsStartTime=null;constructor(e){if(!e)throw"A lumino client needs to be passed.";this.apiClient=e,this.debug=false,this.debug&&(this.apiCalls=[],this.apiCallsStartTime=null)}start(){this.debug&&(this.apiCallsStartTime=L(),this.apiCalls=[])}end(){if(this.debug){console.log("Calls: "+this.apiCalls.length);for(const e of this.apiCalls){const t=e.callTime.toString().padStart(6," "),a=e.totalTime.toString().padStart(6," ");console.log(t+a+" -> "+e.caller+"::"+e.method+" ("+JSON.stringify(e.params)+")")}}}async call(e,t,...a){try{if(this.debug){const n=L(),i=await this.apiClient[t](...a),r=L(),s=r.diff(n,"milliseconds"),o=r.diff(this.apiCallsStartTime,"milliseconds");return this.apiCalls.push({caller:e,method:t,params:a,callTime:s,totalTime:o}),i}return this.apiClient[t](...a)}catch(e){throw u.$emit("client:fatalError","API call failed: "+t),e}}}let B=class{itemCache;apiGateway;constructor(e){this.itemCache=new Map,this.apiGateway=e}clear(){this.itemCache.clear()}async getItem(e){if(this.itemCache.has(e))return this.itemCache.get(e);const t=await this.apiGateway.call("ItemCache::getItem","getItem",e);return this.itemCache.set(e,t),t}};class O{id;type;data;constructor(e,t,a){this.id=e,this.type=t,this.data=a}}class ${ownerItem;constructor(e=void 0){this.ownerItem=e}createSnapshot(){throw"createSnapshot not implemented!"}restoreFromSnapshot(e,t){throw"restoreFromSnapshot not implemented!"}rollbackFromSnapshot(e){throw"rollbackFromSnapshot not implemented!"}_getElementById(e,t){for(const a of t)if(a.id===e)return a;return null}_rollbackArray(e,t,a){if(!Array.isArray(e))return void console.log("_rollbackArray(): no array given!");const n=[],i=[];let r=0;for(const a of t){const t=this._getElementById(a.id,e);t?i.push({element:t,snapshot:a}):n.push({position:r,snapshot:a}),r++}const s=[];r=0;for(const a of e){this._getElementById(a.id,t)||s.push(r-s.length),r++}for(const t of s)e.splice(t,1);for(const e of i)e.element.rollbackFromSnapshot(e.snapshot);for(const t of n){const n=a(t.snapshot,this);e.splice(t.position,0,n)}}}class U extends ${id;srcNode;srcSlot;destNode;destSlot;posX;posY;constructor(e,t){super(t),h.assert(e,"NkConnection: data is null or undefined!"),h.assert(e.srcNode,"NkConnection: srcNode is null or undefined!"),h.assert(e.srcSlot,"NkConnection: srcSlot is null or undefined!"),h.assert(e.destNode,"NkConnection: srcNode is null or undefined!"),h.assert(e.destSlot,"NkConnection: srcSlot is null or undefined!"),this.id=e.id||h.createItemOrBlockID(),this.srcNode=e.srcNode,this.srcSlot=e.srcSlot,this.destNode=e.destNode,this.destSlot=e.destSlot,this.posX=e.posX||0,this.posY=e.posY||0}getId(){return this.id}setPosition(e,t){this.posX=e,this.posY=t}getPosX(){return this.posX}getPosY(){return this.posY}getSrcNode(){return this.srcNode}getDestNode(){return this.destNode}getSrcSlot(){return this.srcSlot}getDestSlot(){return this.destSlot}setSrcNode(e){this.srcNode=e}setDestNode(e){this.destNode=e}setSrcSlot(e){this.srcSlot=e}setDestSlot(e){this.destSlot=e}clone(){return new U({srcNode:this.srcNode,srcSlot:this.srcSlot,destNode:this.destNode,destSlot:this.destSlot,posX:this.posX,posY:this.posY},this.ownerItem)}createSnapshot(){return new O(this.id,"connection",{id:this.id,srcNode:this.srcNode,srcSlot:this.srcSlot,destNode:this.destNode,destSlot:this.destSlot,posX:this.posX,posY:this.posY})}restoreFromSnapshot(e){this.id=e.id,this.srcNode=e.data.srcNode,this.srcSlot=e.data.srcSlot,this.destNode=e.data.destNode,this.destSlot=e.data.destSlot,this.posX=e.data.posX,this.posY=e.data.posY}rollbackFromSnapshot(e){this.srcNode=e.data.srcNode,this.srcSlot=e.data.srcSlot,this.destNode=e.data.destNode,this.destSlot=e.data.destSlot,this.posX=e.data.posX,this.posY=e.data.posY}}class j extends ${id;name=void 0;displayName=void 0;value;script;type=void 0;datatype=void 0;minValue=void 0;maxValue=void 0;order=0;inject=void 0;info=void 0;constructor(e=void 0,t=void 0,a=void 0,n=void 0){super(n),this.value=a,this.script=e,this.id=h.createGUID(),this.name=t,this.displayName=t,this._updateDisplayName()}getId(){return this.id}setName(e){this.name=e,this._updateDisplayName()}setOrder(e){this.order=e}setInfo(e){this.info=e}clone(e=new Map){const t=new j;return t.ownerItem=this.ownerItem,t.value=e.get(this.value)??this.value,t.script=this.script,t.type=this.type,t.minValue=this.minValue,t.maxValue=this.maxValue,t.order=this.order,t.info=this.info,t.setName(this.name),t}clearDefinition(){this.type=void 0}setDefinition(e){this.inject=e.inject;const t=e.type.toLowerCase();switch(t){case"boolean":case"bool":this.type="Attribute",this.datatype="Boolean",this.value=void 0!==this.value?this._toBoolean(this.value):this._toBoolean(e.defaultValue);break;case"number":{this.type="Attribute",this.datatype="Float",this.value=void 0!==this.value?Number(this.value):Number(e.defaultValue);const t=this._parseTypeParams(e.typeparams,2);t?(this.minValue=Number(t[0]),this.maxValue=Number(t[1])):(this.minValue=void 0,this.maxValue=void 0);break}case"string":this.type="Attribute",this.datatype="String",this.value=void 0!==this.value&&null!==this.value?this.value.toString():e.defaultValue?e.defaultValue.toString():"";break;case"node":this.type="Attribute",this.datatype="Node";break;default:console.error("Unknown script field type: "+t),this.type="Attribute",this.datatype="String",this.value=this.value?this.value.toString():e.defaultValue?e.defaultValue.toString():""}}_toBoolean(e){return null!=e&&(!0===e||!1===e?e:"false"!==e.toString().toLowerCase())}_updateDisplayName(){this.name?this.displayName=h.toUserFriendlyName(this.name):this.displayName=""}_parseTypeParams(e,t){if(!e)return null;const a=e.split(",").map((e=>e.trim()));return a.length!==t?null:a}createSnapshot(){return new O(this.name,"scriptfield",{id:this.id,type:this.type,name:this.name,value:this.value,datatype:this.datatype,minValue:this.minValue,maxValue:this.maxValue,order:this.order,info:this.info})}}function z(e,t,a){const{datatype:n,minValue:i,maxValue:r,name:s,value:o,type:l,order:u,id:c,info:d}=e.data,p=new j(t,s,o,a);return p.id=c,p.type=l,p.datatype=n,p.minValue=i,p.maxValue=r,p.order=u,p.info=d,p}class W extends ${id=void 0;block=void 0;fields=[];item=null;deferInitCall=!1;constructor(e=void 0,t=void 0,a=void 0,n=void 0){super(a),e instanceof O?this.restoreFromSnapshot(e,t):(this.id=e||h.createItemOrBlockID(),this.block=t),this.item||(this.item={value:n,linkableItems:[],linkableTypes:["Script"]}),this.item=g.instance.proxyScriptItem(this.item,this,this.ownerItem),this.fields=g.instance.proxyScriptFieldsArray(this.fields,this,this.ownerItem)}getId(){return this.id}makeIdsUnique(e,t=!1){if(this.id)if(e.has(this.id)||t){const t=h.createItemOrBlockID();e.set(this.id,t),this.id=t}else e.set(this.id,this.id)}transformNodeIds(e){for(const t of this.fields)t.value&&e.has(t.value)&&(t.value=e.get(t.value))}clone(e=new Map){const t=new W(void 0,this.block,this.ownerItem,this.item.value);for(const a of this.fields){const n=a.clone(e);n.script=t,t.addField(n)}return t}createFieldsFromDefinition(e=[]){function t(e,t){for(const a of e)if(a.name===t)return a;return null}for(const a of this.fields)t(e,a.name)||a.clearDefinition();let a=0;for(const n of e){let e=t(this.fields,n.name);e||(e=new j(this,n.name,void 0,this.ownerItem),this.addField(e)),e.setOrder(a++),e.setInfo(n.info),e.setDefinition(n)}this.fields.sort((function(e,t){return e.order-t.order}))}clearFieldTypes(){this.createFieldsFromDefinition()}addField(e){this.fields.push(g.instance.proxyScriptField(e,this,this.ownerItem))}createSnapshot(){const e=[];for(const t of this.fields)e.push(t.createSnapshot());return new O(this.id,"script",{id:this.id,value:this.item.value,fields:e})}restoreFromSnapshot(e,t){this.id=e.data.id,this.block=t,this.item={value:e.data.value,linkableItems:[],linkableTypes:["Script"]};const a=[];this._rollbackArray(a,e.data.fields,(e=>{const t=z(e,this,this.ownerItem);return g.instance.proxyScriptField(t,this,this.ownerItem)})),this.fields=a}rollbackFromSnapshot(e){e.data.value&&(this.item.value=e.data.value),this._rollbackArray(this.fields,e.data.fields,(e=>{const t=z(e,this,this.ownerItem);return g.instance.proxyScriptField(t,this,this.ownerItem)}))}}var Y,H={exports:{}},G=H.exports;
4
4
  /**
@@ -15,5 +15,5 @@ n.version="2.30.1",i(Za),n.fn=ur,n.min=Qa,n.max=en,n.now=tn,n.utc=f,n.unix=cr,n.
15
15
  Version 1.10.0
16
16
  https://localforage.github.io/localForage
17
17
  (c) 2013-2017 Mozilla, Apache License 2.0
18
- */var Yi=(zi||(zi=1,function(e){e.exports=function e(t,a,n){function i(s,o){if(!a[s]){if(!t[s]){if(!o&&E)return E(s);if(r)return r(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=a[s]={exports:{}};t[s][0].call(u.exports,(function(e){var a=t[s][1][e];return i(a||e)}),u,u.exports,e,t,a,n)}return a[s].exports}for(var r=E,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(e,t,a){(function(e){var a,n,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var r=0,s=new i(c),o=e.document.createTextNode("");s.observe(o,{characterData:!0}),a=function(){o.data=r=++r%2}}else if(e.setImmediate||void 0===e.MessageChannel)a="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){c(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(c,0)};else{var l=new e.MessageChannel;l.port1.onmessage=c,a=function(){l.port2.postMessage(0)}}var u=[];function c(){var e,t;n=!0;for(var a=u.length;a;){for(t=u,u=[],e=-1;++e<a;)t[e]();a=u.length}n=!1}function d(e){1!==u.push(e)||n||a()}t.exports=d}).call(this,void 0!==I?I:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,a){var n=e(1);function i(){}var r={},s=["REJECTED"],o=["FULFILLED"],l=["PENDING"];function u(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,e!==i&&h(this,e)}function c(e,t,a){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof a&&(this.onRejected=a,this.callRejected=this.otherCallRejected)}function d(e,t,a){n((function(){var n;try{n=t(a)}catch(t){return r.reject(e,t)}n===e?r.reject(e,new TypeError("Cannot resolve promise with itself")):r.resolve(e,n)}))}function p(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function h(e,t){var a=!1;function n(t){a||(a=!0,r.reject(e,t))}function i(t){a||(a=!0,r.resolve(e,t))}function s(){t(i,n)}var o=f(s);"error"===o.status&&n(o.value)}function f(e,t){var a={};try{a.value=e(t),a.status="success"}catch(e){a.status="error",a.value=e}return a}function m(e){return e instanceof this?e:r.resolve(new this(i),e)}function y(e){var t=new this(i);return r.reject(t,e)}function g(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var a=e.length,n=!1;if(!a)return this.resolve([]);for(var s=new Array(a),o=0,l=-1,u=new this(i);++l<a;)c(e[l],l);return u;function c(e,i){function l(e){s[i]=e,++o!==a||n||(n=!0,r.resolve(u,s))}t.resolve(e).then(l,(function(e){n||(n=!0,r.reject(u,e))}))}}function b(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var a=e.length,n=!1;if(!a)return this.resolve([]);for(var s=-1,o=new this(i);++s<a;)l(e[s]);return o;function l(e){t.resolve(e).then((function(e){n||(n=!0,r.resolve(o,e))}),(function(e){n||(n=!0,r.reject(o,e))}))}}t.exports=u,u.prototype.catch=function(e){return this.then(null,e)},u.prototype.then=function(e,t){if("function"!=typeof e&&this.state===o||"function"!=typeof t&&this.state===s)return this;var a=new this.constructor(i);return this.state!==l?d(a,this.state===o?e:t,this.outcome):this.queue.push(new c(a,e,t)),a},c.prototype.callFulfilled=function(e){r.resolve(this.promise,e)},c.prototype.otherCallFulfilled=function(e){d(this.promise,this.onFulfilled,e)},c.prototype.callRejected=function(e){r.reject(this.promise,e)},c.prototype.otherCallRejected=function(e){d(this.promise,this.onRejected,e)},r.resolve=function(e,t){var a=f(p,t);if("error"===a.status)return r.reject(e,a.value);var n=a.value;if(n)h(e,n);else{e.state=o,e.outcome=t;for(var i=-1,s=e.queue.length;++i<s;)e.queue[i].callFulfilled(t)}return e},r.reject=function(e,t){e.state=s,e.outcome=t;for(var a=-1,n=e.queue.length;++a<n;)e.queue[a].callRejected(t);return e},u.resolve=m,u.reject=y,u.all=g,u.race=b},{1:1}],3:[function(e,t,a){(function(t){"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,void 0!==I?I:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(e,t,a){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){return}}var s=r();function o(){try{if(!s||!s.open)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}}function l(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(i){if("TypeError"!==i.name)throw i;for(var a=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),n=0;n<e.length;n+=1)a.append(e[n]);return a.getBlob(t.type)}}"undefined"==typeof Promise&&e(3);var u=Promise;function c(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function d(e,t,a){"function"==typeof t&&e.then(t),"function"==typeof a&&e.catch(a)}function p(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function h(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var f="local-forage-detect-blob-support",m=void 0,y={},g=Object.prototype.toString,b="readonly",v="readwrite";function _(e){for(var t=e.length,a=new ArrayBuffer(t),n=new Uint8Array(a),i=0;i<t;i++)n[i]=e.charCodeAt(i);return a}function w(e){return new u((function(t){var a=e.transaction(f,v),n=l([""]);a.objectStore(f).put(n,"key"),a.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},a.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),a=navigator.userAgent.match(/Edge\//);t(a||!e||parseInt(e[1],10)>=43)}})).catch((function(){return!1}))}function A(e){return"boolean"==typeof m?u.resolve(m):w(e).then((function(e){return m=e}))}function k(e){var t=y[e.name],a={};a.promise=new u((function(e,t){a.resolve=e,a.reject=t})),t.deferredOperations.push(a),t.dbReady?t.dbReady=t.dbReady.then((function(){return a.promise})):t.dbReady=a.promise}function S(e){var t=y[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function N(e,t){var a=y[e.name].deferredOperations.pop();if(a)return a.reject(t),a.promise}function T(e,t){return new u((function(a,n){if(y[e.name]=y[e.name]||L(),e.db){if(!t)return a(e.db);k(e),e.db.close()}var i=[e.name];t&&i.push(e.version);var r=s.open.apply(s,i);t&&(r.onupgradeneeded=function(t){var a=r.result;try{a.createObjectStore(e.storeName),t.oldVersion<=1&&a.createObjectStore(f)}catch(a){if("ConstraintError"!==a.name)throw a;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),r.onerror=function(e){e.preventDefault(),n(r.error)},r.onsuccess=function(){var t=r.result;t.onversionchange=function(e){e.target.close()},a(t),S(e)}}))}function M(e){return T(e,!1)}function x(e){return T(e,!0)}function C(e,t){if(!e.db)return!0;var a=!e.db.objectStoreNames.contains(e.storeName),n=e.version<e.db.version,i=e.version>e.db.version;if(n&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),i||a){if(a){var r=e.db.version+1;r>e.version&&(e.version=r)}return!0}return!1}function I(e){return new u((function(t,a){var n=new FileReader;n.onerror=a,n.onloadend=function(a){var n=btoa(a.target.result||"");t({__local_forage_encoded_blob:!0,data:n,type:e.type})},n.readAsBinaryString(e)}))}function V(e){return l([_(atob(e.data))],{type:e.type})}function E(e){return e&&e.__local_forage_encoded_blob}function F(e){var t=this,a=t._initReady().then((function(){var e=y[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return d(a,e,e),a}function D(e){k(e);for(var t=y[e.name],a=t.forages,n=0;n<a.length;n++){var i=a[n];i._dbInfo.db&&(i._dbInfo.db.close(),i._dbInfo.db=null)}return e.db=null,M(e).then((function(t){return e.db=t,C(e)?x(e):t})).then((function(n){e.db=t.db=n;for(var i=0;i<a.length;i++)a[i]._dbInfo.db=n})).catch((function(t){throw N(e,t),t}))}function R(e,t,a,n){void 0===n&&(n=1);try{var i=e.db.transaction(e.storeName,t);a(null,i)}catch(i){if(n>0&&(!e.db||"InvalidStateError"===i.name||"NotFoundError"===i.name))return u.resolve().then((function(){if(!e.db||"NotFoundError"===i.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),x(e)})).then((function(){return D(e).then((function(){R(e,t,a,n-1)}))})).catch(a);a(i)}}function L(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function P(e){var t=this,a={db:null};if(e)for(var n in e)a[n]=e[n];var i=y[a.name];i||(i=L(),y[a.name]=i),i.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=F);var r=[];function s(){return u.resolve()}for(var o=0;o<i.forages.length;o++){var l=i.forages[o];l!==t&&r.push(l._initReady().catch(s))}var c=i.forages.slice(0);return u.all(r).then((function(){return a.db=i.db,M(a)})).then((function(e){return a.db=e,C(a,t._defaultConfig.version)?x(a):e})).then((function(e){a.db=i.db=e,t._dbInfo=a;for(var n=0;n<c.length;n++){var r=c[n];r!==t&&(r._dbInfo.db=a.db,r._dbInfo.version=a.version)}}))}function B(e,t){var a=this;e=p(e);var n=new u((function(t,n){a.ready().then((function(){R(a._dbInfo,b,(function(i,r){if(i)return n(i);try{var s=r.objectStore(a._dbInfo.storeName).get(e);s.onsuccess=function(){var e=s.result;void 0===e&&(e=null),E(e)&&(e=V(e)),t(e)},s.onerror=function(){n(s.error)}}catch(e){n(e)}}))})).catch(n)}));return c(n,t),n}function O(e,t){var a=this,n=new u((function(t,n){a.ready().then((function(){R(a._dbInfo,b,(function(i,r){if(i)return n(i);try{var s=r.objectStore(a._dbInfo.storeName).openCursor(),o=1;s.onsuccess=function(){var a=s.result;if(a){var n=a.value;E(n)&&(n=V(n));var i=e(n,a.key,o++);void 0!==i?t(i):a.continue()}else t()},s.onerror=function(){n(s.error)}}catch(e){n(e)}}))})).catch(n)}));return c(n,t),n}function $(e,t,a){var n=this;e=p(e);var i=new u((function(a,i){var r;n.ready().then((function(){return r=n._dbInfo,"[object Blob]"===g.call(t)?A(r.db).then((function(e){return e?t:I(t)})):t})).then((function(t){R(n._dbInfo,v,(function(r,s){if(r)return i(r);try{var o=s.objectStore(n._dbInfo.storeName);null===t&&(t=void 0);var l=o.put(t,e);s.oncomplete=function(){void 0===t&&(t=null),a(t)},s.onabort=s.onerror=function(){var e=l.error?l.error:l.transaction.error;i(e)}}catch(e){i(e)}}))})).catch(i)}));return c(i,a),i}function U(e,t){var a=this;e=p(e);var n=new u((function(t,n){a.ready().then((function(){R(a._dbInfo,v,(function(i,r){if(i)return n(i);try{var s=r.objectStore(a._dbInfo.storeName).delete(e);r.oncomplete=function(){t()},r.onerror=function(){n(s.error)},r.onabort=function(){var e=s.error?s.error:s.transaction.error;n(e)}}catch(e){n(e)}}))})).catch(n)}));return c(n,t),n}function j(e){var t=this,a=new u((function(e,a){t.ready().then((function(){R(t._dbInfo,v,(function(n,i){if(n)return a(n);try{var r=i.objectStore(t._dbInfo.storeName).clear();i.oncomplete=function(){e()},i.onabort=i.onerror=function(){var e=r.error?r.error:r.transaction.error;a(e)}}catch(e){a(e)}}))})).catch(a)}));return c(a,e),a}function z(e){var t=this,a=new u((function(e,a){t.ready().then((function(){R(t._dbInfo,b,(function(n,i){if(n)return a(n);try{var r=i.objectStore(t._dbInfo.storeName).count();r.onsuccess=function(){e(r.result)},r.onerror=function(){a(r.error)}}catch(e){a(e)}}))})).catch(a)}));return c(a,e),a}function W(e,t){var a=this,n=new u((function(t,n){e<0?t(null):a.ready().then((function(){R(a._dbInfo,b,(function(i,r){if(i)return n(i);try{var s=r.objectStore(a._dbInfo.storeName),o=!1,l=s.openKeyCursor();l.onsuccess=function(){var a=l.result;a?0===e||o?t(a.key):(o=!0,a.advance(e)):t(null)},l.onerror=function(){n(l.error)}}catch(e){n(e)}}))})).catch(n)}));return c(n,t),n}function Y(e){var t=this,a=new u((function(e,a){t.ready().then((function(){R(t._dbInfo,b,(function(n,i){if(n)return a(n);try{var r=i.objectStore(t._dbInfo.storeName).openKeyCursor(),s=[];r.onsuccess=function(){var t=r.result;t?(s.push(t.key),t.continue()):e(s)},r.onerror=function(){a(r.error)}}catch(e){a(e)}}))})).catch(a)}));return c(a,e),a}function H(e,t){t=h.apply(this,arguments);var a=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||a.name,e.storeName=e.storeName||a.storeName);var n,i=this;if(e.name){var r=e.name===a.name&&i._dbInfo.db?u.resolve(i._dbInfo.db):M(e).then((function(t){var a=y[e.name],n=a.forages;a.db=t;for(var i=0;i<n.length;i++)n[i]._dbInfo.db=t;return t}));n=e.storeName?r.then((function(t){if(t.objectStoreNames.contains(e.storeName)){var a=t.version+1;k(e);var n=y[e.name],i=n.forages;t.close();for(var r=0;r<i.length;r++){var o=i[r];o._dbInfo.db=null,o._dbInfo.version=a}var l=new u((function(t,n){var i=s.open(e.name,a);i.onerror=function(e){i.result.close(),n(e)},i.onupgradeneeded=function(){i.result.deleteObjectStore(e.storeName)},i.onsuccess=function(){var e=i.result;e.close(),t(e)}}));return l.then((function(e){n.db=e;for(var t=0;t<i.length;t++){var a=i[t];a._dbInfo.db=e,S(a._dbInfo)}})).catch((function(t){throw(N(e,t)||u.resolve()).catch((function(){})),t}))}})):r.then((function(t){k(e);var a=y[e.name],n=a.forages;t.close();for(var i=0;i<n.length;i++)n[i]._dbInfo.db=null;var r=new u((function(t,a){var n=s.deleteDatabase(e.name);n.onerror=function(){var e=n.result;e&&e.close(),a(n.error)},n.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},n.onsuccess=function(){var e=n.result;e&&e.close(),t(e)}}));return r.then((function(e){a.db=e;for(var t=0;t<n.length;t++)S(n[t]._dbInfo)})).catch((function(t){throw(N(e,t)||u.resolve()).catch((function(){})),t}))}))}else n=u.reject("Invalid arguments");return c(n,t),n}var G={_driver:"asyncStorage",_initStorage:P,_support:o(),iterate:O,getItem:B,setItem:$,removeItem:U,clear:j,length:z,key:W,keys:Y,dropInstance:H};function q(){return"function"==typeof openDatabase}var Z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",J="~~local_forage_type~",K=/^~~local_forage_type~([^~]+)~/,X="__lfsc__:",Q=X.length,ee="arbf",te="blob",ae="si08",ne="ui08",ie="uic8",re="si16",se="si32",oe="ur16",le="ui32",ue="fl32",ce="fl64",de=Q+ee.length,pe=Object.prototype.toString;function he(e){var t,a,n,i,r,s=.75*e.length,o=e.length,l=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);var u=new ArrayBuffer(s),c=new Uint8Array(u);for(t=0;t<o;t+=4)a=Z.indexOf(e[t]),n=Z.indexOf(e[t+1]),i=Z.indexOf(e[t+2]),r=Z.indexOf(e[t+3]),c[l++]=a<<2|n>>4,c[l++]=(15&n)<<4|i>>2,c[l++]=(3&i)<<6|63&r;return u}function fe(e){var t,a=new Uint8Array(e),n="";for(t=0;t<a.length;t+=3)n+=Z[a[t]>>2],n+=Z[(3&a[t])<<4|a[t+1]>>4],n+=Z[(15&a[t+1])<<2|a[t+2]>>6],n+=Z[63&a[t+2]];return a.length%3==2?n=n.substring(0,n.length-1)+"=":a.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}function me(e,t){var a="";if(e&&(a=pe.call(e)),e&&("[object ArrayBuffer]"===a||e.buffer&&"[object ArrayBuffer]"===pe.call(e.buffer))){var n,i=X;e instanceof ArrayBuffer?(n=e,i+=ee):(n=e.buffer,"[object Int8Array]"===a?i+=ae:"[object Uint8Array]"===a?i+=ne:"[object Uint8ClampedArray]"===a?i+=ie:"[object Int16Array]"===a?i+=re:"[object Uint16Array]"===a?i+=oe:"[object Int32Array]"===a?i+=se:"[object Uint32Array]"===a?i+=le:"[object Float32Array]"===a?i+=ue:"[object Float64Array]"===a?i+=ce:t(new Error("Failed to get type for BinaryArray"))),t(i+fe(n))}else if("[object Blob]"===a){var r=new FileReader;r.onload=function(){var a=J+e.type+"~"+fe(this.result);t(X+te+a)},r.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(a){console.error("Couldn't convert value into a JSON string: ",e),t(null,a)}}function ye(e){if(e.substring(0,Q)!==X)return JSON.parse(e);var t,a=e.substring(de),n=e.substring(Q,de);if(n===te&&K.test(a)){var i=a.match(K);t=i[1],a=a.substring(i[0].length)}var r=he(a);switch(n){case ee:return r;case te:return l([r],{type:t});case ae:return new Int8Array(r);case ne:return new Uint8Array(r);case ie:return new Uint8ClampedArray(r);case re:return new Int16Array(r);case oe:return new Uint16Array(r);case se:return new Int32Array(r);case le:return new Uint32Array(r);case ue:return new Float32Array(r);case ce:return new Float64Array(r);default:throw new Error("Unkown type: "+n)}}var ge={serialize:me,deserialize:ye,stringToBuffer:he,bufferToString:fe};function be(e,t,a,n){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],a,n)}function ve(e){var t=this,a={db:null};if(e)for(var n in e)a[n]="string"!=typeof e[n]?e[n].toString():e[n];var i=new u((function(e,n){try{a.db=openDatabase(a.name,String(a.version),a.description,a.size)}catch(e){return n(e)}a.db.transaction((function(i){be(i,a,(function(){t._dbInfo=a,e()}),(function(e,t){n(t)}))}),n)}));return a.serializer=ge,i}function _e(e,t,a,n,i,r){e.executeSql(a,n,i,(function(e,s){s.code===s.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,o){o.rows.length?r(e,s):be(e,t,(function(){e.executeSql(a,n,i,r)}),r)}),r):r(e,s)}),r)}function we(e,t){var a=this;e=p(e);var n=new u((function(t,n){a.ready().then((function(){var i=a._dbInfo;i.db.transaction((function(a){_e(a,i,"SELECT * FROM "+i.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,a){var n=a.rows.length?a.rows.item(0).value:null;n&&(n=i.serializer.deserialize(n)),t(n)}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,t),n}function Ae(e,t){var a=this,n=new u((function(t,n){a.ready().then((function(){var i=a._dbInfo;i.db.transaction((function(a){_e(a,i,"SELECT * FROM "+i.storeName,[],(function(a,n){for(var r=n.rows,s=r.length,o=0;o<s;o++){var l=r.item(o),u=l.value;if(u&&(u=i.serializer.deserialize(u)),void 0!==(u=e(u,l.key,o+1)))return void t(u)}t()}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,t),n}function ke(e,t,a,n){var i=this;e=p(e);var r=new u((function(r,s){i.ready().then((function(){void 0===t&&(t=null);var o=t,l=i._dbInfo;l.serializer.serialize(t,(function(t,u){u?s(u):l.db.transaction((function(a){_e(a,l,"INSERT OR REPLACE INTO "+l.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){r(o)}),(function(e,t){s(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(n>0)return void r(ke.apply(i,[e,o,a,n-1]));s(t)}}))}))})).catch(s)}));return c(r,a),r}function Se(e,t,a){return ke.apply(this,[e,t,a,1])}function Ne(e,t){var a=this;e=p(e);var n=new u((function(t,n){a.ready().then((function(){var i=a._dbInfo;i.db.transaction((function(a){_e(a,i,"DELETE FROM "+i.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,t),n}function Te(e){var t=this,a=new u((function(e,a){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){_e(t,n,"DELETE FROM "+n.storeName,[],(function(){e()}),(function(e,t){a(t)}))}))})).catch(a)}));return c(a,e),a}function Me(e){var t=this,a=new u((function(e,a){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){_e(t,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],(function(t,a){var n=a.rows.item(0).c;e(n)}),(function(e,t){a(t)}))}))})).catch(a)}));return c(a,e),a}function xe(e,t){var a=this,n=new u((function(t,n){a.ready().then((function(){var i=a._dbInfo;i.db.transaction((function(a){_e(a,i,"SELECT key FROM "+i.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,a){var n=a.rows.length?a.rows.item(0).key:null;t(n)}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,t),n}function Ce(e){var t=this,a=new u((function(e,a){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){_e(t,n,"SELECT key FROM "+n.storeName,[],(function(t,a){for(var n=[],i=0;i<a.rows.length;i++)n.push(a.rows.item(i).key);e(n)}),(function(e,t){a(t)}))}))})).catch(a)}));return c(a,e),a}function Ie(e){return new u((function(t,a){e.transaction((function(n){n.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(a,n){for(var i=[],r=0;r<n.rows.length;r++)i.push(n.rows.item(r).name);t({db:e,storeNames:i})}),(function(e,t){a(t)}))}),(function(e){a(e)}))}))}function Ve(e,t){t=h.apply(this,arguments);var a=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||a.name,e.storeName=e.storeName||a.storeName);var n,i=this;return c(n=e.name?new u((function(t){var n;n=e.name===a.name?i._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:n,storeNames:[e.storeName]}):t(Ie(n))})).then((function(e){return new u((function(t,a){e.db.transaction((function(n){function i(e){return new u((function(t,a){n.executeSql("DROP TABLE IF EXISTS "+e,[],(function(){t()}),(function(e,t){a(t)}))}))}for(var r=[],s=0,o=e.storeNames.length;s<o;s++)r.push(i(e.storeNames[s]));u.all(r).then((function(){t()})).catch((function(e){a(e)}))}),(function(e){a(e)}))}))})):u.reject("Invalid arguments"),t),n}var Ee={_driver:"webSQLStorage",_initStorage:ve,_support:q(),iterate:Ae,getItem:we,setItem:Se,removeItem:Ne,clear:Te,length:Me,key:xe,keys:Ce,dropInstance:Ve};function Fe(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}function De(e,t){var a=e.name+"/";return e.storeName!==t.storeName&&(a+=e.storeName+"/"),a}function Re(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch(e){return!0}}function Le(){return!Re()||localStorage.length>0}function Pe(e){var t=this,a={};if(e)for(var n in e)a[n]=e[n];return a.keyPrefix=De(e,t._defaultConfig),Le()?(t._dbInfo=a,a.serializer=ge,u.resolve()):u.reject()}function Be(e){var t=this,a=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,a=localStorage.length-1;a>=0;a--){var n=localStorage.key(a);0===n.indexOf(e)&&localStorage.removeItem(n)}}));return c(a,e),a}function Oe(e,t){var a=this;e=p(e);var n=a.ready().then((function(){var t=a._dbInfo,n=localStorage.getItem(t.keyPrefix+e);return n&&(n=t.serializer.deserialize(n)),n}));return c(n,t),n}function $e(e,t){var a=this,n=a.ready().then((function(){for(var t=a._dbInfo,n=t.keyPrefix,i=n.length,r=localStorage.length,s=1,o=0;o<r;o++){var l=localStorage.key(o);if(0===l.indexOf(n)){var u=localStorage.getItem(l);if(u&&(u=t.serializer.deserialize(u)),void 0!==(u=e(u,l.substring(i),s++)))return u}}}));return c(n,t),n}function Ue(e,t){var a=this,n=a.ready().then((function(){var t,n=a._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(n.keyPrefix.length)),t}));return c(n,t),n}function je(e){var t=this,a=t.ready().then((function(){for(var e=t._dbInfo,a=localStorage.length,n=[],i=0;i<a;i++){var r=localStorage.key(i);0===r.indexOf(e.keyPrefix)&&n.push(r.substring(e.keyPrefix.length))}return n}));return c(a,e),a}function ze(e){var t=this.keys().then((function(e){return e.length}));return c(t,e),t}function We(e,t){var a=this;e=p(e);var n=a.ready().then((function(){var t=a._dbInfo;localStorage.removeItem(t.keyPrefix+e)}));return c(n,t),n}function Ye(e,t,a){var n=this;e=p(e);var i=n.ready().then((function(){void 0===t&&(t=null);var a=t;return new u((function(i,r){var s=n._dbInfo;s.serializer.serialize(t,(function(t,n){if(n)r(n);else try{localStorage.setItem(s.keyPrefix+e,t),i(a)}catch(e){"QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||r(e),r(e)}}))}))}));return c(i,a),i}function He(e,t){if(t=h.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var a=this.config();e.name=e.name||a.name,e.storeName=e.storeName||a.storeName}var n,i=this;return n=e.name?new u((function(t){e.storeName?t(De(e,i._defaultConfig)):t(e.name+"/")})).then((function(e){for(var t=localStorage.length-1;t>=0;t--){var a=localStorage.key(t);0===a.indexOf(e)&&localStorage.removeItem(a)}})):u.reject("Invalid arguments"),c(n,t),n}var Ge={_driver:"localStorageWrapper",_initStorage:Pe,_support:Fe(),iterate:$e,getItem:Oe,setItem:Ye,removeItem:We,clear:Be,length:ze,key:Ue,keys:je,dropInstance:He},qe=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},Ze=function(e,t){for(var a=e.length,n=0;n<a;){if(qe(e[n],t))return!0;n++}return!1},Je=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},Ke={},Xe={},Qe={INDEXEDDB:G,WEBSQL:Ee,LOCALSTORAGE:Ge},et=[Qe.INDEXEDDB._driver,Qe.WEBSQL._driver,Qe.LOCALSTORAGE._driver],tt=["dropInstance"],at=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(tt),nt={description:"",driver:et.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function it(e,t){e[t]=function(){var a=arguments;return e.ready().then((function(){return e[t].apply(e,a)}))}}function rt(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var a in t)t.hasOwnProperty(a)&&(Je(t[a])?arguments[0][a]=t[a].slice():arguments[0][a]=t[a])}return arguments[0]}var st=function(){function e(t){for(var a in i(this,e),Qe)if(Qe.hasOwnProperty(a)){var n=Qe[a],r=n._driver;this[a]=r,Ke[r]||this.defineDriver(n)}this._defaultConfig=rt({},nt),this._config=rt({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return e.prototype.config=function(e){if("object"===(void 0===e?"undefined":n(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,a){var n=new u((function(t,a){try{var n=e._driver,i=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void a(i);for(var r=at.concat("_initStorage"),s=0,o=r.length;s<o;s++){var l=r[s];if((!Ze(tt,l)||e[l])&&"function"!=typeof e[l])return void a(i)}var d=function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),a=u.reject(t);return c(a,arguments[arguments.length-1]),a}},a=0,n=tt.length;a<n;a++){var i=tt[a];e[i]||(e[i]=t(i))}};d();var p=function(a){Ke[n]&&console.info("Redefining LocalForage driver: "+n),Ke[n]=e,Xe[n]=a,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(p,a):p(!!e._support):p(!0)}catch(e){a(e)}}));return d(n,t,a),n},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,a){var n=Ke[e]?u.resolve(Ke[e]):u.reject(new Error("Driver not found."));return d(n,t,a),n},e.prototype.getSerializer=function(e){var t=u.resolve(ge);return d(t,e),t},e.prototype.ready=function(e){var t=this,a=t._driverSet.then((function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready}));return d(a,e,e),a},e.prototype.setDriver=function(e,t,a){var n=this;Je(e)||(e=[e]);var i=this._getSupportedDrivers(e);function r(){n._config.driver=n.driver()}function s(e){return n._extend(e),r(),n._ready=n._initStorage(n._config),n._ready}function o(e){return function(){var t=0;function a(){for(;t<e.length;){var i=e[t];return t++,n._dbInfo=null,n._ready=null,n.getDriver(i).then(s).catch(a)}r();var o=new Error("No available storage method found.");return n._driverSet=u.reject(o),n._driverSet}return a()}}var l=null!==this._driverSet?this._driverSet.catch((function(){return u.resolve()})):u.resolve();return this._driverSet=l.then((function(){var e=i[0];return n._dbInfo=null,n._ready=null,n.getDriver(e).then((function(e){n._driver=e._driver,r(),n._wrapLibraryMethodsWithReady(),n._initDriver=o(i)}))})).catch((function(){r();var e=new Error("No available storage method found.");return n._driverSet=u.reject(e),n._driverSet})),d(this._driverSet,t,a),this._driverSet},e.prototype.supports=function(e){return!!Xe[e]},e.prototype._extend=function(e){rt(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],a=0,n=e.length;a<n;a++){var i=e[a];this.supports(i)&&t.push(i)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=at.length;e<t;e++)it(this,at[e])},e.prototype.createInstance=function(t){return new e(t)},e}(),ot=new st;t.exports=ot},{3:3}]},{},[4])(4)}(Wi)),Wi.exports),Hi=V(Yi);class Gi{databaseName;collectionName;size;_store;constructor(e,t,a){Hi.config({driver:Hi.INDEXEDDB}),this.databaseName=e||"lumino-cache",this.collectionName=t||"data",this.size=a,this._store=Hi.createInstance({name:this.databaseName,storeName:this.collectionName})}async init(){}async _keys(){return this._store.keys()}async _set(e,t){return this._store.setItem(e,t)}async _clear(){return this._store.clear()}async _get(e){return this._store.getItem(e)}async _remove(e){return this._store.removeItem(e)}}function qi(e){let t,a,n,i;e.onmessage=async r=>{const s=r.data;try{switch(s.type){case"init":{n=s.databaseName,i=s.collectionName,t=await navigator.storage.getDirectory();const r=await t.getDirectoryHandle(n,{create:!0});a=await r.getDirectoryHandle(i,{create:!0}),e.postMessage({type:s.type,database:n,collection:i,success:!0});break}case"write":{if(!a)throw new Error("OPFS Worker: not initialized yet!");const t=await a.getFileHandle(s.filename,{create:!0}),r=await t.createSyncAccessHandle();let o;if("string"==typeof s.content){o=(new TextEncoder).encode(s.content).buffer}else if(s.content instanceof ArrayBuffer)o=s.content;else{if(!(s.content instanceof Blob))throw new Error("OPFS Worker: Unsupported content type: "+typeof s.content);o=await s.content.arrayBuffer()}r.truncate(o.byteLength),r.write(o,{at:0}),await r.flush(),r.close(),e.postMessage({type:s.type,database:n,collection:i,success:!0});break}}}catch(t){e.postMessage({type:s.type,success:!1,database:n,collection:i,error:t.message})}}}class Zi{databaseName;collectionName;size;_worker;_storage;_root;constructor(e,t,a){this.databaseName=e||"lumino-cache",this.collectionName=t||"data",this.size=a}async init(){if("object"==typeof globalThis.navigator&&"storage"in globalThis.navigator&&"function"==typeof globalThis.navigator.storage.getDirectory){this._storage=await navigator.storage.getDirectory();const e=await this._storage.getDirectoryHandle(this.databaseName,{create:!0});let t,a;this._root=await e.getDirectoryHandle(this.collectionName,{create:!0}),this._worker=new Worker(URL.createObjectURL(new Blob(["(",qi.toString(),")(self)"],{type:"application/javascript"})),{type:"module"});let n=new Promise(((e,n)=>{t=e,a=n}));return this._worker.onmessage=e=>{const n=e.data;n.success||console.error("OPFS Worker failed:",n),"init"===n.type&&(n.success?t():a(n.error))},this._worker.postMessage({type:"init",databaseName:this.databaseName,collectionName:this.collectionName}),n}}async _keys(){if(!this._root)return[];const e=[];for await(const t of this._root.values())e.push(t.name);return e}async _set(e,t){if(!this._root)return;let a;if(t instanceof Blob)a=t;else if("object"==typeof t){const e=JSON.stringify(t,null,2);a=new Blob([e],{type:"application/json"})}else a=new Blob([t],{type:"text/plain"});const n=await this._root.getFileHandle(e,{create:!0});if("function"==typeof n.createWritable){const e=await n.createWritable();await e.write(a),await e.close()}else this._worker.postMessage({type:"write",filename:e,content:a})}async _clear(){if(!this._root)return;const e=[];for await(const t of this._root.values())e.push(this._root.removeEntry(t.name));return Promise.all(e)}async _get(e,t){if(!this._root)return null;let a;try{const t=await this._root.getFileHandle(e);a=await t.getFile()}catch(e){return null}switch(t=t||a.type){case"text/plain":return a.text();case"application/json":{const e=await a.text();try{return JSON.parse(e)}catch(t){return console.error("Content was loaded from cache but could not be json parsed: ",e),null}}default:return a}}async _remove(e){if(this._root)return this._root.removeEntry(e)}}class Ji{databaseName;collectionName;size;type;_impl;constructor(e,t,a=0,n=1){switch(this.databaseName=e||"lumino",this.collectionName=t||"data",this.size=1048576*(n||1),this.type=a,this.type){case 0:this._impl=new Gi(this.databaseName,this.collectionName,this.size);break;case 1:this._impl=new Zi(this.databaseName,this.collectionName,this.size);break;default:throw"Invalid storage type: "+a}}async init(){return this._impl.init()}async _keys(){return this._impl._keys()}fixKey(e){return e.replaceAll("/","_")}async _set(e,t){return this._impl._set(this.fixKey(e),t)}async _clear(){return this._impl._clear()}async _get(e,t){return this._impl._get(this.fixKey(e),t)}async _remove(e){return this._impl._remove(this.fixKey(e))}}var Ki,Xi,Qi,er,tr,ar,nr,ir,rr,sr,or,lr,ur,cr,dr,pr,hr,fr,mr,yr,gr,br,vr,_r,wr,Ar,kr,Sr;function Nr(){if(Xi)return Ki;return Xi=1,Ki=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}}function Tr(){if(ar)return tr;ar=1;var e=function(){if(er)return Qi;er=1;var e="object"==typeof I&&I&&I.Object===Object&&I;return Qi=e}(),t="object"==typeof self&&self&&self.Object===Object&&self,a=e||t||Function("return this")();return tr=a}function Mr(){if(lr)return or;lr=1;var e=function(){if(sr)return rr;sr=1;var e=/\s/;return rr=function(t){for(var a=t.length;a--&&e.test(t.charAt(a)););return a}}(),t=/^\s+/;return or=function(a){return a?a.slice(0,e(a)+1).replace(t,""):a}}function xr(){if(cr)return ur;cr=1;var e=Tr().Symbol;return ur=e}function Cr(){if(yr)return mr;yr=1;var e=xr(),t=function(){if(pr)return dr;pr=1;var e=xr(),t=Object.prototype,a=t.hasOwnProperty,n=t.toString,i=e?e.toStringTag:void 0;return dr=function(e){var t=a.call(e,i),r=e[i];try{e[i]=void 0;var s=!0}catch(e){}var o=n.call(e);return s&&(t?e[i]=r:delete e[i]),o}}(),a=function(){if(fr)return hr;fr=1;var e=Object.prototype.toString;return hr=function(t){return e.call(t)}}(),n=e?e.toStringTag:void 0;return mr=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":n&&n in Object(e)?t(e):a(e)}}function Ir(){if(_r)return vr;_r=1;var e=Cr(),t=br?gr:(br=1,gr=function(e){return null!=e&&"object"==typeof e});return vr=function(a){return"symbol"==typeof a||t(a)&&"[object Symbol]"==e(a)}}var Vr=function(){if(Sr)return kr;Sr=1;var e=Nr(),t=function(){if(ir)return nr;ir=1;var e=Tr();return nr=function(){return e.Date.now()}}(),a=function(){if(Ar)return wr;Ar=1;var e=Mr(),t=Nr(),a=Ir(),n=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,r=/^0o[0-7]+$/i,s=parseInt;return wr=function(o){if("number"==typeof o)return o;if(a(o))return NaN;if(t(o)){var l="function"==typeof o.valueOf?o.valueOf():o;o=t(l)?l+"":l}if("string"!=typeof o)return 0===o?o:+o;o=e(o);var u=i.test(o);return u||r.test(o)?s(o.slice(2),u?2:8):n.test(o)?NaN:+o}}(),n=Math.max,i=Math.min;return kr=function(r,s,o){var l,u,c,d,p,h,f=0,m=!1,y=!1,g=!0;if("function"!=typeof r)throw new TypeError("Expected a function");function b(e){var t=l,a=u;return l=u=void 0,f=e,d=r.apply(a,t)}function v(e){var t=e-h;return void 0===h||t>=s||t<0||y&&e-f>=c}function _(){var e=t();if(v(e))return w(e);p=setTimeout(_,function(e){var t=s-(e-h);return y?i(t,c-(e-f)):t}(e))}function w(e){return p=void 0,g&&l?b(e):(l=u=void 0,d)}function A(){var e=t(),a=v(e);if(l=arguments,u=this,h=e,a){if(void 0===p)return function(e){return f=e,p=setTimeout(_,s),m?b(e):d}(h);if(y)return clearTimeout(p),p=setTimeout(_,s),b(h)}return void 0===p&&(p=setTimeout(_,s)),d}return s=a(s)||0,e(o)&&(m=!!o.leading,c=(y="maxWait"in o)?n(a(o.maxWait)||0,s):c,g="trailing"in o?!!o.trailing:g),A.cancel=function(){void 0!==p&&clearTimeout(p),f=0,l=h=u=p=void 0},A.flush=function(){return void 0===p?d:w(t())},A},kr}(),Er=V(Vr);class Fr extends Ji{apiClient;cache=new Map;urlToIdMap=new Map;logging=!1;ready=!1;usePublicApi=!1;quota=0;size=0;usePersistentStorage=!1;saveIndex;constructor(e,t,a,n){if(super("lumino","items",1),!a)throw"A lumino client needs to be passed.";this.apiClient=a,this.usePublicApi=e,this.quota=1048576*(n||1024),this.usePersistentStorage=t;this.saveIndex=Er((()=>{const e=[];for(const t of this.cache.values())e.push({id:t.id,time:t.time.valueOf(),size:t.size,hash:t.hash,itemType:t.itemType,mimeType:t.mimeType,itemName:t.itemName});this._set("index",e).then((function(){})).catch((function(e){console.error("Error saving cache index: "+e)}))}),1e3)}async init(){return await super.init(),this.initFromStorage()}getQuota(){return this.quota}setQuota(e){this.quota=e,this.checkQuota()}getCount(){return this.cache.size}getSize(){return this.size}async initFromStorage(){if(this.usePersistentStorage){const e=await this._get("index","application/json");if(e&&Array.isArray(e))for(const t of e)t.time=L(t.time),this.cache.set(t.id,t),this.size+=t.size;else await this._clear(),this.saveIndex()}this.ready=!0,u.$emit("itemCache:cacheReady"),u.$emit("itemCache:cacheChange"),u.$on("item:rename",(e=>this.handleRename(e)))}async addToStorage(e,t){if(this.usePersistentStorage){const a={id:e.id,time:L(e.time.toDate()),size:e.size,hash:e.hash,itemType:e.itemType,mimeType:e.mimeType,itemName:e.itemName};await this._set(`blob_${e.id}`,t),this.cache.set(e.id,a),this.saveIndex()}this.size+=e.size}waitUntilReady(){const e=this;return new Promise(((t,a)=>{try{e.ready?t():u.$on("itemCache:cacheReady",(()=>{t()}))}catch(e){a(e)}}))}findObject(e){return this.cache.get(e)}getEntries(){return this.cache.values()}clear(){for(const e of this.cache.values())e.objectUrl&&URL.revokeObjectURL(e.objectUrl);this.cache.clear(),u.$emit("itemCache:cacheChange"),this.usePersistentStorage&&this._clear().then((function(){console.log("Cache storage cleared.")})).catch((function(e){console.error(e)}))}clearMemory(){for(let e of this.cache.values())e.objectUrl&&(URL.revokeObjectURL(e.objectUrl),delete e.objectUrl);u.$emit("itemCache:cacheChange")}checkQuota(e=0){let t=this.size+e;if(t>this.quota){const e=[...this.cache.entries()].sort((function(e,t){return e[1].time.valueOf()-t[1].time.valueOf()}));let a=0;for(;t>this.quota&&a<e.length;){const n=e[a][1];n.objectUrl||(t-=n.size,this.removeObjectFromCache(n.id)),a++}}}removeObjectFromCache(e){const t=this.cache.get(e);t&&(t.objectUrl&&URL.revokeObjectURL(t.objectUrl),this.cache.delete(e),this.size-=t.size,this.usePersistentStorage&&(this._remove(`blob_${t.id}`).then((function(){console.log(`Removed blob for ${e} from cache`)})).catch((function(t){console.error(`Error removing blob for ${e} from cache: ${t}`)})),this.saveIndex()))}getIdFromUrl(e){return this.urlToIdMap.has(e)?this.urlToIdMap.get(e):null}getById(e){const t=this.findObject(e);return t?(this.logging&&console.log("Retrieving from cache: "+e),t.time=L(),t):(this.logging&&console.error("Object not in cache: "+e),null)}getObjectUrl(e){const t=this.getIdFromUrl(e);if(!t)return console.error("Could not find URL in cache: "+e),"";const a=this.getById(t);return a?a.objectUrl:(console.error("Could not find Id in cache: "+t),"")}async getBufferById(e){const t=await this.getBlobById(e);return t?await new Response(t).arrayBuffer():null}async getBlobById(e){const t=this.getById(e);return t?await fetch(t.objectUrl).then((e=>e.blob())):null}async loadFromStorage(e){if(e.objectUrl)return!0;let t=null;return!!this.usePersistentStorage&&(t=await this._get(`blob_${e.id}`),!!t&&(e.objectUrl=URL.createObjectURL(t),e.time=L(),this.saveIndex(),u.$emit("itemCache:cacheChange"),!0))}getCacheKey(e,t){return t&&"item"!==t.type?e+"_lod"+t.index:e}_getLodLevelUrl(e,t){let a;return a=t&&"item"!==t.type?this.apiClient.getAttachmentDownloadUrl(e,"lod",t.index):this.apiClient.getDownloadUrl(e),a}async loadItem(e,t,a){let n=0;for(;;)try{let n;if(this.usePublicApi)n=t&&"item"!==t.type?await this.apiClient.downloadPublicAttachment(e,"lod",t.index,void 0,a):await this.apiClient.publicDownloadItem(e,a);else try{n=t&&"item"!==t.type?await this.apiClient.downloadAttachment(e,"lod",t.index,void 0,a):await this.apiClient.downloadItem(e,a)}catch{n=t&&"item"!==t.type?await this.apiClient.downloadPublicAttachment(e,"lod",t.index,void 0,a):await this.apiClient.publicDownloadItem(e,a)}return n}catch(t){if(console.log(t),n++,!(n<3))return u.$emit("client:fatalError",`Failed to download item ${e}`),null;console.debug(`Failed attempts to download item ${e}: ${n}. Trying again...`)}}async addItemToCache(e,t,a,n){try{const i=this.getCacheKey(e,t),r=this.findObject(i);if(r&&(a||!this.apiClient.getItemHash||this.usePublicApi||(a=await this.apiClient.getItemHash(e)),a&&r.hash===a&&(this.logging&&console.log("Item already in cache: "+e),await this.loadFromStorage(r))))return r.url||(r.url=this._getLodLevelUrl(e,t)),this.urlToIdMap.set(r.url,i),this.cache.set(i,r),r;n&&n(0);let s=await this.loadItem(e,t,n);if(!s)return console.error("Was not able to load object into cache: "+i),null;n&&n(100);const o=this._getLodLevelUrl(e,t),l=URL.createObjectURL(s.blob),c={id:i,url:o,time:L(),objectUrl:l,size:s.blob.size,hash:s.hash,itemType:s.itemType,mimeType:s.mimeType,itemName:s.itemName};return this.checkQuota(c.size),await this.addToStorage(c,s.blob),this.cache.set(i,c),this.urlToIdMap.set(o,i),this.saveIndex(),u.$emit("itemCache:cacheChange"),this.logging&&console.log("Added item to cache: ",c),c}catch(e){return console.error(e),null}}getObjectCount(){return this.cache.size}getObjectSize(){let e=0;for(const t of this.cache.values())e+=t.size;return e}handleRename({id:e,newName:t}){const a=this.cache.get(e);a&&(a.itemName=t,this.saveIndex(),u.$emit("itemCache:cacheChange"))}}class Dr extends Ji{apiClient;ready=!1;maxNumItems=1e4;constructor(e){if(super("lumino","folders",1),!e)throw"A lumino client needs to be passed.";this.apiClient=e}async init(){await super.init(),await this.checkStorage(),this.ready=!0}clear(){return this._clear()}async checkStorage(){const e=await this._keys();let t=e.length-this.maxNumItems;if(t>0){t=Math.floor(this.maxNumItems/2);const a=[];for(let n=0;n<t;n++)a.push(this._remove(e[n]));await Promise.all(a)}}async getFolderListing(e){return this.ready?this._get(e,"application/json"):null}async getItemListing(e){if(!this.ready)return null;const t=await this._get("items_"+e,"application/json");if(!t)return null;const a=await this.getFolderListing(e);return a&&a.parent&&new Date(t.cachedAt).getTime()>new Date(a.parent.updatedAt).getTime()?t.data:null}async getFolderACLs(e,t){if(!this.ready)return null;const a=await this._get("acl_"+e,"application/json");return a&&Date.now()-a.cachedAt<t?(delete a.cachedAt,a):null}async refreshCacheForFolder(e){const t=await this.getFolderListing(e);await this.addFolderListing(e,t)}async addFolderListing(e,t){this.ready&&(await this._set(e,{...t,cachedAt:new Date}),await this.checkStorage())}async addItemListing(e,t){this.ready&&(await this._set("items_"+e,{data:t,cachedAt:new Date}),await this.checkStorage())}async addACL(e,t){this.ready&&(await this._set("acl_"+e,{...t,cachedAt:new Date}),await this.checkStorage())}}class Rr extends Ji{apiClient;constructor(e){if(super("lumino","thumbs",1),!e)throw"A lumino client needs to be passed.";this.apiClient=e}clear(){this._clear()}async _loadThumbnail(e,t){try{return await this.apiClient.getThumbnail(e,t)}catch{try{return await this.apiClient.getPublicThumbnail(e,t)}catch{return null}}}async get(e,t,a,n){if(!t)throw"Cannot retrieve item thumbnail from cache without knowing size!";let i=await this._get(e,"application/json");if(i&&i.hash===a&&i.timestamp===n){for(const e of i.thumbnails)if(e.size===t){if(e.data)return e.data;i.thumbnails.removeObject(e);break}let a=await this._loadThumbnail(t,e);return a&&(i.thumbnails.push({size:t,data:a}),await this._set(e,i)),a}let r=await this._loadThumbnail(t,e);if(a||n){let s=[];r&&s.push({size:t,data:r}),i={id:e,hash:a,timestamp:n,thumbnails:s},await this._set(e,i)}return r}}class Lr{apiClient;cache=new Map;constructor(e){this.apiClient=e,this.cache=new Map}async resolve(e){let t=this.cache.get(e);if(!t)try{t=this.apiClient.getUserPublicInfo(e,this.apiClient.requestClientId,32),this.cache.set(e,t)}catch(e){console.error(e)}return t}}class Pr{apiClient;cache=new Map;constructor(e){this.apiClient=e}async resolve(e){let t=this.cache.get(e);if(!t)try{t=this.apiClient.getGroupPublicInfo(e,this.apiClient.requestClientId,32),this.cache.set(e,t)}catch(e){console.error(e)}return t}}class Br{apiClient;cache=new Map;constructor(e){this.apiClient=e}async get(e,t,a,n,i=!1){const r=`${e}_${t}_${a}${void 0===n?"":`_${n}`}`,s=this.cache.get(r);if(s)return s;try{const s=new Promise((async r=>{try{let s;s=i?await this.apiClient.downloadPublicAttachment(e,t,a,n,void 0):await this.apiClient.downloadAttachmentPOP(e,t,a,n,void 0);r(URL.createObjectURL(s.blob))}catch(e){r(null)}}));return this.cache.set(r,s),s}catch(e){return console.warn(`Attachment ${r} not available.`),null}}invalidateAttachment(e,t,a,n){let i=`${e}_${t}`;null!=a&&(i+=`_${a}`);for(const e of this.cache.keys()){const t=null==n||e.endsWith(`_${n}`);e.startsWith(i)&&t&&this.cache.delete(e)}}}class Or{apiClient;itemRepo;jobManager;items=[];hasExternalResources=!1;totalSize=0;affectedFolderIds=new Set;constructor(e){this.apiClient=e,this.itemRepo=e.getItemRepo(),this.jobManager=e.getJobManager()}_updateQuota(){this.apiClient.eventBus.$emit("quota:update")}async getPreviousVersions(e,t){const a=[];t=t||"published";const n=await this.apiClient.createFolder({name:t,parent:e,returnIfExists:!0}),i=await this.apiClient.getFoldersInFolderList(n,{folderAsItemType:"Package"});for(const e of i.children)e.item&&a.push({itemId:e.item._id,folderId:e._id,version:e.name,name:e.item.name,filesize:0|e.item.filesize,visibility:e.item.visibility});return a}async verify(e){const t=this,a=new Map,n=new Map;e=e?await this.itemRepo.loadItem(e._id,{recursive:!0}):this.itemRepo.activeItem;const i=await r(e.folder);async function r(e){try{if(e){const a=e._id?e._id:e;if(n.has(a))return n.get(a);{const e=(await t.apiClient.getFolderPath(a)).path;return n.set(a,e),e}}return"/"}catch{return""}}await this.itemRepo.traverseItems((async function(e){const t={_id:e._id,name:e.name,type:e.type,size:e.totalSize,path:await r(e.folder),item:e,external:!1};t.path.startsWith(i)?t.path=t.path.slice(i.length):t.external=!0,a.set(e._id,t)})),this.items=Array.from(a.values()),this.hasExternalResources=!1,this.totalSize=0;for(const e of this.items)e.external&&(this.hasExternalResources=!0),this.totalSize+=e.size;return!this.hasExternalResources}getItems(){return this.items}async unpackToProject(e,t,a,n){a&&(t=await this.apiClient.createFolder({name:a,parent:t,returnIfExists:!0}));const i=await this.apiClient.getItem(e);i.folder===t&&await this.apiClient.renameItem(e,i.name+" (Unpackaged)");const r=await this.apiClient.createFolder({name:i.name,parent:t,fixNameCollisions:!0}),s=await this.jobManager.execute("JS:Unpackage",[{_id:e,isFolder:!1}],[{name:"Destination Folder",value:r},{name:"Make Destination Visible",value:!1}],n);if(this._updateQuota(),3===s.state){const t=s.log.trim().split(";");if(2!==t.length||"UNPACKAGED"!==t[0])throw new A("Unpacking failed. Did not get unpackaged item id!");const a=t[1].trim();return await this.apiClient.renameItem(a,i.name),await this.itemRepo.replaceLink(e,a),a}if(2===s.state)throw new A("Unpacking failed: "+s.error)}async copyItemToProject(e,t,a,n){return(await this.copyItemsToProject([{_id:e,isFolder:!1}],t,a,n))[0].newId}async copyItemsToProject(e,t,a,n){a=a||"packages",t=await this.apiClient.createFolder({name:a,parent:t,returnIfExists:!0}),this.affectedFolderIds.add(t);const i=[];if(e.length){const a=await this.jobManager.execute("JS:CloneItem",e,[{name:"Deep Clone",value:!1},{name:"Destination Folder",value:t},{name:"Exclude Types",value:""},{name:"Make Private",value:!0}],n);if(this._updateQuota(),3===a.state){if(!a.log.trim().length)throw new A("Copy job returned no results.");{const e=a.log.split("\n").reverse();for(const t of e){const e=t.trim().split(";");if(3===e.length){const t=e[1],a=e[2];await this.itemRepo.replaceLink(t,a),i.push({oldId:t,newId:a})}}}}else if(2===a.state)throw new A("Copying of items failed: "+a.error)}return i}async copyToProject(e,t,a){const n=[];for(const e of this.items)e.external&&n.push({_id:e._id,isFolder:!1});return this.copyItemsToProject(n,e,t,a)}async unpublish(e){await this.apiClient.makeItemPrivate(e,!1,!1)}async publish(e,t,a,n,i,r,s,o){const l=e.version;n=n||`published/${l.major}.${l.minor}.${l.revision}`,i=void 0===i||i,r=void 0===r||r,this.affectedFolderIds.add(a);let u,c=a;if(n){const e=n.split("/");for(const t of e)c=await this.apiClient.createFolder({name:t,parent:c,returnIfExists:!0}),this.affectedFolderIds.add(c),u||(u=c)}const d=(await this.apiClient.getFoldersInFolderList(a)).children.map((e=>e._id)).filter((e=>e!==u)).join(","),p=await this.jobManager.execute("JS:CreatePackage",[{_id:e._id,isFolder:!1}],[{name:"Folders To Include",value:d},{name:"Destination Folder",value:c},{name:"Item Name",value:t},{name:"Make Public",value:!!i},{name:"Copy External",value:!!r},{name:"Always Create New Package",value:!!s},{name:"Make Cloneable",value:!!o}]);if(this._updateQuota(),2===p.state)throw new A("Packaging failed: "+p.error);this.apiClient.eventBus.$emit("folder:changed",Array.from(this.affectedFolderIds.values()))}}class $r{id;job;nextCheckMs;constructor(e,t,a){this.id=e,this.job=a,this.nextCheckMs=t}}class Ur{apiClient;jobs=new Map;constructor(e){this.apiClient=e}getJobs(){return Array.from(this.jobs.values())}async execute(e,t,a,n=void 0,i){const r=this;return new Promise((async(s,o)=>{try{const o=async()=>{try{u.job=await r.apiClient.getJobState(l);let e=!1;switch(u.job.state){case 0:case 1:try{n&&n(u.job)}catch(e){console.error("Error calling progress callback: ",e)}break;case 2:case 3:console.log("Job is done."),e=!0,s(u.job)}e?r.jobs.delete(l):(u.nextCheckMs=Math.min(2*u.nextCheckMs,8e3),setTimeout(o,u.nextCheckMs))}catch(e){console.error("Error fetching job state: "+e)}},l=await r.apiClient.createJob({type:e,elements:t,parameters:a,requiredParameters:i}),u=new $r(l,1e3);r.jobs.set(l,u),setTimeout(o,u.nextCheckMs)}catch(e){o(e)}}))}}const jr={mp3:{name:"Mpeg Audio Layer 3",itemType:"Audio",itemTypeCollection:"Audio Collection",collectionEntryName:"AudioItems",folderName:"audio",defaultAction:"Use",actions:["Skip","Use"]},hdr:{name:"HDR Image",itemType:"HDR Image",folderName:"envmaps",defaultAction:"Use",actions:["Skip","Use"]},glb:{name:"Gltf Binary",itemType:"Mesh",itemTypeCollection:"Mesh Collection",collectionEntryName:"MeshItems",folderName:"meshes",defaultAction:"Use",actions:["Skip","Use"]},png:{name:"Portable Network Graphics",itemType:"Image",folderName:"textures",defaultAction:"Use",actions:["Skip","Use"]},jpg:{name:"JPEG",itemType:"Image",folderName:"textures",defaultAction:"Use",actions:["Skip","Use"]},jpeg:{name:"JPEG",itemType:"Image",folderName:"textures",defaultAction:"Use",actions:["Skip","Use"]},lua:{name:"Lua",itemType:"Script",folderName:"scripts",defaultAction:"Use",actions:["Skip","Use"]},ttf:{name:"True Type Font",itemType:"Font",folderName:"fonts",defaultAction:"Use",actions:["Skip","Use"]},otf:{name:"Open Type Font",itemType:"Font",folderName:"fonts",defaultAction:"Use",actions:["Skip","Use"]},unknown:{name:"Unsupported",itemType:"Unknown",defaultAction:"Skip",actions:["Skip"],invisible:!0}},zr={Audio:"audio","Audio Collection":"audio","HDR Image":"envmaps",Mesh:"meshes","Mesh Collection":"",Script:"scripts",Material:"materials","Background Shader":"background shaders","Pixel Shader":"pixel shaders","Vertex Shader":"vertex shaders",Image:"textures",Scene:"prefabs",Font:"fonts"};function Wr(e,t){let a=jr[t];a||(a=jr.unknown),e.size=e.blob?e.blob.size:0,e.type=a.name,e.collectionType=a.itemTypeCollection,e.collectionEntryName=a.collectionEntryName,e.action=a.defaultAction,e.actions=a.actions,e.folderName=a.folderName,e.itemType=a.itemType,e.name=function(e,t){let a=e.lastIndexOf(".");return e.substring(0,a<0?e.length:a)+"."+t}(e.name,t)}class Yr{name;blob;processing=!1;progress=0;size=0;type;collectionType;collectionEntryName;action;actions;folderName;itemType;constructor(e,t,a){this.name=e,this.blob=t,Wr(this,a)}}class Hr{apiClient;itemRepo;jobManager;items=[];mainItem;totalSize=0;oldMainItemId;originalItemIds=[];affectedFolderIds=new Set;packageId;converter;supportedExtensions;hasExternalResources=!1;constructor(e){this.apiClient=e,this.itemRepo=e.getItemRepo(),this.jobManager=e.getJobManager();const t=[];for(const e in jr)jr[e].invisible||t.push(`.${e.toUpperCase()}`);this.supportedExtensions=t.sort(((e,t)=>e.localeCompare(t)))}_updateQuota(){this.apiClient.eventBus.$emit("quota:update")}_addAffectedFolder(e){"object"==typeof e&&e._id?this.affectedFolderIds.add(e._id):"string"==typeof e?this.affectedFolderIds.add(e):console.error("Invalid affected folder to add: ",e)}getAffectedFolderIds(){return Array.from(this.affectedFolderIds.values())}getSupportedExtensions(){return this.supportedExtensions}setConverter(e){this.converter=e}setItems(e){this.items=e}async scan(e){const t=this,a=new Map,n=new Map;this.mainItem=await this.itemRepo.loadItem(e,{recursive:!0}),this.oldMainItemId=this.mainItem._id;const i=await r(this.mainItem.folder);async function r(e){try{if(e){const a=e._id?e._id:e;if(n.has(a))return n.get(a);{const e=(await t.apiClient.getFolderPath(a)).path;return n.set(a,e),e}}return"/"}catch(e){return console.error(e),""}}await this.itemRepo.traverseItems((async function(e){const n={_id:e._id,name:e.name,type:e.type,size:e.totalSize,path:await r(e.folder),item:e,external:!1};n.path.startsWith(i)?n.path=n.path.slice(i.length):n.external=!0,t._addAffectedFolder(e.folder),a.set(e._id,n)}),this.mainItem),this.items=Array.from(a.values()),this.originalItemIds=this.items.map((e=>e._id)),this.hasExternalResources=!1,this.totalSize=0;for(const e of this.items)e.external&&(this.hasExternalResources=!0),this.totalSize+=e.size;return this.items}getItems(){return this.items}async saveMainItemChanges(){const e=this.mainItem;await this.apiClient.updateItem({_id:e._id,name:e.name,shortDescription:e.shortDescription,description:e.description,tags:e.tags,categories:e.categories,visibility:e.visibility,contributors:e.contributors,version:e.version})}async createAssetFolder(e,t){let a=e;const n=t.split("/");this._addAffectedFolder(e);for(const e of n)a=await this.apiClient.createFolder({name:e,parent:a,returnIfExists:!0}),this._addAffectedFolder(a);const i=await this.apiClient.getItemsInFolderList(a,!0);if(i&&i.length)throw new Error("Asset folder already exists and is not empty!");return a}createStandardAssetFolderPath(e){let t=zr[e.type];return t||(t=e.type.toLowerCase()+"s"),`assets/${t}/${e.name}`}async executeActions(){if(!this.converter)throw new Error("No converter is configured. Cannot execute actions on items.");return this.converter(this.items,Wr)}async createAsset(e,t=!1,a){const n=[];for(const e of this.items)n.push(e._id);if(this._addAffectedFolder(e),n.length)if(t){await this.apiClient.moveItems({items:n,dest:e})!==n.length&&console.warn("Not all items could be moved. Most likely due to permissions."),this.mainItem.folder=e}else{const t=await this.jobManager.execute("JS:CloneItem",[{_id:this.mainItem._id,isFolder:!1}],[{name:"Deep Clone",value:!0},{name:"Destination Folder",value:e},{name:"Exclude Types",value:""}],a);if(3===t.state){const a=t.log.split("\n").reverse()[0].split(";");this.mainItem={...this.mainItem,_id:a[2],folder:e}}else if(2===t.state)throw new A("Copying of items failed: "+t.error)}"Main"!==this.mainItem.name&&(this.mainItem.originalName=this.mainItem.name,this.mainItem.name="Main",await this.apiClient.renameItem(this.mainItem._id,this.mainItem.name));const i=await this.apiClient.getItem(this.mainItem._id);return i.flags||(i.flags=[]),i.flags.includes("original")||i.flags.push("original"),await this.apiClient.updateItem(i),this._updateQuota(),this.mainItem._id}async createPackage(e,t=!1,a=!1){let n,i=this.mainItem.folder;if(this._addAffectedFolder(i),void 0===e){const t=this.mainItem.version||{major:1,minor:0,revision:0};e=`published/${t.major}.${t.minor}.${t.revision}`}if(void 0===t&&(t=!0),e){const t=e.split("/");for(const e of t)i=await this.apiClient.createFolder({name:e,parent:i,returnIfExists:!0}),this._addAffectedFolder(i),n||(n=i)}const r=(await this.apiClient.getFoldersInFolderList(this.mainItem.folder)).children.map((e=>e._id)).filter((e=>e!==n)).join(","),s=await this.jobManager.execute("JS:CreatePackage",[{_id:this.mainItem._id,isFolder:!1}],[{name:"Folders To Include",value:r},{name:"Destination Folder",value:i},{name:"Item Name",value:this.mainItem.originalName||this.mainItem.name},{name:"Make Public",value:!!t},{name:"Copy External",value:!!a}]);if(this._updateQuota(),2===s.state)throw new A("Packaging failed: "+s.error);const o=s.log.split("\n").reverse()[0].split(";");this.packageId=o[2]}async replaceReferences(){await this.itemRepo.replaceLink(this.oldMainItemId,this.packageId)}async deleteOriginalItems(){await this.apiClient.deleteItem(this.originalItemIds)}sendFolderRefreshEvent(){this.apiClient.eventBus.$emit("folder:changed",this.getAffectedFolderIds())}async processUploads(e){const t=[];for(const a of e)if("application/zip"===a.type||"application/x-zip-compressed"===a.type){const e=new s;try{const n=[];(await e.loadAsync(a)).forEach(((e,a)=>{const i=a.name.split("/").pop();if(!i.startsWith(".")){const e=i.split(".").pop(),r=a.async("blob");n.push(r),r.then((function(n){const i=new Yr(a.name,n,e);t.push(i)}))}})),await Promise.all(n)}catch(e){console.error("Error reading the ZIP file:",e)}}else{const e=a.name.split(".").pop(),n=new Yr(a.name,a,e);t.push(n)}return t}detectAssets(e){let t,a,n,i=0;for(const r of e)if("Use"===r.action)if(void 0===t)t=r.itemType,a=r.collectionType,n=r.folderName,i++;else{if(t!==r.itemType)return{valid:!1,reason:"Mixed item types found. To create an asset, upload a single type of file for example only meshes."};i++}return 0===i?{valid:!1,reason:"There are no files we can use to create an asset."}:i>1&&!a?{valid:!1,reason:"Cannot create collections of this type."}:{valid:!0,assetType:i>1?a:t,itemCount:i,folderName:n}}_filterUploadFiles(e){let t=[];for(const a of e)"Use"===a.action&&t.push(a);return t}createNewItem(){return{name:"New asset",type:"",description:"",shortDescription:"",tags:[],flags:["original"],categories:[],license:"CC0",allowConversation:!0,version:{major:1,minor:0,revision:0}}}async createAssetFromFiles(e,t,a,n=!1,i=!1){const r=this.detectAssets(e);if(r.assetType!==a.type)throw new Error("Asset type not valid for these items.");if(!r.valid)throw new Error(r.reason||"No valid asset detected.");let s=await this.apiClient.createFolder({name:r.folderName,parent:t,returnIfExists:!0}),o=await this.apiClient.createFolder({name:a.name,parent:s,returnIfExists:!0}),l=!1;if(0===(await this.apiClient.getItemsInFolderList(o)).length){(await this.apiClient.getFoldersInFolderList(o)).children.length&&(l=!0)}else l=!0;if(l){if(!n)throw new Error("Cannot create asset, target folder is not empty!");await this.apiClient.deleteFolder(o),o=await this.apiClient.createFolder({name:a.name,parent:s})}let u,c=this._filterUploadFiles(e);if(1===c.length){const e=c[0];e.processing=!0,e.progress=0,u=await this.apiClient.uploadAndCreate(o,e.blob,e.name,{nameOverride:"Main",flags:"original"},(function(t){e.progress=t})),this._updateQuota(),e.action="Skip"}else{let e=await this.apiClient.createFolder({name:"resources",parent:o}),t={},a=[],n=0;for(const i of c){i.processing=!0,i.progress=0;const r=await this.apiClient.uploadAndCreate(e,i.blob,i.name,void 0,(function(e){i.progress=e}));this._updateQuota(),i.action="Skip",t[`${i.collectionEntryName}[${n}]->Name`]="",a.push({usage:`MeshItems[${n}]->Mesh`,to:r}),n++}u=await this.apiClient.createItem({type:r.assetType,name:"Main",flags:["original"],folder:o,fixNameCollisions:!0,attributes:t,links:a})}return a._id=u,a.folder=o,this.mainItem=a,i?{assetItemId:u,assetTypeFolderId:s,assetFolderId:o}:u}}class Gr{apiClient;itemRepo;constructor(e){this.apiClient=e,this.itemRepo=e.getItemRepo()}grab(e,t,a,n){n=n||{};const i=[];for(const r of a){const a=this._serializeBlockFields(r),s=this._serializeScripts(r),o={type:"block",item:e._id,field:t.name,path:"",block:{id:r.id,type:r.type||"Group",fields:a,scripts:s,children:[]}};n.omitPath||(o.path=this._getBlockPath(r)),n.withChildren&&(o.block.children=this.grab(e,t,r.blocks||[],{withChildren:!0,returnArray:!0})),i.push(o)}if(n.returnArray)return i;const r={type:"serializedBlocks",data:i};return n.noStringify?r:JSON.stringify(r,null,2)}async put(e,t,a,n={}){e=this.validateMessage(e);const i=[];for(const r of e.data){const e=await this._putBlock(r,t,a,n);e&&i.push(e)}return i}validateMessage(e){if("string"==typeof e&&(e=JSON.parse(e)),"serializedBlocks"!==e.type)throw new Error("Data must be a serialized block message. Format is wrong.");if(!Array.isArray(e.data))throw new Error("The contained data is not an array.");return e}async clone(e,t,a,n,i={}){const r=this.grab(n,t,[e],{withChildren:!0,noStringify:!0});return this.put(r,t,a,i)}_updateScriptFieldReferences(e,t){const a=new Map,n=(e,t)=>{a.set(e.block.id,t.id);const i=e.block.children||[],r=t.blocks||[];for(let e=0;e<i.length;e++)n(i[e],r[e])};n(e,t),this.itemRepo.updateScriptFieldReferencesFromMap(a,t)}async _putBlock(e,t,a,n={},i=!1){if(!e.block||!e.block.type||!e.block.fields)return null;const r=e.block,s=this._findItemById(e.item)??this.itemRepo.activeItem;let o=a;o||(o=this._findParentBlock(s,e.field,e.path));const l={};if(Array.isArray(r.fields))for(const e of r.fields){const{name:t,type:a,value:i,linkto:r}=e;if("Separator"!==a)if(n.fieldOverrides&&t in n.fieldOverrides)l[t]=n.fieldOverrides[t];else if(r){const e=this.itemRepo.getLoadedItem(r);l[t]=e||await this.itemRepo.loadItem(r)}else l[t]=i}const u=n.dontCopyScripts?[]:[...r.scripts],c=await this._createUnproxifiedBlock(r.type,l,u,t,s),d={...n,parentPosition:void 0,fieldOverrides:void 0};if(!c)return console.warn(`Could not create block of type ${r.type}. Skipping.`),null;if(Array.isArray(r.children))for(const e of r.children)await this._putBlock(e,t,c,d,!0);if(i&&o)return"number"==typeof n.parentPosition?o.blocks.splice(n.parentPosition,0,c):o.blocks.push(c),c.parent=o,c;n.dontCopyScripts||this._updateScriptFieldReferences(e,c);return this._proxifyAndAttachTree(c,o,s,n.parentPosition)}async _createUnproxifiedBlock(e,t,a,n,i){let r=ee.instance.getTemplate(i.packageType||i.type,n.name,e);if(!r)return null;if(t){const e=r.template.clone().specialize(t);r={displayName:r.displayName,typeName:r.typeName,template:e,inputs:r.inputs,outputs:r.outputs}}const s=new ae(void 0,void 0,r.typeName,void 0,r.displayName,i),o=await this.itemRepo.createFieldsForItem(s,r.template,i,!0);return s.setFields(o),s.blocks=[],await this.itemRepo.createScriptsForItem(s,a,i,!1),s}_proxifyAndAttachTree(e,t,a,n){const i=e=>{if(Array.isArray(e.blocks)&&e.blocks.length)for(const t of e.blocks)i(t);const t=e.blocks.map((e=>g.instance.proxyBlock(e,a)));e.blocks=g.instance.proxyBlockArray(t,e,a),e.scripts=g.instance.proxyScriptArray(e.scripts,e,a)};i(e),e.parent=t;const r=g.instance.proxyBlock(e,a);return"number"==typeof n?t.blocks.splice(n,0,r):t.blocks.push(r),r}_findItemById(e){return this.itemRepo.findLoadedItem(e)}_findItemField(e,t){if(!e.fieldInstances)return null;for(const a of e.fieldInstances)if(a.name===t)return a;return null}_findParentBlock(e,t,a){const n=this._findItemField(e,t);if(!n)return null;const i=a.split("/");let r=n.blocks,s=null;for(const e of i)s=r[e],r=s.blocks;return s}_getBlockIndex(e){if(!e.parent)return 0;let t=0;for(const a of e.parent.blocks){if(e.id===a.id)return t;t++}throw new Error("Could not find block in parent block array!")}_getBlockPath(e){const t=[];let a=e;for(;a;)t.push(this._getBlockIndex(a)),a=a.parent;return"/"+t.reverse().join("/")}_serializeBlockFields(e){const t=[];if(!Array.isArray(e.fields))return t;for(const a of e.fields)switch(a.type){case"Link":t.push({name:a.name,linkto:a.value?._id});break;case"Attribute":t.push({name:a.name,value:a.value});break;case"Separator":t.push({name:a.name,type:"Separator"})}return t}_serializeScripts(e){const t=[];if(!Array.isArray(e.scripts))return t;for(const a of e.scripts){const e=[],n={item:a.item?.value?._id,fields:e};for(const t of a.fields)e.push({name:t.name,value:t.value});t.push(n)}return t}}function qr(){throw new Error("setTimeout has not been defined")}function Zr(){throw new Error("clearTimeout has not been defined")}Array.prototype.pushAll||(Array.prototype.pushAll=function(e){for(const t of e)this.push(t)}),Array.prototype.removeObject||(Array.prototype.removeObject=function(e){const t=this.indexOf(e);return t>-1&&(this.splice(t,1),!0)}),Array.prototype.moveObjectToArray||(Array.prototype.moveObjectToArray=function(e,t,a){const n=this.indexOf(e);if(n>-1){return(0,this.moveToArray)(n,t,a)}return!1}),Array.prototype.removeByFilterFunc||(Array.prototype.removeByFilterFunc=function(e){let t=0;for(let a=0;a<this.length;a++)e(this[a])&&(this.splice(a,1),a--,t++);return t}),Array.prototype.clone||(Array.prototype.clone=function(){const e=[];for(const t of this)e.push(t);return e});var Jr=qr,Kr=Zr;function Xr(e){if(Jr===setTimeout)return setTimeout(e,0);if((Jr===qr||!Jr)&&setTimeout)return Jr=setTimeout,setTimeout(e,0);try{return Jr(e,0)}catch(t){try{return Jr.call(null,e,0)}catch(t){return Jr.call(this,e,0)}}}"function"==typeof Mn.setTimeout&&(Jr=setTimeout),"function"==typeof Mn.clearTimeout&&(Kr=clearTimeout);var Qr,es=[],ts=!1,as=-1;function ns(){ts&&Qr&&(ts=!1,Qr.length?es=Qr.concat(es):as=-1,es.length&&is())}function is(){if(!ts){var e=Xr(ns);ts=!0;for(var t=es.length;t;){for(Qr=es,es=[];++as<t;)Qr&&Qr[as].run();as=-1,t=es.length}Qr=null,ts=!1,function(e){if(Kr===clearTimeout)return clearTimeout(e);if((Kr===Zr||!Kr)&&clearTimeout)return Kr=clearTimeout,clearTimeout(e);try{return Kr(e)}catch(t){try{return Kr.call(null,e)}catch(t){return Kr.call(this,e)}}}(e)}}function rs(e,t){this.fun=e,this.array=t}rs.prototype.run=function(){this.fun.apply(null,this.array)};function ss(){}var os=ss,ls=ss,us=ss,cs=ss,ds=ss,ps=ss,hs=ss;var fs=Mn.performance||{},ms=fs.now||fs.mozNow||fs.msNow||fs.oNow||fs.webkitNow||function(){return(new Date).getTime()};var ys=new Date;var gs={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var a=1;a<arguments.length;a++)t[a-1]=arguments[a];es.push(new rs(e,t)),1!==es.length||ts||Xr(is)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:os,addListener:ls,once:us,off:cs,removeListener:ds,removeAllListeners:ps,emit:hs,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*ms.call(fs),a=Math.floor(t),n=Math.floor(t%1*1e9);return e&&(a-=e[0],(n-=e[1])<0&&(a--,n+=1e9)),[a,n]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-ys)/1e3}};const bs=()=>new Map,vs=e=>{const t=bs();return e.forEach(((e,a)=>{t.set(a,e)})),t},_s=(e,t,a)=>{let n=e.get(t);return void 0===n&&e.set(t,n=a()),n},ws=()=>new Set,As=e=>e[e.length-1],ks=(e,t)=>{for(let a=0;a<t.length;a++)e.push(t[a])},Ss=Array.from,Ns=Array.isArray;class Ts{constructor(){this._observers=bs()}on(e,t){return _s(this._observers,e,ws).add(t),t}once(e,t){const a=(...n)=>{this.off(e,a),t(...n)};this.on(e,a)}off(e,t){const a=this._observers.get(e);void 0!==a&&(a.delete(t),0===a.size&&this._observers.delete(e))}emit(e,t){return Ss((this._observers.get(e)||bs()).values()).forEach((e=>e(...t)))}destroy(){this._observers=bs()}}class Ms{constructor(){this._observers=bs()}on(e,t){_s(this._observers,e,ws).add(t)}once(e,t){const a=(...n)=>{this.off(e,a),t(...n)};this.on(e,a)}off(e,t){const a=this._observers.get(e);void 0!==a&&(a.delete(t),0===a.size&&this._observers.delete(e))}emit(e,t){return Ss((this._observers.get(e)||bs()).values()).forEach((e=>e(...t)))}destroy(){this._observers=bs()}}const xs=Math.floor,Cs=Math.abs,Is=(e,t)=>e<t?e:t,Vs=(e,t)=>e>t?e:t,Es=Math.pow,Fs=e=>0!==e?e<0:1/e<0,Ds=64,Rs=128,Ls=127,Ps=Number.MAX_SAFE_INTEGER,Bs=Number.isInteger||(e=>"number"==typeof e&&isFinite(e)&&xs(e)===e),Os=String.fromCharCode,$s=/^\s*/g,Us=/([A-Z])/g,js=(e,t)=>(e=>e.replace($s,""))(e.replace(Us,(e=>`${t}${(e=>e.toLowerCase())(e)}`))),zs="undefined"!=typeof TextEncoder?new TextEncoder:null,Ws=zs?e=>zs.encode(e):e=>{const t=unescape(encodeURIComponent(e)),a=t.length,n=new Uint8Array(a);for(let e=0;e<a;e++)n[e]=t.codePointAt(e);return n};let Ys="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});Ys&&1===Ys.decode(new Uint8Array).length&&(Ys=null);class Hs{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const Gs=()=>new Hs,qs=e=>{let t=e.cpos;for(let a=0;a<e.bufs.length;a++)t+=e.bufs[a].length;return t},Zs=e=>{const t=new Uint8Array(qs(e));let a=0;for(let n=0;n<e.bufs.length;n++){const i=e.bufs[n];t.set(i,a),a+=i.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),a),t},Js=(e,t)=>{const a=e.cbuf.length;e.cpos===a&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(2*a),e.cpos=0),e.cbuf[e.cpos++]=t},Ks=Js,Xs=(e,t)=>{for(;t>Ls;)Js(e,Rs|Ls&t),t=xs(t/128);Js(e,Ls&t)},Qs=(e,t)=>{const a=Fs(t);for(a&&(t=-t),Js(e,(t>63?Rs:0)|(a?Ds:0)|63&t),t=xs(t/64);t>0;)Js(e,(t>Ls?Rs:0)|Ls&t),t=xs(t/128)},eo=new Uint8Array(3e4),to=eo.length/3,ao=zs&&zs.encodeInto?(e,t)=>{if(t.length<to){const a=zs.encodeInto(t,eo).written||0;Xs(e,a);for(let t=0;t<a;t++)Js(e,eo[t])}else io(e,Ws(t))}:(e,t)=>{const a=unescape(encodeURIComponent(t)),n=a.length;Xs(e,n);for(let t=0;t<n;t++)Js(e,a.codePointAt(t))},no=(e,t)=>{const a=e.cbuf.length,n=e.cpos,i=Is(a-n,t.length),r=t.length-i;e.cbuf.set(t.subarray(0,i),n),e.cpos+=i,r>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(Vs(2*a,r)),e.cbuf.set(t.subarray(i)),e.cpos=r)},io=(e,t)=>{Xs(e,t.byteLength),no(e,t)},ro=(e,t)=>{((e,t)=>{const a=e.cbuf.length;a-e.cpos<t&&(e.bufs.push(new Uint8Array(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(2*Vs(a,t)),e.cpos=0)})(e,t);const a=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,a},so=new DataView(new ArrayBuffer(4)),oo=(e,t)=>{switch(typeof t){case"string":Js(e,119),ao(e,t);break;case"number":Bs(t)&&Cs(t)<=2147483647?(Js(e,125),Qs(e,t)):(a=t,so.setFloat32(0,a),so.getFloat32(0)===a?(Js(e,124),((e,t)=>{ro(e,4).setFloat32(0,t,!1)})(e,t)):(Js(e,123),((e,t)=>{ro(e,8).setFloat64(0,t,!1)})(e,t)));break;case"bigint":Js(e,122),((e,t)=>{ro(e,8).setBigInt64(0,t,!1)})(e,t);break;case"object":if(null===t)Js(e,126);else if(Ns(t)){Js(e,117),Xs(e,t.length);for(let a=0;a<t.length;a++)oo(e,t[a])}else if(t instanceof Uint8Array)Js(e,116),io(e,t);else{Js(e,118);const a=Object.keys(t);Xs(e,a.length);for(let n=0;n<a.length;n++){const i=a[n];ao(e,i),oo(e,t[i])}}break;case"boolean":Js(e,t?120:121);break;default:Js(e,127)}var a};class lo extends Hs{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&Xs(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const uo=e=>{e.count>0&&(Qs(e.encoder,1===e.count?e.s:-e.s),e.count>1&&Xs(e.encoder,e.count-2))};class co{constructor(){this.encoder=new Hs,this.s=0,this.count=0}write(e){this.s===e?this.count++:(uo(this),this.count=1,this.s=e)}toUint8Array(){return uo(this),Zs(this.encoder)}}const po=e=>{if(e.count>0){const t=2*e.diff+(1===e.count?0:1);Qs(e.encoder,t),e.count>1&&Xs(e.encoder,e.count-2)}};class ho{constructor(){this.encoder=new Hs,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(po(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return po(this),Zs(this.encoder)}}class fo{constructor(){this.sarr=[],this.s="",this.lensE=new co}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new Hs;return this.sarr.push(this.s),this.s="",ao(e,this.sarr.join("")),no(e,this.lensE.toUint8Array()),Zs(e)}}const mo=e=>new Error(e),yo=()=>{throw mo("Method unimplemented")},go=()=>{throw mo("Unexpected case")},bo=mo("Unexpected end of array"),vo=mo("Integer out of Range");class _o{constructor(e){this.arr=e,this.pos=0}}const wo=e=>new _o(e),Ao=e=>((e,t)=>{const a=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,a})(e,So(e)),ko=e=>e.arr[e.pos++],So=e=>{let t=0,a=1;const n=e.arr.length;for(;e.pos<n;){const n=e.arr[e.pos++];if(t+=(n&Ls)*a,a*=128,n<Rs)return t;if(t>Ps)throw vo}throw bo},No=e=>{let t=e.arr[e.pos++],a=63&t,n=64;const i=(t&Ds)>0?-1:1;if(!(t&Rs))return i*a;const r=e.arr.length;for(;e.pos<r;){if(t=e.arr[e.pos++],a+=(t&Ls)*n,n*=128,t<Rs)return i*a;if(a>Ps)throw vo}throw bo},To=Ys?e=>Ys.decode(Ao(e)):e=>{let t=So(e);if(0===t)return"";{let a=String.fromCodePoint(ko(e));if(--t<100)for(;t--;)a+=String.fromCodePoint(ko(e));else for(;t>0;){const n=t<1e4?t:1e4,i=e.arr.subarray(e.pos,e.pos+n);e.pos+=n,a+=String.fromCodePoint.apply(null,i),t-=n}return decodeURIComponent(escape(a))}},Mo=(e,t)=>{const a=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,a},xo=[e=>{},e=>null,No,e=>Mo(e,4).getFloat32(0,!1),e=>Mo(e,8).getFloat64(0,!1),e=>Mo(e,8).getBigInt64(0,!1),e=>!1,e=>!0,To,e=>{const t=So(e),a={};for(let n=0;n<t;n++){a[To(e)]=Co(e)}return a},e=>{const t=So(e),a=[];for(let n=0;n<t;n++)a.push(Co(e));return a},Ao],Co=e=>xo[127-ko(e)](e);class Io extends _o{constructor(e,t){super(e),this.reader=t,this.s=null,this.count=0}read(){var e;return 0===this.count&&(this.s=this.reader(this),(e=this).pos!==e.arr.length?this.count=So(this)+1:this.count=-1),this.count--,this.s}}class Vo extends _o{constructor(e){super(e),this.s=0,this.count=0}read(){if(0===this.count){this.s=No(this);const e=Fs(this.s);this.count=1,e&&(this.s=-this.s,this.count=So(this)+2)}return this.count--,this.s}}class Eo extends _o{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(0===this.count){const e=No(this),t=1&e;this.diff=xs(e/2),this.count=1,t&&(this.count=So(this)+2)}return this.s+=this.diff,this.count--,this.s}}class Fo{constructor(e){this.decoder=new Vo(e),this.str=To(this.decoder),this.spos=0}read(){const e=this.spos+this.decoder.read(),t=this.str.slice(this.spos,e);return this.spos=e,t}}const Do=crypto.getRandomValues.bind(crypto),Ro=()=>Do(new Uint32Array(1))[0],Lo=[1e7]+-1e3+-4e3+-8e3+-1e11,Po=()=>Lo.replace(/[018]/g,(e=>(e^Ro()&15>>e/4).toString(16))),Bo=Date.now,Oo=e=>new Promise(e);Promise.all.bind(Promise);const $o=e=>void 0===e?null:e;let Uo=new class{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}},jo=!0;try{"undefined"!=typeof localStorage&&localStorage&&(Uo=localStorage,jo=!1)}catch(e){}const zo=Uo,Wo=Object.assign,Yo=Object.keys,Ho=e=>Yo(e).length,Go=e=>Yo(e).length,qo=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Zo=Object.freeze,Jo=e=>{for(const t in e){const a=e[t];"object"!=typeof a&&"function"!=typeof a||Jo(e[t])}return Zo(e)},Ko=Symbol("Equality"),Xo=(e,t,a=0)=>{try{for(;a<e.length;a++)e[a](...t)}finally{a<e.length&&Xo(e,t,a+1)}},Qo=e=>e,el=(e,t)=>{if(e===t)return!0;if(null==e||null==t||e.constructor!==t.constructor)return!1;if(null!=e[Ko])return e[Ko](t);switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:if(e.byteLength!==t.byteLength)return!1;for(let a=0;a<e.length;a++)if(e[a]!==t[a])return!1;break;case Set:if(e.size!==t.size)return!1;for(const a of e)if(!t.has(a))return!1;break;case Map:if(e.size!==t.size)return!1;for(const a of e.keys())if(!t.has(a)||!el(e.get(a),t.get(a)))return!1;break;case Object:if(Ho(e)!==Ho(t))return!1;for(const a in e)if(!qo(e,a)||!el(e[a],t[a]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let a=0;a<e.length;a++)if(!el(e[a],t[a]))return!1;break;default:return!1}return!0},tl=void 0!==gs&&gs.release&&/node|io\.js/.test(gs.release.name)&&"[object process]"===Object.prototype.toString.call(void 0!==gs?gs:0),al="undefined"!=typeof window&&"undefined"!=typeof document&&!tl;let nl;const il=e=>(()=>{if(void 0===nl)if(tl){nl=bs();const e=gs.argv;let t=null;for(let a=0;a<e.length;a++){const n=e[a];"-"===n[0]?(null!==t&&nl.set(t,""),t=n):null!==t&&(nl.set(t,n),t=null)}null!==t&&nl.set(t,"")}else"object"==typeof location?(nl=bs(),(location.search||"?").slice(1).split("&").forEach((e=>{if(0!==e.length){const[t,a]=e.split("=");nl.set(`--${js(t,"-")}`,a),nl.set(`-${js(t,"-")}`,a)}}))):nl=bs();return nl})().has(e),rl=e=>$o(tl?gs.env[e.toUpperCase().replaceAll("-","_")]:zo.getItem(e)),sl=e=>il("--"+e)||null!==rl(e);sl("production");var ol;const ll=tl&&(ol=gs.env.FORCE_COLOR,["true","1","2"].includes(ol))||!il("--no-colors")&&!sl("no-color")&&(!tl||gs.stdout.isTTY)&&(!tl||il("--color")||null!==rl("COLORTERM")||(rl("TERM")||"").includes("color")),ul=e=>new Uint8Array(e),cl=al?e=>{let t="";for(let a=0;a<e.byteLength;a++)t+=Os(e[a]);return btoa(t)}:e=>Un.from(e.buffer,e.byteOffset,e.byteLength).toString("base64"),dl=al?e=>{const t=atob(e),a=ul(t.length);for(let e=0;e<t.length;e++)a[e]=t.charCodeAt(e);return a}:e=>{const t=Un.from(e,"base64");return((e,t,a)=>new Uint8Array(e,t,a))(t.buffer,t.byteOffset,t.byteLength)};class pl{constructor(e,t){this.left=e,this.right=t}}const hl=(e,t)=>new pl(e,t);"undefined"!=typeof DOMParser&&new DOMParser;const fl=Symbol,ml=fl(),yl=fl(),gl=fl(),bl=fl(),vl=fl(),_l=fl(),wl=fl(),Al=fl(),kl=fl(),Sl={[ml]:hl("font-weight","bold"),[yl]:hl("font-weight","normal"),[gl]:hl("color","blue"),[vl]:hl("color","green"),[bl]:hl("color","grey"),[_l]:hl("color","red"),[wl]:hl("color","purple"),[Al]:hl("color","orange"),[kl]:hl("color","black")},Nl=ll?e=>{1===e.length&&e[0]?.constructor===Function&&(e=e[0]());const t=[],a=[],n=bs();let i=[],r=0;for(;r<e.length;r++){const i=e[r],s=Sl[i];if(void 0!==s)n.set(s.left,s.right);else{if(void 0===i)break;if(i.constructor!==String&&i.constructor!==Number)break;{const e=((e,t)=>{const a=[];for(const[n,i]of e)a.push(t(i,n));return a})(n,((e,t)=>`${t}:${e};`)).join("");r>0||e.length>0?(t.push("%c"+i),a.push(e)):t.push(i)}}}for(r>0&&(i=a,i.unshift(t.join("")));r<e.length;r++){const t=e[r];t instanceof Symbol||i.push(t)}return i}:e=>{1===e.length&&e[0]?.constructor===Function&&(e=e[0]());const t=[],a=[];let n=0;for(;n<e.length;n++){const a=e[n];if(void 0===a)break;if(a.constructor===String||a.constructor===Number)t.push(a);else if(a.constructor===Object)break}for(n>0&&a.push(t.join(""));n<e.length;n++){const t=e[n];t instanceof Symbol||a.push(t)}return a},Tl=ws(),Ml=e=>({[Symbol.iterator](){return this},next:e}),xl=(e,t)=>Ml((()=>{const{done:a,value:n}=e.next();return{done:a,value:a?void 0:t(n)}}));class Cl{constructor(e,t){this.clock=e,this.len=t}}class Il{constructor(){this.clients=new Map}}const Vl=(e,t,a)=>t.clients.forEach(((t,n)=>{const i=e.doc.store.clients.get(n);if(null!=i){const n=i[i.length-1],r=n.id.clock+n.length;for(let n=0,s=t[n];n<t.length&&s.clock<r;s=t[++n])wu(e,i,s.clock,s.len,a)}})),El=(e,t)=>{const a=e.clients.get(t.client);return void 0!==a&&null!==((e,t)=>{let a=0,n=e.length-1;for(;a<=n;){const i=xs((a+n)/2),r=e[i],s=r.clock;if(s<=t){if(t<s+r.len)return i;a=i+1}else n=i-1}return null})(a,t.clock)},Fl=e=>{e.clients.forEach((e=>{let t,a;for(e.sort(((e,t)=>e.clock-t.clock)),t=1,a=1;t<e.length;t++){const n=e[a-1],i=e[t];n.clock+n.len>=i.clock?n.len=Vs(n.len,i.clock+i.len-n.clock):(a<t&&(e[a]=i),a++)}e.length=a}))},Dl=(e,t,a,n)=>{_s(e.clients,t,(()=>[])).push(new Cl(a,n))},Rl=e=>{const t=new Il;return e.clients.forEach(((e,a)=>{const n=[];for(let t=0;t<e.length;t++){const a=e[t];if(a.deleted){const i=a.id.clock;let r=a.length;if(t+1<e.length)for(let a=e[t+1];t+1<e.length&&a.deleted;a=e[1+ ++t])r+=a.length;n.push(new Cl(i,r))}}n.length>0&&t.clients.set(a,n)})),t},Ll=(e,t)=>{Xs(e.restEncoder,t.clients.size),Ss(t.clients.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([t,a])=>{e.resetDsCurVal(),Xs(e.restEncoder,t);const n=a.length;Xs(e.restEncoder,n);for(let t=0;t<n;t++){const n=a[t];e.writeDsClock(n.clock),e.writeDsLen(n.len)}}))},Pl=e=>{const t=new Il,a=So(e.restDecoder);for(let n=0;n<a;n++){e.resetDsCurVal();const a=So(e.restDecoder),n=So(e.restDecoder);if(n>0){const i=_s(t.clients,a,(()=>[]));for(let t=0;t<n;t++)i.push(new Cl(e.readDsClock(),e.readDsLen()))}}return t},Bl=(e,t,a)=>{const n=new Il,i=So(e.restDecoder);for(let r=0;r<i;r++){e.resetDsCurVal();const i=So(e.restDecoder),r=So(e.restDecoder),s=a.clients.get(i)||[],o=fu(a,i);for(let a=0;a<r;a++){const a=e.readDsClock(),r=a+e.readDsLen();if(a<o){o<r&&Dl(n,i,o,r-o);let e=yu(s,a),l=s[e];for(!l.deleted&&l.id.clock<a&&(s.splice(e+1,0,id(t,l,a-l.id.clock)),e++);e<s.length&&(l=s[e++],l.id.clock<r);)l.deleted||(r<l.id.clock+l.length&&s.splice(e,0,id(t,l,r-l.id.clock)),l.delete(t))}else Dl(n,i,a,r-a)}}if(n.clients.size>0){const e=new ql;return Xs(e.restEncoder,0),Ll(e,n),e.toUint8Array()}return null},Ol=Ro;class $l extends Ts{constructor({guid:e=Po(),collectionid:t=null,gc:a=!0,gcFilter:n=()=>!0,meta:i=null,autoLoad:r=!1,shouldLoad:s=!0}={}){super(),this.gc=a,this.gcFilter=n,this.clientID=Ol(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new pu,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=s,this.autoLoad=r,this.meta=i,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=Oo((e=>{this.on("load",(()=>{this.isLoaded=!0,e(this)}))}));const o=()=>Oo((e=>{const t=a=>{void 0!==a&&!0!==a||(this.off("sync",t),e())};this.on("sync",t)}));this.on("sync",(e=>{!1===e&&this.isSynced&&(this.whenSynced=o()),this.isSynced=void 0===e||!0===e,this.isSynced&&!this.isLoaded&&this.emit("load",[this])})),this.whenSynced=o()}load(){const e=this._item;null===e||this.shouldLoad||Mu(e.parent.doc,(e=>{e.subdocsLoaded.add(this)}),null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(Ss(this.subdocs).map((e=>e.guid)))}transact(e,t=null){return Mu(this,e,t)}get(e,t=qu){const a=_s(this.share,e,(()=>{const e=new t;return e._integrate(this,null),e})),n=a.constructor;if(t!==qu&&n!==t){if(n===qu){const n=new t;n._map=a._map,a._map.forEach((e=>{for(;null!==e;e=e.left)e.parent=n})),n._start=a._start;for(let e=n._start;null!==e;e=e.right)e.parent=n;return n._length=a._length,this.share.set(e,n),n._integrate(this,null),n}throw new Error(`Type with the name ${e} has already been defined with a different constructor`)}return a}getArray(e=""){return this.get(e,pc)}getText(e=""){return this.get(e,Ic)}getMap(e=""){return this.get(e,fc)}getXmlElement(e=""){return this.get(e,Fc)}getXmlFragment(e=""){return this.get(e,Ec)}toJSON(){const e={};return this.share.forEach(((t,a)=>{e[a]=t.toJSON()})),e}destroy(){this.isDestroyed=!0,Ss(this.subdocs).forEach((e=>e.destroy()));const e=this._item;if(null!==e){this._item=null;const t=e.content;t.doc=new $l({guid:this.guid,...t.opts,shouldLoad:!1}),t.doc._item=e,Mu(e.parent.doc,(a=>{const n=t.doc;e.deleted||a.subdocsAdded.add(n),a.subdocsRemoved.add(this)}),null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class Ul{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return So(this.restDecoder)}readDsLen(){return So(this.restDecoder)}}class jl extends Ul{readLeftID(){return uu(So(this.restDecoder),So(this.restDecoder))}readRightID(){return uu(So(this.restDecoder),So(this.restDecoder))}readClient(){return So(this.restDecoder)}readInfo(){return ko(this.restDecoder)}readString(){return To(this.restDecoder)}readParentInfo(){return 1===So(this.restDecoder)}readTypeRef(){return So(this.restDecoder)}readLen(){return So(this.restDecoder)}readAny(){return Co(this.restDecoder)}readBuf(){return(e=>{const t=ul(e.byteLength);return t.set(e),t})(Ao(this.restDecoder))}readJSON(){return JSON.parse(To(this.restDecoder))}readKey(){return To(this.restDecoder)}}class zl{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=So(this.restDecoder),this.dsCurrVal}readDsLen(){const e=So(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class Wl extends zl{constructor(e){super(e),this.keys=[],So(e),this.keyClockDecoder=new Eo(Ao(e)),this.clientDecoder=new Vo(Ao(e)),this.leftClockDecoder=new Eo(Ao(e)),this.rightClockDecoder=new Eo(Ao(e)),this.infoDecoder=new Io(Ao(e),ko),this.stringDecoder=new Fo(Ao(e)),this.parentInfoDecoder=new Io(Ao(e),ko),this.typeRefDecoder=new Vo(Ao(e)),this.lenDecoder=new Vo(Ao(e))}readLeftID(){return new ou(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new ou(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return 1===this.parentInfoDecoder.read()}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return Co(this.restDecoder)}readBuf(){return Ao(this.restDecoder)}readJSON(){return Co(this.restDecoder)}readKey(){const e=this.keyClockDecoder.read();if(e<this.keys.length)return this.keys[e];{const e=this.stringDecoder.read();return this.keys.push(e),e}}}class Yl{constructor(){this.restEncoder=Gs()}toUint8Array(){return Zs(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){Xs(this.restEncoder,e)}writeDsLen(e){Xs(this.restEncoder,e)}}class Hl extends Yl{writeLeftID(e){Xs(this.restEncoder,e.client),Xs(this.restEncoder,e.clock)}writeRightID(e){Xs(this.restEncoder,e.client),Xs(this.restEncoder,e.clock)}writeClient(e){Xs(this.restEncoder,e)}writeInfo(e){Ks(this.restEncoder,e)}writeString(e){ao(this.restEncoder,e)}writeParentInfo(e){Xs(this.restEncoder,e?1:0)}writeTypeRef(e){Xs(this.restEncoder,e)}writeLen(e){Xs(this.restEncoder,e)}writeAny(e){oo(this.restEncoder,e)}writeBuf(e){io(this.restEncoder,e)}writeJSON(e){ao(this.restEncoder,JSON.stringify(e))}writeKey(e){ao(this.restEncoder,e)}}class Gl{constructor(){this.restEncoder=Gs(),this.dsCurrVal=0}toUint8Array(){return Zs(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const t=e-this.dsCurrVal;this.dsCurrVal=e,Xs(this.restEncoder,t)}writeDsLen(e){0===e&&go(),Xs(this.restEncoder,e-1),this.dsCurrVal+=e}}class ql extends Gl{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new ho,this.clientEncoder=new co,this.leftClockEncoder=new ho,this.rightClockEncoder=new ho,this.infoEncoder=new lo(Ks),this.stringEncoder=new fo,this.parentInfoEncoder=new lo(Ks),this.typeRefEncoder=new co,this.lenEncoder=new co}toUint8Array(){const e=Gs();return Xs(e,0),io(e,this.keyClockEncoder.toUint8Array()),io(e,this.clientEncoder.toUint8Array()),io(e,this.leftClockEncoder.toUint8Array()),io(e,this.rightClockEncoder.toUint8Array()),io(e,Zs(this.infoEncoder)),io(e,this.stringEncoder.toUint8Array()),io(e,Zs(this.parentInfoEncoder)),io(e,this.typeRefEncoder.toUint8Array()),io(e,this.lenEncoder.toUint8Array()),no(e,Zs(this.restEncoder)),Zs(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){oo(this.restEncoder,e)}writeBuf(e){io(this.restEncoder,e)}writeJSON(e){oo(this.restEncoder,e)}writeKey(e){const t=this.keyMap.get(e);void 0===t?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(t)}}const Zl=(e,t,a)=>{const n=new Map;a.forEach(((e,a)=>{fu(t,a)>e&&n.set(a,e)})),hu(t).forEach(((e,t)=>{a.has(t)||n.set(t,0)})),Xs(e.restEncoder,n.size),Ss(n.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([a,n])=>{((e,t,a,n)=>{n=Vs(n,t[0].id.clock);const i=yu(t,n);Xs(e.restEncoder,t.length-i),e.writeClient(a),Xs(e.restEncoder,n);const r=t[i];r.write(e,n-r.id.clock);for(let a=i+1;a<t.length;a++)t[a].write(e,0)})(e,t.clients.get(a),a,n)}))},Jl=(e,t,a,n=new Wl(e))=>Mu(t,(e=>{e.local=!1;let t=!1;const a=e.doc,i=a.store,r=((e,t)=>{const a=bs(),n=So(e.restDecoder);for(let i=0;i<n;i++){const n=So(e.restDecoder),i=new Array(n),r=e.readClient();let s=So(e.restDecoder);a.set(r,{i:0,refs:i});for(let a=0;a<n;a++){const n=e.readInfo();switch(31&n){case 0:{const t=e.readLen();i[a]=new Bc(uu(r,s),t),s+=t;break}case 10:{const t=So(e.restDecoder);i[a]=new ld(uu(r,s),t),s+=t;break}default:{const o=!(192&n),l=new rd(uu(r,s),null,(n&Rs)===Rs?e.readLeftID():null,null,(n&Ds)===Ds?e.readRightID():null,o?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,!o||32&~n?null:e.readString(),sd(e,n));i[a]=l,s+=l.length}}}}return a})(n,a),s=((e,t,a)=>{const n=[];let i=Ss(a.keys()).sort(((e,t)=>e-t));if(0===i.length)return null;const r=()=>{if(0===i.length)return null;let e=a.get(i[i.length-1]);for(;e.refs.length===e.i;){if(i.pop(),!(i.length>0))return null;e=a.get(i[i.length-1])}return e};let s=r();if(null===s)return null;const o=new pu,l=new Map,u=(e,t)=>{const a=l.get(e);(null==a||a>t)&&l.set(e,t)};let c=s.refs[s.i++];const d=new Map,p=()=>{for(const e of n){const t=e.id.client,n=a.get(t);n?(n.i--,o.clients.set(t,n.refs.slice(n.i)),a.delete(t),n.i=0,n.refs=[]):o.clients.set(t,[e]),i=i.filter((e=>e!==t))}n.length=0};for(;;){if(c.constructor!==ld){const i=_s(d,c.id.client,(()=>fu(t,c.id.client)))-c.id.clock;if(i<0)n.push(c),u(c.id.client,c.id.clock-1),p();else{const r=c.getMissing(e,t);if(null!==r){n.push(c);const e=a.get(r)||{refs:[],i:0};if(e.refs.length!==e.i){c=e.refs[e.i++];continue}u(r,fu(t,r)),p()}else(0===i||i<c.length)&&(c.integrate(e,i),d.set(c.id.client,c.id.clock+c.length))}}if(n.length>0)c=n.pop();else if(null!==s&&s.i<s.refs.length)c=s.refs[s.i++];else{if(s=r(),null===s)break;c=s.refs[s.i++]}}if(o.clients.size>0){const e=new ql;return Zl(e,o,new Map),Xs(e.restEncoder,0),{missing:l,update:e.toUint8Array()}}return null})(e,i,r),o=i.pendingStructs;if(o){for(const[e,a]of o.missing)if(a<fu(i,e)){t=!0;break}if(s){for(const[e,t]of s.missing){const a=o.missing.get(e);(null==a||a>t)&&o.missing.set(e,t)}o.update=Eu([o.update,s.update])}}else i.pendingStructs=s;const l=Bl(n,e,i);if(i.pendingDs){const t=new Wl(wo(i.pendingDs));So(t.restDecoder);const a=Bl(t,e,i);i.pendingDs=l&&a?Eu([l,a]):l||a}else i.pendingDs=l;if(t){const t=i.pendingStructs.update;i.pendingStructs=null,Kl(e.doc,t)}}),a,!1),Kl=(e,t,a,n=Wl)=>{const i=wo(t);Jl(i,e,a,new n(i))},Xl=(e,t=new Uint8Array([0]),a=new ql)=>{((e,t,a=new Map)=>{Zl(e,t.store,a),Ll(e,Rl(t.store))})(a,e,Ql(t));const n=[a.toUint8Array()];if(e.store.pendingDs&&n.push(e.store.pendingDs),e.store.pendingStructs&&n.push(Fu(e.store.pendingStructs.update,t)),n.length>1){if(a.constructor===Hl)return Iu(n.map(((e,t)=>0===t?e:Pu(e))));if(a.constructor===ql)return Eu(n)}return n[0]},Ql=e=>(e=>{const t=new Map,a=So(e.restDecoder);for(let n=0;n<a;n++){const a=So(e.restDecoder),n=So(e.restDecoder);t.set(a,n)}return t})(new Ul(wo(e))),eu=(e,t)=>(Xs(e.restEncoder,t.size),Ss(t.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([t,a])=>{Xs(e.restEncoder,t),Xs(e.restEncoder,a)})),e),tu=(e,t=new Gl)=>(e instanceof Map?eu(t,e):((e,t)=>{eu(e,hu(t.store))})(t,e),t.toUint8Array());class au{constructor(){this.l=[]}}const nu=()=>new au,iu=(e,t)=>e.l.push(t),ru=(e,t)=>{const a=e.l,n=a.length;e.l=a.filter((e=>t!==e)),n===e.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},su=(e,t,a)=>Xo(e.l,[t,a]);class ou{constructor(e,t){this.client=e,this.clock=t}}const lu=(e,t)=>e===t||null!==e&&null!==t&&e.client===t.client&&e.clock===t.clock,uu=(e,t)=>new ou(e,t),cu=(e,t)=>void 0===t?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!El(t.ds,e.id),du=(e,t)=>{const a=_s(e.meta,du,ws),n=e.doc.store;a.has(t)||(t.sv.forEach(((t,a)=>{t<fu(n,a)&&vu(e,uu(a,t))})),Vl(e,t.ds,(e=>{})),a.add(t))};class pu{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const hu=e=>{const t=new Map;return e.clients.forEach(((e,a)=>{const n=e[e.length-1];t.set(a,n.id.clock+n.length)})),t},fu=(e,t)=>{const a=e.clients.get(t);if(void 0===a)return 0;const n=a[a.length-1];return n.id.clock+n.length},mu=(e,t)=>{let a=e.clients.get(t.id.client);if(void 0===a)a=[],e.clients.set(t.id.client,a);else{const e=a[a.length-1];if(e.id.clock+e.length!==t.id.clock)throw go()}a.push(t)},yu=(e,t)=>{let a=0,n=e.length-1,i=e[n],r=i.id.clock;if(r===t)return n;let s=xs(t/(r+i.length-1)*n);for(;a<=n;){if(i=e[s],r=i.id.clock,r<=t){if(t<r+i.length)return s;a=s+1}else n=s-1;s=xs((a+n)/2)}throw go()},gu=(e,t)=>{const a=e.clients.get(t.client);return a[yu(a,t.clock)]},bu=(e,t,a)=>{const n=yu(t,a),i=t[n];return i.id.clock<a&&i instanceof rd?(t.splice(n+1,0,id(e,i,a-i.id.clock)),n+1):n},vu=(e,t)=>{const a=e.doc.store.clients.get(t.client);return a[bu(e,a,t.clock)]},_u=(e,t,a)=>{const n=t.clients.get(a.client),i=yu(n,a.clock),r=n[i];return a.clock!==r.id.clock+r.length-1&&r.constructor!==Bc&&n.splice(i+1,0,id(e,r,a.clock-r.id.clock+1)),r},wu=(e,t,a,n,i)=>{if(0===n)return;const r=a+n;let s,o=bu(e,t,a);do{s=t[o++],r<s.id.clock+s.length&&bu(e,t,r),i(s)}while(o<t.length&&t[o].id.clock<r)};class Au{constructor(e,t,a){this.doc=e,this.deleteSet=new Il,this.beforeState=hu(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=t,this.meta=new Map,this.local=a,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const ku=(e,t)=>!(0===t.deleteSet.clients.size&&!((e,t)=>{for(const[a,n]of e)if(t(n,a))return!0;return!1})(t.afterState,((e,a)=>t.beforeState.get(a)!==e)))&&(Fl(t.deleteSet),((e,t)=>{Zl(e,t.doc.store,t.beforeState)})(e,t),Ll(e,t.deleteSet),!0),Su=(e,t,a)=>{const n=t._item;(null===n||n.id.clock<(e.beforeState.get(n.id.client)||0)&&!n.deleted)&&_s(e.changed,t,ws).add(a)},Nu=(e,t)=>{let a=e[t],n=e[t-1],i=t;for(;i>0&&(n.deleted===a.deleted&&n.constructor===a.constructor&&n.mergeWith(a));a=n,n=e[--i-1])a instanceof rd&&null!==a.parentSub&&a.parent._map.get(a.parentSub)===a&&a.parent._map.set(a.parentSub,n);const r=t-i;return r&&e.splice(t+1-r,r),r},Tu=(e,t)=>{if(t<e.length){const a=e[t],n=a.doc,i=n.store,r=a.deleteSet,s=a._mergeStructs;try{Fl(r),a.afterState=hu(a.doc.store),n.emit("beforeObserverCalls",[a,n]);const e=[];a.changed.forEach(((t,n)=>e.push((()=>{null!==n._item&&n._item.deleted||n._callObserver(a,t)})))),e.push((()=>{a.changedParentTypes.forEach(((e,t)=>{t._dEH.l.length>0&&(null===t._item||!t._item.deleted)&&((e=e.filter((e=>null===e.target._item||!e.target._item.deleted))).forEach((e=>{e.currentTarget=t,e._path=null})),e.sort(((e,t)=>e.path.length-t.path.length)),su(t._dEH,e,a))}))})),e.push((()=>n.emit("afterTransaction",[a,n]))),Xo(e,[]),a._needFormattingCleanup&&Mc(a)}finally{n.gc&&((e,t,a)=>{for(const[n,i]of e.clients.entries()){const e=t.clients.get(n);for(let n=i.length-1;n>=0;n--){const r=i[n],s=r.clock+r.len;for(let n=yu(e,r.clock),i=e[n];n<e.length&&i.id.clock<s;i=e[++n]){const i=e[n];if(r.clock+r.len<=i.id.clock)break;i instanceof rd&&i.deleted&&!i.keep&&a(i)&&i.gc(t,!1)}}}})(r,i,n.gcFilter),((e,t)=>{e.clients.forEach(((e,a)=>{const n=t.clients.get(a);for(let t=e.length-1;t>=0;t--){const a=e[t];for(let e=Is(n.length-1,1+yu(n,a.clock+a.len-1)),t=n[e];e>0&&t.id.clock>=a.clock;t=n[e])e-=1+Nu(n,e)}}))})(r,i),a.afterState.forEach(((e,t)=>{const n=a.beforeState.get(t)||0;if(n!==e){const e=i.clients.get(t),a=Vs(yu(e,n),1);for(let t=e.length-1;t>=a;)t-=1+Nu(e,t)}}));for(let e=s.length-1;e>=0;e--){const{client:t,clock:a}=s[e].id,n=i.clients.get(t),r=yu(n,a);r+1<n.length&&Nu(n,r+1)>1||r>0&&Nu(n,r)}if(a.local||a.afterState.get(n.clientID)===a.beforeState.get(n.clientID)||(((...e)=>{console.log(...Nl(e)),Tl.forEach((t=>t.print(e)))})(Al,ml,"[yjs] ",yl,_l,"Changed the client-id because another client seems to be using it."),n.clientID=Ol()),n.emit("afterTransactionCleanup",[a,n]),n._observers.has("update")){const e=new Hl;ku(e,a)&&n.emit("update",[e.toUint8Array(),a.origin,n,a])}if(n._observers.has("updateV2")){const e=new ql;ku(e,a)&&n.emit("updateV2",[e.toUint8Array(),a.origin,n,a])}const{subdocsAdded:o,subdocsLoaded:l,subdocsRemoved:u}=a;(o.size>0||u.size>0||l.size>0)&&(o.forEach((e=>{e.clientID=n.clientID,null==e.collectionid&&(e.collectionid=n.collectionid),n.subdocs.add(e)})),u.forEach((e=>n.subdocs.delete(e))),n.emit("subdocs",[{loaded:l,added:o,removed:u},n,a]),u.forEach((e=>e.destroy()))),e.length<=t+1?(n._transactionCleanups=[],n.emit("afterAllTransactions",[n,e])):Tu(e,t+1)}}},Mu=(e,t,a=null,n=!0)=>{const i=e._transactionCleanups;let r=!1,s=null;null===e._transaction&&(r=!0,e._transaction=new Au(e,a,n),i.push(e._transaction),1===i.length&&e.emit("beforeAllTransactions",[e]),e.emit("beforeTransaction",[e._transaction,e]));try{s=t(e._transaction)}finally{if(r){const t=e._transaction===i[0];e._transaction=null,t&&Tu(i,0)}}return s};class xu{constructor(e,t){this.gen=function*(e){const t=So(e.restDecoder);for(let a=0;a<t;a++){const t=So(e.restDecoder),a=e.readClient();let n=So(e.restDecoder);for(let i=0;i<t;i++){const t=e.readInfo();if(10===t){const t=So(e.restDecoder);yield new ld(uu(a,n),t),n+=t}else if(31&t){const i=!(192&t),r=new rd(uu(a,n),null,(t&Rs)===Rs?e.readLeftID():null,null,(t&Ds)===Ds?e.readRightID():null,i?e.readParentInfo()?e.readString():e.readLeftID():null,!i||32&~t?null:e.readString(),sd(e,t));yield r,n+=r.length}else{const t=e.readLen();yield new Bc(uu(a,n),t),n+=t}}}}(e),this.curr=null,this.done=!1,this.filterSkips=t,this.next()}next(){do{this.curr=this.gen.next().value||null}while(this.filterSkips&&null!==this.curr&&this.curr.constructor===ld);return this.curr}}class Cu{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}}const Iu=e=>Eu(e,jl,Hl),Vu=(e,t)=>{if(e.constructor===Bc){const{client:a,clock:n}=e.id;return new Bc(uu(a,n+t),e.length-t)}if(e.constructor===ld){const{client:a,clock:n}=e.id;return new ld(uu(a,n+t),e.length-t)}{const a=e,{client:n,clock:i}=a.id;return new rd(uu(n,i+t),null,uu(n,i+t-1),null,a.rightOrigin,a.parent,a.parentSub,a.content.splice(t))}},Eu=(e,t=Wl,a=ql)=>{if(1===e.length)return e[0];const n=e.map((e=>new t(wo(e))));let i=n.map((e=>new xu(e,!0))),r=null;const s=new a,o=new Cu(s);for(;i=i.filter((e=>null!==e.curr)),i.sort(((e,t)=>{if(e.curr.id.client===t.curr.id.client){const a=e.curr.id.clock-t.curr.id.clock;return 0===a?e.curr.constructor===t.curr.constructor?0:e.curr.constructor===ld?1:-1:a}return t.curr.id.client-e.curr.id.client})),0!==i.length;){const e=i[0],t=e.curr.id.client;if(null!==r){let a=e.curr,n=!1;for(;null!==a&&a.id.clock+a.length<=r.struct.id.clock+r.struct.length&&a.id.client>=r.struct.id.client;)a=e.next(),n=!0;if(null===a||a.id.client!==t||n&&a.id.clock>r.struct.id.clock+r.struct.length)continue;if(t!==r.struct.id.client)Ru(o,r.struct,r.offset),r={struct:a,offset:0},e.next();else if(r.struct.id.clock+r.struct.length<a.id.clock)if(r.struct.constructor===ld)r.struct.length=a.id.clock+a.length-r.struct.id.clock;else{Ru(o,r.struct,r.offset);const e=a.id.clock-r.struct.id.clock-r.struct.length;r={struct:new ld(uu(t,r.struct.id.clock+r.struct.length),e),offset:0}}else{const t=r.struct.id.clock+r.struct.length-a.id.clock;t>0&&(r.struct.constructor===ld?r.struct.length-=t:a=Vu(a,t)),r.struct.mergeWith(a)||(Ru(o,r.struct,r.offset),r={struct:a,offset:0},e.next())}}else r={struct:e.curr,offset:0},e.next();for(let a=e.curr;null!==a&&a.id.client===t&&a.id.clock===r.struct.id.clock+r.struct.length&&a.constructor!==ld;a=e.next())Ru(o,r.struct,r.offset),r={struct:a,offset:0}}null!==r&&(Ru(o,r.struct,r.offset),r=null),Lu(o);const l=(e=>{const t=new Il;for(let a=0;a<e.length;a++)e[a].clients.forEach(((n,i)=>{if(!t.clients.has(i)){const r=n.slice();for(let t=a+1;t<e.length;t++)ks(r,e[t].clients.get(i)||[]);t.clients.set(i,r)}}));return Fl(t),t})(n.map((e=>Pl(e))));return Ll(s,l),s.toUint8Array()},Fu=(e,t,a=Wl,n=ql)=>{const i=Ql(t),r=new n,s=new Cu(r),o=new a(wo(e)),l=new xu(o,!1);for(;l.curr;){const e=l.curr,t=e.id.client,a=i.get(t)||0;if(l.curr.constructor!==ld)if(e.id.clock+e.length>a)for(Ru(s,e,Vs(a-e.id.clock,0)),l.next();l.curr&&l.curr.id.client===t;)Ru(s,l.curr,0),l.next();else for(;l.curr&&l.curr.id.client===t&&l.curr.id.clock+l.curr.length<=a;)l.next();else l.next()}Lu(s);const u=Pl(o);return Ll(r,u),r.toUint8Array()},Du=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:Zs(e.encoder.restEncoder)}),e.encoder.restEncoder=Gs(),e.written=0)},Ru=(e,t,a)=>{e.written>0&&e.currClient!==t.id.client&&Du(e),0===e.written&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),Xs(e.encoder.restEncoder,t.id.clock+a)),t.write(e.encoder,a),e.written++},Lu=e=>{Du(e);const t=e.encoder.restEncoder;Xs(t,e.clientStructs.length);for(let a=0;a<e.clientStructs.length;a++){const n=e.clientStructs[a];Xs(t,n.written),no(t,n.restEncoder)}},Pu=e=>((e,t,a,n)=>{const i=new a(wo(e)),r=new xu(i,!1),s=new n,o=new Cu(s);for(let e=r.curr;null!==e;e=r.next())Ru(o,t(e),0);Lu(o);const l=Pl(i);return Ll(s,l),s.toUint8Array()})(e,Qo,Wl,Hl),Bu="You must not compute changes after the event-handler fired.";class Ou{constructor(e,t){this.target=e,this.currentTarget=e,this.transaction=t,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=$u(this.currentTarget,this.target))}deletes(e){return El(this.transaction.deleteSet,e.id)}get keys(){if(null===this._keys){if(0===this.transaction.doc._transactionCleanups.length)throw mo(Bu);const e=new Map,t=this.target;this.transaction.changed.get(t).forEach((a=>{if(null!==a){const n=t._map.get(a);let i,r;if(this.adds(n)){let e=n.left;for(;null!==e&&this.adds(e);)e=e.left;if(this.deletes(n)){if(null===e||!this.deletes(e))return;i="delete",r=As(e.content.getContent())}else null!==e&&this.deletes(e)?(i="update",r=As(e.content.getContent())):(i="add",r=void 0)}else{if(!this.deletes(n))return;i="delete",r=As(n.content.getContent())}e.set(a,{action:i,oldValue:r})}})),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(null===e){if(0===this.transaction.doc._transactionCleanups.length)throw mo(Bu);const t=this.target,a=ws(),n=ws(),i=[];e={added:a,deleted:n,delta:i,keys:this.keys};if(this.transaction.changed.get(t).has(null)){let e=null;const r=()=>{e&&i.push(e)};for(let i=t._start;null!==i;i=i.right)i.deleted?this.deletes(i)&&!this.adds(i)&&(null!==e&&void 0!==e.delete||(r(),e={delete:0}),e.delete+=i.length,n.add(i)):this.adds(i)?(null!==e&&void 0!==e.insert||(r(),e={insert:[]}),e.insert=e.insert.concat(i.content.getContent()),a.add(i)):(null!==e&&void 0!==e.retain||(r(),e={retain:0}),e.retain+=i.length);null!==e&&void 0===e.retain&&r()}this._changes=e}return e}}const $u=(e,t)=>{const a=[];for(;null!==t._item&&t!==e;){if(null!==t._item.parentSub)a.unshift(t._item.parentSub);else{let e=0,n=t._item.parent._start;for(;n!==t._item&&null!==n;)!n.deleted&&n.countable&&(e+=n.length),n=n.right;a.unshift(e)}t=t._item.parent}return a},Uu=()=>{((...e)=>{console.warn(...Nl(e)),e.unshift(Al),Tl.forEach((t=>t.print(e)))})("Invalid access: Add Yjs type to a document before reading data.")};let ju=0;class zu{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=ju++}}const Wu=(e,t,a)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=a,e.timestamp=ju++},Yu=(e,t)=>{if(null===e._start||0===t||null===e._searchMarker)return null;const a=0===e._searchMarker.length?null:e._searchMarker.reduce(((e,a)=>Cs(t-e.index)<Cs(t-a.index)?e:a));let n=e._start,i=0;for(null!==a&&(n=a.p,i=a.index,(e=>{e.timestamp=ju++})(a));null!==n.right&&i<t;){if(!n.deleted&&n.countable){if(t<i+n.length)break;i+=n.length}n=n.right}for(;null!==n.left&&i>t;)n=n.left,!n.deleted&&n.countable&&(i-=n.length);for(;null!==n.left&&n.left.id.client===n.id.client&&n.left.id.clock+n.left.length===n.id.clock;)n=n.left,!n.deleted&&n.countable&&(i-=n.length);return null!==a&&Cs(a.index-i)<n.parent.length/80?(Wu(a,n,i),a):((e,t,a)=>{if(e.length>=80){const n=e.reduce(((e,t)=>e.timestamp<t.timestamp?e:t));return Wu(n,t,a),n}{const n=new zu(t,a);return e.push(n),n}})(e._searchMarker,n,i)},Hu=(e,t,a)=>{for(let n=e.length-1;n>=0;n--){const i=e[n];if(a>0){let t=i.p;for(t.marker=!1;t&&(t.deleted||!t.countable);)t=t.left,t&&!t.deleted&&t.countable&&(i.index-=t.length);if(null===t||!0===t.marker){e.splice(n,1);continue}i.p=t,t.marker=!0}(t<i.index||a>0&&t===i.index)&&(i.index=Vs(t,i.index+a))}},Gu=(e,t,a)=>{const n=e,i=t.changedParentTypes;for(;_s(i,e,(()=>[])).push(a),null!==e._item;)e=e._item.parent;su(n._eH,a,t)};class qu{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=nu(),this._dEH=nu(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw yo()}clone(){throw yo()}_write(e){}get _first(){let e=this._start;for(;null!==e&&e.deleted;)e=e.right;return e}_callObserver(e,t){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){iu(this._eH,e)}observeDeep(e){iu(this._dEH,e)}unobserve(e){ru(this._eH,e)}unobserveDeep(e){ru(this._dEH,e)}toJSON(){}}const Zu=(e,t,a)=>{e.doc??Uu(),t<0&&(t=e._length+t),a<0&&(a=e._length+a);let n=a-t;const i=[];let r=e._start;for(;null!==r&&n>0;){if(r.countable&&!r.deleted){const e=r.content.getContent();if(e.length<=t)t-=e.length;else{for(let a=t;a<e.length&&n>0;a++)i.push(e[a]),n--;t=0}}r=r.right}return i},Ju=e=>{e.doc??Uu();const t=[];let a=e._start;for(;null!==a;){if(a.countable&&!a.deleted){const e=a.content.getContent();for(let a=0;a<e.length;a++)t.push(e[a])}a=a.right}return t},Ku=(e,t)=>{let a=0,n=e._start;for(e.doc??Uu();null!==n;){if(n.countable&&!n.deleted){const i=n.content.getContent();for(let n=0;n<i.length;n++)t(i[n],a++,e)}n=n.right}},Xu=(e,t)=>{const a=[];return Ku(e,((n,i)=>{a.push(t(n,i,e))})),a},Qu=e=>{let t=e._start,a=null,n=0;return{[Symbol.iterator](){return this},next:()=>{if(null===a){for(;null!==t&&t.deleted;)t=t.right;if(null===t)return{done:!0,value:void 0};a=t.content.getContent(),n=0,t=t.right}const e=a[n++];return a.length<=n&&(a=null),{done:!1,value:e}}}},ec=(e,t)=>{e.doc??Uu();const a=Yu(e,t);let n=e._start;for(null!==a&&(n=a.p,t-=a.index);null!==n;n=n.right)if(!n.deleted&&n.countable){if(t<n.length)return n.content.getContent()[t];t-=n.length}},tc=(e,t,a,n)=>{let i=a;const r=e.doc,s=r.clientID,o=r.store,l=null===a?t._start:a.right;let u=[];const c=()=>{u.length>0&&(i=new rd(uu(s,fu(o,s)),i,i&&i.lastId,l,l&&l.id,t,null,new Gc(u)),i.integrate(e,0),u=[])};n.forEach((a=>{if(null===a)u.push(a);else switch(a.constructor){case Number:case Object:case Boolean:case Array:case String:u.push(a);break;default:switch(c(),a.constructor){case Uint8Array:case ArrayBuffer:i=new rd(uu(s,fu(o,s)),i,i&&i.lastId,l,l&&l.id,t,null,new Oc(new Uint8Array(a))),i.integrate(e,0);break;case $l:i=new rd(uu(s,fu(o,s)),i,i&&i.lastId,l,l&&l.id,t,null,new jc(a)),i.integrate(e,0);break;default:if(!(a instanceof qu))throw new Error("Unexpected content type in insert operation");i=new rd(uu(s,fu(o,s)),i,i&&i.lastId,l,l&&l.id,t,null,new nd(a)),i.integrate(e,0)}}})),c()},ac=()=>mo("Length exceeded!"),nc=(e,t,a,n)=>{if(a>t._length)throw ac();if(0===a)return t._searchMarker&&Hu(t._searchMarker,a,n.length),tc(e,t,null,n);const i=a,r=Yu(t,a);let s=t._start;for(null!==r&&(s=r.p,0===(a-=r.index)&&(s=s.prev,a+=s&&s.countable&&!s.deleted?s.length:0));null!==s;s=s.right)if(!s.deleted&&s.countable){if(a<=s.length){a<s.length&&vu(e,uu(s.id.client,s.id.clock+a));break}a-=s.length}return t._searchMarker&&Hu(t._searchMarker,i,n.length),tc(e,t,s,n)},ic=(e,t,a,n)=>{if(0===n)return;const i=a,r=n,s=Yu(t,a);let o=t._start;for(null!==s&&(o=s.p,a-=s.index);null!==o&&a>0;o=o.right)!o.deleted&&o.countable&&(a<o.length&&vu(e,uu(o.id.client,o.id.clock+a)),a-=o.length);for(;n>0&&null!==o;)o.deleted||(n<o.length&&vu(e,uu(o.id.client,o.id.clock+n)),o.delete(e),n-=o.length),o=o.right;if(n>0)throw ac();t._searchMarker&&Hu(t._searchMarker,i,-r+n)},rc=(e,t,a)=>{const n=t._map.get(a);void 0!==n&&n.delete(e)},sc=(e,t,a,n)=>{const i=t._map.get(a)||null,r=e.doc,s=r.clientID;let o;if(null==n)o=new Gc([n]);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:o=new Gc([n]);break;case Uint8Array:o=new Oc(n);break;case $l:o=new jc(n);break;default:if(!(n instanceof qu))throw new Error("Unexpected content type");o=new nd(n)}new rd(uu(s,fu(r.store,s)),i,i&&i.lastId,null,null,t,a,o).integrate(e,0)},oc=(e,t)=>{e.doc??Uu();const a=e._map.get(t);return void 0===a||a.deleted?void 0:a.content.getContent()[a.length-1]},lc=e=>{const t={};return e.doc??Uu(),e._map.forEach(((e,a)=>{e.deleted||(t[a]=e.content.getContent()[e.length-1])})),t},uc=(e,t)=>{e.doc??Uu();const a=e._map.get(t);return void 0!==a&&!a.deleted},cc=e=>{return e.doc??Uu(),t=e._map.entries(),a=e=>!e[1].deleted,Ml((()=>{let e;do{e=t.next()}while(!e.done&&!a(e.value));return e}));var t,a};class dc extends Ou{}class pc extends qu{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const t=new pc;return t.push(e),t}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new pc}clone(){const e=new pc;return e.insert(0,this.toArray().map((e=>e instanceof qu?e.clone():e))),e}get length(){return this.doc??Uu(),this._length}_callObserver(e,t){super._callObserver(e,t),Gu(this,e,new dc(this,e))}insert(e,t){null!==this.doc?Mu(this.doc,(a=>{nc(a,this,e,t)})):this._prelimContent.splice(e,0,...t)}push(e){null!==this.doc?Mu(this.doc,(t=>{((e,t,a)=>{let n=(t._searchMarker||[]).reduce(((e,t)=>t.index>e.index?t:e),{index:0,p:t._start}).p;if(n)for(;n.right;)n=n.right;tc(e,t,n,a)})(t,this,e)})):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,t=1){null!==this.doc?Mu(this.doc,(a=>{ic(a,this,e,t)})):this._prelimContent.splice(e,t)}get(e){return ec(this,e)}toArray(){return Ju(this)}slice(e=0,t=this.length){return Zu(this,e,t)}toJSON(){return this.map((e=>e instanceof qu?e.toJSON():e))}map(e){return Xu(this,e)}forEach(e){Ku(this,e)}[Symbol.iterator](){return Qu(this)}_write(e){e.writeTypeRef(Jc)}}class hc extends Ou{constructor(e,t,a){super(e,t),this.keysChanged=a}}class fc extends qu{constructor(e){super(),this._prelimContent=null,this._prelimContent=void 0===e?new Map:new Map(e)}_integrate(e,t){super._integrate(e,t),this._prelimContent.forEach(((e,t)=>{this.set(t,e)})),this._prelimContent=null}_copy(){return new fc}clone(){const e=new fc;return this.forEach(((t,a)=>{e.set(a,t instanceof qu?t.clone():t)})),e}_callObserver(e,t){Gu(this,e,new hc(this,e,t))}toJSON(){this.doc??Uu();const e={};return this._map.forEach(((t,a)=>{if(!t.deleted){const n=t.content.getContent()[t.length-1];e[a]=n instanceof qu?n.toJSON():n}})),e}get size(){return[...cc(this)].length}keys(){return xl(cc(this),(e=>e[0]))}values(){return xl(cc(this),(e=>e[1].content.getContent()[e[1].length-1]))}entries(){return xl(cc(this),(e=>[e[0],e[1].content.getContent()[e[1].length-1]]))}forEach(e){this.doc??Uu(),this._map.forEach(((t,a)=>{t.deleted||e(t.content.getContent()[t.length-1],a,this)}))}[Symbol.iterator](){return this.entries()}delete(e){null!==this.doc?Mu(this.doc,(t=>{rc(t,this,e)})):this._prelimContent.delete(e)}set(e,t){return null!==this.doc?Mu(this.doc,(a=>{sc(a,this,e,t)})):this._prelimContent.set(e,t),t}get(e){return oc(this,e)}has(e){return uc(this,e)}clear(){null!==this.doc?Mu(this.doc,(e=>{this.forEach((function(t,a,n){rc(e,n,a)}))})):this._prelimContent.clear()}_write(e){e.writeTypeRef(Kc)}}const mc=(e,t)=>e===t||"object"==typeof e&&"object"==typeof t&&e&&t&&((e,t)=>e===t||Go(e)===Go(t)&&((e,t)=>{for(const a in e)if(!t(e[a],a))return!1;return!0})(e,((e,a)=>(void 0!==e||qo(t,a))&&t[a]===e)))(e,t);class yc{constructor(e,t,a,n){this.left=e,this.right=t,this.index=a,this.currentAttributes=n}forward(){if(null===this.right&&go(),this.right.content.constructor===Wc)this.right.deleted||_c(this.currentAttributes,this.right.content);else this.right.deleted||(this.index+=this.right.length);this.left=this.right,this.right=this.right.right}}const gc=(e,t,a)=>{for(;null!==t.right&&a>0;){if(t.right.content.constructor===Wc)t.right.deleted||_c(t.currentAttributes,t.right.content);else t.right.deleted||(a<t.right.length&&vu(e,uu(t.right.id.client,t.right.id.clock+a)),t.index+=t.right.length,a-=t.right.length);t.left=t.right,t.right=t.right.right}return t},bc=(e,t,a,n)=>{const i=new Map,r=n?Yu(t,a):null;if(r){const t=new yc(r.p.left,r.p,r.index,i);return gc(e,t,a-r.index)}{const n=new yc(null,t._start,0,i);return gc(e,n,a)}},vc=(e,t,a,n)=>{for(;null!==a.right&&(!0===a.right.deleted||a.right.content.constructor===Wc&&mc(n.get(a.right.content.key),a.right.content.value));)a.right.deleted||n.delete(a.right.content.key),a.forward();const i=e.doc,r=i.clientID;n.forEach(((n,s)=>{const o=a.left,l=a.right,u=new rd(uu(r,fu(i.store,r)),o,o&&o.lastId,l,l&&l.id,t,null,new Wc(s,n));u.integrate(e,0),a.right=u,a.forward()}))},_c=(e,t)=>{const{key:a,value:n}=t;null===n?e.delete(a):e.set(a,n)},wc=(e,t)=>{for(;null!==e.right&&(e.right.deleted||e.right.content.constructor===Wc&&mc(t[e.right.content.key]??null,e.right.content.value));)e.forward()},Ac=(e,t,a,n)=>{const i=e.doc,r=i.clientID,s=new Map;for(const o in n){const l=n[o],u=a.currentAttributes.get(o)??null;if(!mc(u,l)){s.set(o,u);const{left:n,right:c}=a;a.right=new rd(uu(r,fu(i.store,r)),n,n&&n.lastId,c,c&&c.id,t,null,new Wc(o,l)),a.right.integrate(e,0),a.forward()}}return s},kc=(e,t,a,n,i)=>{a.currentAttributes.forEach(((e,t)=>{void 0===i[t]&&(i[t]=null)}));const r=e.doc,s=r.clientID;wc(a,i);const o=Ac(e,t,a,i),l=n.constructor===String?new qc(n):n instanceof qu?new nd(n):new zc(n);let{left:u,right:c,index:d}=a;t._searchMarker&&Hu(t._searchMarker,a.index,l.getLength()),c=new rd(uu(s,fu(r.store,s)),u,u&&u.lastId,c,c&&c.id,t,null,l),c.integrate(e,0),a.right=c,a.index=d,a.forward(),vc(e,t,a,o)},Sc=(e,t,a,n,i)=>{const r=e.doc,s=r.clientID;wc(a,i);const o=Ac(e,t,a,i);e:for(;null!==a.right&&(n>0||o.size>0&&(a.right.deleted||a.right.content.constructor===Wc));){if(!a.right.deleted)switch(a.right.content.constructor){case Wc:{const{key:t,value:r}=a.right.content,s=i[t];if(void 0!==s){if(mc(s,r))o.delete(t);else{if(0===n)break e;o.set(t,r)}a.right.delete(e)}else a.currentAttributes.set(t,r);break}default:n<a.right.length&&vu(e,uu(a.right.id.client,a.right.id.clock+n)),n-=a.right.length}a.forward()}if(n>0){let i="";for(;n>0;n--)i+="\n";a.right=new rd(uu(s,fu(r.store,s)),a.left,a.left&&a.left.lastId,a.right,a.right&&a.right.id,t,null,new qc(i)),a.right.integrate(e,0),a.forward()}vc(e,t,a,o)},Nc=(e,t,a,n,i)=>{let r=t;const s=bs();for(;r&&(!r.countable||r.deleted);){if(!r.deleted&&r.content.constructor===Wc){const e=r.content;s.set(e.key,e)}r=r.right}let o=0,l=!1;for(;t!==r;){if(a===t&&(l=!0),!t.deleted){const a=t.content;switch(a.constructor){case Wc:{const{key:r,value:u}=a,c=n.get(r)??null;s.get(r)===a&&c!==u||(t.delete(e),o++,l||(i.get(r)??null)!==u||c===u||(null===c?i.delete(r):i.set(r,c))),l||t.deleted||_c(i,a);break}}}t=t.right}return o},Tc=e=>{let t=0;return Mu(e.doc,(a=>{let n=e._start,i=e._start,r=bs();const s=vs(r);for(;i;){if(!1===i.deleted)if(i.content.constructor===Wc)_c(s,i.content);else t+=Nc(a,n,i,r,s),r=vs(s),n=i;i=i.right}})),t},Mc=e=>{const t=new Set,a=e.doc;for(const[n,i]of e.afterState.entries()){const r=e.beforeState.get(n)||0;i!==r&&wu(e,a.store.clients.get(n),r,i,(e=>{e.deleted||e.content.constructor!==Wc||e.constructor===Bc||t.add(e.parent)}))}Mu(a,(a=>{Vl(e,e.deleteSet,(e=>{if(e instanceof Bc||!e.parent._hasFormatting||t.has(e.parent))return;const n=e.parent;e.content.constructor===Wc?t.add(n):((e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;const a=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===Wc){const n=t.content.key;a.has(n)?t.delete(e):a.add(n)}t=t.left}})(a,e)}));for(const e of t)Tc(e)}))},xc=(e,t,a)=>{const n=a,i=vs(t.currentAttributes),r=t.right;for(;a>0&&null!==t.right;){if(!1===t.right.deleted)switch(t.right.content.constructor){case nd:case zc:case qc:a<t.right.length&&vu(e,uu(t.right.id.client,t.right.id.clock+a)),a-=t.right.length,t.right.delete(e)}t.forward()}r&&Nc(e,r,t.right,i,t.currentAttributes);const s=(t.left||t.right).parent;return s._searchMarker&&Hu(s._searchMarker,t.index,-n+a),t};class Cc extends Ou{constructor(e,t,a){super(e,t),this.childListChanged=!1,this.keysChanged=new Set,a.forEach((e=>{null===e?this.childListChanged=!0:this.keysChanged.add(e)}))}get changes(){if(null===this._changes){const e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(null===this._delta){const e=this.target.doc,t=[];Mu(e,(e=>{const a=new Map,n=new Map;let i=this.target._start,r=null;const s={};let o="",l=0,u=0;const c=()=>{if(null!==r){let e=null;switch(r){case"delete":u>0&&(e={delete:u}),u=0;break;case"insert":("object"==typeof o||o.length>0)&&(e={insert:o},a.size>0&&(e.attributes={},a.forEach(((t,a)=>{null!==t&&(e.attributes[a]=t)})))),o="";break;case"retain":l>0&&(e={retain:l},(e=>{for(const t in e)return!1;return!0})(s)||(e.attributes=Wo({},s))),l=0}e&&t.push(e),r=null}};for(;null!==i;){switch(i.content.constructor){case nd:case zc:this.adds(i)?this.deletes(i)||(c(),r="insert",o=i.content.getContent()[0],c()):this.deletes(i)?("delete"!==r&&(c(),r="delete"),u+=1):i.deleted||("retain"!==r&&(c(),r="retain"),l+=1);break;case qc:this.adds(i)?this.deletes(i)||("insert"!==r&&(c(),r="insert"),o+=i.content.str):this.deletes(i)?("delete"!==r&&(c(),r="delete"),u+=i.length):i.deleted||("retain"!==r&&(c(),r="retain"),l+=i.length);break;case Wc:{const{key:t,value:o}=i.content;if(this.adds(i)){if(!this.deletes(i)){const l=a.get(t)??null;mc(l,o)?null!==o&&i.delete(e):("retain"===r&&c(),mc(o,n.get(t)??null)?delete s[t]:s[t]=o)}}else if(this.deletes(i)){n.set(t,o);const e=a.get(t)??null;mc(e,o)||("retain"===r&&c(),s[t]=e)}else if(!i.deleted){n.set(t,o);const a=s[t];void 0!==a&&(mc(a,o)?null!==a&&i.delete(e):("retain"===r&&c(),null===o?delete s[t]:s[t]=o))}i.deleted||("insert"===r&&c(),_c(a,i.content));break}}i=i.right}for(c();t.length>0;){const e=t[t.length-1];if(void 0===e.retain||void 0!==e.attributes)break;t.pop()}})),this._delta=t}return this._delta}}class Ic extends qu{constructor(e){super(),this._pending=void 0!==e?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??Uu(),this._length}_integrate(e,t){super._integrate(e,t);try{this._pending.forEach((e=>e()))}catch(e){console.error(e)}this._pending=null}_copy(){return new Ic}clone(){const e=new Ic;return e.applyDelta(this.toDelta()),e}_callObserver(e,t){super._callObserver(e,t);const a=new Cc(this,e,t);Gu(this,e,a),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??Uu();let e="",t=this._start;for(;null!==t;)!t.deleted&&t.countable&&t.content.constructor===qc&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){null!==this.doc?Mu(this.doc,(a=>{const n=new yc(null,this._start,0,new Map);for(let i=0;i<e.length;i++){const r=e[i];if(void 0!==r.insert){const s=t||"string"!=typeof r.insert||i!==e.length-1||null!==n.right||"\n"!==r.insert.slice(-1)?r.insert:r.insert.slice(0,-1);("string"!=typeof s||s.length>0)&&kc(a,this,n,s,r.attributes||{})}else void 0!==r.retain?Sc(a,this,n,r.retain,r.attributes||{}):void 0!==r.delete&&xc(a,n,r.delete)}})):this._pending.push((()=>this.applyDelta(e)))}toDelta(e,t,a){this.doc??Uu();const n=[],i=new Map,r=this.doc;let s="",o=this._start;function l(){if(s.length>0){const e={};let t=!1;i.forEach(((a,n)=>{t=!0,e[n]=a}));const a={insert:s};t&&(a.attributes=e),n.push(a),s=""}}const u=()=>{for(;null!==o;){if(cu(o,e)||void 0!==t&&cu(o,t))switch(o.content.constructor){case qc:{const n=i.get("ychange");void 0===e||cu(o,e)?void 0===t||cu(o,t)?void 0!==n&&(l(),i.delete("ychange")):void 0!==n&&n.user===o.id.client&&"added"===n.type||(l(),i.set("ychange",a?a("added",o.id):{type:"added"})):void 0!==n&&n.user===o.id.client&&"removed"===n.type||(l(),i.set("ychange",a?a("removed",o.id):{type:"removed"})),s+=o.content.str;break}case nd:case zc:{l();const e={insert:o.content.getContent()[0]};if(i.size>0){const t={};e.attributes=t,i.forEach(((e,a)=>{t[a]=e}))}n.push(e);break}case Wc:cu(o,e)&&(l(),_c(i,o.content))}o=o.right}l()};return e||t?Mu(r,(a=>{e&&du(a,e),t&&du(a,t),u()}),"cleanup"):u(),n}insert(e,t,a){if(t.length<=0)return;const n=this.doc;null!==n?Mu(n,(n=>{const i=bc(n,this,e,!a);a||(a={},i.currentAttributes.forEach(((e,t)=>{a[t]=e}))),kc(n,this,i,t,a)})):this._pending.push((()=>this.insert(e,t,a)))}insertEmbed(e,t,a){const n=this.doc;null!==n?Mu(n,(n=>{const i=bc(n,this,e,!a);kc(n,this,i,t,a||{})})):this._pending.push((()=>this.insertEmbed(e,t,a||{})))}delete(e,t){if(0===t)return;const a=this.doc;null!==a?Mu(a,(a=>{xc(a,bc(a,this,e,!0),t)})):this._pending.push((()=>this.delete(e,t)))}format(e,t,a){if(0===t)return;const n=this.doc;null!==n?Mu(n,(n=>{const i=bc(n,this,e,!1);null!==i.right&&Sc(n,this,i,t,a)})):this._pending.push((()=>this.format(e,t,a)))}removeAttribute(e){null!==this.doc?Mu(this.doc,(t=>{rc(t,this,e)})):this._pending.push((()=>this.removeAttribute(e)))}setAttribute(e,t){null!==this.doc?Mu(this.doc,(a=>{sc(a,this,e,t)})):this._pending.push((()=>this.setAttribute(e,t)))}getAttribute(e){return oc(this,e)}getAttributes(){return lc(this)}_write(e){e.writeTypeRef(Xc)}}class Vc{constructor(e,t=()=>!0){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??Uu()}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type;if(null!==e&&(!this._firstCall||e.deleted||!this._filter(t)))do{if(t=e.content.type,e.deleted||t.constructor!==Fc&&t.constructor!==Ec||null===t._start)for(;null!==e;){const t=e.next;if(null!==t){e=t;break}e=e.parent===this._root?null:e.parent._item}else e=t._start}while(null!==e&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,null===e?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class Ec extends qu{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Ec}clone(){const e=new Ec;return e.insert(0,this.toArray().map((e=>e instanceof qu?e.clone():e))),e}get length(){return this.doc??Uu(),null===this._prelimContent?this._length:this._prelimContent.length}createTreeWalker(e){return new Vc(this,e)}querySelector(e){e=e.toUpperCase();const t=new Vc(this,(t=>t.nodeName&&t.nodeName.toUpperCase()===e)).next();return t.done?null:t.value}querySelectorAll(e){return e=e.toUpperCase(),Ss(new Vc(this,(t=>t.nodeName&&t.nodeName.toUpperCase()===e)))}_callObserver(e,t){Gu(this,e,new Dc(this,t,e))}toString(){return Xu(this,(e=>e.toString())).join("")}toJSON(){return this.toString()}toDOM(e=document,t={},a){const n=e.createDocumentFragment();return void 0!==a&&a._createAssociation(n,this),Ku(this,(i=>{n.insertBefore(i.toDOM(e,t,a),null)})),n}insert(e,t){null!==this.doc?Mu(this.doc,(a=>{nc(a,this,e,t)})):this._prelimContent.splice(e,0,...t)}insertAfter(e,t){if(null!==this.doc)Mu(this.doc,(a=>{const n=e&&e instanceof qu?e._item:e;tc(a,this,n,t)}));else{const a=this._prelimContent,n=null===e?0:a.findIndex((t=>t===e))+1;if(0===n&&null!==e)throw mo("Reference item not found");a.splice(n,0,...t)}}delete(e,t=1){null!==this.doc?Mu(this.doc,(a=>{ic(a,this,e,t)})):this._prelimContent.splice(e,t)}toArray(){return Ju(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return ec(this,e)}slice(e=0,t=this.length){return Zu(this,e,t)}forEach(e){Ku(this,e)}_write(e){e.writeTypeRef(ed)}}class Fc extends Ec{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,t){super._integrate(e,t),this._prelimAttrs.forEach(((e,t)=>{this.setAttribute(t,e)})),this._prelimAttrs=null}_copy(){return new Fc(this.nodeName)}clone(){const e=new Fc(this.nodeName);return((e,t)=>{for(const a in e)t(e[a],a)})(this.getAttributes(),((t,a)=>{"string"==typeof t&&e.setAttribute(a,t)})),e.insert(0,this.toArray().map((e=>e instanceof qu?e.clone():e))),e}toString(){const e=this.getAttributes(),t=[],a=[];for(const t in e)a.push(t);a.sort();const n=a.length;for(let i=0;i<n;i++){const n=a[i];t.push(n+'="'+e[n]+'"')}const i=this.nodeName.toLocaleLowerCase();return`<${i}${t.length>0?" "+t.join(" "):""}>${super.toString()}</${i}>`}removeAttribute(e){null!==this.doc?Mu(this.doc,(t=>{rc(t,this,e)})):this._prelimAttrs.delete(e)}setAttribute(e,t){null!==this.doc?Mu(this.doc,(a=>{sc(a,this,e,t)})):this._prelimAttrs.set(e,t)}getAttribute(e){return oc(this,e)}hasAttribute(e){return uc(this,e)}getAttributes(e){return e?((e,t)=>{const a={};return e._map.forEach(((e,n)=>{let i=e;for(;null!==i&&(!t.sv.has(i.id.client)||i.id.clock>=(t.sv.get(i.id.client)||0));)i=i.left;null!==i&&cu(i,t)&&(a[n]=i.content.getContent()[i.length-1])})),a})(this,e):lc(this)}toDOM(e=document,t={},a){const n=e.createElement(this.nodeName),i=this.getAttributes();for(const e in i){const t=i[e];"string"==typeof t&&n.setAttribute(e,t)}return Ku(this,(i=>{n.appendChild(i.toDOM(e,t,a))})),void 0!==a&&a._createAssociation(n,this),n}_write(e){e.writeTypeRef(Qc),e.writeKey(this.nodeName)}}class Dc extends Ou{constructor(e,t,a){super(e,a),this.childListChanged=!1,this.attributesChanged=new Set,t.forEach((e=>{null===e?this.childListChanged=!0:this.attributesChanged.add(e)}))}}class Rc extends fc{constructor(e){super(),this.hookName=e}_copy(){return new Rc(this.hookName)}clone(){const e=new Rc(this.hookName);return this.forEach(((t,a)=>{e.set(a,t)})),e}toDOM(e=document,t={},a){const n=t[this.hookName];let i;return i=void 0!==n?n.createDom(this):document.createElement(this.hookName),i.setAttribute("data-yjs-hook",this.hookName),void 0!==a&&a._createAssociation(i,this),i}_write(e){e.writeTypeRef(td),e.writeKey(this.hookName)}}class Lc extends Ic{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new Lc}clone(){const e=new Lc;return e.applyDelta(this.toDelta()),e}toDOM(e=document,t,a){const n=e.createTextNode(this.toString());return void 0!==a&&a._createAssociation(n,this),n}toString(){return this.toDelta().map((e=>{const t=[];for(const a in e.attributes){const n=[];for(const t in e.attributes[a])n.push({key:t,value:e.attributes[a][t]});n.sort(((e,t)=>e.key<t.key?-1:1)),t.push({nodeName:a,attrs:n})}t.sort(((e,t)=>e.nodeName<t.nodeName?-1:1));let a="";for(let e=0;e<t.length;e++){const n=t[e];a+=`<${n.nodeName}`;for(let e=0;e<n.attrs.length;e++){const t=n.attrs[e];a+=` ${t.key}="${t.value}"`}a+=">"}a+=e.insert;for(let e=t.length-1;e>=0;e--)a+=`</${t[e].nodeName}>`;return a})).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(ad)}}class Pc{constructor(e,t){this.id=e,this.length=t}get deleted(){throw yo()}mergeWith(e){return!1}write(e,t,a){throw yo()}integrate(e,t){throw yo()}}class Bc extends Pc{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){t>0&&(this.id.clock+=t,this.length-=t),mu(e.doc.store,this)}write(e,t){e.writeInfo(0),e.writeLen(this.length-t)}getMissing(e,t){return null}}class Oc{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Oc(this.content)}splice(e){throw yo()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}}class $c{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new $c(this.len)}splice(e){const t=new $c(this.len-e);return this.len=e,t}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){Dl(e.deleteSet,t.id.client,t.id.clock,this.len),t.markDeleted()}delete(e){}gc(e){}write(e,t){e.writeLen(this.len-t)}getRef(){return 1}}const Uc=(e,t)=>new $l({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1});class jc{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const t={};this.opts=t,e.gc||(t.gc=!1),e.autoLoad&&(t.autoLoad=!0),null!==e.meta&&(t.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new jc(Uc(this.doc.guid,this.opts))}splice(e){throw yo()}mergeWith(e){return!1}integrate(e,t){this.doc._item=t,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,t){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}class zc{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new zc(this.embed)}splice(e){throw yo()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}}class Wc{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new Wc(this.key,this.value)}splice(e){throw yo()}mergeWith(e){return!1}integrate(e,t){const a=t.parent;a._searchMarker=null,a._hasFormatting=!0}delete(e){}gc(e){}write(e,t){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}class Yc{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Yc(this.arr)}splice(e){const t=new Yc(this.arr.slice(e));return this.arr=this.arr.slice(0,e),t}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){const a=this.arr.length;e.writeLen(a-t);for(let n=t;n<a;n++){const t=this.arr[n];e.writeString(void 0===t?"undefined":JSON.stringify(t))}}getRef(){return 2}}const Hc="development"===rl("node_env");class Gc{constructor(e){this.arr=e,Hc&&Jo(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Gc(this.arr)}splice(e){const t=new Gc(this.arr.slice(e));return this.arr=this.arr.slice(0,e),t}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){const a=this.arr.length;e.writeLen(a-t);for(let n=t;n<a;n++){const t=this.arr[n];e.writeAny(t)}}getRef(){return 8}}class qc{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new qc(this.str)}splice(e){const t=new qc(this.str.slice(e));this.str=this.str.slice(0,e);const a=this.str.charCodeAt(e-1);return a>=55296&&a<=56319&&(this.str=this.str.slice(0,e-1)+"�",t.str="�"+t.str.slice(1)),t}mergeWith(e){return this.str+=e.str,!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeString(0===t?this.str:this.str.slice(t))}getRef(){return 4}}const Zc=[e=>new pc,e=>new fc,e=>new Ic,e=>new Fc(e.readKey()),e=>new Ec,e=>new Rc(e.readKey()),e=>new Lc],Jc=0,Kc=1,Xc=2,Qc=3,ed=4,td=5,ad=6;class nd{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new nd(this.type._copy())}splice(e){throw yo()}mergeWith(e){return!1}integrate(e,t){this.type._integrate(e.doc,t)}delete(e){let t=this.type._start;for(;null!==t;)t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e),t=t.right;this.type._map.forEach((t=>{t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e)})),e.changed.delete(this.type)}gc(e){let t=this.type._start;for(;null!==t;)t.gc(e,!0),t=t.right;this.type._start=null,this.type._map.forEach((t=>{for(;null!==t;)t.gc(e,!0),t=t.left})),this.type._map=new Map}write(e,t){this.type._write(e)}getRef(){return 7}}const id=(e,t,a)=>{const{client:n,clock:i}=t.id,r=new rd(uu(n,i+a),t,uu(n,i+a-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(a));return t.deleted&&r.markDeleted(),t.keep&&(r.keep=!0),null!==t.redone&&(r.redone=uu(t.redone.client,t.redone.clock+a)),t.right=r,null!==r.right&&(r.right.left=r),e._mergeStructs.push(r),null!==r.parentSub&&null===r.right&&r.parent._map.set(r.parentSub,r),t.length=a,r};class rd extends Pc{constructor(e,t,a,n,i,r,s,o){super(e,o.getLength()),this.origin=a,this.left=t,this.right=n,this.rightOrigin=i,this.parent=r,this.parentSub=s,this.redone=null,this.content=o,this.info=this.content.isCountable()?2:0}set marker(e){(8&this.info)>0!==e&&(this.info^=8)}get marker(){return(8&this.info)>0}get keep(){return(1&this.info)>0}set keep(e){this.keep!==e&&(this.info^=1)}get countable(){return(2&this.info)>0}get deleted(){return(4&this.info)>0}set deleted(e){this.deleted!==e&&(this.info^=4)}markDeleted(){this.info|=4}getMissing(e,t){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=fu(t,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=fu(t,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===ou&&this.id.client!==this.parent.client&&this.parent.clock>=fu(t,this.parent.client))return this.parent.client;if(this.origin&&(this.left=_u(e,t,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=vu(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===Bc||this.right&&this.right.constructor===Bc)this.parent=null;else if(this.parent){if(this.parent.constructor===ou){const e=gu(t,this.parent);e.constructor===Bc?this.parent=null:this.parent=e.content.type}}else this.left&&this.left.constructor===rd?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===rd&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=_u(e,e.doc.store,uu(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(t),this.length-=t),this.parent){if(!this.left&&(!this.right||null!==this.right.left)||this.left&&this.left.right!==this.right){let t,a=this.left;if(null!==a)t=a.right;else if(null!==this.parentSub)for(t=this.parent._map.get(this.parentSub)||null;null!==t&&null!==t.left;)t=t.left;else t=this.parent._start;const n=new Set,i=new Set;for(;null!==t&&t!==this.right;){if(i.add(t),n.add(t),lu(this.origin,t.origin)){if(t.id.client<this.id.client)a=t,n.clear();else if(lu(this.rightOrigin,t.rightOrigin))break}else{if(null===t.origin||!i.has(gu(e.doc.store,t.origin)))break;n.has(gu(e.doc.store,t.origin))||(a=t,n.clear())}t=t.right}this.left=a}if(null!==this.left){const e=this.left.right;this.right=e,this.left.right=this}else{let e;if(null!==this.parentSub)for(e=this.parent._map.get(this.parentSub)||null;null!==e&&null!==e.left;)e=e.left;else e=this.parent._start,this.parent._start=this;this.right=e}null!==this.right?this.right.left=this:null!==this.parentSub&&(this.parent._map.set(this.parentSub,this),null!==this.left&&this.left.delete(e)),null===this.parentSub&&this.countable&&!this.deleted&&(this.parent._length+=this.length),mu(e.doc.store,this),this.content.integrate(e,this),Su(e,this.parent,this.parentSub),(null!==this.parent._item&&this.parent._item.deleted||null!==this.parentSub&&null!==this.right)&&this.delete(e)}else new Bc(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;null!==e&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;null!==e&&e.deleted;)e=e.left;return e}get lastId(){return 1===this.length?this.id:uu(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&lu(e.origin,this.lastId)&&this.right===e&&lu(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&null===this.redone&&null===e.redone&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){const t=this.parent._searchMarker;return t&&t.forEach((t=>{t.p===e&&(t.p=this,!this.deleted&&this.countable&&(t.index-=this.length))})),e.keep&&(this.keep=!0),this.right=e.right,null!==this.right&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const t=this.parent;this.countable&&null===this.parentSub&&(t._length-=this.length),this.markDeleted(),Dl(e.deleteSet,this.id.client,this.id.clock,this.length),Su(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw go();this.content.gc(e),t?((e,t,a)=>{const n=e.clients.get(t.id.client);n[yu(n,t.id.clock)]=a})(e,this,new Bc(this.id,this.length)):this.content=new $c(this.length)}write(e,t){const a=t>0?uu(this.id.client,this.id.clock+t-1):this.origin,n=this.rightOrigin,i=this.parentSub,r=31&this.content.getRef()|(null===a?0:Rs)|(null===n?0:Ds)|(null===i?0:32);if(e.writeInfo(r),null!==a&&e.writeLeftID(a),null!==n&&e.writeRightID(n),null===a&&null===n){const t=this.parent;if(void 0!==t._item){const a=t._item;if(null===a){const a=(e=>{for(const[t,a]of e.doc.share.entries())if(a===e)return t;throw go()})(t);e.writeParentInfo(!0),e.writeString(a)}else e.writeParentInfo(!1),e.writeLeftID(a.id)}else t.constructor===String?(e.writeParentInfo(!0),e.writeString(t)):t.constructor===ou?(e.writeParentInfo(!1),e.writeLeftID(t)):go();null!==i&&e.writeString(i)}this.content.write(e,t)}}const sd=(e,t)=>od[31&t](e),od=[()=>{go()},e=>new $c(e.readLen()),e=>{const t=e.readLen(),a=[];for(let n=0;n<t;n++){const t=e.readString();"undefined"===t?a.push(void 0):a.push(JSON.parse(t))}return new Yc(a)},e=>new Oc(e.readBuf()),e=>new qc(e.readString()),e=>new zc(e.readJSON()),e=>new Wc(e.readKey(),e.readJSON()),e=>new nd(Zc[e.readTypeRef()](e)),e=>{const t=e.readLen(),a=[];for(let n=0;n<t;n++)a.push(e.readAny());return new Gc(a)},e=>new jc(Uc(e.readString(),e.readAny())),()=>{go()}];class ld extends Pc{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){go()}write(e,t){e.writeInfo(10),Xs(e.restEncoder,this.length-t)}getMissing(e,t){return null}}const ud="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},cd="__ $YJS$ __";!0===ud[cd]&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438"),ud[cd]=!0;const dd=new Map;const pd="undefined"==typeof BroadcastChannel?class{constructor(e){var t;this.room=e,this.onmessage=null,this._onChange=t=>t.key===e&&null!==this.onmessage&&this.onmessage({data:dl(t.newValue||"")}),t=this._onChange,jo||addEventListener("storage",t)}postMessage(e){zo.setItem(this.room,cl(new Uint8Array(e)))}close(){var e;e=this._onChange,jo||removeEventListener("storage",e)}}:BroadcastChannel,hd=e=>_s(dd,e,(()=>{const t=ws(),a=new pd(e);return a.onmessage=e=>t.forEach((t=>t(e.data,"broadcastchannel"))),{bc:a,subs:t}})),fd=(e,t,a=null)=>{const n=hd(e);n.bc.postMessage(t),n.subs.forEach((e=>e(t,a)))},md=(e,t)=>{Xs(e,0);const a=(e=>tu(e,new Yl))(t);io(e,a)},yd=(e,t,a)=>{Xs(e,1),io(e,((e,t)=>Xl(e,t,new Hl))(t,a))},gd=(e,t,a)=>{try{((e,t,a)=>{Kl(e,t,a,jl)})(t,Ao(e),a)}catch(e){console.error("Caught error while handling a Yjs update",e)}},bd=gd,vd=(e,t,a,n)=>{const i=So(e);switch(i){case 0:((e,t,a)=>{yd(t,a,Ao(e))})(e,t,a);break;case 1:gd(e,a,n);break;case 2:bd(e,a,n);break;default:throw new Error("Unknown message type")}return i},_d=3e4;class wd extends Ms{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval((()=>{const e=Bo();null!==this.getLocalState()&&15e3<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const t=[];this.meta.forEach(((a,n)=>{n!==this.clientID&&_d<=e-a.lastUpdated&&this.states.has(n)&&t.push(n)})),t.length>0&&Ad(this,t,"timeout")}),xs(3e3)),e.on("destroy",(()=>{this.destroy()})),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){const t=this.clientID,a=this.meta.get(t),n=void 0===a?0:a.clock+1,i=this.states.get(t);null===e?this.states.delete(t):this.states.set(t,e),this.meta.set(t,{clock:n,lastUpdated:Bo()});const r=[],s=[],o=[],l=[];null===e?l.push(t):null==i?null!=e&&r.push(t):(s.push(t),el(i,e)||o.push(t)),(r.length>0||o.length>0||l.length>0)&&this.emit("change",[{added:r,updated:o,removed:l},"local"]),this.emit("update",[{added:r,updated:s,removed:l},"local"])}setLocalStateField(e,t){const a=this.getLocalState();null!==a&&this.setLocalState({...a,[e]:t})}getStates(){return this.states}}const Ad=(e,t,a)=>{const n=[];for(let a=0;a<t.length;a++){const i=t[a];if(e.states.has(i)){if(e.states.delete(i),i===e.clientID){const t=e.meta.get(i);e.meta.set(i,{clock:t.clock+1,lastUpdated:Bo()})}n.push(i)}}n.length>0&&(e.emit("change",[{added:[],updated:[],removed:n},a]),e.emit("update",[{added:[],updated:[],removed:n},a]))},kd=(e,t,a=e.states)=>{const n=t.length,i=Gs();Xs(i,n);for(let r=0;r<n;r++){const n=t[r],s=a.get(n)||null,o=e.meta.get(n).clock;Xs(i,n),Xs(i,o),ao(i,JSON.stringify(s))}return Zs(i)},Sd=[];Sd[0]=(e,t,a,n,i)=>{Xs(e,0);const r=vd(t,e,a.doc,a);n&&1===r&&!a.synced&&(a.synced=!0)},Sd[3]=(e,t,a,n,i)=>{Xs(e,1),io(e,kd(a.awareness,Array.from(a.awareness.getStates().keys())))},Sd[1]=(e,t,a,n,i)=>{((e,t,a)=>{const n=wo(t),i=Bo(),r=[],s=[],o=[],l=[],u=So(n);for(let t=0;t<u;t++){const t=So(n);let a=So(n);const u=JSON.parse(To(n)),c=e.meta.get(t),d=e.states.get(t),p=void 0===c?0:c.clock;(p<a||p===a&&null===u&&e.states.has(t))&&(null===u?t===e.clientID&&null!=e.getLocalState()?a++:e.states.delete(t):e.states.set(t,u),e.meta.set(t,{clock:a,lastUpdated:i}),void 0===c&&null!==u?r.push(t):void 0!==c&&null===u?l.push(t):null!==u&&(el(u,d)||o.push(t),s.push(t)))}(r.length>0||o.length>0||l.length>0)&&e.emit("change",[{added:r,updated:o,removed:l},a]),(r.length>0||s.length>0||l.length>0)&&e.emit("update",[{added:r,updated:s,removed:l},a])})(a.awareness,Ao(t),a)},Sd[2]=(e,t,a,n,i)=>{((e,t,a)=>{0===So(e)&&a(t,To(e))})(t,a.doc,((e,t)=>Nd(a,t)))};const Nd=(e,t)=>console.warn(`Permission denied to access ${e.url}.\n${t}`),Td=(e,t,a)=>{const n=wo(t),i=Gs(),r=So(n),s=e.messageHandlers[r];return s?s(i,n,e,a,r):console.error("Unable to compute message"),i},Md=(e,t,a)=>{t===e.ws&&(e.emit("connection-close",[a,e]),e.ws=null,t.close(),e.wsconnecting=!1,e.wsconnected?(e.wsconnected=!1,e.synced=!1,Ad(e.awareness,Array.from(e.awareness.getStates().keys()).filter((t=>t!==e.doc.clientID)),e),e.emit("status",[{status:"disconnected"}])):e.wsUnsuccessfulReconnects++,setTimeout(xd,Is(100*Es(2,e.wsUnsuccessfulReconnects),e.maxBackoffTime),e))},xd=e=>{if(e.shouldConnect&&null===e.ws){const t=new e._WS(e.url,e.protocols);t.binaryType="arraybuffer",e.ws=t,e.wsconnecting=!0,e.wsconnected=!1,e.synced=!1,t.onmessage=a=>{e.wsLastMessageReceived=Bo();const n=Td(e,new Uint8Array(a.data),!0);qs(n)>1&&t.send(Zs(n))},t.onerror=t=>{e.emit("connection-error",[t,e])},t.onclose=a=>{Md(e,t,a)},t.onopen=()=>{e.wsLastMessageReceived=Bo(),e.wsconnecting=!1,e.wsconnected=!0,e.wsUnsuccessfulReconnects=0,e.emit("status",[{status:"connected"}]);const a=Gs();if(Xs(a,0),md(a,e.doc),t.send(Zs(a)),null!==e.awareness.getLocalState()){const a=Gs();Xs(a,1),io(a,kd(e.awareness,[e.doc.clientID])),t.send(Zs(a))}},e.emit("status",[{status:"connecting"}])}},Cd=(e,t)=>{const a=e.ws;e.wsconnected&&a&&a.readyState===a.OPEN&&a.send(t),e.bcconnected&&fd(e.bcChannel,t,e)};class Id extends Ts{constructor(e,t,a,{connect:n=!0,awareness:i=new wd(a),params:r={},protocols:s=[],WebSocketPolyfill:o=WebSocket,resyncInterval:l=-1,maxBackoffTime:u=2500,disableBc:c=!1}={}){for(super();"/"===e[e.length-1];)e=e.slice(0,e.length-1);this.serverUrl=e,this.bcChannel=e+"/"+t,this.maxBackoffTime=u,this.params=r,this.protocols=s,this.roomname=t,this.doc=a,this._WS=o,this.awareness=i,this.wsconnected=!1,this.wsconnecting=!1,this.bcconnected=!1,this.disableBc=c,this.wsUnsuccessfulReconnects=0,this.messageHandlers=Sd.slice(),this._synced=!1,this.ws=null,this.wsLastMessageReceived=0,this.shouldConnect=n,this._resyncInterval=0,l>0&&(this._resyncInterval=setInterval((()=>{if(this.ws&&this.ws.readyState===WebSocket.OPEN){const e=Gs();Xs(e,0),md(e,a),this.ws.send(Zs(e))}}),l)),this._bcSubscriber=(e,t)=>{if(t!==this){const t=Td(this,new Uint8Array(e),!1);qs(t)>1&&fd(this.bcChannel,Zs(t),this)}},this._updateHandler=(e,t)=>{if(t!==this){const t=Gs();Xs(t,0),((e,t)=>{Xs(e,2),io(e,t)})(t,e),Cd(this,Zs(t))}},this.doc.on("update",this._updateHandler),this._awarenessUpdateHandler=({added:e,updated:t,removed:a},n)=>{const r=e.concat(t).concat(a),s=Gs();Xs(s,1),io(s,kd(i,r)),Cd(this,Zs(s))},this._exitHandler=()=>{Ad(this.awareness,[a.clientID],"app closed")},tl&&void 0!==gs&&gs.on("exit",this._exitHandler),i.on("update",this._awarenessUpdateHandler),this._checkInterval=setInterval((()=>{this.wsconnected&&3e4<Bo()-this.wsLastMessageReceived&&Md(this,this.ws,null)}),3e3),n&&this.connect()}get url(){const e=(e=>((e,t)=>{const a=[];for(const n in e)a.push(t(e[n],n));return a})(e,((e,t)=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`)).join("&"))(this.params);return this.serverUrl+"/"+this.roomname+(0===e.length?"":"?"+e)}get synced(){return this._synced}set synced(e){this._synced!==e&&(this._synced=e,this.emit("synced",[e]),this.emit("sync",[e]))}destroy(){0!==this._resyncInterval&&clearInterval(this._resyncInterval),clearInterval(this._checkInterval),this.disconnect(),tl&&void 0!==gs&&gs.off("exit",this._exitHandler),this.awareness.off("update",this._awarenessUpdateHandler),this.doc.off("update",this._updateHandler),super.destroy()}connectBc(){if(this.disableBc)return;var e,t;this.bcconnected||(e=this.bcChannel,t=this._bcSubscriber,hd(e).subs.add(t),this.bcconnected=!0);const a=Gs();Xs(a,0),md(a,this.doc),fd(this.bcChannel,Zs(a),this);const n=Gs();Xs(n,0),yd(n,this.doc),fd(this.bcChannel,Zs(n),this);const i=Gs();Xs(i,3),fd(this.bcChannel,Zs(i),this);const r=Gs();Xs(r,1),io(r,kd(this.awareness,[this.doc.clientID])),fd(this.bcChannel,Zs(r),this)}disconnectBc(){const e=Gs();Xs(e,1),io(e,kd(this.awareness,[this.doc.clientID],new Map)),Cd(this,Zs(e)),this.bcconnected&&(((e,t)=>{const a=hd(e),n=a.subs.delete(t);n&&0===a.subs.size&&(a.bc.close(),dd.delete(e))})(this.bcChannel,this._bcSubscriber),this.bcconnected=!1)}disconnect(){this.shouldConnect=!1,this.disconnectBc(),null!==this.ws&&Md(this,this.ws,null)}connect(){this.shouldConnect=!0,this.wsconnected||null!==this.ws||(xd(this),this.connectBc())}}class Vd extends $l{}class Ed{apiClient;collabDocument;yWebsocketProvider;item;awareness;users=[];avatars=new Map;constructor(e){this.apiClient=e,this.collabDocument=new Vd}isActive(){return void 0!==this.yWebsocketProvider}getAwarenessStates(){return this.awareness?this.awareness.getStates():new Map}getUsersList(){return this.users}_getUser(e){for(const t of this.users)if(e===t.key)return t;return null}getLocalState(){if(!this.awareness)throw new Error("No awareness available. Cannot get state field.");return this.awareness.getLocalState()}setLocalStateField(e,t){if(!this.awareness)throw new Error("No awareness available. Cannot set state field.");this.awareness.setLocalStateField(e,t)}async _updateUsersList(){const e=this.getAwarenessStates(),t=await this.apiClient.me(!0);for(const[a,n]of e.entries()){if(!this._getUser(a)){let e=this.avatars.get(n.user.id);if(!e){e=(await this.apiClient.getAvatar(n.user.id,32)).avatar,this.avatars.set(n.user.id,e)}this.users.push({key:a,id:n.user.id,name:n.user.name,color:n.user.color,avatar:e,itsMe:n.user.id===t._id})}}const a=[];for(const t of this.users)e.has(t.key)&&a.push(t);this.users=a}async startCollaboration(e){try{if(!this.apiClient.isDevOrLocalhost())return!1;this.endCollaboration(),this.item=e;const t=this.apiClient.getCollabUrl(),a=`${this.item.type}.${this.item._id}`;let n=1e3;this.yWebsocketProvider=new Id(t,a,this.collabDocument,{connect:!1}),this.yWebsocketProvider.on("status",(e=>{console.log(`[Collab] ${e.status}`),"disconnected"===e.status&&this.yWebsocketProvider&&(this.yWebsocketProvider.disconnect(),setTimeout(r,n))})),this.yWebsocketProvider.on("sync",(e=>{console.log(`[Collab] synced: ${e}`)})),this.awareness=this.yWebsocketProvider.awareness,this.awareness.on("change",(async e=>{await this._updateUsersList(),u.$emit("collab:awareness:changed",{users:this.users,states:this.getAwarenessStates(),changes:e})}));const i=await this.apiClient.me(!0);this.awareness.setLocalStateField("user",{id:i._id,name:i.name,color:h.colorFromString(i.name)});const r=async()=>{if(!this.yWebsocketProvider)return void console.warn("[Collab] Cannot connect without websocket provider!");console.log("[Collab] reconnecting...");const e=await this.apiClient.getCollabToken();this.yWebsocketProvider.params.token=e,this.yWebsocketProvider.connect()};return await r(),u.$emit("collab:started"),!0}catch(e){return console.error("Error starting collaboration: ",e),!1}}endCollaboration(){this.yWebsocketProvider&&(console.log("Ending collaboration."),u.$emit("collab:ended"),this.yWebsocketProvider.destroy(),this.yWebsocketProvider=void 0,this.awareness=void 0),this.collabDocument=new Vd,this.item=void 0}}class Fd{apiClient;constructor(e){this.apiClient=e}async testCopyItems(e,t){const a=await this.apiClient.getItemsInFolderList(t,!0),n=await this.apiClient.getFoldersInFolderList(t),i=new Map;for(const e of n.children)i.set(e.name,null);for(const e of a)i.set(e.name,e._id);const r=this.apiClient.getItemRepo(),s=[];for(const t of e){let e,a,n=!1;t.isFolder?a=await this.apiClient.getFolder(t._id):(a=r.getLoadedItem(t._id),a||(a=await this.apiClient.getItem(t._id))),e=a?.name,n=i.has(e),s.push({_id:t._id,isFolder:t.isFolder,data:a,name:e,conflicted:n,conflictedItemId:i.get(e)})}return s}async copyItems(e,t,a=!1,n=!1){const i=e.filter((e=>!e.isFolder)).map((e=>e._id)),r=await this.apiClient.copyItems(i,t,a,n),s=this.apiClient.getItemRepo();for(let t of r){const a=e.filter((e=>e._id===t.original));a.length>0&&(t.replaced=a[0].conflictedItemId),await s.replaceLink(t.original,t.clone)}return await this.apiClient.eventBus.$emit("folder:changed",t),await this.apiClient.eventBus.$emit("items:copied",r),r}}class Dd{apiClient;jobManager;constructor(e){this.apiClient=e,this.jobManager=e.getJobManager()}async executeExport(e,t,a,n){const i=await this.jobManager.execute("EXPORT:ExportGame",[{_id:e,isFolder:!1}],[{name:"Destination Folder",value:a},{name:"EngineVersion",value:n}],void 0,{os:t});if(await this.apiClient.eventBus.$emit("quota:update"),2===i.state)throw new A("Export failed: "+i.error);await this.apiClient.eventBus.$emit("folder:changed",[a])}}(n.default?n.default:n)(a,{retries:3,retryCondition:e=>e.message.includes("net::ERR_NETWORK_CHANGED")});const Rd={Draft:0,Private:1,NotListed:2,Public:3},Ld=[{id:"prod",name:"Production",ssl:!0,apiHost:"api.lumino.cloud",viewerHost:"viewer.lumino.cloud",collabHost:"collab.lumino.cloud"},{id:"dev",name:"Development",ssl:!0,apiHost:"api-dev.lumino.cloud",viewerHost:"viewer-dev.lumino.cloud",collabHost:"collab-dev.lumino.cloud"},{id:"local",name:"Local",ssl:!1,apiHost:"localhost:8081",viewerHost:"localhost:8090",collabHost:"localhost:8200"}];e.AccessDeniedException=N,e.AggregatedItem=M,e.ApiClient=class extends l{accessToken;apiToken;options;forcePublicApi;usePublicApi;usePersistentStorage;storageSizeMib;requestClientId;apiUrl;wsUrl;viewerUrl;collabUrl;itemRepo;itemCache;folderCache;thumbCache;userCache;groupCache;attachmentCache;jobManager;serializer;collab;itemCopier;executableExporter;eventBus;env;api;ws=null;cachedMe;profiler;wsLastPing=null;last2faCode="";constructor(e={}){super(),e=e||{},this.options=Object.assign({environment:"auto",wsAutoReconnect:!0,wsAutoConnect:!1,forcePublicApi:!1,debug:!1,accessToken:null,apiToken:null,usePersistentStorage:!0,storageSizeMib:10240,requestClientId:null},e),this.accessToken=this.options.accessToken,this.apiToken=this.options.apiToken,this.forcePublicApi=this.options.forcePublicApi,this.usePublicApi=!this.accessToken&&!this.apiToken,this.usePersistentStorage=this.options.usePersistentStorage,this.storageSizeMib=this.options.storageSizeMib,this.requestClientId=this.options.requestClientId,this.cachedMe=null,this.itemRepo=new ji(this.usePublicApi,this),this.itemCache=new Fr(this.usePublicApi,this.usePersistentStorage,this,this.storageSizeMib),this.folderCache=new Dr(this),this.thumbCache=new Rr(this),this.userCache=new Lr(this),this.groupCache=new Pr(this),this.attachmentCache=new Br(this),this.jobManager=new Ur(this),this.serializer=new Gr(this),this.collab=new Ed(this),this.itemCopier=new Fd(this),this.executableExporter=new Dd(this),this.eventBus=u,this.profiler=null,this.switchEnvironment(this.options.environment),this.setDebugMode(this.options.debug)}detectEnvironment(){const e=this.isOnLocalhost(),t=this.isDevPlatform();return e?this.getEnvironmentById("local"):t?this.getEnvironmentById("dev"):this.getEnvironmentById("prod")}getEnvironmentById(e){return"auto"===e?this.detectEnvironment():Ld.find((t=>t.id===e))}getEnvironments(){return Ld}switchEnvironment(e){let t=this.getEnvironmentById(e);if(!t)throw new Error(`Unknown environment: ${e}`);console.log(`ApiClient switched to env: ${t.name}`);const n=t.ssl?"https":"http",i=t.ssl?"wss":"ws";this.apiUrl=`${n}://${t.apiHost}`,this.wsUrl=`${i}://${t.apiHost}/api/ws`,this.viewerUrl=`${n}://${t.viewerHost}`,this.collabUrl=`${n}://${t.collabHost}`,this.api=a.create({baseURL:this.apiUrl}),this.ws=null,this.wsLastPing=null}async initCaches(){return Promise.all([this.itemCache.init(),this.folderCache.init(),this.thumbCache.init()])}clearCaches(){this.itemCache.clear(),this.folderCache.clear(),this.thumbCache.clear()}isDevPlatform(){return"object"==typeof window&&"location"in window&&window.location.href.includes("dev.lumino.cloud")}isOnLocalhost(){return"object"==typeof window&&"location"in window&&window.location.href.includes("localhost")}isDevOrLocalhost(){return this.isOnLocalhost()||this.isDevPlatform()}async clearIndexedDb(e){return new Promise(((t,a)=>{const n=indexedDB.deleteDatabase(e);n.onsuccess=()=>{t()},n.onerror=e=>{a("An error occured while deleting a IndexedDB database.")},n.onblocked=()=>{a(`Database deletion is blocked. Please close all connections to "${e}".`)}}))}async logout(){return this.clearCaches(),this.clearIndexedDb("lumino")}setDebugMode(e){this.options.debug=!!e,this.eventBus.setDebugMode(this.options.debug)}websocketConnect(e){const t=this;if(this.ws){if(!e)return void console.warn("Websocket is already connected!");this.websocketDisconnect()}this.ws=new i(this.wsUrl),this.ws.onerror=function(e){console.error("Websocket error",e),t.$emit("client:websocketError",e)},this.ws.onopen=function(){t.$emit("client:websocketOpen"),t.accessToken&&t.websocketSend(JSON.stringify({type:"auth",subscriptions:["item","folder","job","user","notification"],token:t.accessToken}))},this.ws.onclose=function(){t.$emit("client:websocketClosed"),t.options.wsAutoReconnect&&t.websocketConnect(!0)},this.ws.onmessage=function(e){try{const a=JSON.parse(e.data);switch(a.type){case"ping":t.wsLastPing=new Date,t.ws&&t.ws.send(JSON.stringify({type:"ping"}));break;case"authenticated":t.$emit("client:websocketAuthenticated");break;case"Item":case"Folder":case"Notification":case"Job":case"User":u.$emit("client:elementUpdate",a);break;default:console.warn("Unknown websocket message: ",a)}}catch(e){console.error("Websocket error:",e)}}}websocketDisconnect(){this.ws&&(this.ws.close(),this.ws=null)}websocketSend(e){this.ws?1===this.ws.readyState?this.ws.send(e):console.error("Websocket is not in READY state. Currently in state "+this.ws.readyState):console.error("Websocket is not created")}getItemCopier(){return this.itemCopier}getExecutableExporter(){return this.executableExporter}getCollab(){return this.collab}getCollabUrl(){return this.collabUrl}getPublisher(){return new Or(this)}getAssetCreator(){return new Hr(this)}getJobManager(){return this.jobManager}getThumbCache(){return this.thumbCache}getItemCache(){return this.itemCache}getItemRepo(){return this.itemRepo}getRootVisibility(){return this.itemRepo.activeItem?this.itemRepo.activeItem.visibility:Rd.Private}getEventBus(){return this.eventBus}getSerializer(){return this.serializer}setForcePublicApi(e){this.forcePublicApi=e,this._updateUsePublicApi()}_updateUsePublicApi(){this.usePublicApi=this.forcePublicApi||!this.apiToken&&!this.accessToken,this.itemRepo.usePublicApi=this.usePublicApi,this.itemCache.usePublicApi=this.usePublicApi}setApiToken(e){this.apiToken=e,this._updateUsePublicApi()}setAccessToken(e){this.accessToken=e,this._updateUsePublicApi(),this.accessToken&&this.options.wsAutoConnect&&this.websocketConnect()}getApiToken(){return this.apiToken}getAccessToken(){return this.accessToken}setApiBaseUrl(e){this.apiUrl=e,this.api=a.create({baseURL:this.apiUrl})}setWsBaseUrl(e){this.wsUrl=e,this.accessToken&&this.options.wsAutoConnect&&(this.websocketDisconnect(),this.websocketConnect())}setRequestClientId(e){this.requestClientId=e}getApiBaseUrl(){return this.apiUrl}getWsBaseUrl(){return this.wsUrl}getViewerBaseUrl(){return this.viewerUrl}setProfiler(e){if(!e||"function"!=typeof e.start)throw new Error("Profiler needs to be an object providing a start function.");this.profiler=e}async login2FA(e,t,a){return console.log("Running Login..."),this.execute("post","/api/auth/login2fa",{account:e,password:t,client:a}).then((e=>{this.last2faCode=e,this.eventBus.$emit("login.2facode",e)}))}async confirm2FA(e,t){return this.execute("post","/api/auth/confirm2fa",{account:e,code:t})}isAuthenticated(){return!!this.accessToken||!!this.apiToken}isFeatureEnabled(e){return!!this.cachedMe&&this.cachedMe.features.includes(e)}async resolveUserOrGroupInfoForItem(e){return e.quotaUser?this.userCache.resolve(e.quotaUser):e.quotaGroup?this.groupCache.resolve(e.quotaGroup):e.createdBy?this.userCache.resolve(e.createdBy):{name:"?",initials:"?",avatar:null}}_startOp(e){const t=this,a={id:h.createGUID(),name:e,startTimeMs:performance.now(),runningMs:0,percent:0,reportProgress:function(e){a.percent=e},interval:null,finish:function(){if(a.interval&&clearInterval(a.interval),a.runningMs>1e3)try{t.$emit("client:longRunningOpFinished",a.id)}catch(e){console.error(e)}}};return a.interval=setInterval((function(){if(a.runningMs=performance.now()-a.startTimeMs,a.runningMs>1e3)try{t.$emit("client:longRunningOp",a.id,a.name,a.percent)}catch(e){console.error(e)}}),100),a}_createOpName(e,t){try{const a=t.split("/");switch(e.toLowerCase()){case"get":e="Fetching";break;case"post":e="Creating";break;case"put":e="Updating";break;case"delete":e="Deleting"}a.shift(),a.shift();const n=a.shift();let i=a.join("/");return i.length&&(i=` [${i}]`),`${e} ${n} data ${i}`}catch{return`${e} ${t}`}}addAuthenticationHeaders(e){this.accessToken&&(e["x-access-token"]=this.accessToken),this.apiToken&&(e["x-api-token"]=this.apiToken),this.requestClientId&&(e["x-request-client"]=this.requestClientId)}async execute(e,t,a,n){let i=this,r={};(n=n||{}).headers?r=n.headers:a&&"object"==typeof a&&"getHeaders"in a&&"function"==typeof a.getHeaders&&(r=a.getHeaders()),this.addAuthenticationHeaders(r);const s=this.profiler?this.profiler.start("ApiClient",`${e} ${t}`):null,o=this._startOp(n.opName||i._createOpName(e,t));return this.api({method:e,url:t,data:a,responseType:n.responseType,headers:r,signal:n.controller?n.controller.signal:void 0,onUploadProgress:function(e){if(e.total){const t=Math.min(100,Math.round(100*e.loaded/e.total));o.reportProgress(t),i.$emit("client:progress",{type:"upload",percent:t}),"function"==typeof n.progressCallback&&n.progressCallback(t,e.loaded,e.total)}},onDownloadProgress:function(e){if(e.total){const t=Math.min(100,Math.round(100*e.loaded/e.total));o.reportProgress(t),i.$emit("client:progress",{type:"download",percent:t}),"function"==typeof n.progressCallback&&n.progressCallback(t,e.loaded,e.total)}}}).then((e=>{if(s&&s.done(),o.finish(),i.$emit("client:progress",{type:"done"}),e.headers["content-type"].startsWith("application/json")){if("success"===e.data.result){let t;return t=n.withNext?{data:e.data.data,next:e.data.next}:e.data.data,n.emitOnSuccess&&this.eventBus.$emit(n.emitOnSuccess,t),t}throw e.data.redirect&&this.$emit("client:redirect",e.data.redirect),e.data.error?e.data.error:"API response seems to be json but does not contain result type!"}return n.emitOnSuccess&&this.eventBus.$emit(n.emitOnSuccess),{blob:new Blob([e.data],{type:e.headers["content-type"]}),hash:e.headers["sha256-hash"],itemName:e.headers["lumino-itemname"],itemType:e.headers["lumino-itemtype"],mimeType:e.headers["content-type"]}})).catch((e=>{if(s&&s.done(),o.finish(),i.$emit("client:progress",{type:"done"}),e.response){if(401===e.response.status)throw this.$emit("client:unauthorized"),new N("Access denied. Please login again.");if(413===e.response.status)throw new S;if(e.response.data&&e.response.data.error)throw new Error(e.response.data.error)}throw e}))}_createFormData(e,t){let a=new r;if("function"==typeof File&&e instanceof Blob)a.append("file",e,t);else{const n=new Blob([e]);try{a.append("file",n,t)}catch{a=new r,a.append("file",e,t)}}return a}async me(e){return e&&this.cachedMe||(this.cachedMe=await this.execute("get","/api/auth/me")),this.cachedMe}async getHomeFolder(){return this.execute("get","/api/auth/homefolder")}async myClients(){return this.execute("get","/api/auth/myclients")}async getCollabToken(){return this.execute("get","/api/auth/collabtoken")}async checkCollabToken(e){return this.execute("post","/api/auth/collabtoken",{token:e})}async register(e){return this.execute("post","/api/auth/register",e)}async deleteMyAccount(e){return this.execute("post","/api/auth/deletemyaccount",{password:e})}async confirmEmail(e){return this.execute("get","/api/auth/confirmemail/"+e)}async confirmEmailChange(e){return this.execute("get","/api/auth/confirmchangedemail/"+e)}async forgotPassword(e,t){return this.execute("post","/api/auth/forgotpassword",{account:e,client:t})}async setNewPassword(e,t){return this.execute("post","/api/auth/setnewpassword",{token:e,password:t})}async accountExists(e){return this.execute("post","/api/auth/accountExists",e)}async getItemsInFolderList(e,t=!1){if(e&&!t){const t=await this.folderCache.getItemListing(e);if(t)return t}const a=await this.execute("get","/api/item/infolder/"+(e||"0"));return await this.folderCache.addItemListing(e,a),a}async getItem(e,t){const a=[];t&&(t.returnClonedFrom&&a.push("returnClonedFrom=true"),t.withThumbnails&&a.push("withThumbnails=true"));let n="";return a.length&&(n=`?${a.join("&")}`),this.execute("get",`/api/item/${e}${n}`)}getItemAggregatedPOP(e,t){return this.usePublicApi?this.getItemPublicAggregated(e,t):this.getItemAggregated(e,t)}async getItemPublicAggregated(e,t){const a=Ei(e);if(a)return a;const n=[];t&&(t.withFieldInstances&&n.push("withFieldInstances"),t.withAttachmentInfo&&n.push("withAttachmentInfo"),t.noAttributes&&n.push("noAttributes"),t.noUserAttributes&&n.push("noUserAttributes"),t.noFields&&n.push("noFields"),t.noThumbnails&&n.push("noThumbnails"),t.noLinks&&n.push("noLinks"));let i="";return n.length&&(i=`?${n.join("&")}`),Ei(e)?Ei(e):this.execute("get","/api/item/publicaggregate/"+e+i)}async getItemAggregated(e,t){const a=Ei(e);if(a)return a;const n=[];t&&(t.withFieldInstances&&n.push("withFieldInstances"),t.withAttachmentInfo&&n.push("withAttachmentInfo"),t.noAttributes&&n.push("noAttributes"),t.noUserAttributes&&n.push("noUserAttributes"),t.noFields&&n.push("noFields"),t.noThumbnails&&n.push("noThumbnails"),t.noLinks&&n.push("noLinks"));let i="";return n.length&&(i=`?${n.join("&")}`),Ei(e)?Ei(e):this.execute("get",`/api/item/aggregate/${e}${i}`)}async getItemAggregatedRecursive(e,t){const a=[];t&&(t.withFieldInstances&&a.push("withFieldInstances"),t.withAttachmentInfo&&a.push("withAttachmentInfo"),t.noAttributes&&a.push("noAttributes"),t.noUserAttributes&&a.push("noUserAttributes"),t.noFields&&a.push("noFields"),t.noThumbnails&&a.push("noThumbnails"));let n="";return a.length&&(n=`?${a.join("&")}`),this.execute("get",`/api/item/aggregaterecursive/${e}${n}`)}async getItemPublicRecursive(e,t){return this.execute("get","/api/item/publicrecursive/"+e+(t?"?withFeatures":""))}async getItemPublic(e,t){return this.execute("get","/api/item/public/"+e+(t?"?returnClonedFrom=true":""))}async getItemHistory(e){return this.execute("get","/api/item/history/"+e)}async copyItems(e,t,a,n){return this.execute("post","/api/item/copy",{sourceItemIds:e,destFolderId:t,deepCopy:a,overwrite:n})}async createItem(e){return this.execute("post","/api/item",e)}async updateItem(e){return this.execute("put","/api/item",e)}async deleteItem(e){return this.execute("delete","/api/item",{id:e})}async renameItem(e,t){return this.updateItem({_id:e,name:t})}async queryPublicItemsList(e){return this.execute("post","/api/item/publicquery",e)}async queryItemsListPOP(e){return this.usePublicApi?this.queryPublicItemsList(e):this.queryItemsList(e)}async queryItemsList(e){return this.execute("post","/api/item/query",e)}async queryItemsListAsExcel(e){e.exportAsExcel=!0;const t=await this.execute("post","/api/item/query",e,{responseType:"arraybuffer"}),a=window.URL.createObjectURL(t.blob),n=document.createElement("a");n.href=a,n.setAttribute("download","export.xlsx"),n.click()}async moveItems(e){return this.execute("post","/api/item/move",e)}async downloadItem(e,t){const a=Ti(e);return a||this.execute("get",`/api/item/download/${e}`,null,{responseType:"arraybuffer",progressCallback:t,opName:`Downloading item ${e}`})}async publicDownloadItem(e,t){const a=Ti(e);return a||this.execute("get",`/api/item/publicdownload/${e}`,null,{responseType:"arraybuffer",progressCallback:t})}async getItemHash(e){const t=Ei(e);return t?t.hash:this.execute("get",`/api/item/hash/${e}`)}async requestSecureDownload(e){return this.execute("get","/api/item/requestsecuredownload/"+e)}async getThumbnail(e,t){return this.execute("get",`/api/item/thumbnail/${e}/${t}`)}async uploadThumbnail(e,t,a,n,i,r){const s=this._createFormData(a,n);return this.execute("post",`/api/item/thumbnail/${t}/${e}`,s,{progressCallback:i,controller:r})}async getPublicThumbnail(e,t){return this.execute("get",`/api/item/publicthumbnail/${e}/${t}`)}async makeItemPublic(e,t,a){return this.execute("put","/api/item/makepublic",{id:e,recursive:t,inSubfolders:a})}async setVisibility(e,t,a,n){return this.execute("put","/api/item/setvisibility",{id:e,visibility:t,recursive:a,inSubfolders:n})}async makeItemPrivate(e,t,a){return this.execute("put","/api/item/makeprivate",{id:e,recursive:t,inSubfolders:a})}async setOmitLodGeneration(e,t){return this.execute("get",`/api/item/setOmitLodGeneration/${e}/${t}`)}async setOmitThumbnailGeneration(e,t){return this.execute("get",`/api/item/setOmitThumbnailGeneration/${e}/${t}`)}async setOmitPreviewGeneration(e,t){return this.execute("get",`/api/item/setOmitPreviewGeneration/${e}/${t}`)}async uploadAndCreate(e,t,a,n,i,r){const s=this._createFormData(t,a);let o=`/api/item/uploadAndCreate/${e}`,l={};return n&&("object"==typeof n?(n.autoDestructIn&&(o+="?autoDestructIn="+n.autoDestructIn),n.visibility&&(o+="?visibility="+n.visibility),n.flags&&(o+="?flags="+n.flags),n.overwrite&&(o+="?overwrite="+(n.overwrite?"true":"false")),n.nameOverride&&(l["x-override-name"]=n.nameOverride)):o+="?autoDestructIn="+n),this.execute("post",o,s,{progressCallback:i,controller:r,headers:l})}async upload(e,t,a,n,i,r){const s=[];r&&(r.omitHandleDependencyChange&&s.push("omitHandleDependencyChange=true"),r.keepThumbnails&&s.push("keepThumbnails=true"));let o="";s.length&&(o=`?${s.join("&")}`);const l=this._createFormData(t,a);return this.execute("post",`/api/item/upload/${e}${o}`,l,{progressCallback:n,controller:i})}resetPreview(e){const t=this.execute("delete",`/api/item/attachment/${e}/preview`),a=this.execute("get",`/api/item/setOmitPreviewGeneration/${e}/false`);return Promise.all([t,a])}clearPreview(e){const t=this.execute("delete",`/api/item/attachment/${e}/preview`),a=this.execute("get",`/api/item/setOmitPreviewGeneration/${e}/true`);return Promise.all([t,a])}async clearThumbnail(e){return this.execute("get",`/api/item/clearThumbnail/${e}`)}async resetThumbnail(e){return this.execute("get",`/api/item/resetThumbnail/${e}`)}async downloadAttachmentPOP(e,t,a,n,i){return this.usePublicApi?this.downloadPublicAttachment(e,t,a,n,i):this.downloadAttachment(e,t,a,n,i)}_getAttachmentUrlPath(e,t,a,n,i){return`/api/item/${i?"public":""}attachment/${e}/${t}${null!=a?`/${a}`:"/undefined"}${null!=n?`/${n}`:""}`}async downloadAttachment(e,t,a,n=0,i){const r=Pi(e,t,a,n);return r||this.execute("get",this._getAttachmentUrlPath(e,t,a,n),null,{responseType:"arraybuffer",progressCallback:i})}async downloadPublicAttachment(e,t,a,n,i){const r=Pi(e,t,a,n);return r||this.execute("get",this._getAttachmentUrlPath(e,t,a,n,!0),null,{responseType:"arraybuffer",progressCallback:i})}async uploadAttachment(e,t,a,n,i,r,s,o){const l=this._createFormData(i,r);return this.execute("post",this._getAttachmentUrlPath(e,t,a,n),l,{progressCallback:s,controller:o})}async deleteAttachment(e,t,a,n){return this.attachmentCache.invalidateAttachment(e,t,a,n),this.execute("delete",this._getAttachmentUrlPath(e,t,a,n))}setPerceptiveHashOnAttachment(e,t,a){return this.execute("get",`/api/item/setPerceptiveHashAttachment/${e}/${t}/${a}`)}setPerceptiveHash(e,t){return this.execute("get",`/api/item/setPerceptiveHash/${e}/${t}`)}async getItemClient(e){return this.execute("get",`/api/item/getClient/${e}`)}async getItemAcl(e){return this.execute("get",`/api/item/acl/${e}`)}async getItemsLinking(e){return this.execute("get",`/api/item/linking/${e}`)}async setAttributes(e,t){return this.execute("put","/api/item/setAttributes",{id:e,attributes:t})}async getItemSyncList(e){const t=L(e).format("YYYYMMDDHHmmss");return this.execute("get",`/api/item/synclist/${t}`)}async increaseViews(e){return this.execute("get",`/api/item/increaseViews/${e}`)}async getViews(e){return this.execute("get",`/api/item/views/${e}`)}async getPublicItemCounts(e){return this.execute("get",`/api/item/publiccounts/${e}`)}async getItemCounts(e){return this.execute("get",`/api/item/counts/${e}`)}async likeItem(e){return this.execute("get",`/api/item/like/${e}`)}async unlikeItem(e){return this.execute("get",`/api/item/unlike/${e}`)}async doILike(e){return this.execute("get",`/api/item/doILike/${e}`)}async setItemAutoDestruct(e,t){const a=L(t).format("YYYYMMDDHHmmss");return this.execute("get",`/api/item/setAutoDestruct/${e}/${a}`)}async clearItemAutoDestruct(e){return this.execute("get",`/api/item/clearAutoDestruct/${e}`)}async resolveRelativeItem(e,t){const a=Ei(e);if(!a)return this.execute("post","/api/item/resolve/"+e,{path:t});t.startsWith("/")&&(t=t.substring(1));const n=t.split("/"),i=n.pop();let r=a.folder._id;for(const e of n){let t=!1;for(const[a,n]of Object.entries(Mi()))if(n.parent===r&&n.name===e){r=a,t=!0;break}if(!t)break}for(const e of Object.values(Vi()))if(e.folder._id===r&&e.name===i)return e._id;return console.error(`Could not resolve path ${t} for item ${e}`),null}async publicResolveRelativeItem(e,t){const a=Ei(e);if(!a)return this.execute("post","/api/item/publicResolve/"+e,{path:t});t.startsWith("/")&&(t=t.substring(1));const n=t.split("/"),i=n.pop();let r=xi(a.folder._id);for(const e of n)if(".."===e)r=xi(r.parent);else{const t=Ci(e,r._id);if(!t)throw new Error("Can't find folder while loading folder from package");r=t}const s=Ii(i,r._id);if(s)return s._id;throw new Error("Can't load item from package.")}async rewireItems(e){return this.execute("post","/api/item/rewire",{items:e})}async getFolder(e){return this.execute("get","/api/folder/"+e)}async getFullFolderTree(e){return this.execute("get",`/api/folder/fulltree/${e||"0"}`)}async getFoldersInFolderList(e,t){e=e||"0";const a=[];let n="";if(t){if(t.resolveNames&&!t.folderAsItemType&&"0"!==e){if(n=await this.folderCache.getFolderListing(e),n&&Date.now()-new Date(n.cachedAt).getTime()<1e4)return n;n&&n.parent&&a.push(`lastUpdatedAt=${n.parent.updatedAt}`)}t.resolveNames&&a.push("resolve"),t.folderAsItemType&&a.push(`folderAsItemType=${t.folderAsItemType}`),t.folderAsItemName&&a.push(`folderAsItemName=${t.folderAsItemName}`),t.folderAsItemFlag&&a.push(`folderAsItemFlag=${t.folderAsItemFlag}`),t.withStats&&a.push("withStats=true"),t.returnLatestPackage&&a.push("returnLatestPackage=true")}let i="";a.length&&(i="?"+a.join("&"));const r=await this.execute("get",`/api/folder/infolder/${e}${i}`);if(!0===r.notModified)return n;if(!t||t.resolveNames&&!t.folderAsItemType){const t=await this.getFolderAclList([e,...r.children.map((e=>e._id))]);for(const e of t)await this.folderCache.addACL(e.id,e.acl);return await this.folderCache.addFolderListing(e,r),r}return r}async updateFolderCache(e){const t=[];for(const a of e){if(!a)continue;const e=await this.folderCache.getFolderListing(a);e&&e.parent?t.push({id:a,lastUpdatedAt:e.parent.updatedAt}):t.push({id:a})}const a=await this.execute("post","/api/folder/infolderquery",{folders:t});for(const e of a)!0===e.data.notModified?await this.folderCache.refreshCacheForFolder(e.id):await this.folderCache.addFolderListing(e.id,e.data)}async createFolder(e){return this.execute("post","/api/folder",e)}async updateFolder(e){return this.execute("put","/api/folder",e)}async deleteFolder(e){return this.execute("delete","/api/folder",{id:e})}async renameFolder(e,t){return this.updateFolder({_id:e,name:t})}async moveFolders(e){return this.execute("post","/api/folder/move",e)}async getFolderPath(e){return e?("object"==typeof e&&(e=e._id),this.execute("get","/api/folder/path/"+e)):{path:"/",elements:[]}}async resolveFolderPath(e){return"/"===(e=e.trim())?null:this.execute("post","/api/folder/resolve",{path:e})}async getFolderClient(e){return this.execute("get",`/api/folder/getClient/${e}`)}async getFolderAcl(e){const t=await this.folderCache.getFolderACLs(e||"0",1e4);if(t&&e)return t;{const t=await this.execute("get",`/api/folder/acl/${e||"0"}`);return await this.folderCache.addACL(e||"0",t),t}}async getFolderAclList(e){return this.execute("post","/api/folder/aclquery",{ids:e})}async getUser(e){return this.execute("get","/api/user/"+e)}async getUsersList(){return this.execute("get","/api/user")}async createUser(e){return this.execute("post","/api/user",e)}async queryUser(e,t,a){return this.execute("post","/api/user/query",{searchQuery:e,groupID:t,cursor:a},{withNext:!0})}async updateUser(e){return this.execute("put","/api/user",e)}async deleteUser(e){return this.execute("delete","/api/user",{id:e})}async updateMyProfile(e){return this.execute("put","/api/user/myprofile",e)}async switchClient(e){return this.execute("get",`/api/user/switchclient/${e}`)}async activateUser(e,t){return this.execute("post","/api/user/activate",{token:t,password:e})}async getUsersToApprove(){return this.execute("get","/api/user/approvals")}async approveUserRegistration(e){return this.execute("get",`/api/user/approveuserregistration/${e}`)}async rejectUserRegistration(e){return this.execute("get",`/api/user/rejectuserregistration/${e}`)}async uploadAvatar(e){const t=new r;if(e instanceof Blob)t.append("file",e);else{const a=new Blob([new Uint8Array(e)]);t.append("file",a,"avatar.jpg")}return this.execute("post","/api/user/uploadAvatar",t)}async clearAvatar(){return this.execute("get","/api/user/clearAvatar")}async getAvatar(e,t){return this.execute("get",`/api/user/avatar/${t}/${e}`)}async getUserPublicInfo(e,t,a){return this.execute("get",`/api/user/publicinfo/${e}/${t}/${a}`)}async getUserAttribute(e){return this.execute("get",`/api/user/attribute/${e}`)}async clearUserAttribute(e){return this.execute("delete",`/api/user/attribute/${e}`)}async setUserAttribute(e,t){return this.execute("post",`/api/user/attribute/${e}`,t)}async getGroup(e){return this.execute("get","/api/group/"+e)}async getGroupFolder(e){return this.execute("get","/api/group/folder/"+e)}async getGroupsList(){return this.execute("get","/api/group")}async createGroup(e){return this.execute("post","/api/group",e)}async queryGroup(e,t){return this.execute("post","/api/group/query",{searchQuery:e,cursor:t},{withNext:!0})}async updateGroup(e){return this.execute("put","/api/group",e)}async deleteGroup(e){return this.execute("delete","/api/group",{id:e})}async getGroupQuotaInfo(e){return this.execute("get","/api/group/quota/"+e)}async getGroupPublicInfo(e,t,a){return this.execute("get",`/api/group/publicinfo/${e}/${t}/${a}`)}async getGroupUsers(e){return this.execute("get","/api/group/users/"+e)}async uploadGroupAvatar(e,t){const a=new r;if(t instanceof Blob)a.append("file",t);else{const e=new Blob([new Uint8Array(t)]);a.append("file",e,"avatar.jpg")}return this.execute("post","/api/group/"+e+"/uploadAvatar",a)}async getClientsList(){return this.execute("get","/api/client")}async getClient(e){return this.execute("get",`/api/client/${e}`)}async createClient(e){return this.execute("post","/api/client",e)}async queryClient(e,t){return this.execute("post","/api/client/query",{searchQuery:e,cursor:t},{withNext:!0})}async updateClient(e){return this.execute("put","/api/client",e)}async deleteClient(e){return this.execute("delete","/api/client",{id:e})}async getClientMetrics(e,t,a){return this.execute("get",`/api/client/metrics/${t}/${a}/${e}`)}async joinClient(e){return this.execute("get",`/api/client/join/${e}`)}async leaveClient(e){return this.execute("get",`/api/client/leave/${e}`)}async myClient(){return this.execute("get","/api/client/my")}async saveMyClient(e){return this.execute("put","/api/client/my",e)}async getPublicCategories(e){return this.execute("get",`/api/client/publiccategories/${e}`)}async getCategories(){return this.execute("get","/api/client/categories")}async getCategoriesInClient(e){return this.execute("get",`/api/client/categories/${e}`)}async updateCategoriesInClient(e,t){return this.execute("post",`/api/client/categories/${e}`,t)}async getLicenses(){return this.execute("get","/api/license")}async getLicensesInClient(e){return this.execute("get",`/api/license/inclient/${e}`)}async getLicense(e){return this.execute("get",`/api/license/${e}`)}async createLicense(e){return this.execute("post","/api/license",e)}async updateLicense(e){return this.execute("put","/api/license",e)}async deleteLicense(e,t){return this.execute("delete","/api/license",{_id:e,client:t})}async getPublicLicenses(e){return this.execute("get",`/api/license/publiclist/${e}`)}async getPublicLicense(e){return this.execute("get",`/api/license/public/${e}`)}async getDatatypesList(){return this.execute("get","/api/datatype")}async getPublicDatatypesList(e){return this.execute("get",`/api/datatype/public/${e}`)}async getDatatypesListOnClient(){return this.execute("get","/api/datatype/onclient")}async getDatatypesListOnClientForAll(){return this.execute("get","/api/datatype/onclientforall")}async getAllDatatypesList(){return this.execute("get","/api/datatype/all")}async getDatatype(e){return this.execute("get",`/api/datatype/${e}`)}async createDatatype(e){return this.execute("post","/api/datatype",e)}async updateDatatype(e){return this.execute("put","/api/datatype",e)}async deleteDatatype(e){return this.execute("delete","/api/datatype",{id:e})}async getMyNotifications(e){return this.execute("get","/api/notification"+(e?`?maxCount=${e}`:""))}async markNotificationAsRead(e){return this.execute("get",`/api/notification/markasread/${e}`)}async markAllNotificationsAsRead(){return this.execute("get","/api/notification/markallasread")}async createJob(e){return this.execute("post","/api/job",e,{emitOnSuccess:"job:created"})}async getManualJobTypes(){return this.execute("get","/api/job/manualtypes")}async getManualJobTypesOnClient(){return this.execute("get","/api/job/manualtypes/onclient")}async getManualJobTypesOnClientForAll(){return this.execute("get","/api/job/manualtypes/onclientforall")}async getAllManualJobTypes(){return this.execute("get","/api/job/manualtypes/all")}async getAllManualJobTypesForClient(e){return this.execute("get",`/api/job/manualtypes/all/${e}`)}async getClientJobTypes(){return this.execute("get","/api/job/clientTypes")}async getMyJobs(){return this.execute("get","/api/job/mine")}async getJobs(){return this.execute("get","/api/job")}async getJobsAggregated(){return this.execute("get","/api/job/aggregated")}async getJobsTimeframe(e,t){return this.execute("get",`/api/job/all/${e}/${t}`)}async getJob(e){return this.execute("get",`/api/job/${e}`)}async getJobState(e){return this.execute("get",`/api/job/state/${e}`)}async getAgents(){return this.execute("get","/api/jobagent")}async getAgentsAggregated(){return this.execute("get","/api/jobagent/aggregated")}async enableJobAgent(e){return this.execute("get",`/api/jobagent/enable/${e}`)}async disableJobAgent(e){return this.execute("get",`/api/jobagent/disable/${e}`)}async restartJobAgent(e){return this.execute("get",`/api/jobagent/restart/${e}`)}async getPermissionsList(){return this.execute("get","/api/permission")}async getPlugins(){return this.execute("get","/api/plugin")}async getPlans(){return this.execute("get","/api/plan")}async getPlan(e){return this.execute("get",`/api/plan/${e}`)}async createPlan(e){return this.execute("post","/api/plan",e)}async updatePlan(e){return this.execute("put","/api/plan",e)}async deletePlan(e){return this.execute("delete","/api/plan",{id:e})}async getWorkflows(){return this.execute("get","/api/workflow")}async getWorkflow(e){return this.execute("get",`/api/workflow/${e}`)}async createWorkflow(e){return this.execute("post","/api/workflow",e)}async updateWorkflow(e){return this.execute("put","/api/workflow",e)}async deleteWorkflow(e){return this.execute("delete","/api/workflow",{id:e})}async startWorkflow(e){return this.execute("post","/api/workflow/start",e)}async getAccessTokens(){return this.execute("get","/api/accesstoken")}async getClientAccessTokens(){return this.execute("get","/api/accesstoken/client")}async createAccessToken(e){return this.execute("post","/api/accesstoken",e)}async createClientAccessToken(e){return this.execute("post","/api/accesstoken/client",e)}async deleteAccessToken(e){return this.execute("delete","/api/accesstoken",{id:e})}async deleteClientAccessToken(e){return this.execute("delete","/api/accesstoken/client",{id:e})}async enableAccessToken(e){return this.execute("get",`/api/accesstoken/enable/${e}`)}async disableAccessToken(e){return this.execute("get",`/api/accesstoken/disable/${e}`)}async getApiTokens(){return this.execute("get","/api/apitoken")}async createApiToken(e){return this.execute("post","/api/apitoken",e)}async deleteApiToken(e){return this.execute("delete","/api/apitoken",{id:e})}async getMyClientInvoices(){return this.execute("get","/api/invoice")}async getMyUserInvoices(){return this.execute("get","/api/invoice/my")}async getClientInvoices(e){return this.execute("get",`/api/invoice/client/${e}`)}async downloadInvoice(e,t){const a=await this.execute("get",`/api/invoice/download/${e}`,null,{responseType:"arraybuffer"}),n=window.URL.createObjectURL(a.blob),i=document.createElement("a");i.href=n,i.setAttribute("download",t||"invoice.pdf"),document.body.appendChild(i),i.click()}async regenerateInvoice(e){return this.execute("get",`/api/invoice/regenerate/${e}`)}async getInvoicesForMonth(e,t){return this.execute("get",`/api/invoice/month/${t}/${e}`)}async refundInvoice(e,t,a){return this.execute("post","/api/invoice/refund",{invoice:e,amount:t,reason:a})}async paymentStartCheckout(e,t){return this.execute("post","/api/payment/checkout",{successUrl:e,cancelUrl:t})}async paymentStartUserCheckout(e,t){return this.execute("post","/api/payment/usercheckout",{successUrl:e,cancelUrl:t})}async getSupportedCurrencies(){return this.execute("get","/api/payment/supportedCurrencies")}async getPurchasables(){return this.execute("get","/api/purchasable")}async getPurchasable(e){return this.execute("get",`/api/purchasable/${e}`)}async createPurchasable(e){return this.execute("post","/api/purchasable",e)}async updatePurchasable(e){return this.execute("put","/api/purchasable",e)}async deletePurchasable(e){return this.execute("delete","/api/purchasable",{id:e})}async getPublicPurchasables(e){return this.execute("get",`/api/purchasable/public/${e}`)}async getPurchases(){return this.execute("get","/api/purchase")}async getMyActivePurchases(){return this.execute("get","/api/purchase/active")}async purchase(e){return this.execute("post","/api/purchase",e)}async changePurchaseProduct(e,t,a){return this.execute("post","/api/purchase/change",{purchaseID:e,purchasableID:t,optionID:a})}async cancelPurchase(e){return this.execute("delete","/api/purchase",{id:e})}async uncancelPurchase(e){return this.execute("post","/api/purchase/uncancel",{id:e})}async getSecureSessionPayload(e,t){return this.execute("get","/api/payment/secureSessionPayload?purchasableID="+e+"&optionID="+t)}async queryPurchases(e,t,a,n,i,r){return this.execute("post","/api/purchase/query",{startDate:e,endDate:t,email:a,invoice:n,cursor:i,limit:r})}async getAttributeTemplates(){return this.execute("get","/api/attributetemplate")}async getAttributeTemplate(e){return this.execute("get",`/api/attributetemplate/${e}`)}async createAttributeTemplate(e){return this.execute("post","/api/attributetemplate",e)}async updateAttributeTemplate(e){return this.execute("put","/api/attributetemplate",e)}async deleteAttributeTemplate(e){return this.execute("delete","/api/attributetemplate",{id:e})}async getStorages(){return this.execute("get","/api/storage")}async getConversation(e){return this.execute("get",`/api/conversation/${e}`)}async getPublicConversation(e){return this.execute("get",`/api/conversation/public/${e}`)}async createConversation(e,t){return this.execute("post","/api/conversation",{parentId:e,parentType:t})}async postConversationMessage(e,t,a){return this.execute("post","/api/conversation/post",{id:e,text:t,replyTo:a})}async editConversationMessage(e,t){return this.execute("put","/api/conversation/post",{id:e,text:t})}async deleteConversationMessage(e){return this.execute("delete","/api/conversation/post",{id:e})}async subscribeToConversation(e){return this.execute("post","/api/conversation/subscribe",{id:e})}async unsubscribeFromConversation(e){return this.execute("post","/api/conversation/unsubscribe",{id:e})}async likeConversationEntry(e){return this.execute("post","/api/conversation/like",{id:e})}async unlikeConversationEntry(e){return this.execute("post","/api/conversation/unlike",{id:e})}async command(e){return this.execute("post","/api/command",e)}async getMailTemplates(){return this.execute("get","/api/mailtemplate")}async getMailTemplate(e){return this.execute("get",`/api/mailtemplate/${e}`)}async createMailTemplate(e){return this.execute("post","/api/mailtemplate",e)}async updateMailTemplate(e){return this.execute("put","/api/mailtemplate",e)}async deleteMailTemplate(e){return this.execute("delete","/api/mailtemplate",{id:e})}async addMailTemplateImage(e,t,a){const n=this._createFormData(a,"image.jpg");return this.execute("post",`/api/mailtemplate/image/${e}/${t}`,n)}async deleteMailTemplateImage(e,t){return this.execute("delete",`/api/mailtemplate/image/${e}/${t}`)}async getMailTemplateNames(){return this.execute("get","/api/mailtemplate/names")}async getMailQuery(e,t,a,n){return this.execute("post","/api/email/query",{templateName:e,dateStart:t,dateEnd:a,success:n},{withNext:!0})}async getMail(e){return this.execute("get","/api/email/get?token="+e)}async getInvoiceTemplates(){return this.execute("get","/api/invoicetemplate")}async getInvoiceTemplate(e){return this.execute("get",`/api/invoicetemplate/${e}`)}async createInvoiceTemplate(e){return this.execute("post","/api/invoicetemplate",e)}async updateInvoiceTemplate(e){return this.execute("put","/api/invoicetemplate",e)}async deleteInvoiceTemplate(e){return this.execute("delete","/api/invoicetemplate",{id:e})}async addInvoiceTemplateImage(e,t,a){const n=this._createFormData(a,"image.jpg");return this.execute("post",`/api/invoicetemplate/image/${e}/${t}`,n)}async deleteInvoiceTemplateImage(e,t){return this.execute("delete",`/api/invoicetemplate/image/${e}/${t}`)}async getItemTemplatesList(){return this.execute("get","/api/itemtemplate/list")}async getItemTemplates(){return this.execute("get","/api/itemtemplate")}async createItemTemplate(e){return this.execute("post","/api/itemtemplate",e)}async updateItemTemplate(e){return this.execute("put","/api/itemtemplate",e)}async deleteItemTemplate(e){return this.execute("delete","/api/itemtemplate",{id:e})}async getFeatures(){return this.execute("get","/api/feature")}async getFeaturesOnClient(){return this.execute("get","/api/feature/onclient")}async getFeaturesOnClientForAll(){return this.execute("get","/api/feature/onclientforall")}async getAllFeatures(){return this.execute("get","/api/feature/all")}async getBlogs(){return this.execute("get","/api/blog")}async getBlog(e){return this.execute("get","/api/blog/"+e)}async getPublicBlog(e){return this.execute("get","/api/blog/"+e+"/public")}async createBlog(e,t,a,n){return this.execute("post","/api/blog",{name:e,public:t,commentsEnabled:a,editors:n})}async saveBlog(e,t,a,n,i){return this.execute("put","/api/blog",{_id:e,name:t,public:a,commentsEnabled:n,editors:i})}async deleteBlog(e){return this.execute("delete","/api/blog",{_id:e})}async getBlogOverview(e){return this.execute("get","/api/blog/"+e+"/overview")}async queryBlog(e,t,a,n,i,r,s){return this.execute("post","/api/blog/"+e+"/query",{tag:t,text:a,limit:n,previousArticle:i,searchTag:r,sortBy:s})}async getArticles(e){return this.execute("get","/api/blog/"+e+"/article")}async getArticle(e,t){return this.execute("get","/api/blog/"+e+"/article/"+t)}async getArticleBySlug(e,t){return this.execute("get","/api/blog/article/"+e+"/"+t)}async createArticle(e,t,a){return this.execute("post","/api/blog/"+e+"/article",{title:t,slug:a})}async saveArticle(e,t,a,n,i,r,s,o){return this.execute("put","/api/blog/"+e+"/article",{_id:t,title:a,slug:n,content:o,tags:r,public:i,author:s})}async deleteArticle(e,t){return this.execute("delete","/api/blog/"+e+"/article",{_id:t})}async getNewsletters(){return this.execute("get","/api/newsletter")}async createNewsletter(e,t){return this.execute("post","/api/newsletter",{name:e,editors:t})}async getNewsletter(e){return this.execute("get","/api/newsletter/"+e)}async updateNewsletter(e,t,a,n){return this.execute("put","/api/newsletter/"+e,{name:t,sender:a,editors:n})}async deleteNewsletter(e){return this.execute("delete","/api/newsletter/"+e)}async joinNewsletter(e,t){return this.execute("post","/api/newsletter/join",{id:e,email:t})}async confirmNewsletter(e){return this.execute("post","/api/newsletter/confirm",{token:e})}async unsubscribeFromNewsletter(e){return this.execute("post","/api/newsletter/unsubscribe",{token:e})}async getNewsletterBlocks(){return this.execute("get","/api/newsletterblock")}async getNewsletterBlock(e){return this.execute("get","/api/newsletterblock/"+e)}async createNewsletterBlock(e){return this.execute("post","/api/newsletterblock",{name:e})}async updateNewsletterBlock(e,t,a,n,i,r){return this.execute("put","/api/newsletterblock/"+e,{name:t,inputs:a,html:n,css:i,acceptsChildren:r})}async deleteNewsletterBlock(e){return this.execute("delete","/api/newsletterblock/"+e)}async getNewsletterMails(e){return this.execute("get","/api/newslettermail/"+e)}async getNewsletterMail(e,t){return this.execute("get","/api/newslettermail/"+e+"/"+t)}async createNewsletterMail(e,t){return this.execute("post","/api/newslettermail/"+e,{title:t})}async updateNewsletterMail(e,t,a,n,i){return this.execute("put","/api/newslettermail/"+e+"/"+t,{title:a,blocks:n,parentBlock:i})}async generatePreviewNewsletterMail(e,t){return this.execute("post","/api/newslettermail/render",{blocks:e,parentBlock:t})}async sendTestNewsletter(e,t,a){return this.execute("post","/api/newslettermail/"+e+"/"+t+"/sendTest",{email:a})}async sendOutNewsletter(e,t){return this.execute("post","/api/newslettermail/"+e+"/"+t+"/send",{})}async getPages(){return this.execute("get","/api/page")}async createPage(e,t){return this.execute("post","/api/page",{title:e,slug:t})}async getPage(e){return this.execute("get","/api/page/"+e)}async updatePage(e,t,a,n,i){return this.execute("put","/api/page",{_id:e,title:t,slug:a,public:n,content:i})}async deletePage(e){return this.execute("delete","/api/page",{_id:e})}async getPublicPage(e,t){return this.execute("get","/api/page/public/"+e+"/"+t)}async setItemFlag(e,t,a,n,i,r){return this.execute("post","/api/itemflag",{item:e,isStaffPick:t,featureWeight:a,isGame:n,replaceIndex:i,internalRating:r})}getDownloadUrl(e){return`${this.getApiBaseUrl()}/api/item/download/${e}`}getAttachmentDownloadUrl(e,t,a,n){return`${this.getApiBaseUrl()}${this._getAttachmentUrlPath(e,t,a,n)}`}getPublicAttachmentDownloadUrl(e,t,a,n){return`${this.getApiBaseUrl()}${this._getAttachmentUrlPath(e,t,a,n,!0)}`}getPublicDownloadUrl(e){return`${this.getApiBaseUrl()}/api/item/publicdownload/${e}`}async postFeedback(e){return this.execute("post","/api/feedback",{text:e})}},e.ApiGateway=P,e.Block=ae,e.CustomField=J,e.EventEmitter=l,e.Field=Z,e.InvalidArgumentException=w,e.InvalidStateException=class extends _{constructor(e){super(e,"InvalidStateException")}},e.Item=T,e.ItemCache=Fr,e.ItemRepo=ji,e.ItemVisibility=Rd,e.LinkableItemsCache=class{linkableItemsCache;apiGateway;itemCache;usePublicApi;constructor(e,t,a=!1){this.linkableItemsCache=new Map,this.apiGateway=e,this.itemCache=t,this.usePublicApi=a}clear(){this.linkableItemsCache.clear()}resolveItem(e,t){for(const a of t)if(a._id===e)return a;return null}async loadLinkableItems(e,t){if(!e)throw"loadLinkableItems(): Item cannot be null!";let a=[];if(t.linkableTypes&&t.linkableTypes.length){if(!this.usePublicApi){const n=t.linkableTypes.join("#")+(e.folder?e.folder._id:"");if(this.linkableItemsCache.has(n))return this.linkableItemsCache.get(n);const i=[...t.linkableTypes];i.includes("Package")||i.push("Package");const r={types:i,folder:e.folder?e.folder._id:null};a=(await this.apiGateway.call("LinkableItemsCache::loadLinkableItems","queryItemsList",r)).filter((e=>"Package"!==e.type||t.linkableTypes.includes(e.packageType)));for(const n of e.links)if(null==this.resolveItem(n.to,a))try{const e=await this.itemCache.getItem(n.to);t.linkableTypes.includes(e.type)&&a.push(e)}catch(e){console.error(`Link item ${n.to} not found. Dead link? (${e})`)}this.linkableItemsCache.set(n,a)}}else{for(const t of e.links){const e=await this.itemCache.getItem(t.to);a.push(e)}const n=t.name+"#CurrentLinks";this.linkableItemsCache.set(n,a)}return a}},e.LoaderException=k,e.PackageTools=Bi,e.PreparedItem=K,e.Profiler=v,e.Proxifier=g,e.ProxyEvent=c,e.QuotaExceededException=S,e.Script=W,e.ScriptField=j,e.Snapshot=O,e.Storage=Ji,e.Template=Q,e.TemplateFactory=ee,e.ThumbCache=Rr,e.UndoManager=$i,e.eventBus=u,e.getDatatypeByName=C,e.getDatatypes=function(){return structuredClone(x)},e.hasPermission=function(e,t,a){if(e.admin&&!a)return!0;if(e.superadmin)return!0;if(Array.isArray(e.permissions))if(Array.isArray(t)){for(const a of e.permissions)for(const e of t)if(a===e)return!0}else for(const a of e.permissions)if(a===t)return!0;return!1},e.profileAsyncBlock=async function(e,t){return v.instance.asyncBlock(e,t)},e.profileBlock=function(e,t){return v.instance.block(e,t)},e.tools=h,e.verifyAcl=X}));
18
+ */var Yi=(zi||(zi=1,function(e){e.exports=function e(t,a,n){function i(s,o){if(!a[s]){if(!t[s]){if(!o&&E)return E(s);if(r)return r(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=a[s]={exports:{}};t[s][0].call(u.exports,(function(e){var a=t[s][1][e];return i(a||e)}),u,u.exports,e,t,a,n)}return a[s].exports}for(var r=E,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(e,t,a){(function(e){var a,n,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var r=0,s=new i(c),o=e.document.createTextNode("");s.observe(o,{characterData:!0}),a=function(){o.data=r=++r%2}}else if(e.setImmediate||void 0===e.MessageChannel)a="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){c(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(c,0)};else{var l=new e.MessageChannel;l.port1.onmessage=c,a=function(){l.port2.postMessage(0)}}var u=[];function c(){var e,t;n=!0;for(var a=u.length;a;){for(t=u,u=[],e=-1;++e<a;)t[e]();a=u.length}n=!1}function d(e){1!==u.push(e)||n||a()}t.exports=d}).call(this,void 0!==I?I:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,a){var n=e(1);function i(){}var r={},s=["REJECTED"],o=["FULFILLED"],l=["PENDING"];function u(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,e!==i&&h(this,e)}function c(e,t,a){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof a&&(this.onRejected=a,this.callRejected=this.otherCallRejected)}function d(e,t,a){n((function(){var n;try{n=t(a)}catch(t){return r.reject(e,t)}n===e?r.reject(e,new TypeError("Cannot resolve promise with itself")):r.resolve(e,n)}))}function p(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function h(e,t){var a=!1;function n(t){a||(a=!0,r.reject(e,t))}function i(t){a||(a=!0,r.resolve(e,t))}function s(){t(i,n)}var o=f(s);"error"===o.status&&n(o.value)}function f(e,t){var a={};try{a.value=e(t),a.status="success"}catch(e){a.status="error",a.value=e}return a}function m(e){return e instanceof this?e:r.resolve(new this(i),e)}function y(e){var t=new this(i);return r.reject(t,e)}function g(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var a=e.length,n=!1;if(!a)return this.resolve([]);for(var s=new Array(a),o=0,l=-1,u=new this(i);++l<a;)c(e[l],l);return u;function c(e,i){function l(e){s[i]=e,++o!==a||n||(n=!0,r.resolve(u,s))}t.resolve(e).then(l,(function(e){n||(n=!0,r.reject(u,e))}))}}function b(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var a=e.length,n=!1;if(!a)return this.resolve([]);for(var s=-1,o=new this(i);++s<a;)l(e[s]);return o;function l(e){t.resolve(e).then((function(e){n||(n=!0,r.resolve(o,e))}),(function(e){n||(n=!0,r.reject(o,e))}))}}t.exports=u,u.prototype.catch=function(e){return this.then(null,e)},u.prototype.then=function(e,t){if("function"!=typeof e&&this.state===o||"function"!=typeof t&&this.state===s)return this;var a=new this.constructor(i);return this.state!==l?d(a,this.state===o?e:t,this.outcome):this.queue.push(new c(a,e,t)),a},c.prototype.callFulfilled=function(e){r.resolve(this.promise,e)},c.prototype.otherCallFulfilled=function(e){d(this.promise,this.onFulfilled,e)},c.prototype.callRejected=function(e){r.reject(this.promise,e)},c.prototype.otherCallRejected=function(e){d(this.promise,this.onRejected,e)},r.resolve=function(e,t){var a=f(p,t);if("error"===a.status)return r.reject(e,a.value);var n=a.value;if(n)h(e,n);else{e.state=o,e.outcome=t;for(var i=-1,s=e.queue.length;++i<s;)e.queue[i].callFulfilled(t)}return e},r.reject=function(e,t){e.state=s,e.outcome=t;for(var a=-1,n=e.queue.length;++a<n;)e.queue[a].callRejected(t);return e},u.resolve=m,u.reject=y,u.all=g,u.race=b},{1:1}],3:[function(e,t,a){(function(t){"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,void 0!==I?I:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(e,t,a){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){return}}var s=r();function o(){try{if(!s||!s.open)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}}function l(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(i){if("TypeError"!==i.name)throw i;for(var a=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),n=0;n<e.length;n+=1)a.append(e[n]);return a.getBlob(t.type)}}"undefined"==typeof Promise&&e(3);var u=Promise;function c(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function d(e,t,a){"function"==typeof t&&e.then(t),"function"==typeof a&&e.catch(a)}function p(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function h(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var f="local-forage-detect-blob-support",m=void 0,y={},g=Object.prototype.toString,b="readonly",v="readwrite";function _(e){for(var t=e.length,a=new ArrayBuffer(t),n=new Uint8Array(a),i=0;i<t;i++)n[i]=e.charCodeAt(i);return a}function w(e){return new u((function(t){var a=e.transaction(f,v),n=l([""]);a.objectStore(f).put(n,"key"),a.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},a.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),a=navigator.userAgent.match(/Edge\//);t(a||!e||parseInt(e[1],10)>=43)}})).catch((function(){return!1}))}function A(e){return"boolean"==typeof m?u.resolve(m):w(e).then((function(e){return m=e}))}function k(e){var t=y[e.name],a={};a.promise=new u((function(e,t){a.resolve=e,a.reject=t})),t.deferredOperations.push(a),t.dbReady?t.dbReady=t.dbReady.then((function(){return a.promise})):t.dbReady=a.promise}function S(e){var t=y[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function N(e,t){var a=y[e.name].deferredOperations.pop();if(a)return a.reject(t),a.promise}function T(e,t){return new u((function(a,n){if(y[e.name]=y[e.name]||L(),e.db){if(!t)return a(e.db);k(e),e.db.close()}var i=[e.name];t&&i.push(e.version);var r=s.open.apply(s,i);t&&(r.onupgradeneeded=function(t){var a=r.result;try{a.createObjectStore(e.storeName),t.oldVersion<=1&&a.createObjectStore(f)}catch(a){if("ConstraintError"!==a.name)throw a;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),r.onerror=function(e){e.preventDefault(),n(r.error)},r.onsuccess=function(){var t=r.result;t.onversionchange=function(e){e.target.close()},a(t),S(e)}}))}function M(e){return T(e,!1)}function x(e){return T(e,!0)}function C(e,t){if(!e.db)return!0;var a=!e.db.objectStoreNames.contains(e.storeName),n=e.version<e.db.version,i=e.version>e.db.version;if(n&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),i||a){if(a){var r=e.db.version+1;r>e.version&&(e.version=r)}return!0}return!1}function I(e){return new u((function(t,a){var n=new FileReader;n.onerror=a,n.onloadend=function(a){var n=btoa(a.target.result||"");t({__local_forage_encoded_blob:!0,data:n,type:e.type})},n.readAsBinaryString(e)}))}function V(e){return l([_(atob(e.data))],{type:e.type})}function E(e){return e&&e.__local_forage_encoded_blob}function F(e){var t=this,a=t._initReady().then((function(){var e=y[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return d(a,e,e),a}function D(e){k(e);for(var t=y[e.name],a=t.forages,n=0;n<a.length;n++){var i=a[n];i._dbInfo.db&&(i._dbInfo.db.close(),i._dbInfo.db=null)}return e.db=null,M(e).then((function(t){return e.db=t,C(e)?x(e):t})).then((function(n){e.db=t.db=n;for(var i=0;i<a.length;i++)a[i]._dbInfo.db=n})).catch((function(t){throw N(e,t),t}))}function R(e,t,a,n){void 0===n&&(n=1);try{var i=e.db.transaction(e.storeName,t);a(null,i)}catch(i){if(n>0&&(!e.db||"InvalidStateError"===i.name||"NotFoundError"===i.name))return u.resolve().then((function(){if(!e.db||"NotFoundError"===i.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),x(e)})).then((function(){return D(e).then((function(){R(e,t,a,n-1)}))})).catch(a);a(i)}}function L(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function P(e){var t=this,a={db:null};if(e)for(var n in e)a[n]=e[n];var i=y[a.name];i||(i=L(),y[a.name]=i),i.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=F);var r=[];function s(){return u.resolve()}for(var o=0;o<i.forages.length;o++){var l=i.forages[o];l!==t&&r.push(l._initReady().catch(s))}var c=i.forages.slice(0);return u.all(r).then((function(){return a.db=i.db,M(a)})).then((function(e){return a.db=e,C(a,t._defaultConfig.version)?x(a):e})).then((function(e){a.db=i.db=e,t._dbInfo=a;for(var n=0;n<c.length;n++){var r=c[n];r!==t&&(r._dbInfo.db=a.db,r._dbInfo.version=a.version)}}))}function B(e,t){var a=this;e=p(e);var n=new u((function(t,n){a.ready().then((function(){R(a._dbInfo,b,(function(i,r){if(i)return n(i);try{var s=r.objectStore(a._dbInfo.storeName).get(e);s.onsuccess=function(){var e=s.result;void 0===e&&(e=null),E(e)&&(e=V(e)),t(e)},s.onerror=function(){n(s.error)}}catch(e){n(e)}}))})).catch(n)}));return c(n,t),n}function O(e,t){var a=this,n=new u((function(t,n){a.ready().then((function(){R(a._dbInfo,b,(function(i,r){if(i)return n(i);try{var s=r.objectStore(a._dbInfo.storeName).openCursor(),o=1;s.onsuccess=function(){var a=s.result;if(a){var n=a.value;E(n)&&(n=V(n));var i=e(n,a.key,o++);void 0!==i?t(i):a.continue()}else t()},s.onerror=function(){n(s.error)}}catch(e){n(e)}}))})).catch(n)}));return c(n,t),n}function $(e,t,a){var n=this;e=p(e);var i=new u((function(a,i){var r;n.ready().then((function(){return r=n._dbInfo,"[object Blob]"===g.call(t)?A(r.db).then((function(e){return e?t:I(t)})):t})).then((function(t){R(n._dbInfo,v,(function(r,s){if(r)return i(r);try{var o=s.objectStore(n._dbInfo.storeName);null===t&&(t=void 0);var l=o.put(t,e);s.oncomplete=function(){void 0===t&&(t=null),a(t)},s.onabort=s.onerror=function(){var e=l.error?l.error:l.transaction.error;i(e)}}catch(e){i(e)}}))})).catch(i)}));return c(i,a),i}function U(e,t){var a=this;e=p(e);var n=new u((function(t,n){a.ready().then((function(){R(a._dbInfo,v,(function(i,r){if(i)return n(i);try{var s=r.objectStore(a._dbInfo.storeName).delete(e);r.oncomplete=function(){t()},r.onerror=function(){n(s.error)},r.onabort=function(){var e=s.error?s.error:s.transaction.error;n(e)}}catch(e){n(e)}}))})).catch(n)}));return c(n,t),n}function j(e){var t=this,a=new u((function(e,a){t.ready().then((function(){R(t._dbInfo,v,(function(n,i){if(n)return a(n);try{var r=i.objectStore(t._dbInfo.storeName).clear();i.oncomplete=function(){e()},i.onabort=i.onerror=function(){var e=r.error?r.error:r.transaction.error;a(e)}}catch(e){a(e)}}))})).catch(a)}));return c(a,e),a}function z(e){var t=this,a=new u((function(e,a){t.ready().then((function(){R(t._dbInfo,b,(function(n,i){if(n)return a(n);try{var r=i.objectStore(t._dbInfo.storeName).count();r.onsuccess=function(){e(r.result)},r.onerror=function(){a(r.error)}}catch(e){a(e)}}))})).catch(a)}));return c(a,e),a}function W(e,t){var a=this,n=new u((function(t,n){e<0?t(null):a.ready().then((function(){R(a._dbInfo,b,(function(i,r){if(i)return n(i);try{var s=r.objectStore(a._dbInfo.storeName),o=!1,l=s.openKeyCursor();l.onsuccess=function(){var a=l.result;a?0===e||o?t(a.key):(o=!0,a.advance(e)):t(null)},l.onerror=function(){n(l.error)}}catch(e){n(e)}}))})).catch(n)}));return c(n,t),n}function Y(e){var t=this,a=new u((function(e,a){t.ready().then((function(){R(t._dbInfo,b,(function(n,i){if(n)return a(n);try{var r=i.objectStore(t._dbInfo.storeName).openKeyCursor(),s=[];r.onsuccess=function(){var t=r.result;t?(s.push(t.key),t.continue()):e(s)},r.onerror=function(){a(r.error)}}catch(e){a(e)}}))})).catch(a)}));return c(a,e),a}function H(e,t){t=h.apply(this,arguments);var a=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||a.name,e.storeName=e.storeName||a.storeName);var n,i=this;if(e.name){var r=e.name===a.name&&i._dbInfo.db?u.resolve(i._dbInfo.db):M(e).then((function(t){var a=y[e.name],n=a.forages;a.db=t;for(var i=0;i<n.length;i++)n[i]._dbInfo.db=t;return t}));n=e.storeName?r.then((function(t){if(t.objectStoreNames.contains(e.storeName)){var a=t.version+1;k(e);var n=y[e.name],i=n.forages;t.close();for(var r=0;r<i.length;r++){var o=i[r];o._dbInfo.db=null,o._dbInfo.version=a}var l=new u((function(t,n){var i=s.open(e.name,a);i.onerror=function(e){i.result.close(),n(e)},i.onupgradeneeded=function(){i.result.deleteObjectStore(e.storeName)},i.onsuccess=function(){var e=i.result;e.close(),t(e)}}));return l.then((function(e){n.db=e;for(var t=0;t<i.length;t++){var a=i[t];a._dbInfo.db=e,S(a._dbInfo)}})).catch((function(t){throw(N(e,t)||u.resolve()).catch((function(){})),t}))}})):r.then((function(t){k(e);var a=y[e.name],n=a.forages;t.close();for(var i=0;i<n.length;i++)n[i]._dbInfo.db=null;var r=new u((function(t,a){var n=s.deleteDatabase(e.name);n.onerror=function(){var e=n.result;e&&e.close(),a(n.error)},n.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},n.onsuccess=function(){var e=n.result;e&&e.close(),t(e)}}));return r.then((function(e){a.db=e;for(var t=0;t<n.length;t++)S(n[t]._dbInfo)})).catch((function(t){throw(N(e,t)||u.resolve()).catch((function(){})),t}))}))}else n=u.reject("Invalid arguments");return c(n,t),n}var G={_driver:"asyncStorage",_initStorage:P,_support:o(),iterate:O,getItem:B,setItem:$,removeItem:U,clear:j,length:z,key:W,keys:Y,dropInstance:H};function q(){return"function"==typeof openDatabase}var Z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",J="~~local_forage_type~",K=/^~~local_forage_type~([^~]+)~/,X="__lfsc__:",Q=X.length,ee="arbf",te="blob",ae="si08",ne="ui08",ie="uic8",re="si16",se="si32",oe="ur16",le="ui32",ue="fl32",ce="fl64",de=Q+ee.length,pe=Object.prototype.toString;function he(e){var t,a,n,i,r,s=.75*e.length,o=e.length,l=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);var u=new ArrayBuffer(s),c=new Uint8Array(u);for(t=0;t<o;t+=4)a=Z.indexOf(e[t]),n=Z.indexOf(e[t+1]),i=Z.indexOf(e[t+2]),r=Z.indexOf(e[t+3]),c[l++]=a<<2|n>>4,c[l++]=(15&n)<<4|i>>2,c[l++]=(3&i)<<6|63&r;return u}function fe(e){var t,a=new Uint8Array(e),n="";for(t=0;t<a.length;t+=3)n+=Z[a[t]>>2],n+=Z[(3&a[t])<<4|a[t+1]>>4],n+=Z[(15&a[t+1])<<2|a[t+2]>>6],n+=Z[63&a[t+2]];return a.length%3==2?n=n.substring(0,n.length-1)+"=":a.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}function me(e,t){var a="";if(e&&(a=pe.call(e)),e&&("[object ArrayBuffer]"===a||e.buffer&&"[object ArrayBuffer]"===pe.call(e.buffer))){var n,i=X;e instanceof ArrayBuffer?(n=e,i+=ee):(n=e.buffer,"[object Int8Array]"===a?i+=ae:"[object Uint8Array]"===a?i+=ne:"[object Uint8ClampedArray]"===a?i+=ie:"[object Int16Array]"===a?i+=re:"[object Uint16Array]"===a?i+=oe:"[object Int32Array]"===a?i+=se:"[object Uint32Array]"===a?i+=le:"[object Float32Array]"===a?i+=ue:"[object Float64Array]"===a?i+=ce:t(new Error("Failed to get type for BinaryArray"))),t(i+fe(n))}else if("[object Blob]"===a){var r=new FileReader;r.onload=function(){var a=J+e.type+"~"+fe(this.result);t(X+te+a)},r.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(a){console.error("Couldn't convert value into a JSON string: ",e),t(null,a)}}function ye(e){if(e.substring(0,Q)!==X)return JSON.parse(e);var t,a=e.substring(de),n=e.substring(Q,de);if(n===te&&K.test(a)){var i=a.match(K);t=i[1],a=a.substring(i[0].length)}var r=he(a);switch(n){case ee:return r;case te:return l([r],{type:t});case ae:return new Int8Array(r);case ne:return new Uint8Array(r);case ie:return new Uint8ClampedArray(r);case re:return new Int16Array(r);case oe:return new Uint16Array(r);case se:return new Int32Array(r);case le:return new Uint32Array(r);case ue:return new Float32Array(r);case ce:return new Float64Array(r);default:throw new Error("Unkown type: "+n)}}var ge={serialize:me,deserialize:ye,stringToBuffer:he,bufferToString:fe};function be(e,t,a,n){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],a,n)}function ve(e){var t=this,a={db:null};if(e)for(var n in e)a[n]="string"!=typeof e[n]?e[n].toString():e[n];var i=new u((function(e,n){try{a.db=openDatabase(a.name,String(a.version),a.description,a.size)}catch(e){return n(e)}a.db.transaction((function(i){be(i,a,(function(){t._dbInfo=a,e()}),(function(e,t){n(t)}))}),n)}));return a.serializer=ge,i}function _e(e,t,a,n,i,r){e.executeSql(a,n,i,(function(e,s){s.code===s.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,o){o.rows.length?r(e,s):be(e,t,(function(){e.executeSql(a,n,i,r)}),r)}),r):r(e,s)}),r)}function we(e,t){var a=this;e=p(e);var n=new u((function(t,n){a.ready().then((function(){var i=a._dbInfo;i.db.transaction((function(a){_e(a,i,"SELECT * FROM "+i.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,a){var n=a.rows.length?a.rows.item(0).value:null;n&&(n=i.serializer.deserialize(n)),t(n)}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,t),n}function Ae(e,t){var a=this,n=new u((function(t,n){a.ready().then((function(){var i=a._dbInfo;i.db.transaction((function(a){_e(a,i,"SELECT * FROM "+i.storeName,[],(function(a,n){for(var r=n.rows,s=r.length,o=0;o<s;o++){var l=r.item(o),u=l.value;if(u&&(u=i.serializer.deserialize(u)),void 0!==(u=e(u,l.key,o+1)))return void t(u)}t()}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,t),n}function ke(e,t,a,n){var i=this;e=p(e);var r=new u((function(r,s){i.ready().then((function(){void 0===t&&(t=null);var o=t,l=i._dbInfo;l.serializer.serialize(t,(function(t,u){u?s(u):l.db.transaction((function(a){_e(a,l,"INSERT OR REPLACE INTO "+l.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){r(o)}),(function(e,t){s(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(n>0)return void r(ke.apply(i,[e,o,a,n-1]));s(t)}}))}))})).catch(s)}));return c(r,a),r}function Se(e,t,a){return ke.apply(this,[e,t,a,1])}function Ne(e,t){var a=this;e=p(e);var n=new u((function(t,n){a.ready().then((function(){var i=a._dbInfo;i.db.transaction((function(a){_e(a,i,"DELETE FROM "+i.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,t),n}function Te(e){var t=this,a=new u((function(e,a){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){_e(t,n,"DELETE FROM "+n.storeName,[],(function(){e()}),(function(e,t){a(t)}))}))})).catch(a)}));return c(a,e),a}function Me(e){var t=this,a=new u((function(e,a){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){_e(t,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],(function(t,a){var n=a.rows.item(0).c;e(n)}),(function(e,t){a(t)}))}))})).catch(a)}));return c(a,e),a}function xe(e,t){var a=this,n=new u((function(t,n){a.ready().then((function(){var i=a._dbInfo;i.db.transaction((function(a){_e(a,i,"SELECT key FROM "+i.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,a){var n=a.rows.length?a.rows.item(0).key:null;t(n)}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,t),n}function Ce(e){var t=this,a=new u((function(e,a){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){_e(t,n,"SELECT key FROM "+n.storeName,[],(function(t,a){for(var n=[],i=0;i<a.rows.length;i++)n.push(a.rows.item(i).key);e(n)}),(function(e,t){a(t)}))}))})).catch(a)}));return c(a,e),a}function Ie(e){return new u((function(t,a){e.transaction((function(n){n.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(a,n){for(var i=[],r=0;r<n.rows.length;r++)i.push(n.rows.item(r).name);t({db:e,storeNames:i})}),(function(e,t){a(t)}))}),(function(e){a(e)}))}))}function Ve(e,t){t=h.apply(this,arguments);var a=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||a.name,e.storeName=e.storeName||a.storeName);var n,i=this;return c(n=e.name?new u((function(t){var n;n=e.name===a.name?i._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:n,storeNames:[e.storeName]}):t(Ie(n))})).then((function(e){return new u((function(t,a){e.db.transaction((function(n){function i(e){return new u((function(t,a){n.executeSql("DROP TABLE IF EXISTS "+e,[],(function(){t()}),(function(e,t){a(t)}))}))}for(var r=[],s=0,o=e.storeNames.length;s<o;s++)r.push(i(e.storeNames[s]));u.all(r).then((function(){t()})).catch((function(e){a(e)}))}),(function(e){a(e)}))}))})):u.reject("Invalid arguments"),t),n}var Ee={_driver:"webSQLStorage",_initStorage:ve,_support:q(),iterate:Ae,getItem:we,setItem:Se,removeItem:Ne,clear:Te,length:Me,key:xe,keys:Ce,dropInstance:Ve};function Fe(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}function De(e,t){var a=e.name+"/";return e.storeName!==t.storeName&&(a+=e.storeName+"/"),a}function Re(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch(e){return!0}}function Le(){return!Re()||localStorage.length>0}function Pe(e){var t=this,a={};if(e)for(var n in e)a[n]=e[n];return a.keyPrefix=De(e,t._defaultConfig),Le()?(t._dbInfo=a,a.serializer=ge,u.resolve()):u.reject()}function Be(e){var t=this,a=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,a=localStorage.length-1;a>=0;a--){var n=localStorage.key(a);0===n.indexOf(e)&&localStorage.removeItem(n)}}));return c(a,e),a}function Oe(e,t){var a=this;e=p(e);var n=a.ready().then((function(){var t=a._dbInfo,n=localStorage.getItem(t.keyPrefix+e);return n&&(n=t.serializer.deserialize(n)),n}));return c(n,t),n}function $e(e,t){var a=this,n=a.ready().then((function(){for(var t=a._dbInfo,n=t.keyPrefix,i=n.length,r=localStorage.length,s=1,o=0;o<r;o++){var l=localStorage.key(o);if(0===l.indexOf(n)){var u=localStorage.getItem(l);if(u&&(u=t.serializer.deserialize(u)),void 0!==(u=e(u,l.substring(i),s++)))return u}}}));return c(n,t),n}function Ue(e,t){var a=this,n=a.ready().then((function(){var t,n=a._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(n.keyPrefix.length)),t}));return c(n,t),n}function je(e){var t=this,a=t.ready().then((function(){for(var e=t._dbInfo,a=localStorage.length,n=[],i=0;i<a;i++){var r=localStorage.key(i);0===r.indexOf(e.keyPrefix)&&n.push(r.substring(e.keyPrefix.length))}return n}));return c(a,e),a}function ze(e){var t=this.keys().then((function(e){return e.length}));return c(t,e),t}function We(e,t){var a=this;e=p(e);var n=a.ready().then((function(){var t=a._dbInfo;localStorage.removeItem(t.keyPrefix+e)}));return c(n,t),n}function Ye(e,t,a){var n=this;e=p(e);var i=n.ready().then((function(){void 0===t&&(t=null);var a=t;return new u((function(i,r){var s=n._dbInfo;s.serializer.serialize(t,(function(t,n){if(n)r(n);else try{localStorage.setItem(s.keyPrefix+e,t),i(a)}catch(e){"QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||r(e),r(e)}}))}))}));return c(i,a),i}function He(e,t){if(t=h.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var a=this.config();e.name=e.name||a.name,e.storeName=e.storeName||a.storeName}var n,i=this;return n=e.name?new u((function(t){e.storeName?t(De(e,i._defaultConfig)):t(e.name+"/")})).then((function(e){for(var t=localStorage.length-1;t>=0;t--){var a=localStorage.key(t);0===a.indexOf(e)&&localStorage.removeItem(a)}})):u.reject("Invalid arguments"),c(n,t),n}var Ge={_driver:"localStorageWrapper",_initStorage:Pe,_support:Fe(),iterate:$e,getItem:Oe,setItem:Ye,removeItem:We,clear:Be,length:ze,key:Ue,keys:je,dropInstance:He},qe=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},Ze=function(e,t){for(var a=e.length,n=0;n<a;){if(qe(e[n],t))return!0;n++}return!1},Je=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},Ke={},Xe={},Qe={INDEXEDDB:G,WEBSQL:Ee,LOCALSTORAGE:Ge},et=[Qe.INDEXEDDB._driver,Qe.WEBSQL._driver,Qe.LOCALSTORAGE._driver],tt=["dropInstance"],at=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(tt),nt={description:"",driver:et.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function it(e,t){e[t]=function(){var a=arguments;return e.ready().then((function(){return e[t].apply(e,a)}))}}function rt(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var a in t)t.hasOwnProperty(a)&&(Je(t[a])?arguments[0][a]=t[a].slice():arguments[0][a]=t[a])}return arguments[0]}var st=function(){function e(t){for(var a in i(this,e),Qe)if(Qe.hasOwnProperty(a)){var n=Qe[a],r=n._driver;this[a]=r,Ke[r]||this.defineDriver(n)}this._defaultConfig=rt({},nt),this._config=rt({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return e.prototype.config=function(e){if("object"===(void 0===e?"undefined":n(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,a){var n=new u((function(t,a){try{var n=e._driver,i=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void a(i);for(var r=at.concat("_initStorage"),s=0,o=r.length;s<o;s++){var l=r[s];if((!Ze(tt,l)||e[l])&&"function"!=typeof e[l])return void a(i)}var d=function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),a=u.reject(t);return c(a,arguments[arguments.length-1]),a}},a=0,n=tt.length;a<n;a++){var i=tt[a];e[i]||(e[i]=t(i))}};d();var p=function(a){Ke[n]&&console.info("Redefining LocalForage driver: "+n),Ke[n]=e,Xe[n]=a,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(p,a):p(!!e._support):p(!0)}catch(e){a(e)}}));return d(n,t,a),n},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,a){var n=Ke[e]?u.resolve(Ke[e]):u.reject(new Error("Driver not found."));return d(n,t,a),n},e.prototype.getSerializer=function(e){var t=u.resolve(ge);return d(t,e),t},e.prototype.ready=function(e){var t=this,a=t._driverSet.then((function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready}));return d(a,e,e),a},e.prototype.setDriver=function(e,t,a){var n=this;Je(e)||(e=[e]);var i=this._getSupportedDrivers(e);function r(){n._config.driver=n.driver()}function s(e){return n._extend(e),r(),n._ready=n._initStorage(n._config),n._ready}function o(e){return function(){var t=0;function a(){for(;t<e.length;){var i=e[t];return t++,n._dbInfo=null,n._ready=null,n.getDriver(i).then(s).catch(a)}r();var o=new Error("No available storage method found.");return n._driverSet=u.reject(o),n._driverSet}return a()}}var l=null!==this._driverSet?this._driverSet.catch((function(){return u.resolve()})):u.resolve();return this._driverSet=l.then((function(){var e=i[0];return n._dbInfo=null,n._ready=null,n.getDriver(e).then((function(e){n._driver=e._driver,r(),n._wrapLibraryMethodsWithReady(),n._initDriver=o(i)}))})).catch((function(){r();var e=new Error("No available storage method found.");return n._driverSet=u.reject(e),n._driverSet})),d(this._driverSet,t,a),this._driverSet},e.prototype.supports=function(e){return!!Xe[e]},e.prototype._extend=function(e){rt(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],a=0,n=e.length;a<n;a++){var i=e[a];this.supports(i)&&t.push(i)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=at.length;e<t;e++)it(this,at[e])},e.prototype.createInstance=function(t){return new e(t)},e}(),ot=new st;t.exports=ot},{3:3}]},{},[4])(4)}(Wi)),Wi.exports),Hi=V(Yi);class Gi{databaseName;collectionName;size;_store;constructor(e,t,a){Hi.config({driver:Hi.INDEXEDDB}),this.databaseName=e||"lumino-cache",this.collectionName=t||"data",this.size=a,this._store=Hi.createInstance({name:this.databaseName,storeName:this.collectionName})}async init(){}async _keys(){return this._store.keys()}async _set(e,t){return this._store.setItem(e,t)}async _clear(){return this._store.clear()}async _get(e){return this._store.getItem(e)}async _remove(e){return this._store.removeItem(e)}}function qi(e){let t,a,n,i;e.onmessage=async r=>{const s=r.data;try{switch(s.type){case"init":{n=s.databaseName,i=s.collectionName,t=await navigator.storage.getDirectory();const r=await t.getDirectoryHandle(n,{create:!0});a=await r.getDirectoryHandle(i,{create:!0}),e.postMessage({type:s.type,database:n,collection:i,success:!0});break}case"write":{if(!a)throw new Error("OPFS Worker: not initialized yet!");const t=await a.getFileHandle(s.filename,{create:!0}),r=await t.createSyncAccessHandle();let o;if("string"==typeof s.content){o=(new TextEncoder).encode(s.content).buffer}else if(s.content instanceof ArrayBuffer)o=s.content;else{if(!(s.content instanceof Blob))throw new Error("OPFS Worker: Unsupported content type: "+typeof s.content);o=await s.content.arrayBuffer()}r.truncate(o.byteLength),r.write(o,{at:0}),await r.flush(),r.close(),e.postMessage({type:s.type,database:n,collection:i,success:!0});break}}}catch(t){e.postMessage({type:s.type,success:!1,database:n,collection:i,error:t.message})}}}class Zi{databaseName;collectionName;size;_worker;_storage;_root;constructor(e,t,a){this.databaseName=e||"lumino-cache",this.collectionName=t||"data",this.size=a}async init(){if("object"==typeof globalThis.navigator&&"storage"in globalThis.navigator&&"function"==typeof globalThis.navigator.storage.getDirectory){this._storage=await navigator.storage.getDirectory();const e=await this._storage.getDirectoryHandle(this.databaseName,{create:!0});let t,a;this._root=await e.getDirectoryHandle(this.collectionName,{create:!0}),this._worker=new Worker(URL.createObjectURL(new Blob(["(",qi.toString(),")(self)"],{type:"application/javascript"})),{type:"module"});let n=new Promise(((e,n)=>{t=e,a=n}));return this._worker.onmessage=e=>{const n=e.data;n.success||console.error("OPFS Worker failed:",n),"init"===n.type&&(n.success?t():a(n.error))},this._worker.postMessage({type:"init",databaseName:this.databaseName,collectionName:this.collectionName}),n}}async _keys(){if(!this._root)return[];const e=[];for await(const t of this._root.values())e.push(t.name);return e}async _set(e,t){if(!this._root)return;let a;if(t instanceof Blob)a=t;else if("object"==typeof t){const e=JSON.stringify(t,null,2);a=new Blob([e],{type:"application/json"})}else a=new Blob([t],{type:"text/plain"});const n=await this._root.getFileHandle(e,{create:!0});if("function"==typeof n.createWritable){const e=await n.createWritable();await e.write(a),await e.close()}else this._worker.postMessage({type:"write",filename:e,content:a})}async _clear(){if(!this._root)return;const e=[];for await(const t of this._root.values())e.push(this._root.removeEntry(t.name));return Promise.all(e)}async _get(e,t){if(!this._root)return null;let a;try{const t=await this._root.getFileHandle(e);a=await t.getFile()}catch(e){return null}switch(t=t||a.type){case"text/plain":return a.text();case"application/json":{const e=await a.text();try{return JSON.parse(e)}catch(t){return console.error("Content was loaded from cache but could not be json parsed: ",e),null}}default:return a}}async _remove(e){if(this._root)return this._root.removeEntry(e)}}class Ji{databaseName;collectionName;size;type;_impl;constructor(e,t,a=0,n=1){switch(this.databaseName=e||"lumino",this.collectionName=t||"data",this.size=1048576*(n||1),this.type=a,this.type){case 0:this._impl=new Gi(this.databaseName,this.collectionName,this.size);break;case 1:this._impl=new Zi(this.databaseName,this.collectionName,this.size);break;default:throw"Invalid storage type: "+a}}async init(){return this._impl.init()}async _keys(){return this._impl._keys()}fixKey(e){return e.replaceAll("/","_")}async _set(e,t){return this._impl._set(this.fixKey(e),t)}async _clear(){return this._impl._clear()}async _get(e,t){return this._impl._get(this.fixKey(e),t)}async _remove(e){return this._impl._remove(this.fixKey(e))}}var Ki,Xi,Qi,er,tr,ar,nr,ir,rr,sr,or,lr,ur,cr,dr,pr,hr,fr,mr,yr,gr,br,vr,_r,wr,Ar,kr,Sr;function Nr(){if(Xi)return Ki;return Xi=1,Ki=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}}function Tr(){if(ar)return tr;ar=1;var e=function(){if(er)return Qi;er=1;var e="object"==typeof I&&I&&I.Object===Object&&I;return Qi=e}(),t="object"==typeof self&&self&&self.Object===Object&&self,a=e||t||Function("return this")();return tr=a}function Mr(){if(lr)return or;lr=1;var e=function(){if(sr)return rr;sr=1;var e=/\s/;return rr=function(t){for(var a=t.length;a--&&e.test(t.charAt(a)););return a}}(),t=/^\s+/;return or=function(a){return a?a.slice(0,e(a)+1).replace(t,""):a}}function xr(){if(cr)return ur;cr=1;var e=Tr().Symbol;return ur=e}function Cr(){if(yr)return mr;yr=1;var e=xr(),t=function(){if(pr)return dr;pr=1;var e=xr(),t=Object.prototype,a=t.hasOwnProperty,n=t.toString,i=e?e.toStringTag:void 0;return dr=function(e){var t=a.call(e,i),r=e[i];try{e[i]=void 0;var s=!0}catch(e){}var o=n.call(e);return s&&(t?e[i]=r:delete e[i]),o}}(),a=function(){if(fr)return hr;fr=1;var e=Object.prototype.toString;return hr=function(t){return e.call(t)}}(),n=e?e.toStringTag:void 0;return mr=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":n&&n in Object(e)?t(e):a(e)}}function Ir(){if(_r)return vr;_r=1;var e=Cr(),t=br?gr:(br=1,gr=function(e){return null!=e&&"object"==typeof e});return vr=function(a){return"symbol"==typeof a||t(a)&&"[object Symbol]"==e(a)}}var Vr=function(){if(Sr)return kr;Sr=1;var e=Nr(),t=function(){if(ir)return nr;ir=1;var e=Tr();return nr=function(){return e.Date.now()}}(),a=function(){if(Ar)return wr;Ar=1;var e=Mr(),t=Nr(),a=Ir(),n=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,r=/^0o[0-7]+$/i,s=parseInt;return wr=function(o){if("number"==typeof o)return o;if(a(o))return NaN;if(t(o)){var l="function"==typeof o.valueOf?o.valueOf():o;o=t(l)?l+"":l}if("string"!=typeof o)return 0===o?o:+o;o=e(o);var u=i.test(o);return u||r.test(o)?s(o.slice(2),u?2:8):n.test(o)?NaN:+o}}(),n=Math.max,i=Math.min;return kr=function(r,s,o){var l,u,c,d,p,h,f=0,m=!1,y=!1,g=!0;if("function"!=typeof r)throw new TypeError("Expected a function");function b(e){var t=l,a=u;return l=u=void 0,f=e,d=r.apply(a,t)}function v(e){var t=e-h;return void 0===h||t>=s||t<0||y&&e-f>=c}function _(){var e=t();if(v(e))return w(e);p=setTimeout(_,function(e){var t=s-(e-h);return y?i(t,c-(e-f)):t}(e))}function w(e){return p=void 0,g&&l?b(e):(l=u=void 0,d)}function A(){var e=t(),a=v(e);if(l=arguments,u=this,h=e,a){if(void 0===p)return function(e){return f=e,p=setTimeout(_,s),m?b(e):d}(h);if(y)return clearTimeout(p),p=setTimeout(_,s),b(h)}return void 0===p&&(p=setTimeout(_,s)),d}return s=a(s)||0,e(o)&&(m=!!o.leading,c=(y="maxWait"in o)?n(a(o.maxWait)||0,s):c,g="trailing"in o?!!o.trailing:g),A.cancel=function(){void 0!==p&&clearTimeout(p),f=0,l=h=u=p=void 0},A.flush=function(){return void 0===p?d:w(t())},A},kr}(),Er=V(Vr);class Fr extends Ji{apiClient;cache=new Map;urlToIdMap=new Map;logging=!1;ready=!1;usePublicApi=!1;quota=0;size=0;usePersistentStorage=!1;saveIndex;constructor(e,t,a,n){if(super("lumino","items",1),!a)throw"A lumino client needs to be passed.";this.apiClient=a,this.usePublicApi=e,this.quota=1048576*(n||1024),this.usePersistentStorage=t;this.saveIndex=Er((()=>{const e=[];for(const t of this.cache.values())e.push({id:t.id,time:t.time.valueOf(),size:t.size,hash:t.hash,itemType:t.itemType,mimeType:t.mimeType,itemName:t.itemName});this._set("index",e).then((function(){})).catch((function(e){console.error("Error saving cache index: "+e)}))}),1e3)}async init(){return await super.init(),this.initFromStorage()}getQuota(){return this.quota}setQuota(e){this.quota=e,this.checkQuota()}getCount(){return this.cache.size}getSize(){return this.size}async initFromStorage(){if(this.usePersistentStorage){const e=await this._get("index","application/json");if(e&&Array.isArray(e))for(const t of e)t.time=L(t.time),this.cache.set(t.id,t),this.size+=t.size;else await this._clear(),this.saveIndex()}this.ready=!0,u.$emit("itemCache:cacheReady"),u.$emit("itemCache:cacheChange"),u.$on("item:rename",(e=>this.handleRename(e)))}async addToStorage(e,t){if(this.usePersistentStorage){const a={id:e.id,time:L(e.time.toDate()),size:e.size,hash:e.hash,itemType:e.itemType,mimeType:e.mimeType,itemName:e.itemName};await this._set(`blob_${e.id}`,t),this.cache.set(e.id,a),this.saveIndex()}this.size+=e.size}waitUntilReady(){const e=this;return new Promise(((t,a)=>{try{e.ready?t():u.$on("itemCache:cacheReady",(()=>{t()}))}catch(e){a(e)}}))}findObject(e){return this.cache.get(e)}getEntries(){return this.cache.values()}clear(){for(const e of this.cache.values())e.objectUrl&&URL.revokeObjectURL(e.objectUrl);this.cache.clear(),u.$emit("itemCache:cacheChange"),this.usePersistentStorage&&this._clear().then((function(){console.log("Cache storage cleared.")})).catch((function(e){console.error(e)}))}clearMemory(){for(let e of this.cache.values())e.objectUrl&&(URL.revokeObjectURL(e.objectUrl),delete e.objectUrl);u.$emit("itemCache:cacheChange")}checkQuota(e=0){let t=this.size+e;if(t>this.quota){const e=[...this.cache.entries()].sort((function(e,t){return e[1].time.valueOf()-t[1].time.valueOf()}));let a=0;for(;t>this.quota&&a<e.length;){const n=e[a][1];n.objectUrl||(t-=n.size,this.removeObjectFromCache(n.id)),a++}}}removeObjectFromCache(e){const t=this.cache.get(e);t&&(t.objectUrl&&URL.revokeObjectURL(t.objectUrl),this.cache.delete(e),this.size-=t.size,this.usePersistentStorage&&(this._remove(`blob_${t.id}`).then((function(){console.log(`Removed blob for ${e} from cache`)})).catch((function(t){console.error(`Error removing blob for ${e} from cache: ${t}`)})),this.saveIndex()))}getIdFromUrl(e){return this.urlToIdMap.has(e)?this.urlToIdMap.get(e):null}getById(e){const t=this.findObject(e);return t?(this.logging&&console.log("Retrieving from cache: "+e),t.time=L(),t):(this.logging&&console.error("Object not in cache: "+e),null)}getObjectUrl(e){const t=this.getIdFromUrl(e);if(!t)return console.error("Could not find URL in cache: "+e),"";const a=this.getById(t);return a?a.objectUrl:(console.error("Could not find Id in cache: "+t),"")}async getBufferById(e){const t=await this.getBlobById(e);return t?await new Response(t).arrayBuffer():null}async getBlobById(e){const t=this.getById(e);return t?await fetch(t.objectUrl).then((e=>e.blob())):null}async loadFromStorage(e){if(e.objectUrl)return!0;let t=null;return!!this.usePersistentStorage&&(t=await this._get(`blob_${e.id}`),!!t&&(e.objectUrl=URL.createObjectURL(t),e.time=L(),this.saveIndex(),u.$emit("itemCache:cacheChange"),!0))}getCacheKey(e,t){return t&&"item"!==t.type?e+"_lod"+t.index:e}_getLodLevelUrl(e,t){let a;return a=t&&"item"!==t.type?this.apiClient.getAttachmentDownloadUrl(e,"lod",t.index):this.apiClient.getDownloadUrl(e),a}async loadItem(e,t,a){let n=0;for(;;)try{let n;if(this.usePublicApi)n=t&&"item"!==t.type?await this.apiClient.downloadPublicAttachment(e,"lod",t.index,void 0,a):await this.apiClient.publicDownloadItem(e,a);else try{n=t&&"item"!==t.type?await this.apiClient.downloadAttachment(e,"lod",t.index,void 0,a):await this.apiClient.downloadItem(e,a)}catch{n=t&&"item"!==t.type?await this.apiClient.downloadPublicAttachment(e,"lod",t.index,void 0,a):await this.apiClient.publicDownloadItem(e,a)}return n}catch(t){if(console.log(t),n++,!(n<3))return u.$emit("client:fatalError",`Failed to download item ${e}`),null;console.debug(`Failed attempts to download item ${e}: ${n}. Trying again...`)}}async addItemToCache(e,t,a,n){try{const i=this.getCacheKey(e,t),r=this.findObject(i);if(r&&(a||!this.apiClient.getItemHash||this.usePublicApi||(a=await this.apiClient.getItemHash(e)),a&&r.hash===a&&(this.logging&&console.log("Item already in cache: "+e),await this.loadFromStorage(r))))return r.url||(r.url=this._getLodLevelUrl(e,t)),this.urlToIdMap.set(r.url,i),this.cache.set(i,r),r;n&&n(0);let s=await this.loadItem(e,t,n);if(!s)return console.error("Was not able to load object into cache: "+i),null;n&&n(100);const o=this._getLodLevelUrl(e,t),l=URL.createObjectURL(s.blob),c={id:i,url:o,time:L(),objectUrl:l,size:s.blob.size,hash:s.hash,itemType:s.itemType,mimeType:s.mimeType,itemName:s.itemName};return this.checkQuota(c.size),await this.addToStorage(c,s.blob),this.cache.set(i,c),this.urlToIdMap.set(o,i),this.saveIndex(),u.$emit("itemCache:cacheChange"),this.logging&&console.log("Added item to cache: ",c),c}catch(e){return console.error(e),null}}getObjectCount(){return this.cache.size}getObjectSize(){let e=0;for(const t of this.cache.values())e+=t.size;return e}handleRename({id:e,newName:t}){const a=this.cache.get(e);a&&(a.itemName=t,this.saveIndex(),u.$emit("itemCache:cacheChange"))}}class Dr extends Ji{apiClient;ready=!1;maxNumItems=1e4;constructor(e){if(super("lumino","folders",1),!e)throw"A lumino client needs to be passed.";this.apiClient=e}async init(){await super.init(),await this.checkStorage(),this.ready=!0}clear(){return this._clear()}async checkStorage(){const e=await this._keys();let t=e.length-this.maxNumItems;if(t>0){t=Math.floor(this.maxNumItems/2);const a=[];for(let n=0;n<t;n++)a.push(this._remove(e[n]));await Promise.all(a)}}async getFolderListing(e){return this.ready?this._get(e,"application/json"):null}async getItemListing(e){if(!this.ready)return null;const t=await this._get("items_"+e,"application/json");if(!t)return null;const a=await this.getFolderListing(e);return a&&a.parent&&new Date(t.cachedAt).getTime()>new Date(a.parent.updatedAt).getTime()?t.data:null}async getFolderACLs(e,t){if(!this.ready)return null;const a=await this._get("acl_"+e,"application/json");return a&&Date.now()-a.cachedAt<t?(delete a.cachedAt,a):null}async refreshCacheForFolder(e){const t=await this.getFolderListing(e);await this.addFolderListing(e,t)}async addFolderListing(e,t){this.ready&&(await this._set(e,{...t,cachedAt:new Date}),await this.checkStorage())}async addItemListing(e,t){this.ready&&(await this._set("items_"+e,{data:t,cachedAt:new Date}),await this.checkStorage())}async addACL(e,t){this.ready&&(await this._set("acl_"+e,{...t,cachedAt:new Date}),await this.checkStorage())}}class Rr extends Ji{apiClient;constructor(e){if(super("lumino","thumbs",1),!e)throw"A lumino client needs to be passed.";this.apiClient=e}clear(){this._clear()}async _loadThumbnail(e,t){try{return await this.apiClient.getThumbnail(e,t)}catch{try{return await this.apiClient.getPublicThumbnail(e,t)}catch{return null}}}async get(e,t,a,n){if(!t)throw"Cannot retrieve item thumbnail from cache without knowing size!";let i=await this._get(e,"application/json");if(i&&i.hash===a&&i.timestamp===n){for(const e of i.thumbnails)if(e.size===t){if(e.data)return e.data;i.thumbnails.removeObject(e);break}let a=await this._loadThumbnail(t,e);return a&&(i.thumbnails.push({size:t,data:a}),await this._set(e,i)),a}let r=await this._loadThumbnail(t,e);if(a||n){let s=[];r&&s.push({size:t,data:r}),i={id:e,hash:a,timestamp:n,thumbnails:s},await this._set(e,i)}return r}}class Lr{apiClient;cache=new Map;constructor(e){this.apiClient=e,this.cache=new Map}async resolve(e){let t=this.cache.get(e);if(!t)try{t=this.apiClient.getUserPublicInfo(e,this.apiClient.requestClientId,32),this.cache.set(e,t)}catch(e){console.error(e)}return t}}class Pr{apiClient;cache=new Map;constructor(e){this.apiClient=e}async resolve(e){let t=this.cache.get(e);if(!t)try{t=this.apiClient.getGroupPublicInfo(e,this.apiClient.requestClientId,32),this.cache.set(e,t)}catch(e){console.error(e)}return t}}class Br{apiClient;cache=new Map;constructor(e){this.apiClient=e}async get(e,t,a,n,i=!1){const r=`${e}_${t}_${a}${void 0===n?"":`_${n}`}`,s=this.cache.get(r);if(s)return s;try{const s=new Promise((async r=>{try{let s;s=i?await this.apiClient.downloadPublicAttachment(e,t,a,n,void 0):await this.apiClient.downloadAttachmentPOP(e,t,a,n,void 0);r(URL.createObjectURL(s.blob))}catch(e){r(null)}}));return this.cache.set(r,s),s}catch(e){return console.warn(`Attachment ${r} not available.`),null}}invalidateAttachment(e,t,a,n){let i=`${e}_${t}`;null!=a&&(i+=`_${a}`);for(const e of this.cache.keys()){const t=null==n||e.endsWith(`_${n}`);e.startsWith(i)&&t&&this.cache.delete(e)}}}class Or{apiClient;itemRepo;jobManager;items=[];hasExternalResources=!1;totalSize=0;affectedFolderIds=new Set;constructor(e){this.apiClient=e,this.itemRepo=e.getItemRepo(),this.jobManager=e.getJobManager()}_updateQuota(){this.apiClient.eventBus.$emit("quota:update")}async getPreviousVersions(e,t){const a=[];t=t||"published";const n=await this.apiClient.createFolder({name:t,parent:e,returnIfExists:!0}),i=await this.apiClient.getFoldersInFolderList(n,{folderAsItemType:"Package"});for(const e of i.children)e.item&&a.push({itemId:e.item._id,folderId:e._id,version:e.name,name:e.item.name,filesize:0|e.item.filesize,visibility:e.item.visibility});return a}async verify(e){const t=this,a=new Map,n=new Map;e=e?await this.itemRepo.loadItem(e._id,{recursive:!0}):this.itemRepo.activeItem;const i=await r(e.folder);async function r(e){try{if(e){const a=e._id?e._id:e;if(n.has(a))return n.get(a);{const e=(await t.apiClient.getFolderPath(a)).path;return n.set(a,e),e}}return"/"}catch{return""}}await this.itemRepo.traverseItems((async function(e){const t={_id:e._id,name:e.name,type:e.type,size:e.totalSize,path:await r(e.folder),item:e,external:!1};t.path.startsWith(i)?t.path=t.path.slice(i.length):t.external=!0,a.set(e._id,t)})),this.items=Array.from(a.values()),this.hasExternalResources=!1,this.totalSize=0;for(const e of this.items)e.external&&(this.hasExternalResources=!0),this.totalSize+=e.size;return!this.hasExternalResources}getItems(){return this.items}async unpackToProject(e,t,a,n){a&&(t=await this.apiClient.createFolder({name:a,parent:t,returnIfExists:!0}));const i=await this.apiClient.getItem(e);i.folder===t&&await this.apiClient.renameItem(e,i.name+" (Unpackaged)");const r=await this.apiClient.createFolder({name:i.name,parent:t,fixNameCollisions:!0}),s=await this.jobManager.execute("JS:Unpackage",[{_id:e,isFolder:!1}],[{name:"Destination Folder",value:r},{name:"Make Destination Visible",value:!1}],n);if(this._updateQuota(),3===s.state){const t=s.log.trim().split(";");if(2!==t.length||"UNPACKAGED"!==t[0])throw new A("Unpacking failed. Did not get unpackaged item id!");const a=t[1].trim();return await this.apiClient.renameItem(a,i.name),await this.itemRepo.replaceLink(e,a),a}if(2===s.state)throw new A("Unpacking failed: "+s.error)}async copyItemToProject(e,t,a,n){return(await this.copyItemsToProject([{_id:e,isFolder:!1}],t,a,n))[0].newId}async copyItemsToProject(e,t,a,n){a=a||"packages",t=await this.apiClient.createFolder({name:a,parent:t,returnIfExists:!0}),this.affectedFolderIds.add(t);const i=[];if(e.length){const a=await this.jobManager.execute("JS:CloneItem",e,[{name:"Deep Clone",value:!1},{name:"Destination Folder",value:t},{name:"Exclude Types",value:""},{name:"Make Private",value:!0}],n);if(this._updateQuota(),3===a.state){if(!a.log.trim().length)throw new A("Copy job returned no results.");{const e=a.log.split("\n").reverse();for(const t of e){const e=t.trim().split(";");if(3===e.length){const t=e[1],a=e[2];await this.itemRepo.replaceLink(t,a),i.push({oldId:t,newId:a})}}}}else if(2===a.state)throw new A("Copying of items failed: "+a.error)}return i}async copyToProject(e,t,a){const n=[];for(const e of this.items)e.external&&n.push({_id:e._id,isFolder:!1});return this.copyItemsToProject(n,e,t,a)}async unpublish(e){await this.apiClient.makeItemPrivate(e,!1,!1)}async publish(e,t,a,n,i,r,s,o){const l=e.version;n=n||`published/${l.major}.${l.minor}.${l.revision}`,i=void 0===i||i,r=void 0===r||r,this.affectedFolderIds.add(a);let u,c=a;if(n){const e=n.split("/");for(const t of e)c=await this.apiClient.createFolder({name:t,parent:c,returnIfExists:!0}),this.affectedFolderIds.add(c),u||(u=c)}const d=(await this.apiClient.getFoldersInFolderList(a)).children.map((e=>e._id)).filter((e=>e!==u)).join(","),p=await this.jobManager.execute("JS:CreatePackage",[{_id:e._id,isFolder:!1}],[{name:"Folders To Include",value:d},{name:"Destination Folder",value:c},{name:"Item Name",value:t},{name:"Make Public",value:!!i},{name:"Copy External",value:!!r},{name:"Always Create New Package",value:!!s},{name:"Make Cloneable",value:!!o}]);if(this._updateQuota(),2===p.state)throw new A("Packaging failed: "+p.error);this.apiClient.eventBus.$emit("folder:changed",Array.from(this.affectedFolderIds.values()))}}class $r{id;job;nextCheckMs;constructor(e,t,a){this.id=e,this.job=a,this.nextCheckMs=t}}class Ur{apiClient;jobs=new Map;constructor(e){this.apiClient=e}getJobs(){return Array.from(this.jobs.values())}async execute(e,t,a,n=void 0,i){const r=this;return new Promise((async(s,o)=>{try{const o=async()=>{try{u.job=await r.apiClient.getJobState(l);let e=!1;switch(u.job.state){case 0:case 1:try{n&&n(u.job)}catch(e){console.error("Error calling progress callback: ",e)}break;case 2:case 3:console.log("Job is done."),e=!0,s(u.job)}e?r.jobs.delete(l):(u.nextCheckMs=Math.min(2*u.nextCheckMs,8e3),setTimeout(o,u.nextCheckMs))}catch(e){console.error("Error fetching job state: "+e)}},l=await r.apiClient.createJob({type:e,elements:t,parameters:a,requiredParameters:i}),u=new $r(l,1e3);r.jobs.set(l,u),setTimeout(o,u.nextCheckMs)}catch(e){o(e)}}))}}const jr={mp3:{name:"Mpeg Audio Layer 3",itemType:"Audio",itemTypeCollection:"Audio Collection",collectionEntryName:"AudioItems",folderName:"audio",defaultAction:"Use",actions:["Skip","Use"]},hdr:{name:"HDR Image",itemType:"HDR Image",folderName:"envmaps",defaultAction:"Use",actions:["Skip","Use"]},glb:{name:"Gltf Binary",itemType:"Mesh",itemTypeCollection:"Mesh Collection",collectionEntryName:"MeshItems",folderName:"meshes",defaultAction:"Use",actions:["Skip","Use"]},png:{name:"Portable Network Graphics",itemType:"Image",folderName:"textures",defaultAction:"Use",actions:["Skip","Use"]},jpg:{name:"JPEG",itemType:"Image",folderName:"textures",defaultAction:"Use",actions:["Skip","Use"]},jpeg:{name:"JPEG",itemType:"Image",folderName:"textures",defaultAction:"Use",actions:["Skip","Use"]},lua:{name:"Lua",itemType:"Script",folderName:"scripts",defaultAction:"Use",actions:["Skip","Use"]},ttf:{name:"True Type Font",itemType:"Font",folderName:"fonts",defaultAction:"Use",actions:["Skip","Use"]},otf:{name:"Open Type Font",itemType:"Font",folderName:"fonts",defaultAction:"Use",actions:["Skip","Use"]},unknown:{name:"Unsupported",itemType:"Unknown",defaultAction:"Skip",actions:["Skip"],invisible:!0}},zr={Audio:"audio","Audio Collection":"audio","HDR Image":"envmaps",Mesh:"meshes","Mesh Collection":"",Script:"scripts",Material:"materials","Background Shader":"background shaders","Pixel Shader":"pixel shaders","Vertex Shader":"vertex shaders",Image:"textures",Scene:"prefabs",Font:"fonts"};function Wr(e,t){let a=jr[t];a||(a=jr.unknown),e.size=e.blob?e.blob.size:0,e.type=a.name,e.collectionType=a.itemTypeCollection,e.collectionEntryName=a.collectionEntryName,e.action=a.defaultAction,e.actions=a.actions,e.folderName=a.folderName,e.itemType=a.itemType,e.name=function(e,t){let a=e.lastIndexOf(".");return e.substring(0,a<0?e.length:a)+"."+t}(e.name,t)}class Yr{name;blob;processing=!1;progress=0;size=0;type;collectionType;collectionEntryName;action;actions;folderName;itemType;constructor(e,t,a){this.name=e,this.blob=t,Wr(this,a)}}class Hr{apiClient;itemRepo;jobManager;items=[];mainItem;totalSize=0;oldMainItemId;originalItemIds=[];affectedFolderIds=new Set;packageId;converter;supportedExtensions;hasExternalResources=!1;constructor(e){this.apiClient=e,this.itemRepo=e.getItemRepo(),this.jobManager=e.getJobManager();const t=[];for(const e in jr)jr[e].invisible||t.push(`.${e.toUpperCase()}`);this.supportedExtensions=t.sort(((e,t)=>e.localeCompare(t)))}_updateQuota(){this.apiClient.eventBus.$emit("quota:update")}_addAffectedFolder(e){"object"==typeof e&&e._id?this.affectedFolderIds.add(e._id):"string"==typeof e?this.affectedFolderIds.add(e):console.error("Invalid affected folder to add: ",e)}getAffectedFolderIds(){return Array.from(this.affectedFolderIds.values())}getSupportedExtensions(){return this.supportedExtensions}setConverter(e){this.converter=e}setItems(e){this.items=e}async scan(e){const t=this,a=new Map,n=new Map;this.mainItem=await this.itemRepo.loadItem(e,{recursive:!0}),this.oldMainItemId=this.mainItem._id;const i=await r(this.mainItem.folder);async function r(e){try{if(e){const a=e._id?e._id:e;if(n.has(a))return n.get(a);{const e=(await t.apiClient.getFolderPath(a)).path;return n.set(a,e),e}}return"/"}catch(e){return console.error(e),""}}await this.itemRepo.traverseItems((async function(e){const n={_id:e._id,name:e.name,type:e.type,size:e.totalSize,path:await r(e.folder),item:e,external:!1};n.path.startsWith(i)?n.path=n.path.slice(i.length):n.external=!0,t._addAffectedFolder(e.folder),a.set(e._id,n)}),this.mainItem),this.items=Array.from(a.values()),this.originalItemIds=this.items.map((e=>e._id)),this.hasExternalResources=!1,this.totalSize=0;for(const e of this.items)e.external&&(this.hasExternalResources=!0),this.totalSize+=e.size;return this.items}getItems(){return this.items}async saveMainItemChanges(){const e=this.mainItem;await this.apiClient.updateItem({_id:e._id,name:e.name,shortDescription:e.shortDescription,description:e.description,tags:e.tags,categories:e.categories,visibility:e.visibility,contributors:e.contributors,version:e.version})}async createAssetFolder(e,t){let a=e;const n=t.split("/");this._addAffectedFolder(e);for(const e of n)a=await this.apiClient.createFolder({name:e,parent:a,returnIfExists:!0}),this._addAffectedFolder(a);const i=await this.apiClient.getItemsInFolderList(a,!0);if(i&&i.length)throw new Error("Asset folder already exists and is not empty!");return a}createStandardAssetFolderPath(e){let t=zr[e.type];return t||(t=e.type.toLowerCase()+"s"),`assets/${t}/${e.name}`}async executeActions(){if(!this.converter)throw new Error("No converter is configured. Cannot execute actions on items.");return this.converter(this.items,Wr)}async createAsset(e,t=!1,a){const n=[];for(const e of this.items)n.push(e._id);if(this._addAffectedFolder(e),n.length)if(t){await this.apiClient.moveItems({items:n,dest:e})!==n.length&&console.warn("Not all items could be moved. Most likely due to permissions."),this.mainItem.folder=e}else{const t=await this.jobManager.execute("JS:CloneItem",[{_id:this.mainItem._id,isFolder:!1}],[{name:"Deep Clone",value:!0},{name:"Destination Folder",value:e},{name:"Exclude Types",value:""}],a);if(3===t.state){const a=t.log.split("\n").reverse()[0].split(";");this.mainItem={...this.mainItem,_id:a[2],folder:e}}else if(2===t.state)throw new A("Copying of items failed: "+t.error)}"Main"!==this.mainItem.name&&(this.mainItem.originalName=this.mainItem.name,this.mainItem.name="Main",await this.apiClient.renameItem(this.mainItem._id,this.mainItem.name));const i=await this.apiClient.getItem(this.mainItem._id);return i.flags||(i.flags=[]),i.flags.includes("original")||i.flags.push("original"),await this.apiClient.updateItem(i),this._updateQuota(),this.mainItem._id}async createPackage(e,t=!1,a=!1){let n,i=this.mainItem.folder;if(this._addAffectedFolder(i),void 0===e){const t=this.mainItem.version||{major:1,minor:0,revision:0};e=`published/${t.major}.${t.minor}.${t.revision}`}if(void 0===t&&(t=!0),e){const t=e.split("/");for(const e of t)i=await this.apiClient.createFolder({name:e,parent:i,returnIfExists:!0}),this._addAffectedFolder(i),n||(n=i)}const r=(await this.apiClient.getFoldersInFolderList(this.mainItem.folder)).children.map((e=>e._id)).filter((e=>e!==n)).join(","),s=await this.jobManager.execute("JS:CreatePackage",[{_id:this.mainItem._id,isFolder:!1}],[{name:"Folders To Include",value:r},{name:"Destination Folder",value:i},{name:"Item Name",value:this.mainItem.originalName||this.mainItem.name},{name:"Make Public",value:!!t},{name:"Copy External",value:!!a}]);if(this._updateQuota(),2===s.state)throw new A("Packaging failed: "+s.error);const o=s.log.split("\n").reverse()[0].split(";");this.packageId=o[2]}async replaceReferences(){await this.itemRepo.replaceLink(this.oldMainItemId,this.packageId)}async deleteOriginalItems(){await this.apiClient.deleteItem(this.originalItemIds)}sendFolderRefreshEvent(){this.apiClient.eventBus.$emit("folder:changed",this.getAffectedFolderIds())}async processUploads(e){const t=[];for(const a of e)if("application/zip"===a.type||"application/x-zip-compressed"===a.type){const e=new s;try{const n=[];(await e.loadAsync(a)).forEach(((e,a)=>{const i=a.name.split("/").pop();if(!i.startsWith(".")){const e=i.split(".").pop(),r=a.async("blob");n.push(r),r.then((function(n){const i=new Yr(a.name,n,e);t.push(i)}))}})),await Promise.all(n)}catch(e){console.error("Error reading the ZIP file:",e)}}else{const e=a.name.split(".").pop(),n=new Yr(a.name,a,e);t.push(n)}return t}detectAssets(e){let t,a,n,i=0;for(const r of e)if("Use"===r.action)if(void 0===t)t=r.itemType,a=r.collectionType,n=r.folderName,i++;else{if(t!==r.itemType)return{valid:!1,reason:"Mixed item types found. To create an asset, upload a single type of file for example only meshes."};i++}return 0===i?{valid:!1,reason:"There are no files we can use to create an asset."}:i>1&&!a?{valid:!1,reason:"Cannot create collections of this type."}:{valid:!0,assetType:i>1?a:t,itemCount:i,folderName:n}}_filterUploadFiles(e){let t=[];for(const a of e)"Use"===a.action&&t.push(a);return t}createNewItem(){return{name:"New asset",type:"",description:"",shortDescription:"",tags:[],flags:["original"],categories:[],license:"CC0",allowConversation:!0,version:{major:1,minor:0,revision:0}}}async createAssetFromFiles(e,t,a,n=!1,i=!1){const r=this.detectAssets(e);if(r.assetType!==a.type)throw new Error("Asset type not valid for these items.");if(!r.valid)throw new Error(r.reason||"No valid asset detected.");let s=await this.apiClient.createFolder({name:r.folderName,parent:t,returnIfExists:!0}),o=await this.apiClient.createFolder({name:a.name,parent:s,returnIfExists:!0}),l=!1;if(0===(await this.apiClient.getItemsInFolderList(o)).length){(await this.apiClient.getFoldersInFolderList(o)).children.length&&(l=!0)}else l=!0;if(l){if(!n)throw new Error("Cannot create asset, target folder is not empty!");await this.apiClient.deleteFolder(o),o=await this.apiClient.createFolder({name:a.name,parent:s})}let u,c=this._filterUploadFiles(e);if(1===c.length){const e=c[0];e.processing=!0,e.progress=0,u=await this.apiClient.uploadAndCreate(o,e.blob,e.name,{nameOverride:"Main",flags:"original"},(function(t){e.progress=t})),this._updateQuota(),e.action="Skip"}else{let e=await this.apiClient.createFolder({name:"resources",parent:o}),t={},a=[],n=0;for(const i of c){i.processing=!0,i.progress=0;const r=await this.apiClient.uploadAndCreate(e,i.blob,i.name,void 0,(function(e){i.progress=e}));this._updateQuota(),i.action="Skip",t[`${i.collectionEntryName}[${n}]->Name`]="",a.push({usage:`MeshItems[${n}]->Mesh`,to:r}),n++}u=await this.apiClient.createItem({type:r.assetType,name:"Main",flags:["original"],folder:o,fixNameCollisions:!0,attributes:t,links:a})}return a._id=u,a.folder=o,this.mainItem=a,i?{assetItemId:u,assetTypeFolderId:s,assetFolderId:o}:u}}class Gr{apiClient;itemRepo;constructor(e){this.apiClient=e,this.itemRepo=e.getItemRepo()}grab(e,t,a,n){n=n||{};const i=[];for(const r of a){const a=this._serializeBlockFields(r),s=this._serializeScripts(r),o={type:"block",item:e._id,field:t.name,path:"",block:{id:r.id,type:r.type||"Group",fields:a,scripts:s,children:[]}};n.omitPath||(o.path=this._getBlockPath(r)),n.withChildren&&(o.block.children=this.grab(e,t,r.blocks||[],{withChildren:!0,returnArray:!0})),i.push(o)}if(n.returnArray)return i;const r={type:"serializedBlocks",data:i};return n.noStringify?r:JSON.stringify(r,null,2)}async put(e,t,a,n={}){e=this.validateMessage(e);const i=[];for(const r of e.data){const e=await this._putBlock(r,t,a,n);e&&i.push(e)}return i}validateMessage(e){if("string"==typeof e&&(e=JSON.parse(e)),"serializedBlocks"!==e.type)throw new Error("Data must be a serialized block message. Format is wrong.");if(!Array.isArray(e.data))throw new Error("The contained data is not an array.");return e}async clone(e,t,a,n,i={}){const r=this.grab(n,t,[e],{withChildren:!0,noStringify:!0});return this.put(r,t,a,i)}_updateScriptFieldReferences(e,t){const a=new Map,n=(e,t)=>{a.set(e.block.id,t.id);const i=e.block.children||[],r=t.blocks||[];for(let e=0;e<i.length;e++)n(i[e],r[e])};n(e,t),this.itemRepo.updateScriptFieldReferencesFromMap(a,t)}async _putBlock(e,t,a,n={},i=!1){if(!e.block||!e.block.type||!e.block.fields)return null;const r=e.block,s=this._findItemById(e.item)??this.itemRepo.activeItem;let o=a;o||(o=this._findParentBlock(s,e.field,e.path));const l={};if(Array.isArray(r.fields))for(const e of r.fields){const{name:t,type:a,value:i,linkto:r}=e;if("Separator"!==a)if(n.fieldOverrides&&t in n.fieldOverrides)l[t]=n.fieldOverrides[t];else if(r){const e=this.itemRepo.getLoadedItem(r);l[t]=e||await this.itemRepo.loadItem(r)}else l[t]=i}const u=n.dontCopyScripts?[]:[...r.scripts],c=await this._createUnproxifiedBlock(r.type,l,u,t,s),d={...n,parentPosition:void 0,fieldOverrides:void 0};if(!c)return console.warn(`Could not create block of type ${r.type}. Skipping.`),null;if(Array.isArray(r.children))for(const e of r.children)await this._putBlock(e,t,c,d,!0);if(i&&o)return"number"==typeof n.parentPosition?o.blocks.splice(n.parentPosition,0,c):o.blocks.push(c),c.parent=o,c;n.dontCopyScripts||this._updateScriptFieldReferences(e,c);return this._proxifyAndAttachTree(c,o,s,n.parentPosition)}async _createUnproxifiedBlock(e,t,a,n,i){let r=ee.instance.getTemplate(i.packageType||i.type,n.name,e);if(!r)return null;if(t){const e=r.template.clone().specialize(t);r={displayName:r.displayName,typeName:r.typeName,template:e,inputs:r.inputs,outputs:r.outputs}}const s=new ae(void 0,void 0,r.typeName,void 0,r.displayName,i),o=await this.itemRepo.createFieldsForItem(s,r.template,i,!0);return s.setFields(o),s.blocks=[],await this.itemRepo.createScriptsForItem(s,a,i,!1),s}_proxifyAndAttachTree(e,t,a,n){const i=e=>{if(Array.isArray(e.blocks)&&e.blocks.length)for(const t of e.blocks)i(t);const t=e.blocks.map((e=>g.instance.proxyBlock(e,a)));e.blocks=g.instance.proxyBlockArray(t,e,a),e.scripts=g.instance.proxyScriptArray(e.scripts,e,a)};i(e),e.parent=t;const r=g.instance.proxyBlock(e,a);return"number"==typeof n?t.blocks.splice(n,0,r):t.blocks.push(r),r}_findItemById(e){return this.itemRepo.findLoadedItem(e)}_findItemField(e,t){if(!e.fieldInstances)return null;for(const a of e.fieldInstances)if(a.name===t)return a;return null}_findParentBlock(e,t,a){const n=this._findItemField(e,t);if(!n)return null;const i=a.split("/");let r=n.blocks,s=null;for(const e of i)s=r[e],r=s.blocks;return s}_getBlockIndex(e){if(!e.parent)return 0;let t=0;for(const a of e.parent.blocks){if(e.id===a.id)return t;t++}throw new Error("Could not find block in parent block array!")}_getBlockPath(e){const t=[];let a=e;for(;a;)t.push(this._getBlockIndex(a)),a=a.parent;return"/"+t.reverse().join("/")}_serializeBlockFields(e){const t=[];if(!Array.isArray(e.fields))return t;for(const a of e.fields)switch(a.type){case"Link":t.push({name:a.name,linkto:a.value?._id});break;case"Attribute":t.push({name:a.name,value:a.value});break;case"Separator":t.push({name:a.name,type:"Separator"})}return t}_serializeScripts(e){const t=[];if(!Array.isArray(e.scripts))return t;for(const a of e.scripts){const e=[],n={item:a.item?.value?._id,fields:e};for(const t of a.fields)e.push({name:t.name,value:t.value});t.push(n)}return t}}function qr(){throw new Error("setTimeout has not been defined")}function Zr(){throw new Error("clearTimeout has not been defined")}Array.prototype.pushAll||(Array.prototype.pushAll=function(e){for(const t of e)this.push(t)}),Array.prototype.removeObject||(Array.prototype.removeObject=function(e){const t=this.indexOf(e);return t>-1&&(this.splice(t,1),!0)}),Array.prototype.moveObjectToArray||(Array.prototype.moveObjectToArray=function(e,t,a){const n=this.indexOf(e);if(n>-1){return(0,this.moveToArray)(n,t,a)}return!1}),Array.prototype.removeByFilterFunc||(Array.prototype.removeByFilterFunc=function(e){let t=0;for(let a=0;a<this.length;a++)e(this[a])&&(this.splice(a,1),a--,t++);return t}),Array.prototype.clone||(Array.prototype.clone=function(){const e=[];for(const t of this)e.push(t);return e});var Jr=qr,Kr=Zr;function Xr(e){if(Jr===setTimeout)return setTimeout(e,0);if((Jr===qr||!Jr)&&setTimeout)return Jr=setTimeout,setTimeout(e,0);try{return Jr(e,0)}catch(t){try{return Jr.call(null,e,0)}catch(t){return Jr.call(this,e,0)}}}"function"==typeof Mn.setTimeout&&(Jr=setTimeout),"function"==typeof Mn.clearTimeout&&(Kr=clearTimeout);var Qr,es=[],ts=!1,as=-1;function ns(){ts&&Qr&&(ts=!1,Qr.length?es=Qr.concat(es):as=-1,es.length&&is())}function is(){if(!ts){var e=Xr(ns);ts=!0;for(var t=es.length;t;){for(Qr=es,es=[];++as<t;)Qr&&Qr[as].run();as=-1,t=es.length}Qr=null,ts=!1,function(e){if(Kr===clearTimeout)return clearTimeout(e);if((Kr===Zr||!Kr)&&clearTimeout)return Kr=clearTimeout,clearTimeout(e);try{return Kr(e)}catch(t){try{return Kr.call(null,e)}catch(t){return Kr.call(this,e)}}}(e)}}function rs(e,t){this.fun=e,this.array=t}rs.prototype.run=function(){this.fun.apply(null,this.array)};function ss(){}var os=ss,ls=ss,us=ss,cs=ss,ds=ss,ps=ss,hs=ss;var fs=Mn.performance||{},ms=fs.now||fs.mozNow||fs.msNow||fs.oNow||fs.webkitNow||function(){return(new Date).getTime()};var ys=new Date;var gs={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var a=1;a<arguments.length;a++)t[a-1]=arguments[a];es.push(new rs(e,t)),1!==es.length||ts||Xr(is)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:os,addListener:ls,once:us,off:cs,removeListener:ds,removeAllListeners:ps,emit:hs,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*ms.call(fs),a=Math.floor(t),n=Math.floor(t%1*1e9);return e&&(a-=e[0],(n-=e[1])<0&&(a--,n+=1e9)),[a,n]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-ys)/1e3}};const bs=()=>new Map,vs=e=>{const t=bs();return e.forEach(((e,a)=>{t.set(a,e)})),t},_s=(e,t,a)=>{let n=e.get(t);return void 0===n&&e.set(t,n=a()),n},ws=()=>new Set,As=e=>e[e.length-1],ks=(e,t)=>{for(let a=0;a<t.length;a++)e.push(t[a])},Ss=Array.from,Ns=Array.isArray;class Ts{constructor(){this._observers=bs()}on(e,t){return _s(this._observers,e,ws).add(t),t}once(e,t){const a=(...n)=>{this.off(e,a),t(...n)};this.on(e,a)}off(e,t){const a=this._observers.get(e);void 0!==a&&(a.delete(t),0===a.size&&this._observers.delete(e))}emit(e,t){return Ss((this._observers.get(e)||bs()).values()).forEach((e=>e(...t)))}destroy(){this._observers=bs()}}class Ms{constructor(){this._observers=bs()}on(e,t){_s(this._observers,e,ws).add(t)}once(e,t){const a=(...n)=>{this.off(e,a),t(...n)};this.on(e,a)}off(e,t){const a=this._observers.get(e);void 0!==a&&(a.delete(t),0===a.size&&this._observers.delete(e))}emit(e,t){return Ss((this._observers.get(e)||bs()).values()).forEach((e=>e(...t)))}destroy(){this._observers=bs()}}const xs=Math.floor,Cs=Math.abs,Is=(e,t)=>e<t?e:t,Vs=(e,t)=>e>t?e:t,Es=Math.pow,Fs=e=>0!==e?e<0:1/e<0,Ds=64,Rs=128,Ls=127,Ps=Number.MAX_SAFE_INTEGER,Bs=Number.isInteger||(e=>"number"==typeof e&&isFinite(e)&&xs(e)===e),Os=String.fromCharCode,$s=/^\s*/g,Us=/([A-Z])/g,js=(e,t)=>(e=>e.replace($s,""))(e.replace(Us,(e=>`${t}${(e=>e.toLowerCase())(e)}`))),zs="undefined"!=typeof TextEncoder?new TextEncoder:null,Ws=zs?e=>zs.encode(e):e=>{const t=unescape(encodeURIComponent(e)),a=t.length,n=new Uint8Array(a);for(let e=0;e<a;e++)n[e]=t.codePointAt(e);return n};let Ys="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});Ys&&1===Ys.decode(new Uint8Array).length&&(Ys=null);class Hs{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const Gs=()=>new Hs,qs=e=>{let t=e.cpos;for(let a=0;a<e.bufs.length;a++)t+=e.bufs[a].length;return t},Zs=e=>{const t=new Uint8Array(qs(e));let a=0;for(let n=0;n<e.bufs.length;n++){const i=e.bufs[n];t.set(i,a),a+=i.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),a),t},Js=(e,t)=>{const a=e.cbuf.length;e.cpos===a&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(2*a),e.cpos=0),e.cbuf[e.cpos++]=t},Ks=Js,Xs=(e,t)=>{for(;t>Ls;)Js(e,Rs|Ls&t),t=xs(t/128);Js(e,Ls&t)},Qs=(e,t)=>{const a=Fs(t);for(a&&(t=-t),Js(e,(t>63?Rs:0)|(a?Ds:0)|63&t),t=xs(t/64);t>0;)Js(e,(t>Ls?Rs:0)|Ls&t),t=xs(t/128)},eo=new Uint8Array(3e4),to=eo.length/3,ao=zs&&zs.encodeInto?(e,t)=>{if(t.length<to){const a=zs.encodeInto(t,eo).written||0;Xs(e,a);for(let t=0;t<a;t++)Js(e,eo[t])}else io(e,Ws(t))}:(e,t)=>{const a=unescape(encodeURIComponent(t)),n=a.length;Xs(e,n);for(let t=0;t<n;t++)Js(e,a.codePointAt(t))},no=(e,t)=>{const a=e.cbuf.length,n=e.cpos,i=Is(a-n,t.length),r=t.length-i;e.cbuf.set(t.subarray(0,i),n),e.cpos+=i,r>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(Vs(2*a,r)),e.cbuf.set(t.subarray(i)),e.cpos=r)},io=(e,t)=>{Xs(e,t.byteLength),no(e,t)},ro=(e,t)=>{((e,t)=>{const a=e.cbuf.length;a-e.cpos<t&&(e.bufs.push(new Uint8Array(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(2*Vs(a,t)),e.cpos=0)})(e,t);const a=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,a},so=new DataView(new ArrayBuffer(4)),oo=(e,t)=>{switch(typeof t){case"string":Js(e,119),ao(e,t);break;case"number":Bs(t)&&Cs(t)<=2147483647?(Js(e,125),Qs(e,t)):(a=t,so.setFloat32(0,a),so.getFloat32(0)===a?(Js(e,124),((e,t)=>{ro(e,4).setFloat32(0,t,!1)})(e,t)):(Js(e,123),((e,t)=>{ro(e,8).setFloat64(0,t,!1)})(e,t)));break;case"bigint":Js(e,122),((e,t)=>{ro(e,8).setBigInt64(0,t,!1)})(e,t);break;case"object":if(null===t)Js(e,126);else if(Ns(t)){Js(e,117),Xs(e,t.length);for(let a=0;a<t.length;a++)oo(e,t[a])}else if(t instanceof Uint8Array)Js(e,116),io(e,t);else{Js(e,118);const a=Object.keys(t);Xs(e,a.length);for(let n=0;n<a.length;n++){const i=a[n];ao(e,i),oo(e,t[i])}}break;case"boolean":Js(e,t?120:121);break;default:Js(e,127)}var a};class lo extends Hs{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&Xs(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const uo=e=>{e.count>0&&(Qs(e.encoder,1===e.count?e.s:-e.s),e.count>1&&Xs(e.encoder,e.count-2))};class co{constructor(){this.encoder=new Hs,this.s=0,this.count=0}write(e){this.s===e?this.count++:(uo(this),this.count=1,this.s=e)}toUint8Array(){return uo(this),Zs(this.encoder)}}const po=e=>{if(e.count>0){const t=2*e.diff+(1===e.count?0:1);Qs(e.encoder,t),e.count>1&&Xs(e.encoder,e.count-2)}};class ho{constructor(){this.encoder=new Hs,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(po(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return po(this),Zs(this.encoder)}}class fo{constructor(){this.sarr=[],this.s="",this.lensE=new co}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new Hs;return this.sarr.push(this.s),this.s="",ao(e,this.sarr.join("")),no(e,this.lensE.toUint8Array()),Zs(e)}}const mo=e=>new Error(e),yo=()=>{throw mo("Method unimplemented")},go=()=>{throw mo("Unexpected case")},bo=mo("Unexpected end of array"),vo=mo("Integer out of Range");class _o{constructor(e){this.arr=e,this.pos=0}}const wo=e=>new _o(e),Ao=e=>((e,t)=>{const a=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,a})(e,So(e)),ko=e=>e.arr[e.pos++],So=e=>{let t=0,a=1;const n=e.arr.length;for(;e.pos<n;){const n=e.arr[e.pos++];if(t+=(n&Ls)*a,a*=128,n<Rs)return t;if(t>Ps)throw vo}throw bo},No=e=>{let t=e.arr[e.pos++],a=63&t,n=64;const i=(t&Ds)>0?-1:1;if(!(t&Rs))return i*a;const r=e.arr.length;for(;e.pos<r;){if(t=e.arr[e.pos++],a+=(t&Ls)*n,n*=128,t<Rs)return i*a;if(a>Ps)throw vo}throw bo},To=Ys?e=>Ys.decode(Ao(e)):e=>{let t=So(e);if(0===t)return"";{let a=String.fromCodePoint(ko(e));if(--t<100)for(;t--;)a+=String.fromCodePoint(ko(e));else for(;t>0;){const n=t<1e4?t:1e4,i=e.arr.subarray(e.pos,e.pos+n);e.pos+=n,a+=String.fromCodePoint.apply(null,i),t-=n}return decodeURIComponent(escape(a))}},Mo=(e,t)=>{const a=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,a},xo=[e=>{},e=>null,No,e=>Mo(e,4).getFloat32(0,!1),e=>Mo(e,8).getFloat64(0,!1),e=>Mo(e,8).getBigInt64(0,!1),e=>!1,e=>!0,To,e=>{const t=So(e),a={};for(let n=0;n<t;n++){a[To(e)]=Co(e)}return a},e=>{const t=So(e),a=[];for(let n=0;n<t;n++)a.push(Co(e));return a},Ao],Co=e=>xo[127-ko(e)](e);class Io extends _o{constructor(e,t){super(e),this.reader=t,this.s=null,this.count=0}read(){var e;return 0===this.count&&(this.s=this.reader(this),(e=this).pos!==e.arr.length?this.count=So(this)+1:this.count=-1),this.count--,this.s}}class Vo extends _o{constructor(e){super(e),this.s=0,this.count=0}read(){if(0===this.count){this.s=No(this);const e=Fs(this.s);this.count=1,e&&(this.s=-this.s,this.count=So(this)+2)}return this.count--,this.s}}class Eo extends _o{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(0===this.count){const e=No(this),t=1&e;this.diff=xs(e/2),this.count=1,t&&(this.count=So(this)+2)}return this.s+=this.diff,this.count--,this.s}}class Fo{constructor(e){this.decoder=new Vo(e),this.str=To(this.decoder),this.spos=0}read(){const e=this.spos+this.decoder.read(),t=this.str.slice(this.spos,e);return this.spos=e,t}}const Do=crypto.getRandomValues.bind(crypto),Ro=()=>Do(new Uint32Array(1))[0],Lo=[1e7]+-1e3+-4e3+-8e3+-1e11,Po=()=>Lo.replace(/[018]/g,(e=>(e^Ro()&15>>e/4).toString(16))),Bo=Date.now,Oo=e=>new Promise(e);Promise.all.bind(Promise);const $o=e=>void 0===e?null:e;let Uo=new class{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}},jo=!0;try{"undefined"!=typeof localStorage&&localStorage&&(Uo=localStorage,jo=!1)}catch(e){}const zo=Uo,Wo=Object.assign,Yo=Object.keys,Ho=e=>Yo(e).length,Go=e=>Yo(e).length,qo=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Zo=Object.freeze,Jo=e=>{for(const t in e){const a=e[t];"object"!=typeof a&&"function"!=typeof a||Jo(e[t])}return Zo(e)},Ko=Symbol("Equality"),Xo=(e,t,a=0)=>{try{for(;a<e.length;a++)e[a](...t)}finally{a<e.length&&Xo(e,t,a+1)}},Qo=e=>e,el=(e,t)=>{if(e===t)return!0;if(null==e||null==t||e.constructor!==t.constructor)return!1;if(null!=e[Ko])return e[Ko](t);switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:if(e.byteLength!==t.byteLength)return!1;for(let a=0;a<e.length;a++)if(e[a]!==t[a])return!1;break;case Set:if(e.size!==t.size)return!1;for(const a of e)if(!t.has(a))return!1;break;case Map:if(e.size!==t.size)return!1;for(const a of e.keys())if(!t.has(a)||!el(e.get(a),t.get(a)))return!1;break;case Object:if(Ho(e)!==Ho(t))return!1;for(const a in e)if(!qo(e,a)||!el(e[a],t[a]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let a=0;a<e.length;a++)if(!el(e[a],t[a]))return!1;break;default:return!1}return!0},tl=void 0!==gs&&gs.release&&/node|io\.js/.test(gs.release.name)&&"[object process]"===Object.prototype.toString.call(void 0!==gs?gs:0),al="undefined"!=typeof window&&"undefined"!=typeof document&&!tl;let nl;const il=e=>(()=>{if(void 0===nl)if(tl){nl=bs();const e=gs.argv;let t=null;for(let a=0;a<e.length;a++){const n=e[a];"-"===n[0]?(null!==t&&nl.set(t,""),t=n):null!==t&&(nl.set(t,n),t=null)}null!==t&&nl.set(t,"")}else"object"==typeof location?(nl=bs(),(location.search||"?").slice(1).split("&").forEach((e=>{if(0!==e.length){const[t,a]=e.split("=");nl.set(`--${js(t,"-")}`,a),nl.set(`-${js(t,"-")}`,a)}}))):nl=bs();return nl})().has(e),rl=e=>$o(tl?gs.env[e.toUpperCase().replaceAll("-","_")]:zo.getItem(e)),sl=e=>il("--"+e)||null!==rl(e);sl("production");var ol;const ll=tl&&(ol=gs.env.FORCE_COLOR,["true","1","2"].includes(ol))||!il("--no-colors")&&!sl("no-color")&&(!tl||gs.stdout.isTTY)&&(!tl||il("--color")||null!==rl("COLORTERM")||(rl("TERM")||"").includes("color")),ul=e=>new Uint8Array(e),cl=al?e=>{let t="";for(let a=0;a<e.byteLength;a++)t+=Os(e[a]);return btoa(t)}:e=>Un.from(e.buffer,e.byteOffset,e.byteLength).toString("base64"),dl=al?e=>{const t=atob(e),a=ul(t.length);for(let e=0;e<t.length;e++)a[e]=t.charCodeAt(e);return a}:e=>{const t=Un.from(e,"base64");return((e,t,a)=>new Uint8Array(e,t,a))(t.buffer,t.byteOffset,t.byteLength)};class pl{constructor(e,t){this.left=e,this.right=t}}const hl=(e,t)=>new pl(e,t);"undefined"!=typeof DOMParser&&new DOMParser;const fl=Symbol,ml=fl(),yl=fl(),gl=fl(),bl=fl(),vl=fl(),_l=fl(),wl=fl(),Al=fl(),kl=fl(),Sl={[ml]:hl("font-weight","bold"),[yl]:hl("font-weight","normal"),[gl]:hl("color","blue"),[vl]:hl("color","green"),[bl]:hl("color","grey"),[_l]:hl("color","red"),[wl]:hl("color","purple"),[Al]:hl("color","orange"),[kl]:hl("color","black")},Nl=ll?e=>{1===e.length&&e[0]?.constructor===Function&&(e=e[0]());const t=[],a=[],n=bs();let i=[],r=0;for(;r<e.length;r++){const i=e[r],s=Sl[i];if(void 0!==s)n.set(s.left,s.right);else{if(void 0===i)break;if(i.constructor!==String&&i.constructor!==Number)break;{const e=((e,t)=>{const a=[];for(const[n,i]of e)a.push(t(i,n));return a})(n,((e,t)=>`${t}:${e};`)).join("");r>0||e.length>0?(t.push("%c"+i),a.push(e)):t.push(i)}}}for(r>0&&(i=a,i.unshift(t.join("")));r<e.length;r++){const t=e[r];t instanceof Symbol||i.push(t)}return i}:e=>{1===e.length&&e[0]?.constructor===Function&&(e=e[0]());const t=[],a=[];let n=0;for(;n<e.length;n++){const a=e[n];if(void 0===a)break;if(a.constructor===String||a.constructor===Number)t.push(a);else if(a.constructor===Object)break}for(n>0&&a.push(t.join(""));n<e.length;n++){const t=e[n];t instanceof Symbol||a.push(t)}return a},Tl=ws(),Ml=e=>({[Symbol.iterator](){return this},next:e}),xl=(e,t)=>Ml((()=>{const{done:a,value:n}=e.next();return{done:a,value:a?void 0:t(n)}}));class Cl{constructor(e,t){this.clock=e,this.len=t}}class Il{constructor(){this.clients=new Map}}const Vl=(e,t,a)=>t.clients.forEach(((t,n)=>{const i=e.doc.store.clients.get(n);if(null!=i){const n=i[i.length-1],r=n.id.clock+n.length;for(let n=0,s=t[n];n<t.length&&s.clock<r;s=t[++n])wu(e,i,s.clock,s.len,a)}})),El=(e,t)=>{const a=e.clients.get(t.client);return void 0!==a&&null!==((e,t)=>{let a=0,n=e.length-1;for(;a<=n;){const i=xs((a+n)/2),r=e[i],s=r.clock;if(s<=t){if(t<s+r.len)return i;a=i+1}else n=i-1}return null})(a,t.clock)},Fl=e=>{e.clients.forEach((e=>{let t,a;for(e.sort(((e,t)=>e.clock-t.clock)),t=1,a=1;t<e.length;t++){const n=e[a-1],i=e[t];n.clock+n.len>=i.clock?n.len=Vs(n.len,i.clock+i.len-n.clock):(a<t&&(e[a]=i),a++)}e.length=a}))},Dl=(e,t,a,n)=>{_s(e.clients,t,(()=>[])).push(new Cl(a,n))},Rl=e=>{const t=new Il;return e.clients.forEach(((e,a)=>{const n=[];for(let t=0;t<e.length;t++){const a=e[t];if(a.deleted){const i=a.id.clock;let r=a.length;if(t+1<e.length)for(let a=e[t+1];t+1<e.length&&a.deleted;a=e[1+ ++t])r+=a.length;n.push(new Cl(i,r))}}n.length>0&&t.clients.set(a,n)})),t},Ll=(e,t)=>{Xs(e.restEncoder,t.clients.size),Ss(t.clients.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([t,a])=>{e.resetDsCurVal(),Xs(e.restEncoder,t);const n=a.length;Xs(e.restEncoder,n);for(let t=0;t<n;t++){const n=a[t];e.writeDsClock(n.clock),e.writeDsLen(n.len)}}))},Pl=e=>{const t=new Il,a=So(e.restDecoder);for(let n=0;n<a;n++){e.resetDsCurVal();const a=So(e.restDecoder),n=So(e.restDecoder);if(n>0){const i=_s(t.clients,a,(()=>[]));for(let t=0;t<n;t++)i.push(new Cl(e.readDsClock(),e.readDsLen()))}}return t},Bl=(e,t,a)=>{const n=new Il,i=So(e.restDecoder);for(let r=0;r<i;r++){e.resetDsCurVal();const i=So(e.restDecoder),r=So(e.restDecoder),s=a.clients.get(i)||[],o=fu(a,i);for(let a=0;a<r;a++){const a=e.readDsClock(),r=a+e.readDsLen();if(a<o){o<r&&Dl(n,i,o,r-o);let e=yu(s,a),l=s[e];for(!l.deleted&&l.id.clock<a&&(s.splice(e+1,0,id(t,l,a-l.id.clock)),e++);e<s.length&&(l=s[e++],l.id.clock<r);)l.deleted||(r<l.id.clock+l.length&&s.splice(e,0,id(t,l,r-l.id.clock)),l.delete(t))}else Dl(n,i,a,r-a)}}if(n.clients.size>0){const e=new ql;return Xs(e.restEncoder,0),Ll(e,n),e.toUint8Array()}return null},Ol=Ro;class $l extends Ts{constructor({guid:e=Po(),collectionid:t=null,gc:a=!0,gcFilter:n=()=>!0,meta:i=null,autoLoad:r=!1,shouldLoad:s=!0}={}){super(),this.gc=a,this.gcFilter=n,this.clientID=Ol(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new pu,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=s,this.autoLoad=r,this.meta=i,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=Oo((e=>{this.on("load",(()=>{this.isLoaded=!0,e(this)}))}));const o=()=>Oo((e=>{const t=a=>{void 0!==a&&!0!==a||(this.off("sync",t),e())};this.on("sync",t)}));this.on("sync",(e=>{!1===e&&this.isSynced&&(this.whenSynced=o()),this.isSynced=void 0===e||!0===e,this.isSynced&&!this.isLoaded&&this.emit("load",[this])})),this.whenSynced=o()}load(){const e=this._item;null===e||this.shouldLoad||Mu(e.parent.doc,(e=>{e.subdocsLoaded.add(this)}),null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(Ss(this.subdocs).map((e=>e.guid)))}transact(e,t=null){return Mu(this,e,t)}get(e,t=qu){const a=_s(this.share,e,(()=>{const e=new t;return e._integrate(this,null),e})),n=a.constructor;if(t!==qu&&n!==t){if(n===qu){const n=new t;n._map=a._map,a._map.forEach((e=>{for(;null!==e;e=e.left)e.parent=n})),n._start=a._start;for(let e=n._start;null!==e;e=e.right)e.parent=n;return n._length=a._length,this.share.set(e,n),n._integrate(this,null),n}throw new Error(`Type with the name ${e} has already been defined with a different constructor`)}return a}getArray(e=""){return this.get(e,pc)}getText(e=""){return this.get(e,Ic)}getMap(e=""){return this.get(e,fc)}getXmlElement(e=""){return this.get(e,Fc)}getXmlFragment(e=""){return this.get(e,Ec)}toJSON(){const e={};return this.share.forEach(((t,a)=>{e[a]=t.toJSON()})),e}destroy(){this.isDestroyed=!0,Ss(this.subdocs).forEach((e=>e.destroy()));const e=this._item;if(null!==e){this._item=null;const t=e.content;t.doc=new $l({guid:this.guid,...t.opts,shouldLoad:!1}),t.doc._item=e,Mu(e.parent.doc,(a=>{const n=t.doc;e.deleted||a.subdocsAdded.add(n),a.subdocsRemoved.add(this)}),null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class Ul{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return So(this.restDecoder)}readDsLen(){return So(this.restDecoder)}}class jl extends Ul{readLeftID(){return uu(So(this.restDecoder),So(this.restDecoder))}readRightID(){return uu(So(this.restDecoder),So(this.restDecoder))}readClient(){return So(this.restDecoder)}readInfo(){return ko(this.restDecoder)}readString(){return To(this.restDecoder)}readParentInfo(){return 1===So(this.restDecoder)}readTypeRef(){return So(this.restDecoder)}readLen(){return So(this.restDecoder)}readAny(){return Co(this.restDecoder)}readBuf(){return(e=>{const t=ul(e.byteLength);return t.set(e),t})(Ao(this.restDecoder))}readJSON(){return JSON.parse(To(this.restDecoder))}readKey(){return To(this.restDecoder)}}class zl{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=So(this.restDecoder),this.dsCurrVal}readDsLen(){const e=So(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class Wl extends zl{constructor(e){super(e),this.keys=[],So(e),this.keyClockDecoder=new Eo(Ao(e)),this.clientDecoder=new Vo(Ao(e)),this.leftClockDecoder=new Eo(Ao(e)),this.rightClockDecoder=new Eo(Ao(e)),this.infoDecoder=new Io(Ao(e),ko),this.stringDecoder=new Fo(Ao(e)),this.parentInfoDecoder=new Io(Ao(e),ko),this.typeRefDecoder=new Vo(Ao(e)),this.lenDecoder=new Vo(Ao(e))}readLeftID(){return new ou(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new ou(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return 1===this.parentInfoDecoder.read()}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return Co(this.restDecoder)}readBuf(){return Ao(this.restDecoder)}readJSON(){return Co(this.restDecoder)}readKey(){const e=this.keyClockDecoder.read();if(e<this.keys.length)return this.keys[e];{const e=this.stringDecoder.read();return this.keys.push(e),e}}}class Yl{constructor(){this.restEncoder=Gs()}toUint8Array(){return Zs(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){Xs(this.restEncoder,e)}writeDsLen(e){Xs(this.restEncoder,e)}}class Hl extends Yl{writeLeftID(e){Xs(this.restEncoder,e.client),Xs(this.restEncoder,e.clock)}writeRightID(e){Xs(this.restEncoder,e.client),Xs(this.restEncoder,e.clock)}writeClient(e){Xs(this.restEncoder,e)}writeInfo(e){Ks(this.restEncoder,e)}writeString(e){ao(this.restEncoder,e)}writeParentInfo(e){Xs(this.restEncoder,e?1:0)}writeTypeRef(e){Xs(this.restEncoder,e)}writeLen(e){Xs(this.restEncoder,e)}writeAny(e){oo(this.restEncoder,e)}writeBuf(e){io(this.restEncoder,e)}writeJSON(e){ao(this.restEncoder,JSON.stringify(e))}writeKey(e){ao(this.restEncoder,e)}}class Gl{constructor(){this.restEncoder=Gs(),this.dsCurrVal=0}toUint8Array(){return Zs(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const t=e-this.dsCurrVal;this.dsCurrVal=e,Xs(this.restEncoder,t)}writeDsLen(e){0===e&&go(),Xs(this.restEncoder,e-1),this.dsCurrVal+=e}}class ql extends Gl{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new ho,this.clientEncoder=new co,this.leftClockEncoder=new ho,this.rightClockEncoder=new ho,this.infoEncoder=new lo(Ks),this.stringEncoder=new fo,this.parentInfoEncoder=new lo(Ks),this.typeRefEncoder=new co,this.lenEncoder=new co}toUint8Array(){const e=Gs();return Xs(e,0),io(e,this.keyClockEncoder.toUint8Array()),io(e,this.clientEncoder.toUint8Array()),io(e,this.leftClockEncoder.toUint8Array()),io(e,this.rightClockEncoder.toUint8Array()),io(e,Zs(this.infoEncoder)),io(e,this.stringEncoder.toUint8Array()),io(e,Zs(this.parentInfoEncoder)),io(e,this.typeRefEncoder.toUint8Array()),io(e,this.lenEncoder.toUint8Array()),no(e,Zs(this.restEncoder)),Zs(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){oo(this.restEncoder,e)}writeBuf(e){io(this.restEncoder,e)}writeJSON(e){oo(this.restEncoder,e)}writeKey(e){const t=this.keyMap.get(e);void 0===t?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(t)}}const Zl=(e,t,a)=>{const n=new Map;a.forEach(((e,a)=>{fu(t,a)>e&&n.set(a,e)})),hu(t).forEach(((e,t)=>{a.has(t)||n.set(t,0)})),Xs(e.restEncoder,n.size),Ss(n.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([a,n])=>{((e,t,a,n)=>{n=Vs(n,t[0].id.clock);const i=yu(t,n);Xs(e.restEncoder,t.length-i),e.writeClient(a),Xs(e.restEncoder,n);const r=t[i];r.write(e,n-r.id.clock);for(let a=i+1;a<t.length;a++)t[a].write(e,0)})(e,t.clients.get(a),a,n)}))},Jl=(e,t,a,n=new Wl(e))=>Mu(t,(e=>{e.local=!1;let t=!1;const a=e.doc,i=a.store,r=((e,t)=>{const a=bs(),n=So(e.restDecoder);for(let i=0;i<n;i++){const n=So(e.restDecoder),i=new Array(n),r=e.readClient();let s=So(e.restDecoder);a.set(r,{i:0,refs:i});for(let a=0;a<n;a++){const n=e.readInfo();switch(31&n){case 0:{const t=e.readLen();i[a]=new Bc(uu(r,s),t),s+=t;break}case 10:{const t=So(e.restDecoder);i[a]=new ld(uu(r,s),t),s+=t;break}default:{const o=!(192&n),l=new rd(uu(r,s),null,(n&Rs)===Rs?e.readLeftID():null,null,(n&Ds)===Ds?e.readRightID():null,o?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,!o||32&~n?null:e.readString(),sd(e,n));i[a]=l,s+=l.length}}}}return a})(n,a),s=((e,t,a)=>{const n=[];let i=Ss(a.keys()).sort(((e,t)=>e-t));if(0===i.length)return null;const r=()=>{if(0===i.length)return null;let e=a.get(i[i.length-1]);for(;e.refs.length===e.i;){if(i.pop(),!(i.length>0))return null;e=a.get(i[i.length-1])}return e};let s=r();if(null===s)return null;const o=new pu,l=new Map,u=(e,t)=>{const a=l.get(e);(null==a||a>t)&&l.set(e,t)};let c=s.refs[s.i++];const d=new Map,p=()=>{for(const e of n){const t=e.id.client,n=a.get(t);n?(n.i--,o.clients.set(t,n.refs.slice(n.i)),a.delete(t),n.i=0,n.refs=[]):o.clients.set(t,[e]),i=i.filter((e=>e!==t))}n.length=0};for(;;){if(c.constructor!==ld){const i=_s(d,c.id.client,(()=>fu(t,c.id.client)))-c.id.clock;if(i<0)n.push(c),u(c.id.client,c.id.clock-1),p();else{const r=c.getMissing(e,t);if(null!==r){n.push(c);const e=a.get(r)||{refs:[],i:0};if(e.refs.length!==e.i){c=e.refs[e.i++];continue}u(r,fu(t,r)),p()}else(0===i||i<c.length)&&(c.integrate(e,i),d.set(c.id.client,c.id.clock+c.length))}}if(n.length>0)c=n.pop();else if(null!==s&&s.i<s.refs.length)c=s.refs[s.i++];else{if(s=r(),null===s)break;c=s.refs[s.i++]}}if(o.clients.size>0){const e=new ql;return Zl(e,o,new Map),Xs(e.restEncoder,0),{missing:l,update:e.toUint8Array()}}return null})(e,i,r),o=i.pendingStructs;if(o){for(const[e,a]of o.missing)if(a<fu(i,e)){t=!0;break}if(s){for(const[e,t]of s.missing){const a=o.missing.get(e);(null==a||a>t)&&o.missing.set(e,t)}o.update=Eu([o.update,s.update])}}else i.pendingStructs=s;const l=Bl(n,e,i);if(i.pendingDs){const t=new Wl(wo(i.pendingDs));So(t.restDecoder);const a=Bl(t,e,i);i.pendingDs=l&&a?Eu([l,a]):l||a}else i.pendingDs=l;if(t){const t=i.pendingStructs.update;i.pendingStructs=null,Kl(e.doc,t)}}),a,!1),Kl=(e,t,a,n=Wl)=>{const i=wo(t);Jl(i,e,a,new n(i))},Xl=(e,t=new Uint8Array([0]),a=new ql)=>{((e,t,a=new Map)=>{Zl(e,t.store,a),Ll(e,Rl(t.store))})(a,e,Ql(t));const n=[a.toUint8Array()];if(e.store.pendingDs&&n.push(e.store.pendingDs),e.store.pendingStructs&&n.push(Fu(e.store.pendingStructs.update,t)),n.length>1){if(a.constructor===Hl)return Iu(n.map(((e,t)=>0===t?e:Pu(e))));if(a.constructor===ql)return Eu(n)}return n[0]},Ql=e=>(e=>{const t=new Map,a=So(e.restDecoder);for(let n=0;n<a;n++){const a=So(e.restDecoder),n=So(e.restDecoder);t.set(a,n)}return t})(new Ul(wo(e))),eu=(e,t)=>(Xs(e.restEncoder,t.size),Ss(t.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([t,a])=>{Xs(e.restEncoder,t),Xs(e.restEncoder,a)})),e),tu=(e,t=new Gl)=>(e instanceof Map?eu(t,e):((e,t)=>{eu(e,hu(t.store))})(t,e),t.toUint8Array());class au{constructor(){this.l=[]}}const nu=()=>new au,iu=(e,t)=>e.l.push(t),ru=(e,t)=>{const a=e.l,n=a.length;e.l=a.filter((e=>t!==e)),n===e.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},su=(e,t,a)=>Xo(e.l,[t,a]);class ou{constructor(e,t){this.client=e,this.clock=t}}const lu=(e,t)=>e===t||null!==e&&null!==t&&e.client===t.client&&e.clock===t.clock,uu=(e,t)=>new ou(e,t),cu=(e,t)=>void 0===t?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!El(t.ds,e.id),du=(e,t)=>{const a=_s(e.meta,du,ws),n=e.doc.store;a.has(t)||(t.sv.forEach(((t,a)=>{t<fu(n,a)&&vu(e,uu(a,t))})),Vl(e,t.ds,(e=>{})),a.add(t))};class pu{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const hu=e=>{const t=new Map;return e.clients.forEach(((e,a)=>{const n=e[e.length-1];t.set(a,n.id.clock+n.length)})),t},fu=(e,t)=>{const a=e.clients.get(t);if(void 0===a)return 0;const n=a[a.length-1];return n.id.clock+n.length},mu=(e,t)=>{let a=e.clients.get(t.id.client);if(void 0===a)a=[],e.clients.set(t.id.client,a);else{const e=a[a.length-1];if(e.id.clock+e.length!==t.id.clock)throw go()}a.push(t)},yu=(e,t)=>{let a=0,n=e.length-1,i=e[n],r=i.id.clock;if(r===t)return n;let s=xs(t/(r+i.length-1)*n);for(;a<=n;){if(i=e[s],r=i.id.clock,r<=t){if(t<r+i.length)return s;a=s+1}else n=s-1;s=xs((a+n)/2)}throw go()},gu=(e,t)=>{const a=e.clients.get(t.client);return a[yu(a,t.clock)]},bu=(e,t,a)=>{const n=yu(t,a),i=t[n];return i.id.clock<a&&i instanceof rd?(t.splice(n+1,0,id(e,i,a-i.id.clock)),n+1):n},vu=(e,t)=>{const a=e.doc.store.clients.get(t.client);return a[bu(e,a,t.clock)]},_u=(e,t,a)=>{const n=t.clients.get(a.client),i=yu(n,a.clock),r=n[i];return a.clock!==r.id.clock+r.length-1&&r.constructor!==Bc&&n.splice(i+1,0,id(e,r,a.clock-r.id.clock+1)),r},wu=(e,t,a,n,i)=>{if(0===n)return;const r=a+n;let s,o=bu(e,t,a);do{s=t[o++],r<s.id.clock+s.length&&bu(e,t,r),i(s)}while(o<t.length&&t[o].id.clock<r)};class Au{constructor(e,t,a){this.doc=e,this.deleteSet=new Il,this.beforeState=hu(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=t,this.meta=new Map,this.local=a,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const ku=(e,t)=>!(0===t.deleteSet.clients.size&&!((e,t)=>{for(const[a,n]of e)if(t(n,a))return!0;return!1})(t.afterState,((e,a)=>t.beforeState.get(a)!==e)))&&(Fl(t.deleteSet),((e,t)=>{Zl(e,t.doc.store,t.beforeState)})(e,t),Ll(e,t.deleteSet),!0),Su=(e,t,a)=>{const n=t._item;(null===n||n.id.clock<(e.beforeState.get(n.id.client)||0)&&!n.deleted)&&_s(e.changed,t,ws).add(a)},Nu=(e,t)=>{let a=e[t],n=e[t-1],i=t;for(;i>0&&(n.deleted===a.deleted&&n.constructor===a.constructor&&n.mergeWith(a));a=n,n=e[--i-1])a instanceof rd&&null!==a.parentSub&&a.parent._map.get(a.parentSub)===a&&a.parent._map.set(a.parentSub,n);const r=t-i;return r&&e.splice(t+1-r,r),r},Tu=(e,t)=>{if(t<e.length){const a=e[t],n=a.doc,i=n.store,r=a.deleteSet,s=a._mergeStructs;try{Fl(r),a.afterState=hu(a.doc.store),n.emit("beforeObserverCalls",[a,n]);const e=[];a.changed.forEach(((t,n)=>e.push((()=>{null!==n._item&&n._item.deleted||n._callObserver(a,t)})))),e.push((()=>{a.changedParentTypes.forEach(((e,t)=>{t._dEH.l.length>0&&(null===t._item||!t._item.deleted)&&((e=e.filter((e=>null===e.target._item||!e.target._item.deleted))).forEach((e=>{e.currentTarget=t,e._path=null})),e.sort(((e,t)=>e.path.length-t.path.length)),su(t._dEH,e,a))}))})),e.push((()=>n.emit("afterTransaction",[a,n]))),Xo(e,[]),a._needFormattingCleanup&&Mc(a)}finally{n.gc&&((e,t,a)=>{for(const[n,i]of e.clients.entries()){const e=t.clients.get(n);for(let n=i.length-1;n>=0;n--){const r=i[n],s=r.clock+r.len;for(let n=yu(e,r.clock),i=e[n];n<e.length&&i.id.clock<s;i=e[++n]){const i=e[n];if(r.clock+r.len<=i.id.clock)break;i instanceof rd&&i.deleted&&!i.keep&&a(i)&&i.gc(t,!1)}}}})(r,i,n.gcFilter),((e,t)=>{e.clients.forEach(((e,a)=>{const n=t.clients.get(a);for(let t=e.length-1;t>=0;t--){const a=e[t];for(let e=Is(n.length-1,1+yu(n,a.clock+a.len-1)),t=n[e];e>0&&t.id.clock>=a.clock;t=n[e])e-=1+Nu(n,e)}}))})(r,i),a.afterState.forEach(((e,t)=>{const n=a.beforeState.get(t)||0;if(n!==e){const e=i.clients.get(t),a=Vs(yu(e,n),1);for(let t=e.length-1;t>=a;)t-=1+Nu(e,t)}}));for(let e=s.length-1;e>=0;e--){const{client:t,clock:a}=s[e].id,n=i.clients.get(t),r=yu(n,a);r+1<n.length&&Nu(n,r+1)>1||r>0&&Nu(n,r)}if(a.local||a.afterState.get(n.clientID)===a.beforeState.get(n.clientID)||(((...e)=>{console.log(...Nl(e)),Tl.forEach((t=>t.print(e)))})(Al,ml,"[yjs] ",yl,_l,"Changed the client-id because another client seems to be using it."),n.clientID=Ol()),n.emit("afterTransactionCleanup",[a,n]),n._observers.has("update")){const e=new Hl;ku(e,a)&&n.emit("update",[e.toUint8Array(),a.origin,n,a])}if(n._observers.has("updateV2")){const e=new ql;ku(e,a)&&n.emit("updateV2",[e.toUint8Array(),a.origin,n,a])}const{subdocsAdded:o,subdocsLoaded:l,subdocsRemoved:u}=a;(o.size>0||u.size>0||l.size>0)&&(o.forEach((e=>{e.clientID=n.clientID,null==e.collectionid&&(e.collectionid=n.collectionid),n.subdocs.add(e)})),u.forEach((e=>n.subdocs.delete(e))),n.emit("subdocs",[{loaded:l,added:o,removed:u},n,a]),u.forEach((e=>e.destroy()))),e.length<=t+1?(n._transactionCleanups=[],n.emit("afterAllTransactions",[n,e])):Tu(e,t+1)}}},Mu=(e,t,a=null,n=!0)=>{const i=e._transactionCleanups;let r=!1,s=null;null===e._transaction&&(r=!0,e._transaction=new Au(e,a,n),i.push(e._transaction),1===i.length&&e.emit("beforeAllTransactions",[e]),e.emit("beforeTransaction",[e._transaction,e]));try{s=t(e._transaction)}finally{if(r){const t=e._transaction===i[0];e._transaction=null,t&&Tu(i,0)}}return s};class xu{constructor(e,t){this.gen=function*(e){const t=So(e.restDecoder);for(let a=0;a<t;a++){const t=So(e.restDecoder),a=e.readClient();let n=So(e.restDecoder);for(let i=0;i<t;i++){const t=e.readInfo();if(10===t){const t=So(e.restDecoder);yield new ld(uu(a,n),t),n+=t}else if(31&t){const i=!(192&t),r=new rd(uu(a,n),null,(t&Rs)===Rs?e.readLeftID():null,null,(t&Ds)===Ds?e.readRightID():null,i?e.readParentInfo()?e.readString():e.readLeftID():null,!i||32&~t?null:e.readString(),sd(e,t));yield r,n+=r.length}else{const t=e.readLen();yield new Bc(uu(a,n),t),n+=t}}}}(e),this.curr=null,this.done=!1,this.filterSkips=t,this.next()}next(){do{this.curr=this.gen.next().value||null}while(this.filterSkips&&null!==this.curr&&this.curr.constructor===ld);return this.curr}}class Cu{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}}const Iu=e=>Eu(e,jl,Hl),Vu=(e,t)=>{if(e.constructor===Bc){const{client:a,clock:n}=e.id;return new Bc(uu(a,n+t),e.length-t)}if(e.constructor===ld){const{client:a,clock:n}=e.id;return new ld(uu(a,n+t),e.length-t)}{const a=e,{client:n,clock:i}=a.id;return new rd(uu(n,i+t),null,uu(n,i+t-1),null,a.rightOrigin,a.parent,a.parentSub,a.content.splice(t))}},Eu=(e,t=Wl,a=ql)=>{if(1===e.length)return e[0];const n=e.map((e=>new t(wo(e))));let i=n.map((e=>new xu(e,!0))),r=null;const s=new a,o=new Cu(s);for(;i=i.filter((e=>null!==e.curr)),i.sort(((e,t)=>{if(e.curr.id.client===t.curr.id.client){const a=e.curr.id.clock-t.curr.id.clock;return 0===a?e.curr.constructor===t.curr.constructor?0:e.curr.constructor===ld?1:-1:a}return t.curr.id.client-e.curr.id.client})),0!==i.length;){const e=i[0],t=e.curr.id.client;if(null!==r){let a=e.curr,n=!1;for(;null!==a&&a.id.clock+a.length<=r.struct.id.clock+r.struct.length&&a.id.client>=r.struct.id.client;)a=e.next(),n=!0;if(null===a||a.id.client!==t||n&&a.id.clock>r.struct.id.clock+r.struct.length)continue;if(t!==r.struct.id.client)Ru(o,r.struct,r.offset),r={struct:a,offset:0},e.next();else if(r.struct.id.clock+r.struct.length<a.id.clock)if(r.struct.constructor===ld)r.struct.length=a.id.clock+a.length-r.struct.id.clock;else{Ru(o,r.struct,r.offset);const e=a.id.clock-r.struct.id.clock-r.struct.length;r={struct:new ld(uu(t,r.struct.id.clock+r.struct.length),e),offset:0}}else{const t=r.struct.id.clock+r.struct.length-a.id.clock;t>0&&(r.struct.constructor===ld?r.struct.length-=t:a=Vu(a,t)),r.struct.mergeWith(a)||(Ru(o,r.struct,r.offset),r={struct:a,offset:0},e.next())}}else r={struct:e.curr,offset:0},e.next();for(let a=e.curr;null!==a&&a.id.client===t&&a.id.clock===r.struct.id.clock+r.struct.length&&a.constructor!==ld;a=e.next())Ru(o,r.struct,r.offset),r={struct:a,offset:0}}null!==r&&(Ru(o,r.struct,r.offset),r=null),Lu(o);const l=(e=>{const t=new Il;for(let a=0;a<e.length;a++)e[a].clients.forEach(((n,i)=>{if(!t.clients.has(i)){const r=n.slice();for(let t=a+1;t<e.length;t++)ks(r,e[t].clients.get(i)||[]);t.clients.set(i,r)}}));return Fl(t),t})(n.map((e=>Pl(e))));return Ll(s,l),s.toUint8Array()},Fu=(e,t,a=Wl,n=ql)=>{const i=Ql(t),r=new n,s=new Cu(r),o=new a(wo(e)),l=new xu(o,!1);for(;l.curr;){const e=l.curr,t=e.id.client,a=i.get(t)||0;if(l.curr.constructor!==ld)if(e.id.clock+e.length>a)for(Ru(s,e,Vs(a-e.id.clock,0)),l.next();l.curr&&l.curr.id.client===t;)Ru(s,l.curr,0),l.next();else for(;l.curr&&l.curr.id.client===t&&l.curr.id.clock+l.curr.length<=a;)l.next();else l.next()}Lu(s);const u=Pl(o);return Ll(r,u),r.toUint8Array()},Du=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:Zs(e.encoder.restEncoder)}),e.encoder.restEncoder=Gs(),e.written=0)},Ru=(e,t,a)=>{e.written>0&&e.currClient!==t.id.client&&Du(e),0===e.written&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),Xs(e.encoder.restEncoder,t.id.clock+a)),t.write(e.encoder,a),e.written++},Lu=e=>{Du(e);const t=e.encoder.restEncoder;Xs(t,e.clientStructs.length);for(let a=0;a<e.clientStructs.length;a++){const n=e.clientStructs[a];Xs(t,n.written),no(t,n.restEncoder)}},Pu=e=>((e,t,a,n)=>{const i=new a(wo(e)),r=new xu(i,!1),s=new n,o=new Cu(s);for(let e=r.curr;null!==e;e=r.next())Ru(o,t(e),0);Lu(o);const l=Pl(i);return Ll(s,l),s.toUint8Array()})(e,Qo,Wl,Hl),Bu="You must not compute changes after the event-handler fired.";class Ou{constructor(e,t){this.target=e,this.currentTarget=e,this.transaction=t,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=$u(this.currentTarget,this.target))}deletes(e){return El(this.transaction.deleteSet,e.id)}get keys(){if(null===this._keys){if(0===this.transaction.doc._transactionCleanups.length)throw mo(Bu);const e=new Map,t=this.target;this.transaction.changed.get(t).forEach((a=>{if(null!==a){const n=t._map.get(a);let i,r;if(this.adds(n)){let e=n.left;for(;null!==e&&this.adds(e);)e=e.left;if(this.deletes(n)){if(null===e||!this.deletes(e))return;i="delete",r=As(e.content.getContent())}else null!==e&&this.deletes(e)?(i="update",r=As(e.content.getContent())):(i="add",r=void 0)}else{if(!this.deletes(n))return;i="delete",r=As(n.content.getContent())}e.set(a,{action:i,oldValue:r})}})),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(null===e){if(0===this.transaction.doc._transactionCleanups.length)throw mo(Bu);const t=this.target,a=ws(),n=ws(),i=[];e={added:a,deleted:n,delta:i,keys:this.keys};if(this.transaction.changed.get(t).has(null)){let e=null;const r=()=>{e&&i.push(e)};for(let i=t._start;null!==i;i=i.right)i.deleted?this.deletes(i)&&!this.adds(i)&&(null!==e&&void 0!==e.delete||(r(),e={delete:0}),e.delete+=i.length,n.add(i)):this.adds(i)?(null!==e&&void 0!==e.insert||(r(),e={insert:[]}),e.insert=e.insert.concat(i.content.getContent()),a.add(i)):(null!==e&&void 0!==e.retain||(r(),e={retain:0}),e.retain+=i.length);null!==e&&void 0===e.retain&&r()}this._changes=e}return e}}const $u=(e,t)=>{const a=[];for(;null!==t._item&&t!==e;){if(null!==t._item.parentSub)a.unshift(t._item.parentSub);else{let e=0,n=t._item.parent._start;for(;n!==t._item&&null!==n;)!n.deleted&&n.countable&&(e+=n.length),n=n.right;a.unshift(e)}t=t._item.parent}return a},Uu=()=>{((...e)=>{console.warn(...Nl(e)),e.unshift(Al),Tl.forEach((t=>t.print(e)))})("Invalid access: Add Yjs type to a document before reading data.")};let ju=0;class zu{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=ju++}}const Wu=(e,t,a)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=a,e.timestamp=ju++},Yu=(e,t)=>{if(null===e._start||0===t||null===e._searchMarker)return null;const a=0===e._searchMarker.length?null:e._searchMarker.reduce(((e,a)=>Cs(t-e.index)<Cs(t-a.index)?e:a));let n=e._start,i=0;for(null!==a&&(n=a.p,i=a.index,(e=>{e.timestamp=ju++})(a));null!==n.right&&i<t;){if(!n.deleted&&n.countable){if(t<i+n.length)break;i+=n.length}n=n.right}for(;null!==n.left&&i>t;)n=n.left,!n.deleted&&n.countable&&(i-=n.length);for(;null!==n.left&&n.left.id.client===n.id.client&&n.left.id.clock+n.left.length===n.id.clock;)n=n.left,!n.deleted&&n.countable&&(i-=n.length);return null!==a&&Cs(a.index-i)<n.parent.length/80?(Wu(a,n,i),a):((e,t,a)=>{if(e.length>=80){const n=e.reduce(((e,t)=>e.timestamp<t.timestamp?e:t));return Wu(n,t,a),n}{const n=new zu(t,a);return e.push(n),n}})(e._searchMarker,n,i)},Hu=(e,t,a)=>{for(let n=e.length-1;n>=0;n--){const i=e[n];if(a>0){let t=i.p;for(t.marker=!1;t&&(t.deleted||!t.countable);)t=t.left,t&&!t.deleted&&t.countable&&(i.index-=t.length);if(null===t||!0===t.marker){e.splice(n,1);continue}i.p=t,t.marker=!0}(t<i.index||a>0&&t===i.index)&&(i.index=Vs(t,i.index+a))}},Gu=(e,t,a)=>{const n=e,i=t.changedParentTypes;for(;_s(i,e,(()=>[])).push(a),null!==e._item;)e=e._item.parent;su(n._eH,a,t)};class qu{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=nu(),this._dEH=nu(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw yo()}clone(){throw yo()}_write(e){}get _first(){let e=this._start;for(;null!==e&&e.deleted;)e=e.right;return e}_callObserver(e,t){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){iu(this._eH,e)}observeDeep(e){iu(this._dEH,e)}unobserve(e){ru(this._eH,e)}unobserveDeep(e){ru(this._dEH,e)}toJSON(){}}const Zu=(e,t,a)=>{e.doc??Uu(),t<0&&(t=e._length+t),a<0&&(a=e._length+a);let n=a-t;const i=[];let r=e._start;for(;null!==r&&n>0;){if(r.countable&&!r.deleted){const e=r.content.getContent();if(e.length<=t)t-=e.length;else{for(let a=t;a<e.length&&n>0;a++)i.push(e[a]),n--;t=0}}r=r.right}return i},Ju=e=>{e.doc??Uu();const t=[];let a=e._start;for(;null!==a;){if(a.countable&&!a.deleted){const e=a.content.getContent();for(let a=0;a<e.length;a++)t.push(e[a])}a=a.right}return t},Ku=(e,t)=>{let a=0,n=e._start;for(e.doc??Uu();null!==n;){if(n.countable&&!n.deleted){const i=n.content.getContent();for(let n=0;n<i.length;n++)t(i[n],a++,e)}n=n.right}},Xu=(e,t)=>{const a=[];return Ku(e,((n,i)=>{a.push(t(n,i,e))})),a},Qu=e=>{let t=e._start,a=null,n=0;return{[Symbol.iterator](){return this},next:()=>{if(null===a){for(;null!==t&&t.deleted;)t=t.right;if(null===t)return{done:!0,value:void 0};a=t.content.getContent(),n=0,t=t.right}const e=a[n++];return a.length<=n&&(a=null),{done:!1,value:e}}}},ec=(e,t)=>{e.doc??Uu();const a=Yu(e,t);let n=e._start;for(null!==a&&(n=a.p,t-=a.index);null!==n;n=n.right)if(!n.deleted&&n.countable){if(t<n.length)return n.content.getContent()[t];t-=n.length}},tc=(e,t,a,n)=>{let i=a;const r=e.doc,s=r.clientID,o=r.store,l=null===a?t._start:a.right;let u=[];const c=()=>{u.length>0&&(i=new rd(uu(s,fu(o,s)),i,i&&i.lastId,l,l&&l.id,t,null,new Gc(u)),i.integrate(e,0),u=[])};n.forEach((a=>{if(null===a)u.push(a);else switch(a.constructor){case Number:case Object:case Boolean:case Array:case String:u.push(a);break;default:switch(c(),a.constructor){case Uint8Array:case ArrayBuffer:i=new rd(uu(s,fu(o,s)),i,i&&i.lastId,l,l&&l.id,t,null,new Oc(new Uint8Array(a))),i.integrate(e,0);break;case $l:i=new rd(uu(s,fu(o,s)),i,i&&i.lastId,l,l&&l.id,t,null,new jc(a)),i.integrate(e,0);break;default:if(!(a instanceof qu))throw new Error("Unexpected content type in insert operation");i=new rd(uu(s,fu(o,s)),i,i&&i.lastId,l,l&&l.id,t,null,new nd(a)),i.integrate(e,0)}}})),c()},ac=()=>mo("Length exceeded!"),nc=(e,t,a,n)=>{if(a>t._length)throw ac();if(0===a)return t._searchMarker&&Hu(t._searchMarker,a,n.length),tc(e,t,null,n);const i=a,r=Yu(t,a);let s=t._start;for(null!==r&&(s=r.p,0===(a-=r.index)&&(s=s.prev,a+=s&&s.countable&&!s.deleted?s.length:0));null!==s;s=s.right)if(!s.deleted&&s.countable){if(a<=s.length){a<s.length&&vu(e,uu(s.id.client,s.id.clock+a));break}a-=s.length}return t._searchMarker&&Hu(t._searchMarker,i,n.length),tc(e,t,s,n)},ic=(e,t,a,n)=>{if(0===n)return;const i=a,r=n,s=Yu(t,a);let o=t._start;for(null!==s&&(o=s.p,a-=s.index);null!==o&&a>0;o=o.right)!o.deleted&&o.countable&&(a<o.length&&vu(e,uu(o.id.client,o.id.clock+a)),a-=o.length);for(;n>0&&null!==o;)o.deleted||(n<o.length&&vu(e,uu(o.id.client,o.id.clock+n)),o.delete(e),n-=o.length),o=o.right;if(n>0)throw ac();t._searchMarker&&Hu(t._searchMarker,i,-r+n)},rc=(e,t,a)=>{const n=t._map.get(a);void 0!==n&&n.delete(e)},sc=(e,t,a,n)=>{const i=t._map.get(a)||null,r=e.doc,s=r.clientID;let o;if(null==n)o=new Gc([n]);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:o=new Gc([n]);break;case Uint8Array:o=new Oc(n);break;case $l:o=new jc(n);break;default:if(!(n instanceof qu))throw new Error("Unexpected content type");o=new nd(n)}new rd(uu(s,fu(r.store,s)),i,i&&i.lastId,null,null,t,a,o).integrate(e,0)},oc=(e,t)=>{e.doc??Uu();const a=e._map.get(t);return void 0===a||a.deleted?void 0:a.content.getContent()[a.length-1]},lc=e=>{const t={};return e.doc??Uu(),e._map.forEach(((e,a)=>{e.deleted||(t[a]=e.content.getContent()[e.length-1])})),t},uc=(e,t)=>{e.doc??Uu();const a=e._map.get(t);return void 0!==a&&!a.deleted},cc=e=>{return e.doc??Uu(),t=e._map.entries(),a=e=>!e[1].deleted,Ml((()=>{let e;do{e=t.next()}while(!e.done&&!a(e.value));return e}));var t,a};class dc extends Ou{}class pc extends qu{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const t=new pc;return t.push(e),t}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new pc}clone(){const e=new pc;return e.insert(0,this.toArray().map((e=>e instanceof qu?e.clone():e))),e}get length(){return this.doc??Uu(),this._length}_callObserver(e,t){super._callObserver(e,t),Gu(this,e,new dc(this,e))}insert(e,t){null!==this.doc?Mu(this.doc,(a=>{nc(a,this,e,t)})):this._prelimContent.splice(e,0,...t)}push(e){null!==this.doc?Mu(this.doc,(t=>{((e,t,a)=>{let n=(t._searchMarker||[]).reduce(((e,t)=>t.index>e.index?t:e),{index:0,p:t._start}).p;if(n)for(;n.right;)n=n.right;tc(e,t,n,a)})(t,this,e)})):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,t=1){null!==this.doc?Mu(this.doc,(a=>{ic(a,this,e,t)})):this._prelimContent.splice(e,t)}get(e){return ec(this,e)}toArray(){return Ju(this)}slice(e=0,t=this.length){return Zu(this,e,t)}toJSON(){return this.map((e=>e instanceof qu?e.toJSON():e))}map(e){return Xu(this,e)}forEach(e){Ku(this,e)}[Symbol.iterator](){return Qu(this)}_write(e){e.writeTypeRef(Jc)}}class hc extends Ou{constructor(e,t,a){super(e,t),this.keysChanged=a}}class fc extends qu{constructor(e){super(),this._prelimContent=null,this._prelimContent=void 0===e?new Map:new Map(e)}_integrate(e,t){super._integrate(e,t),this._prelimContent.forEach(((e,t)=>{this.set(t,e)})),this._prelimContent=null}_copy(){return new fc}clone(){const e=new fc;return this.forEach(((t,a)=>{e.set(a,t instanceof qu?t.clone():t)})),e}_callObserver(e,t){Gu(this,e,new hc(this,e,t))}toJSON(){this.doc??Uu();const e={};return this._map.forEach(((t,a)=>{if(!t.deleted){const n=t.content.getContent()[t.length-1];e[a]=n instanceof qu?n.toJSON():n}})),e}get size(){return[...cc(this)].length}keys(){return xl(cc(this),(e=>e[0]))}values(){return xl(cc(this),(e=>e[1].content.getContent()[e[1].length-1]))}entries(){return xl(cc(this),(e=>[e[0],e[1].content.getContent()[e[1].length-1]]))}forEach(e){this.doc??Uu(),this._map.forEach(((t,a)=>{t.deleted||e(t.content.getContent()[t.length-1],a,this)}))}[Symbol.iterator](){return this.entries()}delete(e){null!==this.doc?Mu(this.doc,(t=>{rc(t,this,e)})):this._prelimContent.delete(e)}set(e,t){return null!==this.doc?Mu(this.doc,(a=>{sc(a,this,e,t)})):this._prelimContent.set(e,t),t}get(e){return oc(this,e)}has(e){return uc(this,e)}clear(){null!==this.doc?Mu(this.doc,(e=>{this.forEach((function(t,a,n){rc(e,n,a)}))})):this._prelimContent.clear()}_write(e){e.writeTypeRef(Kc)}}const mc=(e,t)=>e===t||"object"==typeof e&&"object"==typeof t&&e&&t&&((e,t)=>e===t||Go(e)===Go(t)&&((e,t)=>{for(const a in e)if(!t(e[a],a))return!1;return!0})(e,((e,a)=>(void 0!==e||qo(t,a))&&t[a]===e)))(e,t);class yc{constructor(e,t,a,n){this.left=e,this.right=t,this.index=a,this.currentAttributes=n}forward(){if(null===this.right&&go(),this.right.content.constructor===Wc)this.right.deleted||_c(this.currentAttributes,this.right.content);else this.right.deleted||(this.index+=this.right.length);this.left=this.right,this.right=this.right.right}}const gc=(e,t,a)=>{for(;null!==t.right&&a>0;){if(t.right.content.constructor===Wc)t.right.deleted||_c(t.currentAttributes,t.right.content);else t.right.deleted||(a<t.right.length&&vu(e,uu(t.right.id.client,t.right.id.clock+a)),t.index+=t.right.length,a-=t.right.length);t.left=t.right,t.right=t.right.right}return t},bc=(e,t,a,n)=>{const i=new Map,r=n?Yu(t,a):null;if(r){const t=new yc(r.p.left,r.p,r.index,i);return gc(e,t,a-r.index)}{const n=new yc(null,t._start,0,i);return gc(e,n,a)}},vc=(e,t,a,n)=>{for(;null!==a.right&&(!0===a.right.deleted||a.right.content.constructor===Wc&&mc(n.get(a.right.content.key),a.right.content.value));)a.right.deleted||n.delete(a.right.content.key),a.forward();const i=e.doc,r=i.clientID;n.forEach(((n,s)=>{const o=a.left,l=a.right,u=new rd(uu(r,fu(i.store,r)),o,o&&o.lastId,l,l&&l.id,t,null,new Wc(s,n));u.integrate(e,0),a.right=u,a.forward()}))},_c=(e,t)=>{const{key:a,value:n}=t;null===n?e.delete(a):e.set(a,n)},wc=(e,t)=>{for(;null!==e.right&&(e.right.deleted||e.right.content.constructor===Wc&&mc(t[e.right.content.key]??null,e.right.content.value));)e.forward()},Ac=(e,t,a,n)=>{const i=e.doc,r=i.clientID,s=new Map;for(const o in n){const l=n[o],u=a.currentAttributes.get(o)??null;if(!mc(u,l)){s.set(o,u);const{left:n,right:c}=a;a.right=new rd(uu(r,fu(i.store,r)),n,n&&n.lastId,c,c&&c.id,t,null,new Wc(o,l)),a.right.integrate(e,0),a.forward()}}return s},kc=(e,t,a,n,i)=>{a.currentAttributes.forEach(((e,t)=>{void 0===i[t]&&(i[t]=null)}));const r=e.doc,s=r.clientID;wc(a,i);const o=Ac(e,t,a,i),l=n.constructor===String?new qc(n):n instanceof qu?new nd(n):new zc(n);let{left:u,right:c,index:d}=a;t._searchMarker&&Hu(t._searchMarker,a.index,l.getLength()),c=new rd(uu(s,fu(r.store,s)),u,u&&u.lastId,c,c&&c.id,t,null,l),c.integrate(e,0),a.right=c,a.index=d,a.forward(),vc(e,t,a,o)},Sc=(e,t,a,n,i)=>{const r=e.doc,s=r.clientID;wc(a,i);const o=Ac(e,t,a,i);e:for(;null!==a.right&&(n>0||o.size>0&&(a.right.deleted||a.right.content.constructor===Wc));){if(!a.right.deleted)switch(a.right.content.constructor){case Wc:{const{key:t,value:r}=a.right.content,s=i[t];if(void 0!==s){if(mc(s,r))o.delete(t);else{if(0===n)break e;o.set(t,r)}a.right.delete(e)}else a.currentAttributes.set(t,r);break}default:n<a.right.length&&vu(e,uu(a.right.id.client,a.right.id.clock+n)),n-=a.right.length}a.forward()}if(n>0){let i="";for(;n>0;n--)i+="\n";a.right=new rd(uu(s,fu(r.store,s)),a.left,a.left&&a.left.lastId,a.right,a.right&&a.right.id,t,null,new qc(i)),a.right.integrate(e,0),a.forward()}vc(e,t,a,o)},Nc=(e,t,a,n,i)=>{let r=t;const s=bs();for(;r&&(!r.countable||r.deleted);){if(!r.deleted&&r.content.constructor===Wc){const e=r.content;s.set(e.key,e)}r=r.right}let o=0,l=!1;for(;t!==r;){if(a===t&&(l=!0),!t.deleted){const a=t.content;switch(a.constructor){case Wc:{const{key:r,value:u}=a,c=n.get(r)??null;s.get(r)===a&&c!==u||(t.delete(e),o++,l||(i.get(r)??null)!==u||c===u||(null===c?i.delete(r):i.set(r,c))),l||t.deleted||_c(i,a);break}}}t=t.right}return o},Tc=e=>{let t=0;return Mu(e.doc,(a=>{let n=e._start,i=e._start,r=bs();const s=vs(r);for(;i;){if(!1===i.deleted)if(i.content.constructor===Wc)_c(s,i.content);else t+=Nc(a,n,i,r,s),r=vs(s),n=i;i=i.right}})),t},Mc=e=>{const t=new Set,a=e.doc;for(const[n,i]of e.afterState.entries()){const r=e.beforeState.get(n)||0;i!==r&&wu(e,a.store.clients.get(n),r,i,(e=>{e.deleted||e.content.constructor!==Wc||e.constructor===Bc||t.add(e.parent)}))}Mu(a,(a=>{Vl(e,e.deleteSet,(e=>{if(e instanceof Bc||!e.parent._hasFormatting||t.has(e.parent))return;const n=e.parent;e.content.constructor===Wc?t.add(n):((e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;const a=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===Wc){const n=t.content.key;a.has(n)?t.delete(e):a.add(n)}t=t.left}})(a,e)}));for(const e of t)Tc(e)}))},xc=(e,t,a)=>{const n=a,i=vs(t.currentAttributes),r=t.right;for(;a>0&&null!==t.right;){if(!1===t.right.deleted)switch(t.right.content.constructor){case nd:case zc:case qc:a<t.right.length&&vu(e,uu(t.right.id.client,t.right.id.clock+a)),a-=t.right.length,t.right.delete(e)}t.forward()}r&&Nc(e,r,t.right,i,t.currentAttributes);const s=(t.left||t.right).parent;return s._searchMarker&&Hu(s._searchMarker,t.index,-n+a),t};class Cc extends Ou{constructor(e,t,a){super(e,t),this.childListChanged=!1,this.keysChanged=new Set,a.forEach((e=>{null===e?this.childListChanged=!0:this.keysChanged.add(e)}))}get changes(){if(null===this._changes){const e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(null===this._delta){const e=this.target.doc,t=[];Mu(e,(e=>{const a=new Map,n=new Map;let i=this.target._start,r=null;const s={};let o="",l=0,u=0;const c=()=>{if(null!==r){let e=null;switch(r){case"delete":u>0&&(e={delete:u}),u=0;break;case"insert":("object"==typeof o||o.length>0)&&(e={insert:o},a.size>0&&(e.attributes={},a.forEach(((t,a)=>{null!==t&&(e.attributes[a]=t)})))),o="";break;case"retain":l>0&&(e={retain:l},(e=>{for(const t in e)return!1;return!0})(s)||(e.attributes=Wo({},s))),l=0}e&&t.push(e),r=null}};for(;null!==i;){switch(i.content.constructor){case nd:case zc:this.adds(i)?this.deletes(i)||(c(),r="insert",o=i.content.getContent()[0],c()):this.deletes(i)?("delete"!==r&&(c(),r="delete"),u+=1):i.deleted||("retain"!==r&&(c(),r="retain"),l+=1);break;case qc:this.adds(i)?this.deletes(i)||("insert"!==r&&(c(),r="insert"),o+=i.content.str):this.deletes(i)?("delete"!==r&&(c(),r="delete"),u+=i.length):i.deleted||("retain"!==r&&(c(),r="retain"),l+=i.length);break;case Wc:{const{key:t,value:o}=i.content;if(this.adds(i)){if(!this.deletes(i)){const l=a.get(t)??null;mc(l,o)?null!==o&&i.delete(e):("retain"===r&&c(),mc(o,n.get(t)??null)?delete s[t]:s[t]=o)}}else if(this.deletes(i)){n.set(t,o);const e=a.get(t)??null;mc(e,o)||("retain"===r&&c(),s[t]=e)}else if(!i.deleted){n.set(t,o);const a=s[t];void 0!==a&&(mc(a,o)?null!==a&&i.delete(e):("retain"===r&&c(),null===o?delete s[t]:s[t]=o))}i.deleted||("insert"===r&&c(),_c(a,i.content));break}}i=i.right}for(c();t.length>0;){const e=t[t.length-1];if(void 0===e.retain||void 0!==e.attributes)break;t.pop()}})),this._delta=t}return this._delta}}class Ic extends qu{constructor(e){super(),this._pending=void 0!==e?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??Uu(),this._length}_integrate(e,t){super._integrate(e,t);try{this._pending.forEach((e=>e()))}catch(e){console.error(e)}this._pending=null}_copy(){return new Ic}clone(){const e=new Ic;return e.applyDelta(this.toDelta()),e}_callObserver(e,t){super._callObserver(e,t);const a=new Cc(this,e,t);Gu(this,e,a),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??Uu();let e="",t=this._start;for(;null!==t;)!t.deleted&&t.countable&&t.content.constructor===qc&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){null!==this.doc?Mu(this.doc,(a=>{const n=new yc(null,this._start,0,new Map);for(let i=0;i<e.length;i++){const r=e[i];if(void 0!==r.insert){const s=t||"string"!=typeof r.insert||i!==e.length-1||null!==n.right||"\n"!==r.insert.slice(-1)?r.insert:r.insert.slice(0,-1);("string"!=typeof s||s.length>0)&&kc(a,this,n,s,r.attributes||{})}else void 0!==r.retain?Sc(a,this,n,r.retain,r.attributes||{}):void 0!==r.delete&&xc(a,n,r.delete)}})):this._pending.push((()=>this.applyDelta(e)))}toDelta(e,t,a){this.doc??Uu();const n=[],i=new Map,r=this.doc;let s="",o=this._start;function l(){if(s.length>0){const e={};let t=!1;i.forEach(((a,n)=>{t=!0,e[n]=a}));const a={insert:s};t&&(a.attributes=e),n.push(a),s=""}}const u=()=>{for(;null!==o;){if(cu(o,e)||void 0!==t&&cu(o,t))switch(o.content.constructor){case qc:{const n=i.get("ychange");void 0===e||cu(o,e)?void 0===t||cu(o,t)?void 0!==n&&(l(),i.delete("ychange")):void 0!==n&&n.user===o.id.client&&"added"===n.type||(l(),i.set("ychange",a?a("added",o.id):{type:"added"})):void 0!==n&&n.user===o.id.client&&"removed"===n.type||(l(),i.set("ychange",a?a("removed",o.id):{type:"removed"})),s+=o.content.str;break}case nd:case zc:{l();const e={insert:o.content.getContent()[0]};if(i.size>0){const t={};e.attributes=t,i.forEach(((e,a)=>{t[a]=e}))}n.push(e);break}case Wc:cu(o,e)&&(l(),_c(i,o.content))}o=o.right}l()};return e||t?Mu(r,(a=>{e&&du(a,e),t&&du(a,t),u()}),"cleanup"):u(),n}insert(e,t,a){if(t.length<=0)return;const n=this.doc;null!==n?Mu(n,(n=>{const i=bc(n,this,e,!a);a||(a={},i.currentAttributes.forEach(((e,t)=>{a[t]=e}))),kc(n,this,i,t,a)})):this._pending.push((()=>this.insert(e,t,a)))}insertEmbed(e,t,a){const n=this.doc;null!==n?Mu(n,(n=>{const i=bc(n,this,e,!a);kc(n,this,i,t,a||{})})):this._pending.push((()=>this.insertEmbed(e,t,a||{})))}delete(e,t){if(0===t)return;const a=this.doc;null!==a?Mu(a,(a=>{xc(a,bc(a,this,e,!0),t)})):this._pending.push((()=>this.delete(e,t)))}format(e,t,a){if(0===t)return;const n=this.doc;null!==n?Mu(n,(n=>{const i=bc(n,this,e,!1);null!==i.right&&Sc(n,this,i,t,a)})):this._pending.push((()=>this.format(e,t,a)))}removeAttribute(e){null!==this.doc?Mu(this.doc,(t=>{rc(t,this,e)})):this._pending.push((()=>this.removeAttribute(e)))}setAttribute(e,t){null!==this.doc?Mu(this.doc,(a=>{sc(a,this,e,t)})):this._pending.push((()=>this.setAttribute(e,t)))}getAttribute(e){return oc(this,e)}getAttributes(){return lc(this)}_write(e){e.writeTypeRef(Xc)}}class Vc{constructor(e,t=()=>!0){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??Uu()}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type;if(null!==e&&(!this._firstCall||e.deleted||!this._filter(t)))do{if(t=e.content.type,e.deleted||t.constructor!==Fc&&t.constructor!==Ec||null===t._start)for(;null!==e;){const t=e.next;if(null!==t){e=t;break}e=e.parent===this._root?null:e.parent._item}else e=t._start}while(null!==e&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,null===e?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class Ec extends qu{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Ec}clone(){const e=new Ec;return e.insert(0,this.toArray().map((e=>e instanceof qu?e.clone():e))),e}get length(){return this.doc??Uu(),null===this._prelimContent?this._length:this._prelimContent.length}createTreeWalker(e){return new Vc(this,e)}querySelector(e){e=e.toUpperCase();const t=new Vc(this,(t=>t.nodeName&&t.nodeName.toUpperCase()===e)).next();return t.done?null:t.value}querySelectorAll(e){return e=e.toUpperCase(),Ss(new Vc(this,(t=>t.nodeName&&t.nodeName.toUpperCase()===e)))}_callObserver(e,t){Gu(this,e,new Dc(this,t,e))}toString(){return Xu(this,(e=>e.toString())).join("")}toJSON(){return this.toString()}toDOM(e=document,t={},a){const n=e.createDocumentFragment();return void 0!==a&&a._createAssociation(n,this),Ku(this,(i=>{n.insertBefore(i.toDOM(e,t,a),null)})),n}insert(e,t){null!==this.doc?Mu(this.doc,(a=>{nc(a,this,e,t)})):this._prelimContent.splice(e,0,...t)}insertAfter(e,t){if(null!==this.doc)Mu(this.doc,(a=>{const n=e&&e instanceof qu?e._item:e;tc(a,this,n,t)}));else{const a=this._prelimContent,n=null===e?0:a.findIndex((t=>t===e))+1;if(0===n&&null!==e)throw mo("Reference item not found");a.splice(n,0,...t)}}delete(e,t=1){null!==this.doc?Mu(this.doc,(a=>{ic(a,this,e,t)})):this._prelimContent.splice(e,t)}toArray(){return Ju(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return ec(this,e)}slice(e=0,t=this.length){return Zu(this,e,t)}forEach(e){Ku(this,e)}_write(e){e.writeTypeRef(ed)}}class Fc extends Ec{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,t){super._integrate(e,t),this._prelimAttrs.forEach(((e,t)=>{this.setAttribute(t,e)})),this._prelimAttrs=null}_copy(){return new Fc(this.nodeName)}clone(){const e=new Fc(this.nodeName);return((e,t)=>{for(const a in e)t(e[a],a)})(this.getAttributes(),((t,a)=>{"string"==typeof t&&e.setAttribute(a,t)})),e.insert(0,this.toArray().map((e=>e instanceof qu?e.clone():e))),e}toString(){const e=this.getAttributes(),t=[],a=[];for(const t in e)a.push(t);a.sort();const n=a.length;for(let i=0;i<n;i++){const n=a[i];t.push(n+'="'+e[n]+'"')}const i=this.nodeName.toLocaleLowerCase();return`<${i}${t.length>0?" "+t.join(" "):""}>${super.toString()}</${i}>`}removeAttribute(e){null!==this.doc?Mu(this.doc,(t=>{rc(t,this,e)})):this._prelimAttrs.delete(e)}setAttribute(e,t){null!==this.doc?Mu(this.doc,(a=>{sc(a,this,e,t)})):this._prelimAttrs.set(e,t)}getAttribute(e){return oc(this,e)}hasAttribute(e){return uc(this,e)}getAttributes(e){return e?((e,t)=>{const a={};return e._map.forEach(((e,n)=>{let i=e;for(;null!==i&&(!t.sv.has(i.id.client)||i.id.clock>=(t.sv.get(i.id.client)||0));)i=i.left;null!==i&&cu(i,t)&&(a[n]=i.content.getContent()[i.length-1])})),a})(this,e):lc(this)}toDOM(e=document,t={},a){const n=e.createElement(this.nodeName),i=this.getAttributes();for(const e in i){const t=i[e];"string"==typeof t&&n.setAttribute(e,t)}return Ku(this,(i=>{n.appendChild(i.toDOM(e,t,a))})),void 0!==a&&a._createAssociation(n,this),n}_write(e){e.writeTypeRef(Qc),e.writeKey(this.nodeName)}}class Dc extends Ou{constructor(e,t,a){super(e,a),this.childListChanged=!1,this.attributesChanged=new Set,t.forEach((e=>{null===e?this.childListChanged=!0:this.attributesChanged.add(e)}))}}class Rc extends fc{constructor(e){super(),this.hookName=e}_copy(){return new Rc(this.hookName)}clone(){const e=new Rc(this.hookName);return this.forEach(((t,a)=>{e.set(a,t)})),e}toDOM(e=document,t={},a){const n=t[this.hookName];let i;return i=void 0!==n?n.createDom(this):document.createElement(this.hookName),i.setAttribute("data-yjs-hook",this.hookName),void 0!==a&&a._createAssociation(i,this),i}_write(e){e.writeTypeRef(td),e.writeKey(this.hookName)}}class Lc extends Ic{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new Lc}clone(){const e=new Lc;return e.applyDelta(this.toDelta()),e}toDOM(e=document,t,a){const n=e.createTextNode(this.toString());return void 0!==a&&a._createAssociation(n,this),n}toString(){return this.toDelta().map((e=>{const t=[];for(const a in e.attributes){const n=[];for(const t in e.attributes[a])n.push({key:t,value:e.attributes[a][t]});n.sort(((e,t)=>e.key<t.key?-1:1)),t.push({nodeName:a,attrs:n})}t.sort(((e,t)=>e.nodeName<t.nodeName?-1:1));let a="";for(let e=0;e<t.length;e++){const n=t[e];a+=`<${n.nodeName}`;for(let e=0;e<n.attrs.length;e++){const t=n.attrs[e];a+=` ${t.key}="${t.value}"`}a+=">"}a+=e.insert;for(let e=t.length-1;e>=0;e--)a+=`</${t[e].nodeName}>`;return a})).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(ad)}}class Pc{constructor(e,t){this.id=e,this.length=t}get deleted(){throw yo()}mergeWith(e){return!1}write(e,t,a){throw yo()}integrate(e,t){throw yo()}}class Bc extends Pc{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){t>0&&(this.id.clock+=t,this.length-=t),mu(e.doc.store,this)}write(e,t){e.writeInfo(0),e.writeLen(this.length-t)}getMissing(e,t){return null}}class Oc{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Oc(this.content)}splice(e){throw yo()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}}class $c{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new $c(this.len)}splice(e){const t=new $c(this.len-e);return this.len=e,t}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){Dl(e.deleteSet,t.id.client,t.id.clock,this.len),t.markDeleted()}delete(e){}gc(e){}write(e,t){e.writeLen(this.len-t)}getRef(){return 1}}const Uc=(e,t)=>new $l({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1});class jc{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const t={};this.opts=t,e.gc||(t.gc=!1),e.autoLoad&&(t.autoLoad=!0),null!==e.meta&&(t.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new jc(Uc(this.doc.guid,this.opts))}splice(e){throw yo()}mergeWith(e){return!1}integrate(e,t){this.doc._item=t,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,t){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}class zc{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new zc(this.embed)}splice(e){throw yo()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}}class Wc{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new Wc(this.key,this.value)}splice(e){throw yo()}mergeWith(e){return!1}integrate(e,t){const a=t.parent;a._searchMarker=null,a._hasFormatting=!0}delete(e){}gc(e){}write(e,t){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}class Yc{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Yc(this.arr)}splice(e){const t=new Yc(this.arr.slice(e));return this.arr=this.arr.slice(0,e),t}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){const a=this.arr.length;e.writeLen(a-t);for(let n=t;n<a;n++){const t=this.arr[n];e.writeString(void 0===t?"undefined":JSON.stringify(t))}}getRef(){return 2}}const Hc="development"===rl("node_env");class Gc{constructor(e){this.arr=e,Hc&&Jo(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Gc(this.arr)}splice(e){const t=new Gc(this.arr.slice(e));return this.arr=this.arr.slice(0,e),t}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){const a=this.arr.length;e.writeLen(a-t);for(let n=t;n<a;n++){const t=this.arr[n];e.writeAny(t)}}getRef(){return 8}}class qc{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new qc(this.str)}splice(e){const t=new qc(this.str.slice(e));this.str=this.str.slice(0,e);const a=this.str.charCodeAt(e-1);return a>=55296&&a<=56319&&(this.str=this.str.slice(0,e-1)+"�",t.str="�"+t.str.slice(1)),t}mergeWith(e){return this.str+=e.str,!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeString(0===t?this.str:this.str.slice(t))}getRef(){return 4}}const Zc=[e=>new pc,e=>new fc,e=>new Ic,e=>new Fc(e.readKey()),e=>new Ec,e=>new Rc(e.readKey()),e=>new Lc],Jc=0,Kc=1,Xc=2,Qc=3,ed=4,td=5,ad=6;class nd{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new nd(this.type._copy())}splice(e){throw yo()}mergeWith(e){return!1}integrate(e,t){this.type._integrate(e.doc,t)}delete(e){let t=this.type._start;for(;null!==t;)t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e),t=t.right;this.type._map.forEach((t=>{t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e)})),e.changed.delete(this.type)}gc(e){let t=this.type._start;for(;null!==t;)t.gc(e,!0),t=t.right;this.type._start=null,this.type._map.forEach((t=>{for(;null!==t;)t.gc(e,!0),t=t.left})),this.type._map=new Map}write(e,t){this.type._write(e)}getRef(){return 7}}const id=(e,t,a)=>{const{client:n,clock:i}=t.id,r=new rd(uu(n,i+a),t,uu(n,i+a-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(a));return t.deleted&&r.markDeleted(),t.keep&&(r.keep=!0),null!==t.redone&&(r.redone=uu(t.redone.client,t.redone.clock+a)),t.right=r,null!==r.right&&(r.right.left=r),e._mergeStructs.push(r),null!==r.parentSub&&null===r.right&&r.parent._map.set(r.parentSub,r),t.length=a,r};class rd extends Pc{constructor(e,t,a,n,i,r,s,o){super(e,o.getLength()),this.origin=a,this.left=t,this.right=n,this.rightOrigin=i,this.parent=r,this.parentSub=s,this.redone=null,this.content=o,this.info=this.content.isCountable()?2:0}set marker(e){(8&this.info)>0!==e&&(this.info^=8)}get marker(){return(8&this.info)>0}get keep(){return(1&this.info)>0}set keep(e){this.keep!==e&&(this.info^=1)}get countable(){return(2&this.info)>0}get deleted(){return(4&this.info)>0}set deleted(e){this.deleted!==e&&(this.info^=4)}markDeleted(){this.info|=4}getMissing(e,t){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=fu(t,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=fu(t,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===ou&&this.id.client!==this.parent.client&&this.parent.clock>=fu(t,this.parent.client))return this.parent.client;if(this.origin&&(this.left=_u(e,t,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=vu(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===Bc||this.right&&this.right.constructor===Bc)this.parent=null;else if(this.parent){if(this.parent.constructor===ou){const e=gu(t,this.parent);e.constructor===Bc?this.parent=null:this.parent=e.content.type}}else this.left&&this.left.constructor===rd?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===rd&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=_u(e,e.doc.store,uu(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(t),this.length-=t),this.parent){if(!this.left&&(!this.right||null!==this.right.left)||this.left&&this.left.right!==this.right){let t,a=this.left;if(null!==a)t=a.right;else if(null!==this.parentSub)for(t=this.parent._map.get(this.parentSub)||null;null!==t&&null!==t.left;)t=t.left;else t=this.parent._start;const n=new Set,i=new Set;for(;null!==t&&t!==this.right;){if(i.add(t),n.add(t),lu(this.origin,t.origin)){if(t.id.client<this.id.client)a=t,n.clear();else if(lu(this.rightOrigin,t.rightOrigin))break}else{if(null===t.origin||!i.has(gu(e.doc.store,t.origin)))break;n.has(gu(e.doc.store,t.origin))||(a=t,n.clear())}t=t.right}this.left=a}if(null!==this.left){const e=this.left.right;this.right=e,this.left.right=this}else{let e;if(null!==this.parentSub)for(e=this.parent._map.get(this.parentSub)||null;null!==e&&null!==e.left;)e=e.left;else e=this.parent._start,this.parent._start=this;this.right=e}null!==this.right?this.right.left=this:null!==this.parentSub&&(this.parent._map.set(this.parentSub,this),null!==this.left&&this.left.delete(e)),null===this.parentSub&&this.countable&&!this.deleted&&(this.parent._length+=this.length),mu(e.doc.store,this),this.content.integrate(e,this),Su(e,this.parent,this.parentSub),(null!==this.parent._item&&this.parent._item.deleted||null!==this.parentSub&&null!==this.right)&&this.delete(e)}else new Bc(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;null!==e&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;null!==e&&e.deleted;)e=e.left;return e}get lastId(){return 1===this.length?this.id:uu(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&lu(e.origin,this.lastId)&&this.right===e&&lu(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&null===this.redone&&null===e.redone&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){const t=this.parent._searchMarker;return t&&t.forEach((t=>{t.p===e&&(t.p=this,!this.deleted&&this.countable&&(t.index-=this.length))})),e.keep&&(this.keep=!0),this.right=e.right,null!==this.right&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const t=this.parent;this.countable&&null===this.parentSub&&(t._length-=this.length),this.markDeleted(),Dl(e.deleteSet,this.id.client,this.id.clock,this.length),Su(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw go();this.content.gc(e),t?((e,t,a)=>{const n=e.clients.get(t.id.client);n[yu(n,t.id.clock)]=a})(e,this,new Bc(this.id,this.length)):this.content=new $c(this.length)}write(e,t){const a=t>0?uu(this.id.client,this.id.clock+t-1):this.origin,n=this.rightOrigin,i=this.parentSub,r=31&this.content.getRef()|(null===a?0:Rs)|(null===n?0:Ds)|(null===i?0:32);if(e.writeInfo(r),null!==a&&e.writeLeftID(a),null!==n&&e.writeRightID(n),null===a&&null===n){const t=this.parent;if(void 0!==t._item){const a=t._item;if(null===a){const a=(e=>{for(const[t,a]of e.doc.share.entries())if(a===e)return t;throw go()})(t);e.writeParentInfo(!0),e.writeString(a)}else e.writeParentInfo(!1),e.writeLeftID(a.id)}else t.constructor===String?(e.writeParentInfo(!0),e.writeString(t)):t.constructor===ou?(e.writeParentInfo(!1),e.writeLeftID(t)):go();null!==i&&e.writeString(i)}this.content.write(e,t)}}const sd=(e,t)=>od[31&t](e),od=[()=>{go()},e=>new $c(e.readLen()),e=>{const t=e.readLen(),a=[];for(let n=0;n<t;n++){const t=e.readString();"undefined"===t?a.push(void 0):a.push(JSON.parse(t))}return new Yc(a)},e=>new Oc(e.readBuf()),e=>new qc(e.readString()),e=>new zc(e.readJSON()),e=>new Wc(e.readKey(),e.readJSON()),e=>new nd(Zc[e.readTypeRef()](e)),e=>{const t=e.readLen(),a=[];for(let n=0;n<t;n++)a.push(e.readAny());return new Gc(a)},e=>new jc(Uc(e.readString(),e.readAny())),()=>{go()}];class ld extends Pc{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){go()}write(e,t){e.writeInfo(10),Xs(e.restEncoder,this.length-t)}getMissing(e,t){return null}}const ud="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},cd="__ $YJS$ __";!0===ud[cd]&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438"),ud[cd]=!0;const dd=new Map;const pd="undefined"==typeof BroadcastChannel?class{constructor(e){var t;this.room=e,this.onmessage=null,this._onChange=t=>t.key===e&&null!==this.onmessage&&this.onmessage({data:dl(t.newValue||"")}),t=this._onChange,jo||addEventListener("storage",t)}postMessage(e){zo.setItem(this.room,cl(new Uint8Array(e)))}close(){var e;e=this._onChange,jo||removeEventListener("storage",e)}}:BroadcastChannel,hd=e=>_s(dd,e,(()=>{const t=ws(),a=new pd(e);return a.onmessage=e=>t.forEach((t=>t(e.data,"broadcastchannel"))),{bc:a,subs:t}})),fd=(e,t,a=null)=>{const n=hd(e);n.bc.postMessage(t),n.subs.forEach((e=>e(t,a)))},md=(e,t)=>{Xs(e,0);const a=(e=>tu(e,new Yl))(t);io(e,a)},yd=(e,t,a)=>{Xs(e,1),io(e,((e,t)=>Xl(e,t,new Hl))(t,a))},gd=(e,t,a)=>{try{((e,t,a)=>{Kl(e,t,a,jl)})(t,Ao(e),a)}catch(e){console.error("Caught error while handling a Yjs update",e)}},bd=gd,vd=(e,t,a,n)=>{const i=So(e);switch(i){case 0:((e,t,a)=>{yd(t,a,Ao(e))})(e,t,a);break;case 1:gd(e,a,n);break;case 2:bd(e,a,n);break;default:throw new Error("Unknown message type")}return i},_d=3e4;class wd extends Ms{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval((()=>{const e=Bo();null!==this.getLocalState()&&15e3<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const t=[];this.meta.forEach(((a,n)=>{n!==this.clientID&&_d<=e-a.lastUpdated&&this.states.has(n)&&t.push(n)})),t.length>0&&Ad(this,t,"timeout")}),xs(3e3)),e.on("destroy",(()=>{this.destroy()})),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){const t=this.clientID,a=this.meta.get(t),n=void 0===a?0:a.clock+1,i=this.states.get(t);null===e?this.states.delete(t):this.states.set(t,e),this.meta.set(t,{clock:n,lastUpdated:Bo()});const r=[],s=[],o=[],l=[];null===e?l.push(t):null==i?null!=e&&r.push(t):(s.push(t),el(i,e)||o.push(t)),(r.length>0||o.length>0||l.length>0)&&this.emit("change",[{added:r,updated:o,removed:l},"local"]),this.emit("update",[{added:r,updated:s,removed:l},"local"])}setLocalStateField(e,t){const a=this.getLocalState();null!==a&&this.setLocalState({...a,[e]:t})}getStates(){return this.states}}const Ad=(e,t,a)=>{const n=[];for(let a=0;a<t.length;a++){const i=t[a];if(e.states.has(i)){if(e.states.delete(i),i===e.clientID){const t=e.meta.get(i);e.meta.set(i,{clock:t.clock+1,lastUpdated:Bo()})}n.push(i)}}n.length>0&&(e.emit("change",[{added:[],updated:[],removed:n},a]),e.emit("update",[{added:[],updated:[],removed:n},a]))},kd=(e,t,a=e.states)=>{const n=t.length,i=Gs();Xs(i,n);for(let r=0;r<n;r++){const n=t[r],s=a.get(n)||null,o=e.meta.get(n).clock;Xs(i,n),Xs(i,o),ao(i,JSON.stringify(s))}return Zs(i)},Sd=[];Sd[0]=(e,t,a,n,i)=>{Xs(e,0);const r=vd(t,e,a.doc,a);n&&1===r&&!a.synced&&(a.synced=!0)},Sd[3]=(e,t,a,n,i)=>{Xs(e,1),io(e,kd(a.awareness,Array.from(a.awareness.getStates().keys())))},Sd[1]=(e,t,a,n,i)=>{((e,t,a)=>{const n=wo(t),i=Bo(),r=[],s=[],o=[],l=[],u=So(n);for(let t=0;t<u;t++){const t=So(n);let a=So(n);const u=JSON.parse(To(n)),c=e.meta.get(t),d=e.states.get(t),p=void 0===c?0:c.clock;(p<a||p===a&&null===u&&e.states.has(t))&&(null===u?t===e.clientID&&null!=e.getLocalState()?a++:e.states.delete(t):e.states.set(t,u),e.meta.set(t,{clock:a,lastUpdated:i}),void 0===c&&null!==u?r.push(t):void 0!==c&&null===u?l.push(t):null!==u&&(el(u,d)||o.push(t),s.push(t)))}(r.length>0||o.length>0||l.length>0)&&e.emit("change",[{added:r,updated:o,removed:l},a]),(r.length>0||s.length>0||l.length>0)&&e.emit("update",[{added:r,updated:s,removed:l},a])})(a.awareness,Ao(t),a)},Sd[2]=(e,t,a,n,i)=>{((e,t,a)=>{0===So(e)&&a(t,To(e))})(t,a.doc,((e,t)=>Nd(a,t)))};const Nd=(e,t)=>console.warn(`Permission denied to access ${e.url}.\n${t}`),Td=(e,t,a)=>{const n=wo(t),i=Gs(),r=So(n),s=e.messageHandlers[r];return s?s(i,n,e,a,r):console.error("Unable to compute message"),i},Md=(e,t,a)=>{t===e.ws&&(e.emit("connection-close",[a,e]),e.ws=null,t.close(),e.wsconnecting=!1,e.wsconnected?(e.wsconnected=!1,e.synced=!1,Ad(e.awareness,Array.from(e.awareness.getStates().keys()).filter((t=>t!==e.doc.clientID)),e),e.emit("status",[{status:"disconnected"}])):e.wsUnsuccessfulReconnects++,setTimeout(xd,Is(100*Es(2,e.wsUnsuccessfulReconnects),e.maxBackoffTime),e))},xd=e=>{if(e.shouldConnect&&null===e.ws){const t=new e._WS(e.url,e.protocols);t.binaryType="arraybuffer",e.ws=t,e.wsconnecting=!0,e.wsconnected=!1,e.synced=!1,t.onmessage=a=>{e.wsLastMessageReceived=Bo();const n=Td(e,new Uint8Array(a.data),!0);qs(n)>1&&t.send(Zs(n))},t.onerror=t=>{e.emit("connection-error",[t,e])},t.onclose=a=>{Md(e,t,a)},t.onopen=()=>{e.wsLastMessageReceived=Bo(),e.wsconnecting=!1,e.wsconnected=!0,e.wsUnsuccessfulReconnects=0,e.emit("status",[{status:"connected"}]);const a=Gs();if(Xs(a,0),md(a,e.doc),t.send(Zs(a)),null!==e.awareness.getLocalState()){const a=Gs();Xs(a,1),io(a,kd(e.awareness,[e.doc.clientID])),t.send(Zs(a))}},e.emit("status",[{status:"connecting"}])}},Cd=(e,t)=>{const a=e.ws;e.wsconnected&&a&&a.readyState===a.OPEN&&a.send(t),e.bcconnected&&fd(e.bcChannel,t,e)};class Id extends Ts{constructor(e,t,a,{connect:n=!0,awareness:i=new wd(a),params:r={},protocols:s=[],WebSocketPolyfill:o=WebSocket,resyncInterval:l=-1,maxBackoffTime:u=2500,disableBc:c=!1}={}){for(super();"/"===e[e.length-1];)e=e.slice(0,e.length-1);this.serverUrl=e,this.bcChannel=e+"/"+t,this.maxBackoffTime=u,this.params=r,this.protocols=s,this.roomname=t,this.doc=a,this._WS=o,this.awareness=i,this.wsconnected=!1,this.wsconnecting=!1,this.bcconnected=!1,this.disableBc=c,this.wsUnsuccessfulReconnects=0,this.messageHandlers=Sd.slice(),this._synced=!1,this.ws=null,this.wsLastMessageReceived=0,this.shouldConnect=n,this._resyncInterval=0,l>0&&(this._resyncInterval=setInterval((()=>{if(this.ws&&this.ws.readyState===WebSocket.OPEN){const e=Gs();Xs(e,0),md(e,a),this.ws.send(Zs(e))}}),l)),this._bcSubscriber=(e,t)=>{if(t!==this){const t=Td(this,new Uint8Array(e),!1);qs(t)>1&&fd(this.bcChannel,Zs(t),this)}},this._updateHandler=(e,t)=>{if(t!==this){const t=Gs();Xs(t,0),((e,t)=>{Xs(e,2),io(e,t)})(t,e),Cd(this,Zs(t))}},this.doc.on("update",this._updateHandler),this._awarenessUpdateHandler=({added:e,updated:t,removed:a},n)=>{const r=e.concat(t).concat(a),s=Gs();Xs(s,1),io(s,kd(i,r)),Cd(this,Zs(s))},this._exitHandler=()=>{Ad(this.awareness,[a.clientID],"app closed")},tl&&void 0!==gs&&gs.on("exit",this._exitHandler),i.on("update",this._awarenessUpdateHandler),this._checkInterval=setInterval((()=>{this.wsconnected&&3e4<Bo()-this.wsLastMessageReceived&&Md(this,this.ws,null)}),3e3),n&&this.connect()}get url(){const e=(e=>((e,t)=>{const a=[];for(const n in e)a.push(t(e[n],n));return a})(e,((e,t)=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`)).join("&"))(this.params);return this.serverUrl+"/"+this.roomname+(0===e.length?"":"?"+e)}get synced(){return this._synced}set synced(e){this._synced!==e&&(this._synced=e,this.emit("synced",[e]),this.emit("sync",[e]))}destroy(){0!==this._resyncInterval&&clearInterval(this._resyncInterval),clearInterval(this._checkInterval),this.disconnect(),tl&&void 0!==gs&&gs.off("exit",this._exitHandler),this.awareness.off("update",this._awarenessUpdateHandler),this.doc.off("update",this._updateHandler),super.destroy()}connectBc(){if(this.disableBc)return;var e,t;this.bcconnected||(e=this.bcChannel,t=this._bcSubscriber,hd(e).subs.add(t),this.bcconnected=!0);const a=Gs();Xs(a,0),md(a,this.doc),fd(this.bcChannel,Zs(a),this);const n=Gs();Xs(n,0),yd(n,this.doc),fd(this.bcChannel,Zs(n),this);const i=Gs();Xs(i,3),fd(this.bcChannel,Zs(i),this);const r=Gs();Xs(r,1),io(r,kd(this.awareness,[this.doc.clientID])),fd(this.bcChannel,Zs(r),this)}disconnectBc(){const e=Gs();Xs(e,1),io(e,kd(this.awareness,[this.doc.clientID],new Map)),Cd(this,Zs(e)),this.bcconnected&&(((e,t)=>{const a=hd(e),n=a.subs.delete(t);n&&0===a.subs.size&&(a.bc.close(),dd.delete(e))})(this.bcChannel,this._bcSubscriber),this.bcconnected=!1)}disconnect(){this.shouldConnect=!1,this.disconnectBc(),null!==this.ws&&Md(this,this.ws,null)}connect(){this.shouldConnect=!0,this.wsconnected||null!==this.ws||(xd(this),this.connectBc())}}class Vd extends $l{}class Ed{apiClient;collabDocument;yWebsocketProvider;item;awareness;users=[];avatars=new Map;constructor(e){this.apiClient=e,this.collabDocument=new Vd}isActive(){return void 0!==this.yWebsocketProvider}getAwarenessStates(){return this.awareness?this.awareness.getStates():new Map}getUsersList(){return this.users}_getUser(e){for(const t of this.users)if(e===t.key)return t;return null}getLocalState(){if(!this.awareness)throw new Error("No awareness available. Cannot get state field.");return this.awareness.getLocalState()}setLocalStateField(e,t){if(!this.awareness)throw new Error("No awareness available. Cannot set state field.");this.awareness.setLocalStateField(e,t)}async _updateUsersList(){const e=this.getAwarenessStates(),t=await this.apiClient.me(!0);for(const[a,n]of e.entries()){if(!this._getUser(a)){let e=this.avatars.get(n.user.id);if(!e){e=(await this.apiClient.getAvatar(n.user.id,32)).avatar,this.avatars.set(n.user.id,e)}this.users.push({key:a,id:n.user.id,name:n.user.name,color:n.user.color,avatar:e,itsMe:n.user.id===t._id})}}const a=[];for(const t of this.users)e.has(t.key)&&a.push(t);this.users=a}async startCollaboration(e){try{if(!this.apiClient.isDevOrLocalhost())return!1;this.endCollaboration(),this.item=e;const t=this.apiClient.getCollabUrl(),a=`${this.item.type}.${this.item._id}`;let n=1e3;this.yWebsocketProvider=new Id(t,a,this.collabDocument,{connect:!1}),this.yWebsocketProvider.on("status",(e=>{console.log(`[Collab] ${e.status}`),"disconnected"===e.status&&this.yWebsocketProvider&&(this.yWebsocketProvider.disconnect(),setTimeout(r,n))})),this.yWebsocketProvider.on("sync",(e=>{console.log(`[Collab] synced: ${e}`)})),this.awareness=this.yWebsocketProvider.awareness,this.awareness.on("change",(async e=>{await this._updateUsersList(),u.$emit("collab:awareness:changed",{users:this.users,states:this.getAwarenessStates(),changes:e})}));const i=await this.apiClient.me(!0);this.awareness.setLocalStateField("user",{id:i._id,name:i.name,color:h.colorFromString(i.name)});const r=async()=>{if(!this.yWebsocketProvider)return void console.warn("[Collab] Cannot connect without websocket provider!");console.log("[Collab] reconnecting...");const e=await this.apiClient.getCollabToken();this.yWebsocketProvider.params.token=e,this.yWebsocketProvider.connect()};return await r(),u.$emit("collab:started"),!0}catch(e){return console.error("Error starting collaboration: ",e),!1}}endCollaboration(){this.yWebsocketProvider&&(console.log("Ending collaboration."),u.$emit("collab:ended"),this.yWebsocketProvider.destroy(),this.yWebsocketProvider=void 0,this.awareness=void 0),this.collabDocument=new Vd,this.item=void 0}}class Fd{apiClient;constructor(e){this.apiClient=e}async testCopyItems(e,t){const a=await this.apiClient.getItemsInFolderList(t,!0),n=await this.apiClient.getFoldersInFolderList(t),i=new Map;for(const e of n.children)i.set(e.name,null);for(const e of a)i.set(e.name,e._id);const r=this.apiClient.getItemRepo(),s=[];for(const t of e){let e,a,n=!1;t.isFolder?a=await this.apiClient.getFolder(t._id):(a=r.getLoadedItem(t._id),a||(a=await this.apiClient.getItem(t._id))),e=a?.name,n=i.has(e),s.push({_id:t._id,isFolder:t.isFolder,data:a,name:e,conflicted:n,conflictedItemId:i.get(e)})}return s}async copyItems(e,t,a=!1,n=!1){const i=e.filter((e=>!e.isFolder)).map((e=>e._id)),r=await this.apiClient.copyItems(i,t,a,n),s=this.apiClient.getItemRepo();for(let t of r){const a=e.filter((e=>e._id===t.original));a.length>0&&(t.replaced=a[0].conflictedItemId),await s.replaceLink(t.original,t.clone)}return await this.apiClient.eventBus.$emit("folder:changed",t),await this.apiClient.eventBus.$emit("items:copied",r),r}}class Dd{apiClient;jobManager;constructor(e){this.apiClient=e,this.jobManager=e.getJobManager()}async executeExport(e,t,a,n){const i=await this.jobManager.execute("EXPORT:ExportGame",[{_id:e,isFolder:!1}],[{name:"Destination Folder",value:a},{name:"EngineVersion",value:n}],void 0,{os:t});if(await this.apiClient.eventBus.$emit("quota:update"),2===i.state)throw new A("Export failed: "+i.error);await this.apiClient.eventBus.$emit("folder:changed",[a])}}(n.default?n.default:n)(a,{retries:3,retryCondition:e=>e.message.includes("net::ERR_NETWORK_CHANGED")});const Rd={Draft:0,Private:1,NotListed:2,Public:3},Ld=[{id:"prod",name:"Production",ssl:!0,apiHost:"api.lumino.cloud",viewerHost:"viewer.lumino.cloud",collabHost:"collab.lumino.cloud"},{id:"dev",name:"Development",ssl:!0,apiHost:"api-dev.lumino.cloud",viewerHost:"viewer-dev.lumino.cloud",collabHost:"collab-dev.lumino.cloud"},{id:"local",name:"Local",ssl:!1,apiHost:"localhost:8081",viewerHost:"localhost:8090",collabHost:"localhost:8200"}];e.AccessDeniedException=N,e.AggregatedItem=M,e.ApiClient=class extends l{accessToken;apiToken;options;forcePublicApi;usePublicApi;usePersistentStorage;storageSizeMib;requestClientId;apiUrl;wsUrl;viewerUrl;collabUrl;itemRepo;itemCache;folderCache;thumbCache;userCache;groupCache;attachmentCache;jobManager;serializer;collab;itemCopier;executableExporter;eventBus;env;api;ws=null;cachedMe;profiler;wsLastPing=null;last2faCode="";constructor(e={}){super(),e=e||{},this.options=Object.assign({environment:"auto",wsAutoReconnect:!0,wsAutoConnect:!1,forcePublicApi:!1,debug:!1,accessToken:null,apiToken:null,usePersistentStorage:!0,storageSizeMib:10240,requestClientId:null},e),this.accessToken=this.options.accessToken,this.apiToken=this.options.apiToken,this.forcePublicApi=this.options.forcePublicApi,this.usePublicApi=!this.accessToken&&!this.apiToken,this.usePersistentStorage=this.options.usePersistentStorage,this.storageSizeMib=this.options.storageSizeMib,this.requestClientId=this.options.requestClientId,this.cachedMe=null,this.itemRepo=new ji(this.usePublicApi,this),this.itemCache=new Fr(this.usePublicApi,this.usePersistentStorage,this,this.storageSizeMib),this.folderCache=new Dr(this),this.thumbCache=new Rr(this),this.userCache=new Lr(this),this.groupCache=new Pr(this),this.attachmentCache=new Br(this),this.jobManager=new Ur(this),this.serializer=new Gr(this),this.collab=new Ed(this),this.itemCopier=new Fd(this),this.executableExporter=new Dd(this),this.eventBus=u,this.profiler=null,this.switchEnvironment(this.options.environment),this.setDebugMode(this.options.debug)}detectEnvironment(){const e=this.isOnLocalhost(),t=this.isDevPlatform();return e?this.getEnvironmentById("local"):t?this.getEnvironmentById("dev"):this.getEnvironmentById("prod")}getEnvironmentById(e){return"auto"===e?this.detectEnvironment():Ld.find((t=>t.id===e))}getEnvironments(){return Ld}switchEnvironment(e){let t=this.getEnvironmentById(e);if(!t)throw new Error(`Unknown environment: ${e}`);console.log(`ApiClient switched to env: ${t.name}`);const n=t.ssl?"https":"http",i=t.ssl?"wss":"ws";this.apiUrl=`${n}://${t.apiHost}`,this.wsUrl=`${i}://${t.apiHost}/api/ws`,this.viewerUrl=`${n}://${t.viewerHost}`,this.collabUrl=`${n}://${t.collabHost}`,this.api=a.create({baseURL:this.apiUrl}),this.ws=null,this.wsLastPing=null}async initCaches(){return Promise.all([this.itemCache.init(),this.folderCache.init(),this.thumbCache.init()])}clearCaches(){this.itemCache.clear(),this.folderCache.clear(),this.thumbCache.clear()}isDevPlatform(){return"object"==typeof window&&"location"in window&&(window.location.href.includes("dev.lumino.cloud")||window.location.href.includes("taste.lemonate.io"))}isOnLocalhost(){return"object"==typeof window&&"location"in window&&window.location.href.includes("localhost")}isDevOrLocalhost(){return this.isOnLocalhost()||this.isDevPlatform()}async clearIndexedDb(e){return new Promise(((t,a)=>{const n=indexedDB.deleteDatabase(e);n.onsuccess=()=>{t()},n.onerror=e=>{a("An error occured while deleting a IndexedDB database.")},n.onblocked=()=>{a(`Database deletion is blocked. Please close all connections to "${e}".`)}}))}async logout(){return this.clearCaches(),this.clearIndexedDb("lumino")}setDebugMode(e){this.options.debug=!!e,this.eventBus.setDebugMode(this.options.debug)}websocketConnect(e){const t=this;if(this.ws){if(!e)return void console.warn("Websocket is already connected!");this.websocketDisconnect()}this.ws=new i(this.wsUrl),this.ws.onerror=function(e){console.error("Websocket error",e),t.$emit("client:websocketError",e)},this.ws.onopen=function(){t.$emit("client:websocketOpen"),t.accessToken&&t.websocketSend(JSON.stringify({type:"auth",subscriptions:["item","folder","job","user","notification"],token:t.accessToken}))},this.ws.onclose=function(){t.$emit("client:websocketClosed"),t.options.wsAutoReconnect&&t.websocketConnect(!0)},this.ws.onmessage=function(e){try{const a=JSON.parse(e.data);switch(a.type){case"ping":t.wsLastPing=new Date,t.ws&&t.ws.send(JSON.stringify({type:"ping"}));break;case"authenticated":t.$emit("client:websocketAuthenticated");break;case"Item":case"Folder":case"Notification":case"Job":case"User":u.$emit("client:elementUpdate",a);break;default:console.warn("Unknown websocket message: ",a)}}catch(e){console.error("Websocket error:",e)}}}websocketDisconnect(){this.ws&&(this.ws.close(),this.ws=null)}websocketSend(e){this.ws?1===this.ws.readyState?this.ws.send(e):console.error("Websocket is not in READY state. Currently in state "+this.ws.readyState):console.error("Websocket is not created")}getItemCopier(){return this.itemCopier}getExecutableExporter(){return this.executableExporter}getCollab(){return this.collab}getCollabUrl(){return this.collabUrl}getPublisher(){return new Or(this)}getAssetCreator(){return new Hr(this)}getJobManager(){return this.jobManager}getThumbCache(){return this.thumbCache}getItemCache(){return this.itemCache}getItemRepo(){return this.itemRepo}getRootVisibility(){return this.itemRepo.activeItem?this.itemRepo.activeItem.visibility:Rd.Private}getEventBus(){return this.eventBus}getSerializer(){return this.serializer}setForcePublicApi(e){this.forcePublicApi=e,this._updateUsePublicApi()}_updateUsePublicApi(){this.usePublicApi=this.forcePublicApi||!this.apiToken&&!this.accessToken,this.itemRepo.usePublicApi=this.usePublicApi,this.itemCache.usePublicApi=this.usePublicApi}setApiToken(e){this.apiToken=e,this._updateUsePublicApi()}setAccessToken(e){this.accessToken=e,this._updateUsePublicApi(),this.accessToken&&this.options.wsAutoConnect&&this.websocketConnect()}getApiToken(){return this.apiToken}getAccessToken(){return this.accessToken}setApiBaseUrl(e){this.apiUrl=e,this.api=a.create({baseURL:this.apiUrl})}setWsBaseUrl(e){this.wsUrl=e,this.accessToken&&this.options.wsAutoConnect&&(this.websocketDisconnect(),this.websocketConnect())}setRequestClientId(e){this.requestClientId=e}getApiBaseUrl(){return this.apiUrl}getWsBaseUrl(){return this.wsUrl}getViewerBaseUrl(){return this.viewerUrl}setProfiler(e){if(!e||"function"!=typeof e.start)throw new Error("Profiler needs to be an object providing a start function.");this.profiler=e}async login2FA(e,t,a){return console.log("Running Login..."),this.execute("post","/api/auth/login2fa",{account:e,password:t,client:a}).then((e=>{this.last2faCode=e,this.eventBus.$emit("login.2facode",e)}))}async confirm2FA(e,t){return this.execute("post","/api/auth/confirm2fa",{account:e,code:t})}isAuthenticated(){return!!this.accessToken||!!this.apiToken}isFeatureEnabled(e){return!!this.cachedMe&&this.cachedMe.features.includes(e)}async resolveUserOrGroupInfoForItem(e){return e.quotaUser?this.userCache.resolve(e.quotaUser):e.quotaGroup?this.groupCache.resolve(e.quotaGroup):e.createdBy?this.userCache.resolve(e.createdBy):{name:"?",initials:"?",avatar:null}}_startOp(e){const t=this,a={id:h.createGUID(),name:e,startTimeMs:performance.now(),runningMs:0,percent:0,reportProgress:function(e){a.percent=e},interval:null,finish:function(){if(a.interval&&clearInterval(a.interval),a.runningMs>1e3)try{t.$emit("client:longRunningOpFinished",a.id)}catch(e){console.error(e)}}};return a.interval=setInterval((function(){if(a.runningMs=performance.now()-a.startTimeMs,a.runningMs>1e3)try{t.$emit("client:longRunningOp",a.id,a.name,a.percent)}catch(e){console.error(e)}}),100),a}_createOpName(e,t){try{const a=t.split("/");switch(e.toLowerCase()){case"get":e="Fetching";break;case"post":e="Creating";break;case"put":e="Updating";break;case"delete":e="Deleting"}a.shift(),a.shift();const n=a.shift();let i=a.join("/");return i.length&&(i=` [${i}]`),`${e} ${n} data ${i}`}catch{return`${e} ${t}`}}addAuthenticationHeaders(e){this.accessToken&&(e["x-access-token"]=this.accessToken),this.apiToken&&(e["x-api-token"]=this.apiToken),this.requestClientId&&(e["x-request-client"]=this.requestClientId)}async execute(e,t,a,n){let i=this,r={};(n=n||{}).headers?r=n.headers:a&&"object"==typeof a&&"getHeaders"in a&&"function"==typeof a.getHeaders&&(r=a.getHeaders()),this.addAuthenticationHeaders(r);const s=this.profiler?this.profiler.start("ApiClient",`${e} ${t}`):null,o=this._startOp(n.opName||i._createOpName(e,t));return this.api({method:e,url:t,data:a,responseType:n.responseType,headers:r,signal:n.controller?n.controller.signal:void 0,onUploadProgress:function(e){if(e.total){const t=Math.min(100,Math.round(100*e.loaded/e.total));o.reportProgress(t),i.$emit("client:progress",{type:"upload",percent:t}),"function"==typeof n.progressCallback&&n.progressCallback(t,e.loaded,e.total)}},onDownloadProgress:function(e){if(e.total){const t=Math.min(100,Math.round(100*e.loaded/e.total));o.reportProgress(t),i.$emit("client:progress",{type:"download",percent:t}),"function"==typeof n.progressCallback&&n.progressCallback(t,e.loaded,e.total)}}}).then((e=>{if(s&&s.done(),o.finish(),i.$emit("client:progress",{type:"done"}),e.headers["content-type"].startsWith("application/json")){if("success"===e.data.result){let t;return t=n.withNext?{data:e.data.data,next:e.data.next}:e.data.data,n.emitOnSuccess&&this.eventBus.$emit(n.emitOnSuccess,t),t}throw e.data.redirect&&this.$emit("client:redirect",e.data.redirect),e.data.error?e.data.error:"API response seems to be json but does not contain result type!"}return n.emitOnSuccess&&this.eventBus.$emit(n.emitOnSuccess),{blob:new Blob([e.data],{type:e.headers["content-type"]}),hash:e.headers["sha256-hash"],itemName:e.headers["lumino-itemname"],itemType:e.headers["lumino-itemtype"],mimeType:e.headers["content-type"]}})).catch((e=>{if(s&&s.done(),o.finish(),i.$emit("client:progress",{type:"done"}),e.response){if(401===e.response.status)throw this.$emit("client:unauthorized"),new N("Access denied. Please login again.");if(413===e.response.status)throw new S;if(e.response.data&&e.response.data.error)throw new Error(e.response.data.error)}throw e}))}_createFormData(e,t){let a=new r;if("function"==typeof File&&e instanceof Blob)a.append("file",e,t);else{const n=new Blob([e]);try{a.append("file",n,t)}catch{a=new r,a.append("file",e,t)}}return a}async me(e){return e&&this.cachedMe||(this.cachedMe=await this.execute("get","/api/auth/me")),this.cachedMe}async getHomeFolder(){return this.execute("get","/api/auth/homefolder")}async myClients(){return this.execute("get","/api/auth/myclients")}async getCollabToken(){return this.execute("get","/api/auth/collabtoken")}async checkCollabToken(e){return this.execute("post","/api/auth/collabtoken",{token:e})}async register(e){return this.execute("post","/api/auth/register",e)}async deleteMyAccount(e){return this.execute("post","/api/auth/deletemyaccount",{password:e})}async confirmEmail(e){return this.execute("get","/api/auth/confirmemail/"+e)}async confirmEmailChange(e){return this.execute("get","/api/auth/confirmchangedemail/"+e)}async forgotPassword(e,t){return this.execute("post","/api/auth/forgotpassword",{account:e,client:t})}async setNewPassword(e,t){return this.execute("post","/api/auth/setnewpassword",{token:e,password:t})}async accountExists(e){return this.execute("post","/api/auth/accountExists",e)}async getItemsInFolderList(e,t=!1){if(e&&!t){const t=await this.folderCache.getItemListing(e);if(t)return t}const a=await this.execute("get","/api/item/infolder/"+(e||"0"));return await this.folderCache.addItemListing(e,a),a}async getItem(e,t){const a=[];t&&(t.returnClonedFrom&&a.push("returnClonedFrom=true"),t.withThumbnails&&a.push("withThumbnails=true"));let n="";return a.length&&(n=`?${a.join("&")}`),this.execute("get",`/api/item/${e}${n}`)}getItemAggregatedPOP(e,t){return this.usePublicApi?this.getItemPublicAggregated(e,t):this.getItemAggregated(e,t)}async getItemPublicAggregated(e,t){const a=Ei(e);if(a)return a;const n=[];t&&(t.withFieldInstances&&n.push("withFieldInstances"),t.withAttachmentInfo&&n.push("withAttachmentInfo"),t.noAttributes&&n.push("noAttributes"),t.noUserAttributes&&n.push("noUserAttributes"),t.noFields&&n.push("noFields"),t.noThumbnails&&n.push("noThumbnails"),t.noLinks&&n.push("noLinks"));let i="";return n.length&&(i=`?${n.join("&")}`),Ei(e)?Ei(e):this.execute("get","/api/item/publicaggregate/"+e+i)}async getItemAggregated(e,t){const a=Ei(e);if(a)return a;const n=[];t&&(t.withFieldInstances&&n.push("withFieldInstances"),t.withAttachmentInfo&&n.push("withAttachmentInfo"),t.noAttributes&&n.push("noAttributes"),t.noUserAttributes&&n.push("noUserAttributes"),t.noFields&&n.push("noFields"),t.noThumbnails&&n.push("noThumbnails"),t.noLinks&&n.push("noLinks"));let i="";return n.length&&(i=`?${n.join("&")}`),Ei(e)?Ei(e):this.execute("get",`/api/item/aggregate/${e}${i}`)}async getItemAggregatedRecursive(e,t){const a=[];t&&(t.withFieldInstances&&a.push("withFieldInstances"),t.withAttachmentInfo&&a.push("withAttachmentInfo"),t.noAttributes&&a.push("noAttributes"),t.noUserAttributes&&a.push("noUserAttributes"),t.noFields&&a.push("noFields"),t.noThumbnails&&a.push("noThumbnails"));let n="";return a.length&&(n=`?${a.join("&")}`),this.execute("get",`/api/item/aggregaterecursive/${e}${n}`)}async getItemPublicRecursive(e,t){return this.execute("get","/api/item/publicrecursive/"+e+(t?"?withFeatures":""))}async getItemPublic(e,t){return this.execute("get","/api/item/public/"+e+(t?"?returnClonedFrom=true":""))}async getItemHistory(e){return this.execute("get","/api/item/history/"+e)}async copyItems(e,t,a,n){return this.execute("post","/api/item/copy",{sourceItemIds:e,destFolderId:t,deepCopy:a,overwrite:n})}async createItem(e){return this.execute("post","/api/item",e)}async updateItem(e){return this.execute("put","/api/item",e)}async deleteItem(e){return this.execute("delete","/api/item",{id:e})}async renameItem(e,t){return this.updateItem({_id:e,name:t})}async queryPublicItemsList(e){return this.execute("post","/api/item/publicquery",e)}async queryItemsListPOP(e){return this.usePublicApi?this.queryPublicItemsList(e):this.queryItemsList(e)}async queryItemsList(e){return this.execute("post","/api/item/query",e)}async queryItemsListAsExcel(e){e.exportAsExcel=!0;const t=await this.execute("post","/api/item/query",e,{responseType:"arraybuffer"}),a=window.URL.createObjectURL(t.blob),n=document.createElement("a");n.href=a,n.setAttribute("download","export.xlsx"),n.click()}async moveItems(e){return this.execute("post","/api/item/move",e)}async downloadItem(e,t){const a=Ti(e);return a||this.execute("get",`/api/item/download/${e}`,null,{responseType:"arraybuffer",progressCallback:t,opName:`Downloading item ${e}`})}async publicDownloadItem(e,t){const a=Ti(e);return a||this.execute("get",`/api/item/publicdownload/${e}`,null,{responseType:"arraybuffer",progressCallback:t})}async getItemHash(e){const t=Ei(e);return t?t.hash:this.execute("get",`/api/item/hash/${e}`)}async requestSecureDownload(e){return this.execute("get","/api/item/requestsecuredownload/"+e)}async getThumbnail(e,t){return this.execute("get",`/api/item/thumbnail/${e}/${t}`)}async uploadThumbnail(e,t,a,n,i,r){const s=this._createFormData(a,n);return this.execute("post",`/api/item/thumbnail/${t}/${e}`,s,{progressCallback:i,controller:r})}async getPublicThumbnail(e,t){return this.execute("get",`/api/item/publicthumbnail/${e}/${t}`)}async makeItemPublic(e,t,a){return this.execute("put","/api/item/makepublic",{id:e,recursive:t,inSubfolders:a})}async setVisibility(e,t,a,n){return this.execute("put","/api/item/setvisibility",{id:e,visibility:t,recursive:a,inSubfolders:n})}async makeItemPrivate(e,t,a){return this.execute("put","/api/item/makeprivate",{id:e,recursive:t,inSubfolders:a})}async setOmitLodGeneration(e,t){return this.execute("get",`/api/item/setOmitLodGeneration/${e}/${t}`)}async setOmitThumbnailGeneration(e,t){return this.execute("get",`/api/item/setOmitThumbnailGeneration/${e}/${t}`)}async setOmitPreviewGeneration(e,t){return this.execute("get",`/api/item/setOmitPreviewGeneration/${e}/${t}`)}async uploadAndCreate(e,t,a,n,i,r){const s=this._createFormData(t,a);let o=`/api/item/uploadAndCreate/${e}`,l={};return n&&("object"==typeof n?(n.autoDestructIn&&(o+="?autoDestructIn="+n.autoDestructIn),n.visibility&&(o+="?visibility="+n.visibility),n.flags&&(o+="?flags="+n.flags),n.overwrite&&(o+="?overwrite="+(n.overwrite?"true":"false")),n.nameOverride&&(l["x-override-name"]=n.nameOverride)):o+="?autoDestructIn="+n),this.execute("post",o,s,{progressCallback:i,controller:r,headers:l})}async upload(e,t,a,n,i,r){const s=[];r&&(r.omitHandleDependencyChange&&s.push("omitHandleDependencyChange=true"),r.keepThumbnails&&s.push("keepThumbnails=true"));let o="";s.length&&(o=`?${s.join("&")}`);const l=this._createFormData(t,a);return this.execute("post",`/api/item/upload/${e}${o}`,l,{progressCallback:n,controller:i})}resetPreview(e){const t=this.execute("delete",`/api/item/attachment/${e}/preview`),a=this.execute("get",`/api/item/setOmitPreviewGeneration/${e}/false`);return Promise.all([t,a])}clearPreview(e){const t=this.execute("delete",`/api/item/attachment/${e}/preview`),a=this.execute("get",`/api/item/setOmitPreviewGeneration/${e}/true`);return Promise.all([t,a])}async clearThumbnail(e){return this.execute("get",`/api/item/clearThumbnail/${e}`)}async resetThumbnail(e){return this.execute("get",`/api/item/resetThumbnail/${e}`)}async downloadAttachmentPOP(e,t,a,n,i){return this.usePublicApi?this.downloadPublicAttachment(e,t,a,n,i):this.downloadAttachment(e,t,a,n,i)}_getAttachmentUrlPath(e,t,a,n,i){return`/api/item/${i?"public":""}attachment/${e}/${t}${null!=a?`/${a}`:"/undefined"}${null!=n?`/${n}`:""}`}async downloadAttachment(e,t,a,n=0,i){const r=Pi(e,t,a,n);return r||this.execute("get",this._getAttachmentUrlPath(e,t,a,n),null,{responseType:"arraybuffer",progressCallback:i})}async downloadPublicAttachment(e,t,a,n,i){const r=Pi(e,t,a,n);return r||this.execute("get",this._getAttachmentUrlPath(e,t,a,n,!0),null,{responseType:"arraybuffer",progressCallback:i})}async uploadAttachment(e,t,a,n,i,r,s,o){const l=this._createFormData(i,r);return this.execute("post",this._getAttachmentUrlPath(e,t,a,n),l,{progressCallback:s,controller:o})}async deleteAttachment(e,t,a,n){return this.attachmentCache.invalidateAttachment(e,t,a,n),this.execute("delete",this._getAttachmentUrlPath(e,t,a,n))}setPerceptiveHashOnAttachment(e,t,a){return this.execute("get",`/api/item/setPerceptiveHashAttachment/${e}/${t}/${a}`)}setPerceptiveHash(e,t){return this.execute("get",`/api/item/setPerceptiveHash/${e}/${t}`)}async getItemClient(e){return this.execute("get",`/api/item/getClient/${e}`)}async getItemAcl(e){return this.execute("get",`/api/item/acl/${e}`)}async getItemsLinking(e){return this.execute("get",`/api/item/linking/${e}`)}async setAttributes(e,t){return this.execute("put","/api/item/setAttributes",{id:e,attributes:t})}async getItemSyncList(e){const t=L(e).format("YYYYMMDDHHmmss");return this.execute("get",`/api/item/synclist/${t}`)}async increaseViews(e){return this.execute("get",`/api/item/increaseViews/${e}`)}async getViews(e){return this.execute("get",`/api/item/views/${e}`)}async getPublicItemCounts(e){return this.execute("get",`/api/item/publiccounts/${e}`)}async getItemCounts(e){return this.execute("get",`/api/item/counts/${e}`)}async likeItem(e){return this.execute("get",`/api/item/like/${e}`)}async unlikeItem(e){return this.execute("get",`/api/item/unlike/${e}`)}async doILike(e){return this.execute("get",`/api/item/doILike/${e}`)}async setItemAutoDestruct(e,t){const a=L(t).format("YYYYMMDDHHmmss");return this.execute("get",`/api/item/setAutoDestruct/${e}/${a}`)}async clearItemAutoDestruct(e){return this.execute("get",`/api/item/clearAutoDestruct/${e}`)}async resolveRelativeItem(e,t){const a=Ei(e);if(!a)return this.execute("post","/api/item/resolve/"+e,{path:t});t.startsWith("/")&&(t=t.substring(1));const n=t.split("/"),i=n.pop();let r=a.folder._id;for(const e of n){let t=!1;for(const[a,n]of Object.entries(Mi()))if(n.parent===r&&n.name===e){r=a,t=!0;break}if(!t)break}for(const e of Object.values(Vi()))if(e.folder._id===r&&e.name===i)return e._id;return console.error(`Could not resolve path ${t} for item ${e}`),null}async publicResolveRelativeItem(e,t){const a=Ei(e);if(!a)return this.execute("post","/api/item/publicResolve/"+e,{path:t});t.startsWith("/")&&(t=t.substring(1));const n=t.split("/"),i=n.pop();let r=xi(a.folder._id);for(const e of n)if(".."===e)r=xi(r.parent);else{const t=Ci(e,r._id);if(!t)throw new Error("Can't find folder while loading folder from package");r=t}const s=Ii(i,r._id);if(s)return s._id;throw new Error("Can't load item from package.")}async rewireItems(e){return this.execute("post","/api/item/rewire",{items:e})}async getFolder(e){return this.execute("get","/api/folder/"+e)}async getFullFolderTree(e){return this.execute("get",`/api/folder/fulltree/${e||"0"}`)}async getFoldersInFolderList(e,t){e=e||"0";const a=[];let n="";if(t){if(t.resolveNames&&!t.folderAsItemType&&"0"!==e){if(n=await this.folderCache.getFolderListing(e),n&&Date.now()-new Date(n.cachedAt).getTime()<1e4)return n;n&&n.parent&&a.push(`lastUpdatedAt=${n.parent.updatedAt}`)}t.resolveNames&&a.push("resolve"),t.folderAsItemType&&a.push(`folderAsItemType=${t.folderAsItemType}`),t.folderAsItemName&&a.push(`folderAsItemName=${t.folderAsItemName}`),t.folderAsItemFlag&&a.push(`folderAsItemFlag=${t.folderAsItemFlag}`),t.withStats&&a.push("withStats=true"),t.returnLatestPackage&&a.push("returnLatestPackage=true")}let i="";a.length&&(i="?"+a.join("&"));const r=await this.execute("get",`/api/folder/infolder/${e}${i}`);if(!0===r.notModified)return n;if(!t||t.resolveNames&&!t.folderAsItemType){const t=await this.getFolderAclList([e,...r.children.map((e=>e._id))]);for(const e of t)await this.folderCache.addACL(e.id,e.acl);return await this.folderCache.addFolderListing(e,r),r}return r}async updateFolderCache(e){const t=[];for(const a of e){if(!a)continue;const e=await this.folderCache.getFolderListing(a);e&&e.parent?t.push({id:a,lastUpdatedAt:e.parent.updatedAt}):t.push({id:a})}const a=await this.execute("post","/api/folder/infolderquery",{folders:t});for(const e of a)!0===e.data.notModified?await this.folderCache.refreshCacheForFolder(e.id):await this.folderCache.addFolderListing(e.id,e.data)}async createFolder(e){return this.execute("post","/api/folder",e)}async updateFolder(e){return this.execute("put","/api/folder",e)}async deleteFolder(e){return this.execute("delete","/api/folder",{id:e})}async renameFolder(e,t){return this.updateFolder({_id:e,name:t})}async moveFolders(e){return this.execute("post","/api/folder/move",e)}async getFolderPath(e){return e?("object"==typeof e&&(e=e._id),this.execute("get","/api/folder/path/"+e)):{path:"/",elements:[]}}async resolveFolderPath(e){return"/"===(e=e.trim())?null:this.execute("post","/api/folder/resolve",{path:e})}async getFolderClient(e){return this.execute("get",`/api/folder/getClient/${e}`)}async getFolderAcl(e){const t=await this.folderCache.getFolderACLs(e||"0",1e4);if(t&&e)return t;{const t=await this.execute("get",`/api/folder/acl/${e||"0"}`);return await this.folderCache.addACL(e||"0",t),t}}async getFolderAclList(e){return this.execute("post","/api/folder/aclquery",{ids:e})}async getUser(e){return this.execute("get","/api/user/"+e)}async getUsersList(){return this.execute("get","/api/user")}async createUser(e){return this.execute("post","/api/user",e)}async queryUser(e,t,a){return this.execute("post","/api/user/query",{searchQuery:e,groupID:t,cursor:a},{withNext:!0})}async updateUser(e){return this.execute("put","/api/user",e)}async deleteUser(e){return this.execute("delete","/api/user",{id:e})}async updateMyProfile(e){return this.execute("put","/api/user/myprofile",e)}async switchClient(e){return this.execute("get",`/api/user/switchclient/${e}`)}async activateUser(e,t){return this.execute("post","/api/user/activate",{token:t,password:e})}async getUsersToApprove(){return this.execute("get","/api/user/approvals")}async approveUserRegistration(e){return this.execute("get",`/api/user/approveuserregistration/${e}`)}async rejectUserRegistration(e){return this.execute("get",`/api/user/rejectuserregistration/${e}`)}async uploadAvatar(e){const t=new r;if(e instanceof Blob)t.append("file",e);else{const a=new Blob([new Uint8Array(e)]);t.append("file",a,"avatar.jpg")}return this.execute("post","/api/user/uploadAvatar",t)}async clearAvatar(){return this.execute("get","/api/user/clearAvatar")}async getAvatar(e,t){return this.execute("get",`/api/user/avatar/${t}/${e}`)}async getUserPublicInfo(e,t,a){return this.execute("get",`/api/user/publicinfo/${e}/${t}/${a}`)}async getUserAttribute(e){return this.execute("get",`/api/user/attribute/${e}`)}async clearUserAttribute(e){return this.execute("delete",`/api/user/attribute/${e}`)}async setUserAttribute(e,t){return this.execute("post",`/api/user/attribute/${e}`,t)}async getGroup(e){return this.execute("get","/api/group/"+e)}async getGroupFolder(e){return this.execute("get","/api/group/folder/"+e)}async getGroupsList(){return this.execute("get","/api/group")}async createGroup(e){return this.execute("post","/api/group",e)}async queryGroup(e,t){return this.execute("post","/api/group/query",{searchQuery:e,cursor:t},{withNext:!0})}async updateGroup(e){return this.execute("put","/api/group",e)}async deleteGroup(e){return this.execute("delete","/api/group",{id:e})}async getGroupQuotaInfo(e){return this.execute("get","/api/group/quota/"+e)}async getGroupPublicInfo(e,t,a){return this.execute("get",`/api/group/publicinfo/${e}/${t}/${a}`)}async getGroupUsers(e){return this.execute("get","/api/group/users/"+e)}async uploadGroupAvatar(e,t){const a=new r;if(t instanceof Blob)a.append("file",t);else{const e=new Blob([new Uint8Array(t)]);a.append("file",e,"avatar.jpg")}return this.execute("post","/api/group/"+e+"/uploadAvatar",a)}async getClientsList(){return this.execute("get","/api/client")}async getClient(e){return this.execute("get",`/api/client/${e}`)}async createClient(e){return this.execute("post","/api/client",e)}async queryClient(e,t){return this.execute("post","/api/client/query",{searchQuery:e,cursor:t},{withNext:!0})}async updateClient(e){return this.execute("put","/api/client",e)}async deleteClient(e){return this.execute("delete","/api/client",{id:e})}async getClientMetrics(e,t,a){return this.execute("get",`/api/client/metrics/${t}/${a}/${e}`)}async joinClient(e){return this.execute("get",`/api/client/join/${e}`)}async leaveClient(e){return this.execute("get",`/api/client/leave/${e}`)}async myClient(){return this.execute("get","/api/client/my")}async saveMyClient(e){return this.execute("put","/api/client/my",e)}async getPublicCategories(e){return this.execute("get",`/api/client/publiccategories/${e}`)}async getCategories(){return this.execute("get","/api/client/categories")}async getCategoriesInClient(e){return this.execute("get",`/api/client/categories/${e}`)}async updateCategoriesInClient(e,t){return this.execute("post",`/api/client/categories/${e}`,t)}async getLicenses(){return this.execute("get","/api/license")}async getLicensesInClient(e){return this.execute("get",`/api/license/inclient/${e}`)}async getLicense(e){return this.execute("get",`/api/license/${e}`)}async createLicense(e){return this.execute("post","/api/license",e)}async updateLicense(e){return this.execute("put","/api/license",e)}async deleteLicense(e,t){return this.execute("delete","/api/license",{_id:e,client:t})}async getPublicLicenses(e){return this.execute("get",`/api/license/publiclist/${e}`)}async getPublicLicense(e){return this.execute("get",`/api/license/public/${e}`)}async getDatatypesList(){return this.execute("get","/api/datatype")}async getPublicDatatypesList(e){return this.execute("get",`/api/datatype/public/${e}`)}async getDatatypesListOnClient(){return this.execute("get","/api/datatype/onclient")}async getDatatypesListOnClientForAll(){return this.execute("get","/api/datatype/onclientforall")}async getAllDatatypesList(){return this.execute("get","/api/datatype/all")}async getDatatype(e){return this.execute("get",`/api/datatype/${e}`)}async createDatatype(e){return this.execute("post","/api/datatype",e)}async updateDatatype(e){return this.execute("put","/api/datatype",e)}async deleteDatatype(e){return this.execute("delete","/api/datatype",{id:e})}async getMyNotifications(e){return this.execute("get","/api/notification"+(e?`?maxCount=${e}`:""))}async markNotificationAsRead(e){return this.execute("get",`/api/notification/markasread/${e}`)}async markAllNotificationsAsRead(){return this.execute("get","/api/notification/markallasread")}async createJob(e){return this.execute("post","/api/job",e,{emitOnSuccess:"job:created"})}async getManualJobTypes(){return this.execute("get","/api/job/manualtypes")}async getManualJobTypesOnClient(){return this.execute("get","/api/job/manualtypes/onclient")}async getManualJobTypesOnClientForAll(){return this.execute("get","/api/job/manualtypes/onclientforall")}async getAllManualJobTypes(){return this.execute("get","/api/job/manualtypes/all")}async getAllManualJobTypesForClient(e){return this.execute("get",`/api/job/manualtypes/all/${e}`)}async getClientJobTypes(){return this.execute("get","/api/job/clientTypes")}async getMyJobs(){return this.execute("get","/api/job/mine")}async getJobs(){return this.execute("get","/api/job")}async getJobsAggregated(){return this.execute("get","/api/job/aggregated")}async getJobsTimeframe(e,t){return this.execute("get",`/api/job/all/${e}/${t}`)}async getJob(e){return this.execute("get",`/api/job/${e}`)}async getJobState(e){return this.execute("get",`/api/job/state/${e}`)}async getAgents(){return this.execute("get","/api/jobagent")}async getAgentsAggregated(){return this.execute("get","/api/jobagent/aggregated")}async enableJobAgent(e){return this.execute("get",`/api/jobagent/enable/${e}`)}async disableJobAgent(e){return this.execute("get",`/api/jobagent/disable/${e}`)}async restartJobAgent(e){return this.execute("get",`/api/jobagent/restart/${e}`)}async getPermissionsList(){return this.execute("get","/api/permission")}async getPlugins(){return this.execute("get","/api/plugin")}async getPlans(){return this.execute("get","/api/plan")}async getPlan(e){return this.execute("get",`/api/plan/${e}`)}async createPlan(e){return this.execute("post","/api/plan",e)}async updatePlan(e){return this.execute("put","/api/plan",e)}async deletePlan(e){return this.execute("delete","/api/plan",{id:e})}async getWorkflows(){return this.execute("get","/api/workflow")}async getWorkflow(e){return this.execute("get",`/api/workflow/${e}`)}async createWorkflow(e){return this.execute("post","/api/workflow",e)}async updateWorkflow(e){return this.execute("put","/api/workflow",e)}async deleteWorkflow(e){return this.execute("delete","/api/workflow",{id:e})}async startWorkflow(e){return this.execute("post","/api/workflow/start",e)}async getAccessTokens(){return this.execute("get","/api/accesstoken")}async getClientAccessTokens(){return this.execute("get","/api/accesstoken/client")}async createAccessToken(e){return this.execute("post","/api/accesstoken",e)}async createClientAccessToken(e){return this.execute("post","/api/accesstoken/client",e)}async deleteAccessToken(e){return this.execute("delete","/api/accesstoken",{id:e})}async deleteClientAccessToken(e){return this.execute("delete","/api/accesstoken/client",{id:e})}async enableAccessToken(e){return this.execute("get",`/api/accesstoken/enable/${e}`)}async disableAccessToken(e){return this.execute("get",`/api/accesstoken/disable/${e}`)}async getApiTokens(){return this.execute("get","/api/apitoken")}async createApiToken(e){return this.execute("post","/api/apitoken",e)}async deleteApiToken(e){return this.execute("delete","/api/apitoken",{id:e})}async getMyClientInvoices(){return this.execute("get","/api/invoice")}async getMyUserInvoices(){return this.execute("get","/api/invoice/my")}async getClientInvoices(e){return this.execute("get",`/api/invoice/client/${e}`)}async downloadInvoice(e,t){const a=await this.execute("get",`/api/invoice/download/${e}`,null,{responseType:"arraybuffer"}),n=window.URL.createObjectURL(a.blob),i=document.createElement("a");i.href=n,i.setAttribute("download",t||"invoice.pdf"),document.body.appendChild(i),i.click()}async regenerateInvoice(e){return this.execute("get",`/api/invoice/regenerate/${e}`)}async getInvoicesForMonth(e,t){return this.execute("get",`/api/invoice/month/${t}/${e}`)}async refundInvoice(e,t,a){return this.execute("post","/api/invoice/refund",{invoice:e,amount:t,reason:a})}async paymentStartCheckout(e,t){return this.execute("post","/api/payment/checkout",{successUrl:e,cancelUrl:t})}async paymentStartUserCheckout(e,t){return this.execute("post","/api/payment/usercheckout",{successUrl:e,cancelUrl:t})}async getSupportedCurrencies(){return this.execute("get","/api/payment/supportedCurrencies")}async getPurchasables(){return this.execute("get","/api/purchasable")}async getPurchasable(e){return this.execute("get",`/api/purchasable/${e}`)}async createPurchasable(e){return this.execute("post","/api/purchasable",e)}async updatePurchasable(e){return this.execute("put","/api/purchasable",e)}async deletePurchasable(e){return this.execute("delete","/api/purchasable",{id:e})}async getPublicPurchasables(e){return this.execute("get",`/api/purchasable/public/${e}`)}async getPurchases(){return this.execute("get","/api/purchase")}async getMyActivePurchases(){return this.execute("get","/api/purchase/active")}async purchase(e){return this.execute("post","/api/purchase",e)}async changePurchaseProduct(e,t,a){return this.execute("post","/api/purchase/change",{purchaseID:e,purchasableID:t,optionID:a})}async cancelPurchase(e){return this.execute("delete","/api/purchase",{id:e})}async uncancelPurchase(e){return this.execute("post","/api/purchase/uncancel",{id:e})}async getSecureSessionPayload(e,t){return this.execute("get","/api/payment/secureSessionPayload?purchasableID="+e+"&optionID="+t)}async queryPurchases(e,t,a,n,i,r){return this.execute("post","/api/purchase/query",{startDate:e,endDate:t,email:a,invoice:n,cursor:i,limit:r})}async getAttributeTemplates(){return this.execute("get","/api/attributetemplate")}async getAttributeTemplate(e){return this.execute("get",`/api/attributetemplate/${e}`)}async createAttributeTemplate(e){return this.execute("post","/api/attributetemplate",e)}async updateAttributeTemplate(e){return this.execute("put","/api/attributetemplate",e)}async deleteAttributeTemplate(e){return this.execute("delete","/api/attributetemplate",{id:e})}async getStorages(){return this.execute("get","/api/storage")}async getConversation(e){return this.execute("get",`/api/conversation/${e}`)}async getPublicConversation(e){return this.execute("get",`/api/conversation/public/${e}`)}async createConversation(e,t){return this.execute("post","/api/conversation",{parentId:e,parentType:t})}async postConversationMessage(e,t,a){return this.execute("post","/api/conversation/post",{id:e,text:t,replyTo:a})}async editConversationMessage(e,t){return this.execute("put","/api/conversation/post",{id:e,text:t})}async deleteConversationMessage(e){return this.execute("delete","/api/conversation/post",{id:e})}async subscribeToConversation(e){return this.execute("post","/api/conversation/subscribe",{id:e})}async unsubscribeFromConversation(e){return this.execute("post","/api/conversation/unsubscribe",{id:e})}async likeConversationEntry(e){return this.execute("post","/api/conversation/like",{id:e})}async unlikeConversationEntry(e){return this.execute("post","/api/conversation/unlike",{id:e})}async command(e){return this.execute("post","/api/command",e)}async getMailTemplates(){return this.execute("get","/api/mailtemplate")}async getMailTemplate(e){return this.execute("get",`/api/mailtemplate/${e}`)}async createMailTemplate(e){return this.execute("post","/api/mailtemplate",e)}async updateMailTemplate(e){return this.execute("put","/api/mailtemplate",e)}async deleteMailTemplate(e){return this.execute("delete","/api/mailtemplate",{id:e})}async addMailTemplateImage(e,t,a){const n=this._createFormData(a,"image.jpg");return this.execute("post",`/api/mailtemplate/image/${e}/${t}`,n)}async deleteMailTemplateImage(e,t){return this.execute("delete",`/api/mailtemplate/image/${e}/${t}`)}async getMailTemplateNames(){return this.execute("get","/api/mailtemplate/names")}async getMailQuery(e,t,a,n){return this.execute("post","/api/email/query",{templateName:e,dateStart:t,dateEnd:a,success:n},{withNext:!0})}async getMail(e){return this.execute("get","/api/email/get?token="+e)}async getInvoiceTemplates(){return this.execute("get","/api/invoicetemplate")}async getInvoiceTemplate(e){return this.execute("get",`/api/invoicetemplate/${e}`)}async createInvoiceTemplate(e){return this.execute("post","/api/invoicetemplate",e)}async updateInvoiceTemplate(e){return this.execute("put","/api/invoicetemplate",e)}async deleteInvoiceTemplate(e){return this.execute("delete","/api/invoicetemplate",{id:e})}async addInvoiceTemplateImage(e,t,a){const n=this._createFormData(a,"image.jpg");return this.execute("post",`/api/invoicetemplate/image/${e}/${t}`,n)}async deleteInvoiceTemplateImage(e,t){return this.execute("delete",`/api/invoicetemplate/image/${e}/${t}`)}async getItemTemplatesList(){return this.execute("get","/api/itemtemplate/list")}async getItemTemplates(){return this.execute("get","/api/itemtemplate")}async createItemTemplate(e){return this.execute("post","/api/itemtemplate",e)}async updateItemTemplate(e){return this.execute("put","/api/itemtemplate",e)}async deleteItemTemplate(e){return this.execute("delete","/api/itemtemplate",{id:e})}async getFeatures(){return this.execute("get","/api/feature")}async getFeaturesOnClient(){return this.execute("get","/api/feature/onclient")}async getFeaturesOnClientForAll(){return this.execute("get","/api/feature/onclientforall")}async getAllFeatures(){return this.execute("get","/api/feature/all")}async getBlogs(){return this.execute("get","/api/blog")}async getBlog(e){return this.execute("get","/api/blog/"+e)}async getPublicBlog(e){return this.execute("get","/api/blog/"+e+"/public")}async createBlog(e,t,a,n){return this.execute("post","/api/blog",{name:e,public:t,commentsEnabled:a,editors:n})}async saveBlog(e,t,a,n,i){return this.execute("put","/api/blog",{_id:e,name:t,public:a,commentsEnabled:n,editors:i})}async deleteBlog(e){return this.execute("delete","/api/blog",{_id:e})}async getBlogOverview(e){return this.execute("get","/api/blog/"+e+"/overview")}async queryBlog(e,t,a,n,i,r,s){return this.execute("post","/api/blog/"+e+"/query",{tag:t,text:a,limit:n,previousArticle:i,searchTag:r,sortBy:s})}async getArticles(e){return this.execute("get","/api/blog/"+e+"/article")}async getArticle(e,t){return this.execute("get","/api/blog/"+e+"/article/"+t)}async getArticleBySlug(e,t){return this.execute("get","/api/blog/article/"+e+"/"+t)}async createArticle(e,t,a){return this.execute("post","/api/blog/"+e+"/article",{title:t,slug:a})}async saveArticle(e,t,a,n,i,r,s,o){return this.execute("put","/api/blog/"+e+"/article",{_id:t,title:a,slug:n,content:o,tags:r,public:i,author:s})}async deleteArticle(e,t){return this.execute("delete","/api/blog/"+e+"/article",{_id:t})}async getNewsletters(){return this.execute("get","/api/newsletter")}async createNewsletter(e,t){return this.execute("post","/api/newsletter",{name:e,editors:t})}async getNewsletter(e){return this.execute("get","/api/newsletter/"+e)}async updateNewsletter(e,t,a,n){return this.execute("put","/api/newsletter/"+e,{name:t,sender:a,editors:n})}async deleteNewsletter(e){return this.execute("delete","/api/newsletter/"+e)}async joinNewsletter(e,t){return this.execute("post","/api/newsletter/join",{id:e,email:t})}async confirmNewsletter(e){return this.execute("post","/api/newsletter/confirm",{token:e})}async unsubscribeFromNewsletter(e){return this.execute("post","/api/newsletter/unsubscribe",{token:e})}async getNewsletterBlocks(){return this.execute("get","/api/newsletterblock")}async getNewsletterBlock(e){return this.execute("get","/api/newsletterblock/"+e)}async createNewsletterBlock(e){return this.execute("post","/api/newsletterblock",{name:e})}async updateNewsletterBlock(e,t,a,n,i,r){return this.execute("put","/api/newsletterblock/"+e,{name:t,inputs:a,html:n,css:i,acceptsChildren:r})}async deleteNewsletterBlock(e){return this.execute("delete","/api/newsletterblock/"+e)}async getNewsletterMails(e){return this.execute("get","/api/newslettermail/"+e)}async getNewsletterMail(e,t){return this.execute("get","/api/newslettermail/"+e+"/"+t)}async createNewsletterMail(e,t){return this.execute("post","/api/newslettermail/"+e,{title:t})}async updateNewsletterMail(e,t,a,n,i){return this.execute("put","/api/newslettermail/"+e+"/"+t,{title:a,blocks:n,parentBlock:i})}async generatePreviewNewsletterMail(e,t){return this.execute("post","/api/newslettermail/render",{blocks:e,parentBlock:t})}async sendTestNewsletter(e,t,a){return this.execute("post","/api/newslettermail/"+e+"/"+t+"/sendTest",{email:a})}async sendOutNewsletter(e,t){return this.execute("post","/api/newslettermail/"+e+"/"+t+"/send",{})}async getPages(){return this.execute("get","/api/page")}async createPage(e,t){return this.execute("post","/api/page",{title:e,slug:t})}async getPage(e){return this.execute("get","/api/page/"+e)}async updatePage(e,t,a,n,i){return this.execute("put","/api/page",{_id:e,title:t,slug:a,public:n,content:i})}async deletePage(e){return this.execute("delete","/api/page",{_id:e})}async getPublicPage(e,t){return this.execute("get","/api/page/public/"+e+"/"+t)}async setItemFlag(e,t,a,n,i,r){return this.execute("post","/api/itemflag",{item:e,isStaffPick:t,featureWeight:a,isGame:n,replaceIndex:i,internalRating:r})}getDownloadUrl(e){return`${this.getApiBaseUrl()}/api/item/download/${e}`}getAttachmentDownloadUrl(e,t,a,n){return`${this.getApiBaseUrl()}${this._getAttachmentUrlPath(e,t,a,n)}`}getPublicAttachmentDownloadUrl(e,t,a,n){return`${this.getApiBaseUrl()}${this._getAttachmentUrlPath(e,t,a,n,!0)}`}getPublicDownloadUrl(e){return`${this.getApiBaseUrl()}/api/item/publicdownload/${e}`}async postFeedback(e){return this.execute("post","/api/feedback",{text:e})}},e.ApiGateway=P,e.Block=ae,e.CustomField=J,e.EventEmitter=l,e.Field=Z,e.InvalidArgumentException=w,e.InvalidStateException=class extends _{constructor(e){super(e,"InvalidStateException")}},e.Item=T,e.ItemCache=Fr,e.ItemRepo=ji,e.ItemVisibility=Rd,e.LinkableItemsCache=class{linkableItemsCache;apiGateway;itemCache;usePublicApi;constructor(e,t,a=!1){this.linkableItemsCache=new Map,this.apiGateway=e,this.itemCache=t,this.usePublicApi=a}clear(){this.linkableItemsCache.clear()}resolveItem(e,t){for(const a of t)if(a._id===e)return a;return null}async loadLinkableItems(e,t){if(!e)throw"loadLinkableItems(): Item cannot be null!";let a=[];if(t.linkableTypes&&t.linkableTypes.length){if(!this.usePublicApi){const n=t.linkableTypes.join("#")+(e.folder?e.folder._id:"");if(this.linkableItemsCache.has(n))return this.linkableItemsCache.get(n);const i=[...t.linkableTypes];i.includes("Package")||i.push("Package");const r={types:i,folder:e.folder?e.folder._id:null};a=(await this.apiGateway.call("LinkableItemsCache::loadLinkableItems","queryItemsList",r)).filter((e=>"Package"!==e.type||t.linkableTypes.includes(e.packageType)));for(const n of e.links)if(null==this.resolveItem(n.to,a))try{const e=await this.itemCache.getItem(n.to);t.linkableTypes.includes(e.type)&&a.push(e)}catch(e){console.error(`Link item ${n.to} not found. Dead link? (${e})`)}this.linkableItemsCache.set(n,a)}}else{for(const t of e.links){const e=await this.itemCache.getItem(t.to);a.push(e)}const n=t.name+"#CurrentLinks";this.linkableItemsCache.set(n,a)}return a}},e.LoaderException=k,e.PackageTools=Bi,e.PreparedItem=K,e.Profiler=v,e.Proxifier=g,e.ProxyEvent=c,e.QuotaExceededException=S,e.Script=W,e.ScriptField=j,e.Snapshot=O,e.Storage=Ji,e.Template=Q,e.TemplateFactory=ee,e.ThumbCache=Rr,e.UndoManager=$i,e.eventBus=u,e.getDatatypeByName=C,e.getDatatypes=function(){return structuredClone(x)},e.hasPermission=function(e,t,a){if(e.admin&&!a)return!0;if(e.superadmin)return!0;if(Array.isArray(e.permissions))if(Array.isArray(t)){for(const a of e.permissions)for(const e of t)if(a===e)return!0}else for(const a of e.permissions)if(a===t)return!0;return!1},e.profileAsyncBlock=async function(e,t){return v.instance.asyncBlock(e,t)},e.profileBlock=function(e,t){return v.instance.block(e,t)},e.tools=h,e.verifyAcl=X}));
19
19
  //# sourceMappingURL=lemonate-gateway.umd.js.map