@luminocity/lemonate-gateway 8.0.0 → 8.0.2

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,7 +1,7 @@
1
1
  import e from"short-unique-id";import t from"axios";import a from"axios-retry";import i from"isomorphic-ws";import n from"form-data";import s from"jszip";class r{func;owner;constructor(e,t){this.func=e,this.owner=t}}class o{_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 r(e,t))}$on(e,t,a){let i;this._listeners.has(e)?i=this._listeners.get(e):(i=[],this._listeners.set(e,i)),i.push(new r(t,a))}$once(e,t,a){let i;this._onceListeners.has(e)?i=this._onceListeners.get(e):(i=[],this._onceListeners.set(e,i)),i.push(new r(t,a))}$off(e,t,a){let i=0;if(this._listeners.has(e)){i+=this._listeners.get(e).removeByFilterFunc((e=>e.func===t&&e.owner===a))}if(this._onceListeners.has(e)){i+=this._onceListeners.get(e).removeByFilterFunc((e=>e.func===t&&e.owner===a))}return i}$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=[],i=performance.now();let n=0;try{for(const i of this._catchAllListeners.values())try{const s=i.func.call(i.owner,e,...t);s&&s.then&&a.push(s),n++}catch(e){console.error(e)}if(this._listeners.has(e)){const i=this._listeners.get(e);for(const e of i)try{const i=e.func.call(e.owner,...t);i&&i.then&&a.push(i),n++}catch(e){console.error(e)}}if(this._onceListeners.has(e)){const i=this._onceListeners.get(e);for(const e of i)try{const i=e.func.call(e.owner,...t);i&&i.then&&a.push(i),n++}catch(e){console.error(e)}this._onceListeners.set(e,[])}}catch(e){console.error(e)}if(this._debugMode&&"log"!==e){const t=performance.now(),s=Math.floor(t-i);let r=this._capturedEvents.get(e);r?(r.count++,r.duration+=s,r.promises+=a.length,r.sentTo+=n):(r={eventType:e,count:1,duration:s,promises:a.length,sentTo:n},this._capturedEvents.set(e,r)),s>3&&console.log(`Expensive event ${e}: ${s}ms`)}return a.length>0?Promise.all(a):null}$emit(e,...t){return new Promise((a=>{a(this.$emitSync(e,...t))}))}}const l=new o;class u{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,i,n,s,r){this.type=e,this.itemId=t,this.elementId=a,this.target=i,this.prop=n,this.value=s,this.oldValue=r}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 u,this)}isWithinMergeDeltaOf(e){return Math.abs(e.createdAt-this.createdAt)<=75}isMergeableWith(e){if(!this.isWithinMergeDeltaOf(e))return!1;const t=e.type===this.type&&e.itemId===this.itemId&&e.elementId===this.elementId&&e.target===this.target&&e.prop===this.prop,a=e.value&&e.oldValue&&void 0===e.start&&void 0===e.length&&void 0===e.position&&void 0===e.elementsToDelete;return t&&a}merge(e){if(!this.isMergeableWith(e))return null;let t=this.clone();return t.value=e.value,t.createdAt=e.createdAt,t}}const c=new e({dictionary:"hex",length:12});var d={createGUID:function(){return c.rnd()},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),areValuesEqual(e,t,a=5){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;const i=Object.keys(e),n=Object.keys(t);if(i.length!==n.length)return!1;for(let n of i){if(!Object.prototype.hasOwnProperty.call(t,n))return!1;if(a>0&&!this.areValuesEqual(e[n],t[n],a--))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]),i=[];for(let e=0;e<a.length;e++)i.push(a.charCodeAt(e));return new Blob([new Uint8Array(i)],{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 i=(1-Math.abs(2*a-1))*t,n=e/60,s=i*(1-Math.abs(n%2-1));let[r,o,l]=[0,0,0];[r,o,l]=n>=0&&n<1?[i,s,0]:n<2?[s,i,0]:n<3?[0,i,s]:n<4?[0,s,i]:n<5?[s,0,i]:[i,0,s];const u=a-i/2;return[Math.round(255*(r+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:i=.97,minL:n=.48,maxL:s=.62,return:r="hex"}=t,o=this.xmur3(e)(),l=this.mulberry32(o),u=Math.floor(360*l()),c=a+l()*(i-a),d=n+l()*(s-n);if("hsl"===r)return`hsl(${u} ${Math.round(100*c)}% ${Math.round(100*d)}%)`;const[p,h,m]=this.hslToRgb(u,c,d);return"rgb"===r?`rgb(${p}, ${h}, ${m})`:this.rgbToHex(p,h,m)}};const p=["dependantFields","conditionFields","dependenciesInitialized","_hidden","_updateConditions"],h=["__proto__","__ob__","isSelected","isDirty","options","_hidden","_updateConditions","dependantFields","conditionFields","separatorFields","dependenciesInitialized","order","inject","type","datatype","minValue","maxValue","id"],m=["isSelected","isDirty","_hidden","_updateConditions","options","dependantFields","conditionFields","separatorFields","dependenciesInitialized","id"];class f{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&&(m.includes(e.prop)||this.undoManager.event(e))}setItemDirty(e,t,a,i){this.suppressDirty||e.isDirty||a===i||h.includes(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(),l.setDebugMode(!0)}endProfiling(){const e=performance.now()-this._profilerStartTime;l.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,i){const n=this;if(!e)throw"_proxyObject(): Object is not defined. Cannot create proxy!";if(!a)throw"_proxyObject(): Item is not defined. Cannot create proxy!";if(!i)throw"_proxyObject(): Options is not defined. Cannot create proxy!";return new Proxy(e,{set:function(s,r,o){if(p.includes(r))return Reflect.set(s,r,o);const c=performance.now();let h=n.isUndoManagerActive();const m=Reflect.get(s,r);if(d.areValuesEqual(m,o))return!0;let f=Reflect.set(s,r,o);function y(n,o){const l=new u(i.proxyEventTypeName,a._id,t?t.id:null,s,r,n,o);return i.isField&&(l.setField(e.name),l.setFieldId(e.id)),void 0!==i.isLink&&l.setIsLink(i.isLink),l}i.changeDoesNotMakeItemDirty||(d.matchItemIdAndObject(m,o)?h=!1:n.setItemDirty(a,r,m,o));const g=y(o,m);h&&(g.setUndoFunction((()=>{Reflect.set(s,r,g.oldValue);const e=y(g.oldValue,g.value);l.$emitSync("proxy:valueChange",e),i.changeEventFunc(e)})),g.setRedoFunction((()=>{Reflect.set(s,r,g.value);const e=y(g.value,g.oldValue);l.$emitSync("proxy:valueChange",e),i.changeEventFunc(e)}))),i.changeEventFunc(g),h&&n._postUndoManagerEvent(g),l.$emitSync("proxy:valueChange",g);const b=performance.now();return n._profiledCount++,n._profiledEvents.push({event:g,type:"object",duration:b-c}),f}})}_proxyArray(e,t,a,i){const n=this;if(!e)throw"_proxyArray(): Array is not defined. Cannot create proxy!";if(!a)throw"_proxyArray(): Item is not defined. Cannot create proxy!";if(!i)throw"_proxyArray(): Options is not defined. Cannot create proxy!";return new Proxy(e,{set(e,s,r){const o=performance.now(),c=Reflect.get(e,s);let d=Reflect.set(e,s,r);if("length"!==s&&"__proto__"!==s){const p=n.isUndoManagerActive();function h(n,r){const o=new u("arraySetValue",a._id,t?t.id:null,e,s,n,r);return i.field&&(o.setField(i.field.name),o.setFieldId(i.field.id)),o}i.changeDoesNotMakeItemDirty||n.setItemDirty(a,s,c,r);const m=h(r,c);p&&(m.setUndoFunction((()=>{const t=h(m.oldValue,m.value),a=parseInt(s);if(void 0===m.oldValue&&e.length-1===a){const i=e.pop();t.setElementsToDelete([i]),t.setRange(a,1)}else Reflect.set(e,s,m.oldValue);l.$emitSync("proxy:valueChange",t),i.deleteEventFunc(t)})),m.setRedoFunction((()=>{Reflect.set(e,s,m.value);const t=h(m.value,m.oldValue);l.$emitSync("proxy:valueChange",t),i.addEventFunc(t)}))),i.addEventFunc(m),p&&n._postUndoManagerEvent(m),l.$emitSync("proxy:valueChange",m);const f=performance.now();n._profiledCount++,n._profiledEvents.push({event:m,type:"set_array",duration:f-o})}return d},get(s,r){if("splice"===r){const e=Reflect.get(s,r);return function(...o){const c=o[0],d=o[1],p=[];for(let e=c;e<c+d;e++){const t=s[e];p.push(t)}function h(e,n,r){const o=new u("arraySpliceRemove",a._id,t?t.id:null,s);return i.field&&(o.setField(i.field.name),o.setFieldId(i.field.id)),o.setRange(e,n),o.setElementsToDelete(r),o}function m(e,n){const o=new u("arraySpliceAdd",a._id,t?t.id:null,s,r,n);return i.field&&(o.setField(i.field.name),o.setFieldId(i.field.id)),o.setPosition(e),o}if(e.apply(s,o),n.setItemDirty(a,r,!0,!1),d>0&&o.length<3){const e=n.isUndoManagerActive(),t=h(c,d,p);e&&(t.setUndoFunction((()=>{s.splice(c,0,...p);const e=m(c,p);l.$emitSync("proxy:valueChange",e),i.addEventFunc(e)})),t.setRedoFunction((()=>{s.splice(c,d);const e=h(c,d,p);l.$emitSync("proxy:valueChange",e),i.deleteEventFunc(e)}))),i.deleteEventFunc(t),e&&n._postUndoManagerEvent(t),l.$emitSync("proxy:valueChange",t)}else if(o.length>2){const e=o.slice(2),t=m(c,e);t.setPosition(c),t.setUndoFunction((()=>{s.splice(c,e.length);const t=h(c,e.length,e);l.$emitSync("proxy:valueChange",t),i.deleteEventFunc(t)})),t.setRedoFunction((()=>{s.splice(c,0,...e);const t=m(c,e);l.$emitSync("proxy:valueChange",t),i.addEventFunc(t)})),i.addEventFunc(t),n._postUndoManagerEvent(t),l.$emitSync("proxy:valueChange",t)}}}return"moveToArray"===r?function(e,o,c){const d=s,p=t,{array:h,element:m}=o.getTargetArrayAndElement();function f(e,t,a,i){i=void 0===i?a.length:i;const n=Reflect.get(e,"splice").apply(e,[t,1]);if(n.length>0){const e=n[0];return Reflect.get(a,"splice").apply(a,[i,0,e]),e}return null}const y=f(d,e,h,c);if(y){function g(e,i,n,s,r,o){const l=new u("arrayMoveToArray",a._id,t?t.id:null,e,void 0,o);return l.setRange(i,1),l.setMoveTarget(n,s,r?r.id:null),l}n.setItemDirty(a,r,!0,!1);const b=n.isUndoManagerActive(),w=g(d,e,o,c,m,y);b&&(w.setUndoFunction((()=>{const t=f(h,c,d,e),a=g(o,c,d,e,p,t);l.$emitSync("proxy:valueChange",a),i.moveEventFunc(a)})),w.setRedoFunction((()=>{const t=f(d,e,h,c),a=g(d,e,o,c,m,t);l.$emitSync("proxy:valueChange",a),i.moveEventFunc(a)}))),i.moveEventFunc(w),b&&n._postUndoManagerEvent(w),l.$emitSync("proxy:valueChange",w)}}:"getTargetArrayAndElement"===r?function(){return{array:e,element:t}}:("move"===r&&console.warn("'move' prop is not implemented in Proxifier"),Reflect.get(s,r))}})}proxyBlockArray(e,t,a){return this._proxyArray(e,t,a,{addEventFunc:e=>{this._addPromise(l.$emit("itemRepo:blockAdded",e))},deleteEventFunc:e=>{this._addPromise(l.$emit("itemRepo:blockDeleted",e))},moveEventFunc:e=>{this._addPromise(l.$emit("itemRepo:blockMoved",e))}})}proxyListArray(e,t,a){return this._proxyArray(e,null,a,{field:t,addEventFunc:function(e){l.$emit("itemRepo:listEntryAdded",e)},deleteEventFunc:function(e){l.$emit("itemRepo:listEntryDeleted",e)}})}proxyScriptArray(e,t,a){return this._proxyArray(e,t,a,{addEventFunc:function(e){l.$emit("itemRepo:scriptAdded",e)},deleteEventFunc:function(e){l.$emit("itemRepo:scriptDeleted",e)}})}proxyBlock(e,t){return this._proxyObject(e,e,t,{isLink:!0,changeEventFunc:function(e){l.$emit("itemRepo:fieldChanged",e),l.$emit("itemRepo:linkChanged",e)},proxyEventTypeName:"blockSetValue"})}proxyGraphBlock(e,t){return this._proxyObject(e,e,t,{isLink:!0,changeEventFunc:function(e){l.$emit("itemRepo:graphNodeChanged",e)},proxyEventTypeName:"blockSetValue"})}proxyGraphBlockArray(e,t){return this._proxyArray(e,t,t,{addEventFunc:function(e){l.$emit("itemRepo:graphNodeAdded",e)},deleteEventFunc:function(e){l.$emit("itemRepo:graphNodeDeleted",e)}})}proxyConnection(e,t){return this._proxyObject(e,t,t,{changeEventFunc:function(e){l.$emit("itemRepo:graphConnectionChanged",e)},proxyEventTypeName:"connectionSetValue"})}proxyConnectionArray(e,t){return this._proxyArray(e,e,t,{addEventFunc:function(e){l.$emit("itemRepo:graphConnectionAdded",e)},deleteEventFunc:function(e){l.$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){l.$emit("itemRepo:fieldChanged",e),a&&l.$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){l.$emit("itemRepo:graphNodeFieldChanged",e)},proxyEventTypeName:"blockFieldSetValue"})}proxyBlockField(e,t,a){const i="Link"===e.type;return this._proxyObject(e,t,a,{isLink:i,isField:!0,changeEventFunc:function(e){l.$emit("itemRepo:fieldChanged",e),i&&l.$emit("itemRepo:linkChanged",e)},proxyEventTypeName:"blockFieldSetValue"})}proxyScriptItem(e,t,a){return this._proxyObject(e,t,a,{isLink:!0,changeEventFunc:function(e){l.$emit("itemRepo:scriptItemChanged",e)},proxyEventTypeName:"scriptItemSetValue"})}proxyScriptFieldsArray(e,t,a){return this._proxyArray(e,t,a,{addEventFunc:function(e){l.$emit("itemRepo:scriptFieldAdded",e)},deleteEventFunc:function(e){l.$emit("itemRepo:scriptFieldDeleted",e)},changeDoesNotMakeItemDirty:!0})}proxyScriptField(e,t,a){return this._proxyObject(e,t,a,{isLink:!1,isField:!0,changeEventFunc:function(e){l.$emit("itemRepo:scriptFieldChanged",e)},proxyEventTypeName:"itemScriptFieldSetValue",changeDoesNotMakeItemDirty:!1})}}class y{level;name;times;durations=[];childrenMap=new Map;children=[];parent;constructor(e,t,a,i){this.name=e,this.level=t,this.times=[a],this.parent=i}}class g{startTime=0;endTime=0;startIteration=0;currentLevel=0;root=new y("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 y("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(i){const n=t(a(i.times)/i.times.length),s=t(a(i.durations)/i.durations.length),r=t(a(i.durations)),o=t(r-i.children.reduce(((e,t)=>e+a(t.durations)),0));e.push({name:"".padStart(2*i.level," .")+i.name,executions:i.times.length,avgTimeStartMs:n,avgTimeEndMs:t(n+s),avgDurationMs:s,totalDurationMs:r,selfDurationMs:o})})),e}printResults(){console.table(this.getResults())}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 y(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 b extends Error{constructor(e,t){super(e),t&&(this.name=t)}toString(){return this.name?`${this.name}: ${this.message}`:this.message}}class w extends b{constructor(e){super(e,"InvalidArgumentException")}}class _ extends b{constructor(e){super(e,"InvalidStateException")}}class v extends b{constructor(e){super(e,"RuntimeException")}}class A extends b{constructor(e){super(e,"LoaderException")}}class k extends b{constructor(e){super(e,"QuotaExceededException")}}class S extends b{constructor(e){super(e,"AccessDeniedException")}}let N=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 N{links;thumbnails;fieldSets;fields;userFields;additionalUserAttributes;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||[])),this.additionalUserAttributes=JSON.parse(JSON.stringify(e.additionalUserAttributes||{}))}}var T=[{_id:{$oid:"5e6a1ace89707feef5738292"},contentTypes:["model/splat"],fieldSets:[],fields:[],name:"Gaussian Splats",updateRequiresThumbRefresh:!0},{_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},{_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},{_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},{_id:{$oid:"5e6a1acf89707feef917338f"},contentTypes:["*"],fieldSets:[],fields:[],name:"Binary"},{_id:{$oid:"5e6a1acf89707feef917337f"},contentTypes:["application/vnd.lumino.package"],fieldSets:[],fields:[],name:"Package"},{_id:{$oid:"5e6a1ad189707feef9173391"},contentTypes:["image/vnd.radiance"],fieldSets:[],fields:[],name:"HDR Image"},{_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},{_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},{_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},{_id:{$oid:"5e6a1ad189707feef9173395"},contentTypes:["application/pdf"],fieldSets:[],fields:[],name:"PDF"},{_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:!0},{datatype:"Enum",defaultValue:"Forward renderer",displayName:"Renderer",info:"Choose renderer to use. The path tracer is currently in experimental stage and will not support all material features",name:"Renderer",options:["Forward renderer","Path tracer"],if:{$featureenabled:"path_tracer"},type:"Attribute"},{datatype:"Enum",defaultValue:"ACESFilmic",name:"Tonemapping",options:["None","Linear","Reinhard","Cineon","ACESFilmic"],type:"Attribute"},{datatype:"Float",defaultValue:1,displayName:"Tonemapping exposure",minValue:0,name:"TonemappingExposure",type:"Attribute"},{datatype:"Enum",defaultValue:"Linear",displayName:"Output encoding",name:"OutputEncoding",options:["Linear","sRGB"],type:"Attribute"},{datatype:"Enum",defaultValue:"PCF Shadow Map",displayName:"Shadow type",name:"ShadowType",options:["Basic Shadow Map","PCF Shadow Map","PCF Soft Shadow Map","VSM Shadow Map"],type:"Attribute"},{label:"Fog",type:"Separator",collapsed:!0},{datatype:"Boolean",defaultValue:!1,displayName:"Enabled",name:"FogEnabled",type:"Attribute"},{datatype:"Color",defaultValue:{a:255,b:255,g:255,r:255},displayName:"Color",if:{FogEnabled:!0},name:"FogColor",type:"Attribute"},{datatype:"Float",defaultValue:0,displayName:"Near distance",if:{FogEnabled:!0},info:"The camera distance where fog starts to have effect",minValue:0,name:"FogNear",type:"Attribute"},{datatype:"Float",defaultValue:100,displayName:"Far distance",if:{FogEnabled:!0},info:"The camera distance where fog reaches maximum density",minValue:0,name:"FogFar",type:"Attribute"},{collapsed:!0,label:"Downloadables",type:"Separator",if:{$featureenabled:"scene_downloadables"}},{doesNotAffectThumbnail:!0,linkableTypes:["Mesh"],loadingManager:"ignore",preload:!1,type:"Link",usageAs:"USDZ",if:{$featureenabled:"scene_downloadables"}},{doesNotAffectThumbnail:!0,linkableTypes:["Mesh"],loadingManager:"ignore",preload:!1,type:"Link",usageAs:"GLB",if:{$featureenabled:"scene_downloadables"}}],name:"Scene",updateRequiresThumbRefresh:!0,inherits:"Prefab"},{_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"}],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"}],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},{_id:{$oid:"5e6a1ad189307f5ef9173362"},contentTypes:["text/x-animation"],fieldSets:[],fields:[],name:"Animations",updateRequiresThumbRefresh:!1},{_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:"Layer",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",maxValue:1,minValue:0,name:"Threshold",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:"VisibleEdgeColor",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:.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:"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:"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:"TargetTag",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:"MaxIntensity",minValue:.01,maxValue:1,name:"MaxIntensity",type:"Attribute"},{datatype:"Integer",defaultValue:60,displayName:"Samples",minValue:0,name:"Samples",type:"Attribute"},{datatype:"Boolean",defaultValue:!0,displayName:"Blur Rays",name:"BlurRaysFlag",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:{BlurRaysFlag:!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:"Desired width",minValue:1,name:"DesiredWidth",type:"Attribute"},{datatype:"Integer",defaultValue:256,displayName:"Desired height",minValue:1,name:"DesiredHeight",type:"Attribute"}],inputs:[{displayName:"Color input",name:"ColorInput",types:["RGBImage"]}],outputs:[],typeName:"output"}],name:"NodeGraph",type:"NodeGraph"}],name:"Composition",updateRequiresThumbRefresh:!1},{_id:{$oid:"5e6a1ad189707f2ef9147396"},contentTypes:[],fieldSets:[],fields:[],name:"Behavior",updateRequiresThumbRefresh:!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},{_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"},{_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"},{_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"},{_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"},{_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"},{_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"},{_id:{$oid:"5edf2f6edb25bdf5e5c26c10"},contentTypes:["application/vnd.lumi.flex"],fieldSets:[],fields:[],name:"FLEX"},{_id:{$oid:"60827c20d3f7a631e71522cc"},contentTypes:[],fieldSets:[],fields:[],name:"Dataset"},{_id:{$oid:"62133ff41302cfcd0d9a2346"},contentTypes:["text/x-glsl"],fieldSets:[],fields:[],name:"Pixel Shader",updateRequiresThumbRefresh:!1},{_id:{$oid:"62133ffb1302cf53ef9a234e"},contentTypes:["text/x-glsl"],fieldSets:[],fields:[],name:"Vertex Shader",updateRequiresThumbRefresh:!1},{_id:{$oid:"62a83a1ef46738fe096fd7e3"},contentTypes:["application/zip"],fieldSets:[],fields:[],name:"Archive",updateRequiresThumbRefresh:!1},{_id:{$oid:"640076f0e49250ab06ea4aec"},contentTypes:["font/ttf","font/otf"],fieldSets:[],fields:[],name:"Font",updateRequiresThumbRefresh:!0},{_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}];function x(e,t=!1){let a=T.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=x(a.inherits,!0);e&&(a.fields=[...e.fields,...a.fields],a.fieldSets=[...e.fieldSets,...a.fieldSets])}return a}var V="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function C(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function I(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,E={exports:{}};var D,P=(F||(F=1,(D=E).exports=function(){var e,t;function a(){return e.apply(null,arguments)}function i(t){e=t}function n(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 r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function o(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(r(e,t))return!1;return!0}function l(e){return void 0===e}function u(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function c(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function d(e,t){var a,i=[],n=e.length;for(a=0;a<n;++a)i.push(t(e[a],a));return i}function p(e,t){for(var a in t)r(t,a)&&(e[a]=t[a]);return r(t,"toString")&&(e.toString=t.toString),r(t,"valueOf")&&(e.valueOf=t.valueOf),e}function h(e,t,a,i){return qa(e,t,a,i,!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 f(e){return null==e._pf&&(e._pf=m()),e._pf}function y(e){var a=null,i=!1,n=e._d&&!isNaN(e._d.getTime());return n&&(a=f(e),i=t.call(a.parsedDateParts,(function(e){return null!=e})),n=a.overflow<0&&!a.empty&&!a.invalidEra&&!a.invalidMonth&&!a.invalidWeekday&&!a.weekdayMismatch&&!a.nullInput&&!a.invalidFormat&&!a.userInvalidated&&(!a.meridiem||a.meridiem&&i),e._strict&&(n=n&&0===a.charsLeftOver&&0===a.unusedTokens.length&&void 0===a.bigHour)),null!=Object.isFrozen&&Object.isFrozen(e)?n:(e._isValid=n,e._isValid)}function g(e){var t=h(NaN);return null!=e?p(f(t),e):f(t).userInvalidated=!0,t}t=Array.prototype.some?Array.prototype.some:function(e){var t,a=Object(this),i=a.length>>>0;for(t=0;t<i;t++)if(t in a&&e.call(this,a[t],t,a))return!0;return!1};var b=a.momentProperties=[],w=!1;function _(e,t){var a,i,n,s=b.length;if(l(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),l(t._i)||(e._i=t._i),l(t._f)||(e._f=t._f),l(t._l)||(e._l=t._l),l(t._strict)||(e._strict=t._strict),l(t._tzm)||(e._tzm=t._tzm),l(t._isUTC)||(e._isUTC=t._isUTC),l(t._offset)||(e._offset=t._offset),l(t._pf)||(e._pf=f(t)),l(t._locale)||(e._locale=t._locale),s>0)for(a=0;a<s;a++)l(n=t[i=b[a]])||(e[i]=n);return e}function v(e){_(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===w&&(w=!0,a.updateOffset(this),w=!1)}function A(e){return e instanceof v||null!=e&&null!=e._isAMomentObject}function k(e){!1===a.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function S(e,t){var i=!0;return p((function(){if(null!=a.deprecationHandler&&a.deprecationHandler(null,e),i){var n,s,o,l=[],u=arguments.length;for(s=0;s<u;s++){if(n="","object"==typeof arguments[s]){for(o in n+="\n["+s+"] ",arguments[0])r(arguments[0],o)&&(n+=o+": "+arguments[0][o]+", ");n=n.slice(0,-2)}else n=arguments[s];l.push(n)}k(e+"\nArguments: "+Array.prototype.slice.call(l).join("")+"\n"+(new Error).stack),i=!1}return t.apply(this,arguments)}),t)}var N,M={};function T(e,t){null!=a.deprecationHandler&&a.deprecationHandler(e,t),M[e]||(k(t),M[e]=!0)}function x(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function V(e){var t,a;for(a in e)r(e,a)&&(x(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 C(e,t){var a,i=p({},e);for(a in t)r(t,a)&&(s(e[a])&&s(t[a])?(i[a]={},p(i[a],e[a]),p(i[a],t[a])):null!=t[a]?i[a]=t[a]:delete i[a]);for(a in e)r(e,a)&&!r(t,a)&&s(e[a])&&(i[a]=p({},i[a]));return i}function F(e){null!=e&&this.set(e)}a.suppressDeprecationWarnings=!1,a.deprecationHandler=null,N=Object.keys?Object.keys:function(e){var t,a=[];for(t in e)r(e,t)&&a.push(t);return a};var E={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function P(e,t,a){var i=this._calendar[e]||this._calendar.sameElse;return x(i)?i.call(t,a):i}function L(e,t,a){var i=""+Math.abs(e),n=t-i.length;return(e>=0?a?"+":"":"-")+Math.pow(10,Math.max(0,n)).toString().substr(1)+i}var R=/(\[[^\[]*\])|(\\)?([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,i){var n=i;"string"==typeof i&&(n=function(){return this[i]()}),e&&($[e]=n),t&&($[t[0]]=function(){return L(n.apply(this,arguments),t[1],t[2])}),a&&($[a]=function(){return this.localeData().ordinal(n.apply(this,arguments),e)})}function j(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function z(e){var t,a,i=e.match(R);for(t=0,a=i.length;t<a;t++)$[i[t]]?i[t]=$[i[t]]:i[t]=j(i[t]);return function(t){var n,s="";for(n=0;n<a;n++)s+=x(i[n])?i[n].call(t,e):i[n];return s}}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 i(e){return t.longDateFormat(e)||e}for(B.lastIndex=0;a>=0&&B.test(e);)e=e.replace(B,i),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(R).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,i){var n=this._relativeTime[a];return x(n)?n(e,t,a,i):n.replace(/%d/i,e)}function te(e,t){var a=this._relativeTime[e>0?"future":"past"];return x(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 ie(e){return"string"==typeof e?ae[e]||ae[e.toLowerCase()]:void 0}function ne(e){var t,a,i={};for(a in e)r(e,a)&&(t=ie(a))&&(i[t]=e[a]);return i}var se={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 re(e){var t,a=[];for(t in e)r(e,t)&&a.push({unit:t,priority:se[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?/,me=/\d\d\d\d?/,fe=/\d\d\d\d\d\d?/,ye=/\d{1,3}/,ge=/\d{1,4}/,be=/[+-]?\d{1,6}/,we=/\d+/,_e=/[+-]?\d+/,ve=/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?/,Me=/^([1-9]\d|\d)/;function Te(e,t,a){oe[e]=x(t)?t:function(e,i){return e&&a?a:t}}function xe(e,t){return r(oe,e)?oe[e](t._strict,t._locale):new RegExp(Ve(e))}function Ve(e){return Ce(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,a,i,n){return t||a||i||n})))}function Ce(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Ie(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function Fe(e){var t=+e,a=0;return 0!==t&&isFinite(t)&&(a=Ie(t)),a}oe={};var Ee={};function De(e,t){var a,i,n=t;for("string"==typeof e&&(e=[e]),u(t)&&(n=function(e,a){a[t]=Fe(e)}),i=e.length,a=0;a<i;a++)Ee[e[a]]=n}function Pe(e,t){De(e,(function(e,a,i,n){i._w=i._w||{},t(e,i._w,i,n)}))}function Le(e,t,a){null!=t&&r(Ee,e)&&Ee[e](t,a._a,a,e)}function Re(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 Re(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"),Te("Y",_e),Te("YY",he,ue),Te("YYYY",ge,de),Te("YYYYY",be,pe),Te("YYYYYY",be,pe),De(["YYYYY","YYYYYY"],Be),De("YYYY",(function(e,t){t[Be]=2===e.length?a.parseTwoDigitYear(e):Fe(e)})),De("YY",(function(e,t){t[Be]=a.parseTwoDigitYear(e)})),De("Y",(function(e,t){t[Be]=parseInt(e,10)})),a.parseTwoDigitYear=function(e){return Fe(e)+(Fe(e)>68?1900:2e3)};var qe,Ze=Ke("FullYear",!0);function Je(){return Re(this.year())}function Ke(e,t){return function(i){return null!=i?(Qe(this,e,i),a.updateOffset(this,t),this):Xe(this,e)}}function Xe(e,t){if(!e.isValid())return NaN;var a=e._d,i=e._isUTC;switch(t){case"Milliseconds":return i?a.getUTCMilliseconds():a.getMilliseconds();case"Seconds":return i?a.getUTCSeconds():a.getSeconds();case"Minutes":return i?a.getUTCMinutes():a.getMinutes();case"Hours":return i?a.getUTCHours():a.getHours();case"Date":return i?a.getUTCDate():a.getDate();case"Day":return i?a.getUTCDay():a.getDay();case"Month":return i?a.getUTCMonth():a.getMonth();case"FullYear":return i?a.getUTCFullYear():a.getFullYear();default:return NaN}}function Qe(e,t,a){var i,n,s,r,o;if(e.isValid()&&!isNaN(a)){switch(i=e._d,n=e._isUTC,t){case"Milliseconds":return void(n?i.setUTCMilliseconds(a):i.setMilliseconds(a));case"Seconds":return void(n?i.setUTCSeconds(a):i.setSeconds(a));case"Minutes":return void(n?i.setUTCMinutes(a):i.setMinutes(a));case"Hours":return void(n?i.setUTCHours(a):i.setHours(a));case"Date":return void(n?i.setUTCDate(a):i.setDate(a));case"FullYear":break;default:return}s=a,r=e.month(),o=29!==(o=e.date())||1!==r||Re(s)?o:28,n?i.setUTCFullYear(s,r,o):i.setFullYear(s,r,o)}}function et(e){return x(this[e=ie(e)])?this[e]():this}function tt(e,t){if("object"==typeof e){var a,i=re(e=ne(e)),n=i.length;for(a=0;a<n;a++)this[i[a].unit](e[i[a].unit])}else if(x(this[e=ie(e)]))return this[e](t);return this}function at(e,t){return(e%t+t)%t}function it(e,t){if(isNaN(e)||isNaN(t))return NaN;var a=at(t,12);return e+=(t-a)/12,1===a?Re(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)})),Te("M",he,Ne),Te("MM",he,ue),Te("MMM",(function(e,t){return t.monthsShortRegex(e)})),Te("MMMM",(function(e,t){return t.monthsRegex(e)})),De(["M","MM"],(function(e,t){t[Oe]=Fe(e)-1})),De(["MMM","MMMM"],(function(e,t,a,i){var n=a._locale.monthsParse(e,i,a._strict);null!=n?t[Oe]=n:f(a).invalidMonth=e}));var nt="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),st="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),rt=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,ot=Se,lt=Se;function ut(e,t){return e?n(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||rt).test(t)?"format":"standalone"][e.month()]:n(this._months)?this._months:this._months.standalone}function ct(e,t){return e?n(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[rt.test(t)?"format":"standalone"][e.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function dt(e,t,a){var i,n,s,r=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],i=0;i<12;++i)s=h([2e3,i]),this._shortMonthsParse[i]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[i]=this.months(s,"").toLocaleLowerCase();return a?"MMM"===t?-1!==(n=qe.call(this._shortMonthsParse,r))?n:null:-1!==(n=qe.call(this._longMonthsParse,r))?n:null:"MMM"===t?-1!==(n=qe.call(this._shortMonthsParse,r))||-1!==(n=qe.call(this._longMonthsParse,r))?n:null:-1!==(n=qe.call(this._longMonthsParse,r))||-1!==(n=qe.call(this._shortMonthsParse,r))?n:null}function pt(e,t,a){var i,n,s;if(this._monthsParseExact)return dt.call(this,e,t,a);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){if(n=h([2e3,i]),a&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(n,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(n,"").replace(".","")+"$","i")),a||this._monthsParse[i]||(s="^"+this.months(n,"")+"|^"+this.monthsShort(n,""),this._monthsParse[i]=new RegExp(s.replace(".",""),"i")),a&&"MMMM"===t&&this._longMonthsParse[i].test(e))return i;if(a&&"MMM"===t&&this._shortMonthsParse[i].test(e))return i;if(!a&&this._monthsParse[i].test(e))return i}}function ht(e,t){if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=Fe(t);else if(!u(t=e.localeData().monthsParse(t)))return e;var a=t,i=e.date();return i=i<29?i:Math.min(i,it(e.year(),a)),e._isUTC?e._d.setUTCMonth(a,i):e._d.setMonth(a,i),e}function mt(e){return null!=e?(ht(this,e),a.updateOffset(this,!0),this):Xe(this,"Month")}function ft(){return it(this.year(),this.month())}function yt(e){return this._monthsParseExact?(r(this,"_monthsRegex")||bt.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(r(this,"_monthsShortRegex")||(this._monthsShortRegex=ot),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function gt(e){return this._monthsParseExact?(r(this,"_monthsRegex")||bt.call(this),e?this._monthsStrictRegex:this._monthsRegex):(r(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,i,n,s=[],r=[],o=[];for(t=0;t<12;t++)a=h([2e3,t]),i=Ce(this.monthsShort(a,"")),n=Ce(this.months(a,"")),s.push(i),r.push(n),o.push(n),o.push(i);s.sort(e),r.sort(e),o.sort(e),this._monthsRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+s.join("|")+")","i")}function wt(e,t,a,i,n,s,r){var o;return e<100&&e>=0?(o=new Date(e+400,t,a,i,n,s,r),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,a,i,n,s,r),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 vt(e,t,a){var i=7+t-a;return-(7+_t(e,0,i).getUTCDay()-t)%7+i-1}function At(e,t,a,i,n){var s,r,o=1+7*(t-1)+(7+a-i)%7+vt(e,i,n);return o<=0?r=Ge(s=e-1)+o:o>Ge(e)?(s=e+1,r=o-Ge(e)):(s=e,r=o),{year:s,dayOfYear:r}}function kt(e,t,a){var i,n,s=vt(e.year(),t,a),r=Math.floor((e.dayOfYear()-s-1)/7)+1;return r<1?i=r+St(n=e.year()-1,t,a):r>St(e.year(),t,a)?(i=r-St(e.year(),t,a),n=e.year()+1):(n=e.year(),i=r),{week:i,year:n}}function St(e,t,a){var i=vt(e,t,a),n=vt(e+1,t,a);return(Ge(e)-i+n)/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"),Te("w",he,Ne),Te("ww",he,ue),Te("W",he,Ne),Te("WW",he,ue),Pe(["w","ww","W","WW"],(function(e,t,a,i){t[i.substr(0,1)]=Fe(e)}));var Mt={dow:0,doy:6};function Tt(){return this._week.dow}function xt(){return this._week.doy}function Vt(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function Ct(e){var t=kt(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function It(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}function Ft(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Et(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"),Te("d",he),Te("e",he),Te("E",he),Te("dd",(function(e,t){return t.weekdaysMinRegex(e)})),Te("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),Te("dddd",(function(e,t){return t.weekdaysRegex(e)})),Pe(["dd","ddd","dddd"],(function(e,t,a,i){var n=a._locale.weekdaysParse(e,i,a._strict);null!=n?t.d=n:f(a).invalidWeekday=e})),Pe(["d","e","E"],(function(e,t,a,i){t[i]=Fe(e)}));var Dt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Pt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Lt="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Rt=Se,Bt=Se,Ot=Se;function $t(e,t){var a=n(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Et(a,this._week.dow):e?a[e.day()]:a}function Ut(e){return!0===e?Et(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function jt(e){return!0===e?Et(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function zt(e,t,a){var i,n,s,r=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)s=h([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(s,"").toLocaleLowerCase();return a?"dddd"===t?-1!==(n=qe.call(this._weekdaysParse,r))?n:null:"ddd"===t?-1!==(n=qe.call(this._shortWeekdaysParse,r))?n:null:-1!==(n=qe.call(this._minWeekdaysParse,r))?n:null:"dddd"===t?-1!==(n=qe.call(this._weekdaysParse,r))||-1!==(n=qe.call(this._shortWeekdaysParse,r))||-1!==(n=qe.call(this._minWeekdaysParse,r))?n:null:"ddd"===t?-1!==(n=qe.call(this._shortWeekdaysParse,r))||-1!==(n=qe.call(this._weekdaysParse,r))||-1!==(n=qe.call(this._minWeekdaysParse,r))?n:null:-1!==(n=qe.call(this._minWeekdaysParse,r))||-1!==(n=qe.call(this._weekdaysParse,r))||-1!==(n=qe.call(this._shortWeekdaysParse,r))?n:null}function Wt(e,t,a){var i,n,s;if(this._weekdaysParseExact)return zt.call(this,e,t,a);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(n=h([2e3,1]).day(i),a&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(n,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(n,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(n,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[i]||(s="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[i]=new RegExp(s.replace(".",""),"i")),a&&"dddd"===t&&this._fullWeekdaysParse[i].test(e))return i;if(a&&"ddd"===t&&this._shortWeekdaysParse[i].test(e))return i;if(a&&"dd"===t&&this._minWeekdaysParse[i].test(e))return i;if(!a&&this._weekdaysParse[i].test(e))return i}}function Yt(e){if(!this.isValid())return null!=e?this:NaN;var t=Xe(this,"Day");return null!=e?(e=It(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=Ft(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function qt(e){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||Kt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(r(this,"_weekdaysRegex")||(this._weekdaysRegex=Rt),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function Zt(e){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||Kt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(r(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Bt),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Jt(e){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||Kt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(r(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,i,n,s,r=[],o=[],l=[],u=[];for(t=0;t<7;t++)a=h([2e3,1]).day(t),i=Ce(this.weekdaysMin(a,"")),n=Ce(this.weekdaysShort(a,"")),s=Ce(this.weekdays(a,"")),r.push(i),o.push(n),l.push(s),u.push(i),u.push(n),u.push(s);r.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("^("+r.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),Te("a",ta),Te("A",ta),Te("H",he,Me),Te("h",he,Ne),Te("k",he,Ne),Te("HH",he,ue),Te("hh",he,ue),Te("kk",he,ue),Te("hmm",me),Te("hmmss",fe),Te("Hmm",me),Te("Hmmss",fe),De(["H","HH"],Ue),De(["k","kk"],(function(e,t,a){var i=Fe(e);t[Ue]=24===i?0:i})),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]=Fe(e),f(a).bigHour=!0})),De("hmm",(function(e,t,a){var i=e.length-2;t[Ue]=Fe(e.substr(0,i)),t[je]=Fe(e.substr(i)),f(a).bigHour=!0})),De("hmmss",(function(e,t,a){var i=e.length-4,n=e.length-2;t[Ue]=Fe(e.substr(0,i)),t[je]=Fe(e.substr(i,2)),t[ze]=Fe(e.substr(n)),f(a).bigHour=!0})),De("Hmm",(function(e,t,a){var i=e.length-2;t[Ue]=Fe(e.substr(0,i)),t[je]=Fe(e.substr(i))})),De("Hmmss",(function(e,t,a){var i=e.length-4,n=e.length-2;t[Ue]=Fe(e.substr(0,i)),t[je]=Fe(e.substr(i,2)),t[ze]=Fe(e.substr(n))}));var ia=/[ap]\.?m?\.?/i,na=Ke("Hours",!0);function sa(e,t,a){return e>11?a?"pm":"PM":a?"am":"AM"}var ra,oa={calendar:E,longDateFormat:H,invalidDate:q,ordinal:J,dayOfMonthOrdinalParse:K,relativeTime:Q,months:nt,monthsShort:st,week:Mt,weekdays:Dt,weekdaysMin:Lt,weekdaysShort:Pt,meridiemParse:ia},la={},ua={};function ca(e,t){var a,i=Math.min(e.length,t.length);for(a=0;a<i;a+=1)if(e[a]!==t[a])return a;return i}function da(e){return e?e.toLowerCase().replace("_","-"):e}function pa(e){for(var t,a,i,n,s=0;s<e.length;){for(t=(n=da(e[s]).split("-")).length,a=(a=da(e[s+1]))?a.split("-"):null;t>0;){if(i=ma(n.slice(0,t).join("-")))return i;if(a&&a.length>=t&&ca(n,a)>=t-1)break;t--}s++}return ra}function ha(e){return!(!e||!e.match("^[^/\\\\]*$"))}function ma(e){var t=null;if(void 0===la[e]&&D&&D.exports&&ha(e))try{t=ra._abbr,I("./locale/"+e),fa(t)}catch(t){la[e]=null}return la[e]}function fa(e,t){var a;return e&&((a=l(t)?ba(e):ya(e,t))?ra=a:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),ra._abbr}function ya(e,t){if(null!==t){var a,i=oa;if(t.abbr=e,null!=la[e])T("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."),i=la[e]._config;else if(null!=t.parentLocale)if(null!=la[t.parentLocale])i=la[t.parentLocale]._config;else{if(null==(a=ma(t.parentLocale)))return ua[t.parentLocale]||(ua[t.parentLocale]=[]),ua[t.parentLocale].push({name:e,config:t}),null;i=a._config}return la[e]=new F(C(i,t)),ua[e]&&ua[e].forEach((function(e){ya(e.name,e.config)})),fa(e),la[e]}return delete la[e],null}function ga(e,t){if(null!=t){var a,i,n=oa;null!=la[e]&&null!=la[e].parentLocale?la[e].set(C(la[e]._config,t)):(null!=(i=ma(e))&&(n=i._config),t=C(n,t),null==i&&(t.abbr=e),(a=new F(t)).parentLocale=la[e],la[e]=a),fa(e)}else null!=la[e]&&(null!=la[e].parentLocale?(la[e]=la[e].parentLocale,e===fa()&&fa(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 ra;if(!n(e)){if(t=ma(e))return t;e=[e]}return pa(e)}function wa(){return N(la)}function _a(e){var t,a=e._a;return a&&-2===f(e).overflow&&(t=a[Oe]<0||a[Oe]>11?Oe:a[$e]<1||a[$e]>it(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,f(e)._overflowDayOfYear&&(t<Be||t>$e)&&(t=$e),f(e)._overflowWeeks&&-1===t&&(t=Ye),f(e)._overflowWeekday&&-1===t&&(t=He),f(e).overflow=t),e}var va=/^\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/]],Ma=/^\/?Date\((-?\d+)/i,Ta=/^(?:(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 Va(e){var t,a,i,n,s,r,o=e._i,l=va.exec(o)||Aa.exec(o),u=Sa.length,c=Na.length;if(l){for(f(e).iso=!0,t=0,a=u;t<a;t++)if(Sa[t][1].exec(l[1])){n=Sa[t][0],i=!1!==Sa[t][2];break}if(null==n)return void(e._isValid=!1);if(l[3]){for(t=0,a=c;t<a;t++)if(Na[t][1].exec(l[3])){s=(l[2]||" ")+Na[t][0];break}if(null==s)return void(e._isValid=!1)}if(!i&&null!=s)return void(e._isValid=!1);if(l[4]){if(!ka.exec(l[4]))return void(e._isValid=!1);r="Z"}e._f=n+(s||"")+(r||""),Ua(e)}else e._isValid=!1}function Ca(e,t,a,i,n,s){var r=[Ia(e),st.indexOf(t),parseInt(a,10),parseInt(i,10),parseInt(n,10)];return s&&r.push(parseInt(s,10)),r}function Ia(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function Fa(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Ea(e,t,a){return!e||Pt.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(f(a).weekdayMismatch=!0,a._isValid=!1,!1)}function Da(e,t,a){if(e)return xa[e];if(t)return 0;var i=parseInt(a,10),n=i%100;return(i-n)/100*60+n}function Pa(e){var t,a=Ta.exec(Fa(e._i));if(a){if(t=Ca(a[4],a[3],a[2],a[5],a[6],a[7]),!Ea(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),f(e).rfc2822=!0}else e._isValid=!1}function La(e){var t=Ma.exec(e._i);null===t?(Va(e),!1===e._isValid&&(delete e._isValid,Pa(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:a.createFromInputFallback(e)))):e._d=new Date(+t[1])}function Ra(e,t,a){return null!=e?e:null!=t?t:a}function Ba(e){var t=new Date(a.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Oa(e){var t,a,i,n,s,r=[];if(!e._d){for(i=Ba(e),e._w&&null==e._a[$e]&&null==e._a[Oe]&&$a(e),null!=e._dayOfYear&&(s=Ra(e._a[Be],i[Be]),(e._dayOfYear>Ge(s)||0===e._dayOfYear)&&(f(e)._overflowDayOfYear=!0),a=_t(s,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]=r[t]=i[t];for(;t<7;t++)e._a[t]=r[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:wt).apply(null,r),n=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!==n&&(f(e).weekdayMismatch=!0)}}function $a(e){var t,a,i,n,s,r,o,l,u;null!=(t=e._w).GG||null!=t.W||null!=t.E?(s=1,r=4,a=Ra(t.GG,e._a[Be],kt(Za(),1,4).year),i=Ra(t.W,1),((n=Ra(t.E,1))<1||n>7)&&(l=!0)):(s=e._locale._week.dow,r=e._locale._week.doy,u=kt(Za(),s,r),a=Ra(t.gg,e._a[Be],u.year),i=Ra(t.w,u.week),null!=t.d?((n=t.d)<0||n>6)&&(l=!0):null!=t.e?(n=t.e+s,(t.e<0||t.e>6)&&(l=!0)):n=s),i<1||i>St(a,s,r)?f(e)._overflowWeeks=!0:null!=l?f(e)._overflowWeekday=!0:(o=At(a,i,n,s,r),e._a[Be]=o.year,e._dayOfYear=o.dayOfYear)}function Ua(e){if(e._f!==a.ISO_8601)if(e._f!==a.RFC_2822){e._a=[],f(e).empty=!0;var t,i,n,s,r,o,l,u=""+e._i,c=u.length,d=0;for(l=(n=Y(e._f,e._locale).match(R)||[]).length,t=0;t<l;t++)s=n[t],(i=(u.match(xe(s,e))||[])[0])&&((r=u.substr(0,u.indexOf(i))).length>0&&f(e).unusedInput.push(r),u=u.slice(u.indexOf(i)+i.length),d+=i.length),$[s]?(i?f(e).empty=!1:f(e).unusedTokens.push(s),Le(s,i,e)):e._strict&&!i&&f(e).unusedTokens.push(s);f(e).charsLeftOver=c-d,u.length>0&&f(e).unusedInput.push(u),e._a[Ue]<=12&&!0===f(e).bigHour&&e._a[Ue]>0&&(f(e).bigHour=void 0),f(e).parsedDateParts=e._a.slice(0),f(e).meridiem=e._meridiem,e._a[Ue]=ja(e._locale,e._a[Ue],e._meridiem),null!==(o=f(e).era)&&(e._a[Be]=e._locale.erasConvertYear(o,e._a[Be])),Oa(e),_a(e)}else Pa(e);else Va(e)}function ja(e,t,a){var i;return null==a?t:null!=e.meridiemHour?e.meridiemHour(t,a):null!=e.isPM?((i=e.isPM(a))&&t<12&&(t+=12),i||12!==t||(t=0),t):t}function za(e){var t,a,i,n,s,r,o=!1,l=e._f.length;if(0===l)return f(e).invalidFormat=!0,void(e._d=new Date(NaN));for(n=0;n<l;n++)s=0,r=!1,t=_({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[n],Ua(t),y(t)&&(r=!0),s+=f(t).charsLeftOver,s+=10*f(t).unusedTokens.length,f(t).score=s,o?s<i&&(i=s,a=t):(null==i||s<i||r)&&(i=s,a=t,r&&(o=!0));p(e,a||t)}function Wa(e){if(!e._d){var t=ne(e._i),a=void 0===t.day?t.date:t.day;e._a=d([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 v(_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?g({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),A(t)?new v(_a(t)):(c(t)?e._d=t:n(a)?za(e):a?Ua(e):Ga(e),y(e)||(e._d=null),e))}function Ga(e){var t=e._i;l(t)?e._d=new Date(a.now()):c(t)?e._d=new Date(t.valueOf()):"string"==typeof t?La(e):n(t)?(e._a=d(t.slice(0),(function(e){return parseInt(e,10)})),Oa(e)):s(t)?Wa(e):u(t)?e._d=new Date(t):a.createFromInputFallback(e)}function qa(e,t,a,i,r){var l={};return!0!==t&&!1!==t||(i=t,t=void 0),!0!==a&&!1!==a||(i=a,a=void 0),(s(e)&&o(e)||n(e)&&0===e.length)&&(e=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=r,l._l=a,l._i=e,l._f=t,l._strict=i,Ya(l)}function Za(e,t,a,i){return qa(e,t,a,i,!1)}a.createFromInputFallback=S("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":""))})),a.ISO_8601=function(){},a.RFC_2822=function(){};var Ja=S("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:g()})),Ka=S("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:g()}));function Xa(e,t){var a,i;if(1===t.length&&n(t[0])&&(t=t[0]),!t.length)return Za();for(a=t[0],i=1;i<t.length;++i)t[i].isValid()&&!t[i][e](a)||(a=t[i]);return a}function Qa(){return Xa("isBefore",[].slice.call(arguments,0))}function ei(){return Xa("isAfter",[].slice.call(arguments,0))}var ti=function(){return Date.now?Date.now():+new Date},ai=["year","quarter","month","week","day","hour","minute","second","millisecond"];function ii(e){var t,a,i=!1,n=ai.length;for(t in e)if(r(e,t)&&(-1===qe.call(ai,t)||null!=e[t]&&isNaN(e[t])))return!1;for(a=0;a<n;++a)if(e[ai[a]]){if(i)return!1;parseFloat(e[ai[a]])!==Fe(e[ai[a]])&&(i=!0)}return!0}function ni(){return this._isValid}function si(){return xi(NaN)}function ri(e){var t=ne(e),a=t.year||0,i=t.quarter||0,n=t.month||0,s=t.week||t.isoWeek||0,r=t.day||0,o=t.hour||0,l=t.minute||0,u=t.second||0,c=t.millisecond||0;this._isValid=ii(t),this._milliseconds=+c+1e3*u+6e4*l+1e3*o*60*60,this._days=+r+7*s,this._months=+n+3*i+12*a,this._data={},this._locale=ba(),this._bubble()}function oi(e){return e instanceof ri}function li(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function ui(e,t,a){var i,n=Math.min(e.length,t.length),s=Math.abs(e.length-t.length),r=0;for(i=0;i<n;i++)Fe(e[i])!==Fe(t[i])&&r++;return r+s}function ci(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)}))}ci("Z",":"),ci("ZZ",""),Te("Z",Ae),Te("ZZ",Ae),De(["Z","ZZ"],(function(e,t,a){a._useUTC=!0,a._tzm=pi(Ae,e)}));var di=/([\+\-]|\d\d)/gi;function pi(e,t){var a,i,n=(t||"").match(e);return null===n?null:0===(i=60*(a=((n[n.length-1]||[])+"").match(di)||["-",0,0])[1]+Fe(a[2]))?0:"+"===a[0]?i:-i}function hi(e,t){var i,n;return t._isUTC?(i=t.clone(),n=(A(e)||c(e)?e.valueOf():Za(e).valueOf())-i.valueOf(),i._d.setTime(i._d.valueOf()+n),a.updateOffset(i,!1),i):Za(e).local()}function mi(e){return-Math.round(e._d.getTimezoneOffset())}function fi(e,t,i){var n,s=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=pi(Ae,e)))return this}else Math.abs(e)<16&&!i&&(e*=60);return!this._isUTC&&t&&(n=mi(this)),this._offset=e,this._isUTC=!0,null!=n&&this.add(n,"m"),s!==e&&(!t||this._changeInProgress?Ei(this,xi(e-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?s:mi(this)}function yi(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function gi(e){return this.utcOffset(0,e)}function bi(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(mi(this),"m")),this}function wi(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=pi(ve,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this}function _i(e){return!!this.isValid()&&(e=e?Za(e).utcOffset():0,(this.utcOffset()-e)%60==0)}function vi(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ai(){if(!l(this._isDSTShifted))return this._isDSTShifted;var e,t={};return _(t,this),(t=Ha(t))._a?(e=t._isUTC?h(t._a):Za(t._a),this._isDSTShifted=this.isValid()&&ui(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function ki(){return!!this.isValid()&&!this._isUTC}function Si(){return!!this.isValid()&&this._isUTC}function Ni(){return!!this.isValid()&&this._isUTC&&0===this._offset}a.updateOffset=function(){};var Mi=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Ti=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function xi(e,t){var a,i,n,s=e,o=null;return oi(e)?s={ms:e._milliseconds,d:e._days,M:e._months}:u(e)||!isNaN(+e)?(s={},t?s[t]=+e:s.milliseconds=+e):(o=Mi.exec(e))?(a="-"===o[1]?-1:1,s={y:0,d:Fe(o[$e])*a,h:Fe(o[Ue])*a,m:Fe(o[je])*a,s:Fe(o[ze])*a,ms:Fe(li(1e3*o[We]))*a}):(o=Ti.exec(e))?(a="-"===o[1]?-1:1,s={y:Vi(o[2],a),M:Vi(o[3],a),w:Vi(o[4],a),d:Vi(o[5],a),h:Vi(o[6],a),m:Vi(o[7],a),s:Vi(o[8],a)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(n=Ii(Za(s.from),Za(s.to)),(s={}).ms=n.milliseconds,s.M=n.months),i=new ri(s),oi(e)&&r(e,"_locale")&&(i._locale=e._locale),oi(e)&&r(e,"_isValid")&&(i._isValid=e._isValid),i}function Vi(e,t){var a=e&&parseFloat(e.replace(",","."));return(isNaN(a)?0:a)*t}function Ci(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 Ii(e,t){var a;return e.isValid()&&t.isValid()?(t=hi(t,e),e.isBefore(t)?a=Ci(e,t):((a=Ci(t,e)).milliseconds=-a.milliseconds,a.months=-a.months),a):{milliseconds:0,months:0}}function Fi(e,t){return function(a,i){var n;return null===i||isNaN(+i)||(T(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."),n=a,a=i,i=n),Ei(this,xi(a,i),e),this}}function Ei(e,t,i,n){var s=t._milliseconds,r=li(t._days),o=li(t._months);e.isValid()&&(n=null==n||n,o&&ht(e,Xe(e,"Month")+o*i),r&&Qe(e,"Date",Xe(e,"Date")+r*i),s&&e._d.setTime(e._d.valueOf()+s*i),n&&a.updateOffset(e,r||o))}xi.fn=ri.prototype,xi.invalid=si;var Di=Fi(1,"add"),Pi=Fi(-1,"subtract");function Li(e){return"string"==typeof e||e instanceof String}function Ri(e){return A(e)||c(e)||Li(e)||u(e)||Oi(e)||Bi(e)||null==e}function Bi(e){var t,a,i=s(e)&&!o(e),n=!1,l=["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=l.length;for(t=0;t<u;t+=1)a=l[t],n=n||r(e,a);return i&&n}function Oi(e){var t=n(e),a=!1;return t&&(a=0===e.filter((function(t){return!u(t)&&Li(e)})).length),t&&a}function $i(e){var t,a,i=s(e)&&!o(e),n=!1,l=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<l.length;t+=1)a=l[t],n=n||r(e,a);return i&&n}function Ui(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 ji(e,t){1===arguments.length&&(arguments[0]?Ri(arguments[0])?(e=arguments[0],t=void 0):$i(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var i=e||Za(),n=hi(i,this).startOf("day"),s=a.calendarFormat(this,n)||"sameElse",r=t&&(x(t[s])?t[s].call(this,i):t[s]);return this.format(r||this.localeData().calendar(s,this,Za(i)))}function zi(){return new v(this)}function Wi(e,t){var a=A(e)?e:Za(e);return!(!this.isValid()||!a.isValid())&&("millisecond"===(t=ie(t)||"millisecond")?this.valueOf()>a.valueOf():a.valueOf()<this.clone().startOf(t).valueOf())}function Yi(e,t){var a=A(e)?e:Za(e);return!(!this.isValid()||!a.isValid())&&("millisecond"===(t=ie(t)||"millisecond")?this.valueOf()<a.valueOf():this.clone().endOf(t).valueOf()<a.valueOf())}function Hi(e,t,a,i){var n=A(e)?e:Za(e),s=A(t)?t:Za(t);return!!(this.isValid()&&n.isValid()&&s.isValid())&&("("===(i=i||"()")[0]?this.isAfter(n,a):!this.isBefore(n,a))&&(")"===i[1]?this.isBefore(s,a):!this.isAfter(s,a))}function Gi(e,t){var a,i=A(e)?e:Za(e);return!(!this.isValid()||!i.isValid())&&("millisecond"===(t=ie(t)||"millisecond")?this.valueOf()===i.valueOf():(a=i.valueOf(),this.clone().startOf(t).valueOf()<=a&&a<=this.clone().endOf(t).valueOf()))}function qi(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Zi(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Ji(e,t,a){var i,n,s;if(!this.isValid())return NaN;if(!(i=hi(e,this)).isValid())return NaN;switch(n=6e4*(i.utcOffset()-this.utcOffset()),t=ie(t)){case"year":s=Ki(this,i)/12;break;case"month":s=Ki(this,i);break;case"quarter":s=Ki(this,i)/3;break;case"second":s=(this-i)/1e3;break;case"minute":s=(this-i)/6e4;break;case"hour":s=(this-i)/36e5;break;case"day":s=(this-i-n)/864e5;break;case"week":s=(this-i-n)/6048e5;break;default:s=this-i}return a?s:Ie(s)}function Ki(e,t){if(e.date()<t.date())return-Ki(t,e);var a=12*(t.year()-e.year())+(t.month()-e.month()),i=e.clone().add(a,"months");return-(a+(t-i<0?(t-i)/(i-e.clone().add(a-1,"months")):(t-i)/(e.clone().add(a+1,"months")-i)))||0}function Xi(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Qi(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"):x(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 en(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,a,i,n="moment",s="";return this.isLocal()||(n=0===this.utcOffset()?"moment.utc":"moment.parseZone",s="Z"),e="["+n+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a="-MM-DD[T]HH:mm:ss.SSS",i=s+'[")]',this.format(e+t+a+i)}function tn(e){e||(e=this.isUtc()?a.defaultFormatUtc:a.defaultFormat);var t=W(this,e);return this.localeData().postformat(t)}function an(e,t){return this.isValid()&&(A(e)&&e.isValid()||Za(e).isValid())?xi({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function nn(e){return this.from(Za(),e)}function sn(e,t){return this.isValid()&&(A(e)&&e.isValid()||Za(e).isValid())?xi({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function rn(e){return this.to(Za(),e)}function on(e){var t;return void 0===e?this._locale._abbr:(null!=(t=ba(e))&&(this._locale=t),this)}a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",a.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var ln=S("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 un(){return this._locale}var cn=1e3,dn=60*cn,pn=60*dn,hn=3506328*pn;function mn(e,t){return(e%t+t)%t}function fn(e,t,a){return e<100&&e>=0?new Date(e+400,t,a)-hn:new Date(e,t,a).valueOf()}function yn(e,t,a){return e<100&&e>=0?Date.UTC(e+400,t,a)-hn:Date.UTC(e,t,a)}function gn(e){var t,i;if(void 0===(e=ie(e))||"millisecond"===e||!this.isValid())return this;switch(i=this._isUTC?yn:fn,e){case"year":t=i(this.year(),0,1);break;case"quarter":t=i(this.year(),this.month()-this.month()%3,1);break;case"month":t=i(this.year(),this.month(),1);break;case"week":t=i(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=i(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=mn(t+(this._isUTC?0:this.utcOffset()*dn),pn);break;case"minute":t=this._d.valueOf(),t-=mn(t,dn);break;case"second":t=this._d.valueOf(),t-=mn(t,cn)}return this._d.setTime(t),a.updateOffset(this,!0),this}function bn(e){var t,i;if(void 0===(e=ie(e))||"millisecond"===e||!this.isValid())return this;switch(i=this._isUTC?yn:fn,e){case"year":t=i(this.year()+1,0,1)-1;break;case"quarter":t=i(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=i(this.year(),this.month()+1,1)-1;break;case"week":t=i(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=i(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=pn-mn(t+(this._isUTC?0:this.utcOffset()*dn),pn)-1;break;case"minute":t=this._d.valueOf(),t+=dn-mn(t,dn)-1;break;case"second":t=this._d.valueOf(),t+=cn-mn(t,cn)-1}return this._d.setTime(t),a.updateOffset(this,!0),this}function wn(){return this._d.valueOf()-6e4*(this._offset||0)}function _n(){return Math.floor(this.valueOf()/1e3)}function vn(){return new Date(this.valueOf())}function An(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function kn(){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 Sn(){return this.isValid()?this.toISOString():null}function Nn(){return y(this)}function Mn(){return p({},f(this))}function Tn(){return f(this).overflow}function xn(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Vn(e,t){var i,n,s,r=this._eras||ba("en")._eras;for(i=0,n=r.length;i<n;++i)switch("string"==typeof r[i].since&&(s=a(r[i].since).startOf("day"),r[i].since=s.valueOf()),typeof r[i].until){case"undefined":r[i].until=1/0;break;case"string":s=a(r[i].until).startOf("day").valueOf(),r[i].until=s.valueOf()}return r}function Cn(e,t,a){var i,n,s,r,o,l=this.eras();for(e=e.toUpperCase(),i=0,n=l.length;i<n;++i)if(s=l[i].name.toUpperCase(),r=l[i].abbr.toUpperCase(),o=l[i].narrow.toUpperCase(),a)switch(t){case"N":case"NN":case"NNN":if(r===e)return l[i];break;case"NNNN":if(s===e)return l[i];break;case"NNNNN":if(o===e)return l[i]}else if([s,r,o].indexOf(e)>=0)return l[i]}function In(e,t){var i=e.since<=e.until?1:-1;return void 0===t?a(e.since).year():a(e.since).year()+(t-e.offset)*i}function Fn(){var e,t,a,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e){if(a=this.clone().startOf("day").valueOf(),i[e].since<=a&&a<=i[e].until)return i[e].name;if(i[e].until<=a&&a<=i[e].since)return i[e].name}return""}function En(){var e,t,a,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e){if(a=this.clone().startOf("day").valueOf(),i[e].since<=a&&a<=i[e].until)return i[e].narrow;if(i[e].until<=a&&a<=i[e].since)return i[e].narrow}return""}function Dn(){var e,t,a,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e){if(a=this.clone().startOf("day").valueOf(),i[e].since<=a&&a<=i[e].until)return i[e].abbr;if(i[e].until<=a&&a<=i[e].since)return i[e].abbr}return""}function Pn(){var e,t,i,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(i=s[e].since<=s[e].until?1:-1,n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until||s[e].until<=n&&n<=s[e].since)return(this.year()-a(s[e].since).year())*i+s[e].offset;return this.year()}function Ln(e){return r(this,"_erasNameRegex")||zn.call(this),e?this._erasNameRegex:this._erasRegex}function Rn(e){return r(this,"_erasAbbrRegex")||zn.call(this),e?this._erasAbbrRegex:this._erasRegex}function Bn(e){return r(this,"_erasNarrowRegex")||zn.call(this),e?this._erasNarrowRegex:this._erasRegex}function On(e,t){return t.erasAbbrRegex(e)}function $n(e,t){return t.erasNameRegex(e)}function Un(e,t){return t.erasNarrowRegex(e)}function jn(e,t){return t._eraYearOrdinalRegex||we}function zn(){var e,t,a,i,n,s=[],r=[],o=[],l=[],u=this.eras();for(e=0,t=u.length;e<t;++e)a=Ce(u[e].name),i=Ce(u[e].abbr),n=Ce(u[e].narrow),r.push(a),s.push(i),o.push(n),l.push(a),l.push(i),l.push(n);this._erasRegex=new RegExp("^("+l.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+r.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+o.join("|")+")","i")}function Wn(e,t){U(0,[e,e.length],0,t)}function Yn(e){return Kn.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Hn(e){return Kn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Gn(){return St(this.year(),1,4)}function qn(){return St(this.isoWeekYear(),1,4)}function Zn(){var e=this.localeData()._week;return St(this.year(),e.dow,e.doy)}function Jn(){var e=this.localeData()._week;return St(this.weekYear(),e.dow,e.doy)}function Kn(e,t,a,i,n){var s;return null==e?kt(this,i,n).year:(t>(s=St(e,i,n))&&(t=s),Xn.call(this,e,t,a,i,n))}function Xn(e,t,a,i,n){var s=At(e,t,a,i,n),r=_t(s.year,0,s.dayOfYear);return this.year(r.getUTCFullYear()),this.month(r.getUTCMonth()),this.date(r.getUTCDate()),this}function Qn(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"),Te("N",On),Te("NN",On),Te("NNN",On),Te("NNNN",$n),Te("NNNNN",Un),De(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,a,i){var n=a._locale.erasParse(e,i,a._strict);n?f(a).era=n:f(a).invalidEra=e})),Te("y",we),Te("yy",we),Te("yyy",we),Te("yyyy",we),Te("yo",jn),De(["y","yy","yyy","yyyy"],Be),De(["yo"],(function(e,t,a,i){var n;a._locale._eraYearOrdinalRegex&&(n=e.match(a._locale._eraYearOrdinalRegex)),a._locale.eraYearOrdinalParse?t[Be]=a._locale.eraYearOrdinalParse(e,n):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})),Wn("gggg","weekYear"),Wn("ggggg","weekYear"),Wn("GGGG","isoWeekYear"),Wn("GGGGG","isoWeekYear"),Te("G",_e),Te("g",_e),Te("GG",he,ue),Te("gg",he,ue),Te("GGGG",ge,de),Te("gggg",ge,de),Te("GGGGG",be,pe),Te("ggggg",be,pe),Pe(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,a,i){t[i.substr(0,2)]=Fe(e)})),Pe(["gg","GG"],(function(e,t,i,n){t[n]=a.parseTwoDigitYear(e)})),U("Q",0,"Qo","quarter"),Te("Q",le),De("Q",(function(e,t){t[Oe]=3*(Fe(e)-1)})),U("D",["DD",2],"Do","date"),Te("D",he,Ne),Te("DD",he,ue),Te("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),De(["D","DD"],$e),De("Do",(function(e,t){t[$e]=Fe(e.match(he)[0])}));var es=Ke("Date",!0);function ts(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"),Te("DDD",ye),Te("DDDD",ce),De(["DDD","DDDD"],(function(e,t,a){a._dayOfYear=Fe(e)})),U("m",["mm",2],0,"minute"),Te("m",he,Me),Te("mm",he,ue),De(["m","mm"],je);var as=Ke("Minutes",!1);U("s",["ss",2],0,"second"),Te("s",he,Me),Te("ss",he,ue),De(["s","ss"],ze);var is,ns,ss=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()})),Te("S",ye,le),Te("SS",ye,ue),Te("SSS",ye,ce),is="SSSS";is.length<=9;is+="S")Te(is,we);function rs(e,t){t[We]=Fe(1e3*("0."+e))}for(is="S";is.length<=9;is+="S")De(is,rs);function os(){return this._isUTC?"UTC":""}function ls(){return this._isUTC?"Coordinated Universal Time":""}ns=Ke("Milliseconds",!1),U("z",0,0,"zoneAbbr"),U("zz",0,0,"zoneName");var us=v.prototype;function cs(e){return Za(1e3*e)}function ds(){return Za.apply(null,arguments).parseZone()}function ps(e){return e}us.add=Di,us.calendar=ji,us.clone=zi,us.diff=Ji,us.endOf=bn,us.format=tn,us.from=an,us.fromNow=nn,us.to=sn,us.toNow=rn,us.get=et,us.invalidAt=Tn,us.isAfter=Wi,us.isBefore=Yi,us.isBetween=Hi,us.isSame=Gi,us.isSameOrAfter=qi,us.isSameOrBefore=Zi,us.isValid=Nn,us.lang=ln,us.locale=on,us.localeData=un,us.max=Ka,us.min=Ja,us.parsingFlags=Mn,us.set=tt,us.startOf=gn,us.subtract=Pi,us.toArray=An,us.toObject=kn,us.toDate=vn,us.toISOString=Qi,us.inspect=en,"undefined"!=typeof Symbol&&null!=Symbol.for&&(us[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),us.toJSON=Sn,us.toString=Xi,us.unix=_n,us.valueOf=wn,us.creationData=xn,us.eraName=Fn,us.eraNarrow=En,us.eraAbbr=Dn,us.eraYear=Pn,us.year=Ze,us.isLeapYear=Je,us.weekYear=Yn,us.isoWeekYear=Hn,us.quarter=us.quarters=Qn,us.month=mt,us.daysInMonth=ft,us.week=us.weeks=Vt,us.isoWeek=us.isoWeeks=Ct,us.weeksInYear=Zn,us.weeksInWeekYear=Jn,us.isoWeeksInYear=Gn,us.isoWeeksInISOWeekYear=qn,us.date=es,us.day=us.days=Yt,us.weekday=Ht,us.isoWeekday=Gt,us.dayOfYear=ts,us.hour=us.hours=na,us.minute=us.minutes=as,us.second=us.seconds=ss,us.millisecond=us.milliseconds=ns,us.utcOffset=fi,us.utc=gi,us.local=bi,us.parseZone=wi,us.hasAlignedHourOffset=_i,us.isDST=vi,us.isLocal=ki,us.isUtcOffset=Si,us.isUtc=Ni,us.isUTC=Ni,us.zoneAbbr=os,us.zoneName=ls,us.dates=S("dates accessor is deprecated. Use date instead.",es),us.months=S("months accessor is deprecated. Use month instead",mt),us.years=S("years accessor is deprecated. Use year instead",Ze),us.zone=S("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",yi),us.isDSTShifted=S("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Ai);var hs=F.prototype;function ms(e,t,a,i){var n=ba(),s=h().set(i,t);return n[a](s,e)}function fs(e,t,a){if(u(e)&&(t=e,e=void 0),e=e||"",null!=t)return ms(e,t,a,"month");var i,n=[];for(i=0;i<12;i++)n[i]=ms(e,i,a,"month");return n}function ys(e,t,a,i){"boolean"==typeof e?(u(t)&&(a=t,t=void 0),t=t||""):(a=t=e,e=!1,u(t)&&(a=t,t=void 0),t=t||"");var n,s=ba(),r=e?s._week.dow:0,o=[];if(null!=a)return ms(t,(a+r)%7,i,"day");for(n=0;n<7;n++)o[n]=ms(t,(n+r)%7,i,"day");return o}function gs(e,t){return fs(e,t,"months")}function bs(e,t){return fs(e,t,"monthsShort")}function ws(e,t,a){return ys(e,t,a,"weekdays")}function _s(e,t,a){return ys(e,t,a,"weekdaysShort")}function vs(e,t,a){return ys(e,t,a,"weekdaysMin")}hs.calendar=P,hs.longDateFormat=G,hs.invalidDate=Z,hs.ordinal=X,hs.preparse=ps,hs.postformat=ps,hs.relativeTime=ee,hs.pastFuture=te,hs.set=V,hs.eras=Vn,hs.erasParse=Cn,hs.erasConvertYear=In,hs.erasAbbrRegex=Rn,hs.erasNameRegex=Ln,hs.erasNarrowRegex=Bn,hs.months=ut,hs.monthsShort=ct,hs.monthsParse=pt,hs.monthsRegex=gt,hs.monthsShortRegex=yt,hs.week=Nt,hs.firstDayOfYear=xt,hs.firstDayOfWeek=Tt,hs.weekdays=$t,hs.weekdaysMin=jt,hs.weekdaysShort=Ut,hs.weekdaysParse=Wt,hs.weekdaysRegex=qt,hs.weekdaysShortRegex=Zt,hs.weekdaysMinRegex=Jt,hs.isPM=aa,hs.meridiem=sa,fa("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===Fe(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),a.lang=S("moment.lang is deprecated. Use moment.locale instead.",fa),a.langData=S("moment.langData is deprecated. Use moment.localeData instead.",ba);var As=Math.abs;function ks(){var e=this._data;return this._milliseconds=As(this._milliseconds),this._days=As(this._days),this._months=As(this._months),e.milliseconds=As(e.milliseconds),e.seconds=As(e.seconds),e.minutes=As(e.minutes),e.hours=As(e.hours),e.months=As(e.months),e.years=As(e.years),this}function Ss(e,t,a,i){var n=xi(t,a);return e._milliseconds+=i*n._milliseconds,e._days+=i*n._days,e._months+=i*n._months,e._bubble()}function Ns(e,t){return Ss(this,e,t,1)}function Ms(e,t){return Ss(this,e,t,-1)}function Ts(e){return e<0?Math.floor(e):Math.ceil(e)}function xs(){var e,t,a,i,n,s=this._milliseconds,r=this._days,o=this._months,l=this._data;return s>=0&&r>=0&&o>=0||s<=0&&r<=0&&o<=0||(s+=864e5*Ts(Cs(o)+r),r=0,o=0),l.milliseconds=s%1e3,e=Ie(s/1e3),l.seconds=e%60,t=Ie(e/60),l.minutes=t%60,a=Ie(t/60),l.hours=a%24,r+=Ie(a/24),o+=n=Ie(Vs(r)),r-=Ts(Cs(n)),i=Ie(o/12),o%=12,l.days=r,l.months=o,l.years=i,this}function Vs(e){return 4800*e/146097}function Cs(e){return 146097*e/4800}function Is(e){if(!this.isValid())return NaN;var t,a,i=this._milliseconds;if("month"===(e=ie(e))||"quarter"===e||"year"===e)switch(t=this._days+i/864e5,a=this._months+Vs(t),e){case"month":return a;case"quarter":return a/3;case"year":return a/12}else switch(t=this._days+Math.round(Cs(this._months)),e){case"week":return t/7+i/6048e5;case"day":return t+i/864e5;case"hour":return 24*t+i/36e5;case"minute":return 1440*t+i/6e4;case"second":return 86400*t+i/1e3;case"millisecond":return Math.floor(864e5*t)+i;default:throw new Error("Unknown unit "+e)}}function Fs(e){return function(){return this.as(e)}}var Es=Fs("ms"),Ds=Fs("s"),Ps=Fs("m"),Ls=Fs("h"),Rs=Fs("d"),Bs=Fs("w"),Os=Fs("M"),$s=Fs("Q"),Us=Fs("y"),js=Es;function zs(){return xi(this)}function Ws(e){return e=ie(e),this.isValid()?this[e+"s"]():NaN}function Ys(e){return function(){return this.isValid()?this._data[e]:NaN}}var Hs=Ys("milliseconds"),Gs=Ys("seconds"),qs=Ys("minutes"),Zs=Ys("hours"),Js=Ys("days"),Ks=Ys("months"),Xs=Ys("years");function Qs(){return Ie(this.days()/7)}var er=Math.round,tr={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function ar(e,t,a,i,n){return n.relativeTime(t||1,!!a,e,i)}function ir(e,t,a,i){var n=xi(e).abs(),s=er(n.as("s")),r=er(n.as("m")),o=er(n.as("h")),l=er(n.as("d")),u=er(n.as("M")),c=er(n.as("w")),d=er(n.as("y")),p=s<=a.ss&&["s",s]||s<a.s&&["ss",s]||r<=1&&["m"]||r<a.m&&["mm",r]||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]=i,ar.apply(null,p)}function nr(e){return void 0===e?er:"function"==typeof e&&(er=e,!0)}function sr(e,t){return void 0!==tr[e]&&(void 0===t?tr[e]:(tr[e]=t,"s"===e&&(tr.ss=t-1),!0))}function rr(e,t){if(!this.isValid())return this.localeData().invalidDate();var a,i,n=!1,s=tr;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(n=e),"object"==typeof t&&(s=Object.assign({},tr,t),null!=t.s&&null==t.ss&&(s.ss=t.s-1)),i=ir(this,!n,s,a=this.localeData()),n&&(i=a.pastFuture(+this,i)),a.postformat(i)}var or=Math.abs;function lr(e){return(e>0)-(e<0)||+e}function ur(){if(!this.isValid())return this.localeData().invalidDate();var e,t,a,i,n,s,r,o,l=or(this._milliseconds)/1e3,u=or(this._days),c=or(this._months),d=this.asSeconds();return d?(e=Ie(l/60),t=Ie(e/60),l%=60,e%=60,a=Ie(c/12),c%=12,i=l?l.toFixed(3).replace(/\.?0+$/,""):"",n=d<0?"-":"",s=lr(this._months)!==lr(d)?"-":"",r=lr(this._days)!==lr(d)?"-":"",o=lr(this._milliseconds)!==lr(d)?"-":"",n+"P"+(a?s+a+"Y":"")+(c?s+c+"M":"")+(u?r+u+"D":"")+(t||e||l?"T":"")+(t?o+t+"H":"")+(e?o+e+"M":"")+(l?o+i+"S":"")):"P0D"}var cr=ri.prototype;return cr.isValid=ni,cr.abs=ks,cr.add=Ns,cr.subtract=Ms,cr.as=Is,cr.asMilliseconds=Es,cr.asSeconds=Ds,cr.asMinutes=Ps,cr.asHours=Ls,cr.asDays=Rs,cr.asWeeks=Bs,cr.asMonths=Os,cr.asQuarters=$s,cr.asYears=Us,cr.valueOf=js,cr._bubble=xs,cr.clone=zs,cr.get=Ws,cr.milliseconds=Hs,cr.seconds=Gs,cr.minutes=qs,cr.hours=Zs,cr.days=Js,cr.weeks=Qs,cr.months=Ks,cr.years=Xs,cr.humanize=rr,cr.toISOString=ur,cr.toString=ur,cr.toJSON=ur,cr.locale=on,cr.localeData=un,cr.toIsoString=S("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ur),cr.lang=ln,U("X",0,0,"unix"),U("x",0,0,"valueOf"),Te("x",_e),Te("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(Fe(e))})),
2
2
  //! moment.js
3
3
  a.version="2.30.1",i(Za),a.fn=us,a.min=Qa,a.max=ei,a.now=ti,a.utc=h,a.unix=cs,a.months=gs,a.isDate=c,a.locale=fa,a.invalid=g,a.duration=xi,a.isMoment=A,a.weekdays=ws,a.parseZone=ds,a.localeData=ba,a.isDuration=oi,a.monthsShort=bs,a.weekdaysMin=vs,a.defineLocale=ya,a.updateLocale=ga,a.locales=wa,a.weekdaysShort=_s,a.normalizeUnits=ie,a.relativeTimeRounding=nr,a.relativeTimeThreshold=sr,a.calendarFormat=Ui,a.prototype=us,a.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"},a}()),E.exports),L=C(P);class R{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 i=L(),n=await this.apiClient[t](...a),s=L(),r=s.diff(i,"milliseconds"),o=s.diff(this.apiCallsStartTime,"milliseconds");return this.apiCalls.push({caller:e,method:t,params:a,callTime:r,totalTime:o}),n}return this.apiClient[t](...a)}catch(e){throw l.$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{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 i=t.linkableTypes.join("#")+(e.folder?e.folder._id:"");if(this.linkableItemsCache.has(i))return this.linkableItemsCache.get(i);const n=[...t.linkableTypes];n.includes("Package")||n.push("Package");const s={types:n,folder:e.folder?e.folder._id:null};a=(await this.apiGateway.call("LinkableItemsCache::loadLinkableItems","queryItemsList",s)).filter((e=>"Package"!==e.type||t.linkableTypes.includes(e.packageType)));for(const i of e.links)if(null==this.resolveItem(i.to,a))try{const e=await this.itemCache.getItem(i.to);t.linkableTypes.includes(e.type)&&a.push(e)}catch(e){console.error(`Link item ${i.to} not found. Dead link? (${e})`)}this.linkableItemsCache.set(i,a)}}else{for(const t of e.links){const e=await this.itemCache.getItem(t.to);a.push(e)}const i=t.name+"#CurrentLinks";this.linkableItemsCache.set(i,a)}return a}}class ${id;type;data;constructor(e,t,a){this.id=e,this.type=t,this.data=a}}class U{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 i=[],n=[];let s=0;for(const a of t){const t=this._getElementById(a.id,e);t?n.push({element:t,snapshot:a}):i.push({position:s,snapshot:a}),s++}const r=[];s=0;for(const a of e){this._getElementById(a.id,t)||r.push(s-r.length),s++}for(const t of r)e.splice(t,1);for(const e of n)e.element.rollbackFromSnapshot(e.snapshot);for(const t of i){const i=a(t.snapshot,this);e.splice(t.position,0,i)}}}class j extends U{id;srcNode;srcSlot;destNode;destSlot;posX;posY;constructor(e,t){super(t),d.assert(e,"NkConnection: data is null or undefined!"),d.assert(e.srcNode,"NkConnection: srcNode is null or undefined!"),d.assert(e.srcSlot,"NkConnection: srcSlot is null or undefined!"),d.assert(e.destNode,"NkConnection: srcNode is null or undefined!"),d.assert(e.destSlot,"NkConnection: srcSlot is null or undefined!"),this.id=e.id||d.createGUID(),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 j({srcNode:this.srcNode,srcSlot:this.srcSlot,destNode:this.destNode,destSlot:this.destSlot,posX:this.posX,posY:this.posY},this.ownerItem)}createSnapshot(){return new $(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 z extends U{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,i=void 0){super(i),this.value=a,this.script=e,this.id=d.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 z;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=d.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 $(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 W(e,t,a){const{datatype:i,minValue:n,maxValue:s,name:r,value:o,type:l,order:u,id:c,info:d}=e.data,p=new z(t,r,o,a);return p.id=c,p.type=l,p.datatype=i,p.minValue=n,p.maxValue=s,p.order=u,p.info=d,p}class Y extends U{id=void 0;block=void 0;fields=[];item=null;deferInitCall=!1;constructor(e=void 0,t=void 0,a=void 0,i=void 0){super(a),e instanceof $?this.restoreFromSnapshot(e,t):(this.id=e||d.createGUID(),this.block=t),this.item||(this.item={value:i,linkableItems:[],linkableTypes:["Script"]}),this.item=f.instance.proxyScriptItem(this.item,this,this.ownerItem),this.fields=f.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=d.createGUID();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 Y(void 0,this.block,this.ownerItem,this.item.value);for(const a of this.fields){const i=a.clone(e);i.script=t,t.addField(i)}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 i of e){let e=t(this.fields,i.name);e||(e=new z(this,i.name,void 0,this.ownerItem),this.addField(e)),e.setOrder(a++),e.setInfo(i.info),e.setDefinition(i)}this.fields.sort((function(e,t){return e.order-t.order}))}clearFieldTypes(){this.createFieldsFromDefinition()}addField(e){this.fields.push(f.instance.proxyScriptField(e,this,this.ownerItem))}createSnapshot(){const e=[];for(const t of this.fields)e.push(t.createSnapshot());return new $(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=W(e,this,this.ownerItem);return f.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=W(e,this,this.ownerItem);return f.instance.proxyScriptField(t,this,this.ownerItem)}))}}class H extends U{name="";displayName="";type=void 0;info;preload=!1;loadingManagerRule="load";item;itemRepo;condition;conditionFields=[];conditionFieldNames=[];dependantFields=[];dependenciesInitialized=!1;linkableTypes=[];linkableItemsCache;collapsed=!1;presets=[];datatype=null;defaultValue=null;minValue=null;maxValue=null;language=null;widget=null;length=null;labelType=null;blocks=[];connections=[];templates=[];elementName=null;_id="";_internalValue;_internalOptions=[];_updateConditions=!0;_hidden=!1;get hidden(){return!(!this.condition||!this.dependenciesInitialized)&&(this._updateConditions&&(this._hidden=!this._calculateConditionBlock(this.condition),this._updateConditions=!1),this._hidden)}get id(){return this._id}get options(){return this._internalOptions}set options(e){this._internalOptions=e}get value(){return this._internalValue}set value(e){this._internalValue=e,this._processDependencies()}get linkableItems(){return this.linkableItemsCache?this.linkableItemsCache.loadLinkableItems(this.item,this):[]}constructor(e,t=void 0,a=void 0,i=void 0,n=void 0,s=void 0,r=void 0){super(n),e instanceof $?(this._id=e.id,this.restoreFromSnapshot(e)):(d.assert(e,"Field has no name!"),d.assert(a,"Field has no type!"),this._id=d.createGUID(),this.name=e,this.displayName=t||e,this.type=a,this._internalValue=i,this.info=void 0,this.preload=!0,this.loadingManagerRule="load",this.item=n,this.itemRepo=s,this.condition=null,this.conditionFields=[],this.conditionFieldNames=[],this.dependantFields=[],this.dependenciesInitialized=!1,this.linkableTypes=[],this.linkableItemsCache=r,this.collapsed=!1,this.presets=[],this.datatype=null,this.defaultValue=null,this.minValue=null,this.maxValue=null,this.language=null,this.widget=null,this.length=null,this.labelType=null,this.blocks=[],this.connections=[],this.templates=[],this.elementName=null)}updateConditions(){this.condition&&this.dependenciesInitialized&&(this._updateConditions=!0,l.$emit("field:hiddenChanged",this.id))}getId(){return this.id}resetValue(){this.value=this.defaultValue}makeIdsUnique(e=new Map,t=!1){if(e.has(this._id)||t){const t=d.createGUID();e.set(this._id,t),this._id=t}else e.set(this._id,this._id);for(const a of this.blocks)a.makeIdsUnique(e,t);return e}transformNodeIds(e){for(const t of this.blocks)t.transformNodeIds(e);"Attribute"===this.type&&"Node"===this.datatype&&this.value&&e.has(this.value)&&(this.value=e.get(this.value))}findBlock(e){for(const t of this.blocks){const a=t.findBlock(e);if(a)return a}return null}clone(e=void 0,t=!1){let a=new H(this.name,this.displayName,this.type);void 0===this._internalValue?a._internalValue=void 0:"Link"===this.type?a._internalValue=this._internalValue:a._internalValue=JSON.parse(JSON.stringify(this._internalValue)),a.info=this.info,a.preload=this.preload,a.loadingManagerRule=this.loadingManagerRule,a.item=this.item,a.ownerItem=this.ownerItem,a.itemRepo=this.itemRepo,a.condition=this.condition,a.conditionFields=this.conditionFields,a.conditionFieldNames=this.conditionFieldNames,a.dependantFields=this.dependantFields,a.collapsed=this.collapsed,a.presets=this.presets,a.linkableTypes=this.linkableTypes,a.linkableItemsCache=this.linkableItemsCache,a.labelType=this.labelType,a.datatype=this.datatype,a.defaultValue=this.defaultValue,a.minValue=this.minValue,a.maxValue=this.maxValue,a.options=this.options,a.language=this.language,a.widget=this.widget,a.length=this.length;for(const i of this.blocks){let n=i.clone(e,!0,{},t);e&&(n=f.instance.proxyBlock(n,e)),a.blocks.push(n)}for(const t of this.connections){let i=t.clone();e&&(i=f.instance.proxyConnection(i,e)),a.connections.push(i)}return a.templates=this.templates,a.elementName=this.elementName,a}_processDependencies(){for(const e of this.dependantFields)e.updateConditions()}_getConditionField(e){for(const t of this.conditionFields)if(t&&t.name===e)return t;return null}_calculateConditionField(e,t){if(!e.startsWith("$")){let a;e.includes(".")?(a=e.split("."),e=a.splice(0,1)[0]):a=[];let i=e.endsWith("?");i&&(e=e.substring(0,e.length-1));const n=this._getConditionField(e);if(!n)return i||console.error("Field to resolve condition not found: "+e),!1;let s=n.value;for(let t=0;t<a.length;t++){if(!s)return console.error(`Field path ${a.join(".")} not found in field ${e}!`),!1;s=s[a[t]]}return"object"==typeof t?void 0!==t.$isset?t.$isset===!!s:void 0!==t.$not?t.$not!==s:(console.error("Condition value cannot be interpreted: ",t,this),!1):n.value==t}switch(e){case"$isroot":return this.item._id===this.itemRepo.rootItemId===t;case"$parenttype":return console.log("$parenttype is not yet implemented!",this),!1;case"$optionsexist":return(Array.isArray(this.options)&&this.options.length>0)===t;case"$featureenabled":return this.itemRepo.apiClient.isFeatureEnabled(t);default:return console.error("Computed value unknown: "+e,this),!1}}_calculateConditionBlock(e){for(const t in e)if(e.hasOwnProperty(t)){const a=e[t];if("$or"===t)if(Array.isArray(a)){let e=!1;for(const t of a)if(this._calculateConditionBlock(t)){e=!0;break}if(!e)return!1}else console.error("Condition contains $or but its value is not an array!");else if("$not"===t){if("object"!=typeof a)console.error("When using the $not operator, the value needs to be an object");else if(this._calculateConditionBlock(a))return!1}else if(!this._calculateConditionField(t,a))return!1}return!0}refreshFieldDependencies(){for(const e of this.blocks)e.refreshFieldDependencies()}refreshDependantFields(e,t){const a=[];if(this.condition)for(let t of this.conditionFieldNames){const i=t.endsWith("?");i&&(t=t.substring(0,t.length-1));const n=e.get(t);n?a.push(n):i||console.warn("Condition field not found: "+t)}this.conditionFields=a,this.dependantFields=t||[],this.dependenciesInitialized=!0}setCondition(e){e?"object"==typeof e?this.condition=e:(console.error("Condition must be an object if set",e),this.condition=null):this.condition=null,this.conditionFieldNames=[],this.condition&&this._scanConditions(this.condition)}_scanConditions(e){for(let t in e)if(e.hasOwnProperty(t)){const a=e[t];if(Array.isArray(a))for(const e of a)this._scanConditions(e);else t.startsWith("$")||(t.includes(".")&&(t=t.split(".")[0]),this.conditionFieldNames.includes(t)||this.conditionFieldNames.push(t))}}forEachField(e){if(e(this),this.blocks)for(const t of this.blocks)t.forEachField(e)}setInfo(e){this.info=e}setPreload(e){this.preload=e}setLoadingManagerRule(e){this.loadingManagerRule=e}setLinkableTypes(e){this.linkableTypes=e}setDefaultValue(e){this.defaultValue=e,void 0!==this._internalValue&&null!==this._internalValue||(this._internalValue=e)}setMinValue(e){this.minValue=e}setMaxValue(e){this.maxValue=e}setOptions(e){this.options=e}setDatatype(e){this.datatype=e}setLanguage(e){this.language=e}setLength(e){this.length=e}setWidget(e){this.widget=e}setBlocks(e){this.blocks=e}setConnections(e){this.connections=e}setTemplates(e){this.templates=e}setElementName(e){this.elementName=e}setCollapsed(e){this.collapsed=!!e}setPresets(e){this.presets=e||[]}setLabelType(e){this.labelType=e||"info"}createSnapshot(e=!1){d.assert(this.id,"Field has no ID. Cannot create snapshot");const t=[];for(const a of this.blocks)t.push(a.createSnapshot(e));const a=[];for(const e of this.connections)a.push(e.createSnapshot());return new $(this.id,"field",{name:this.name,displayName:this.displayName,type:this.type,value:this._internalValue,preload:this.preload,info:this.info,loadingManagerRule:this.loadingManagerRule,item:this.item,itemRepo:this.itemRepo,condition:this.condition,conditionFields:this.conditionFields,conditionFieldNames:this.conditionFieldNames,dependantFields:this.dependantFields,linkableTypes:this.linkableTypes,linkableItemsCache:this.linkableItemsCache,collapsed:this.collapsed,presets:this.presets,datatype:this.datatype,defaultValue:this.defaultValue,minValue:this.minValue,maxValue:this.maxValue,options:this.options,language:this.language,widget:this.widget,length:this.length,labelType:this.labelType,templates:this.templates,elementName:this.elementName,blocks:t,connections:a})}restoreFromSnapshot(e){e.id===this.id?(this.name=e.data.name,this.displayName=e.data.displayName,this.type=e.data.type,this._internalValue=e.data.value,this.info=e.data.info,this.preload=e.data.preload,this.loadingManagerRule=e.data.loadingManagerRule,this.item=e.data.item,this.ownerItem=e.data.item,this.itemRepo=e.data.itemRepo,this.condition=e.data.condition,this.conditionFields=e.data.conditionFields,this.conditionFieldNames=e.data.conditionFieldNames,this.dependantFields=e.data.dependantFields,this.linkableTypes=e.data.linkableTypes,this.linkableItemsCache=e.data.linkableItemsCache,this.collapsed=e.data.collapsed,this.presets=e.data.presets,this.datatype=e.data.datatype,this.defaultValue=e.data.defaultValue,this.minValue=e.data.minValue,this.maxValue=e.data.maxValue,this.options=e.data.options,this.language=e.data.language,this.widget=e.data.widget,this.length=e.data.length,this.labelType=e.data.labelType,this.blocks=[],this.connections=[],this.templates=e.data.templates,this.elementName=e.data.elementName,this._rollbackArray(this.blocks,e.data.blocks,((e,t)=>f.instance.proxyBlock(new X(e,t),this.ownerItem))),this._rollbackArray(this.connections,e.data.connections,((e,t)=>f.instance.proxyConnection(new j(e.data,t),this.ownerItem)))):console.error("Snapshot ID does not match! Cannot rollback!",this,e)}rollbackFromSnapshot(e){this.value=e.data.value,this._rollbackArray(this.blocks,e.data.blocks,((e,t)=>f.instance.proxyBlock(new X(e,t),this.ownerItem))),this._rollbackArray(this.connections,e.data.connections,((e,t)=>f.instance.proxyConnection(new j(e.data,t),this.ownerItem)))}}class G extends M{links;instanceId;isDirty=!1;fieldInstances;userFieldInstances;packageContent;packageType;public=!1;readOnly=!1;isPackaged=!1;packageItem;isPreparedItem=!0;resultingAcl;constructor(e){if(super(e),this.instanceId=d.createGUID(),this.links=[],Array.isArray(e.links))for(const t of e.links)this.links.push({to:t.to,usage:t.usage,stopRecursion:t.stopRecursion,item:t.item});this.fieldInstances=[],this.userFieldInstances=[],this.public=!!e.public,this.packageContent=e.packageContent,this.packageType=e.packageType,this.packageItem=e.packageItem,this.readOnly=e.readOnly,this.isPackaged=e.isPackaged,this.resultingAcl=JSON.parse(JSON.stringify(e.resultingAcl||[]))}markDirty(){this.isDirty||(this.isDirty=!0,l.$emit("itemRepo:itemBecameDirty",this._id))}makeIdsUnique(){const e=new Map;for(const t of this.fieldInstances)t.makeIdsUnique(e,!0);this.packageContent&&this.packageContent.makeIdsUnique()}clone(e=!1){let t=new G(this);const a=new Map;for(const i of this.fieldInstances){const n=i.clone(this,!0);e&&n.makeIdsUnique(a,!0),t.fieldInstances.push(n)}if(e)for(const e of t.fieldInstances)e.transformNodeIds(a);return t}findBlock(e){for(const t of this.fieldInstances){const a=t.findBlock(e);if(a)return a}return null}refreshFieldDependencies(){K.refreshFieldDependencies(this.fieldInstances);for(const e of this.fieldInstances)e.refreshFieldDependencies()}forEachItem(e){if(e(this),this.links)for(const t of this.links)t.item&&t.item.forEachItem(e)}forEachFieldInstance(e){if(this.fieldInstances)for(const t of this.fieldInstances)t.forEachField(e)}toString(){return`PreparedItem(${JSON.stringify({_id:this._id,name:this.name,type:this.type})})`}}function q(e,t,a){if(e.admin||e.superadmin)return!0;if(!Array.isArray(t))return!0;for(const i of t)if(i.can.includes(a)){if(!i.user&&!i.group)return!0;if(i.user&&i.user===e._id)return!0;if(i.group)for(const t of e.groups){if("object"==typeof t&&t._id===i.group)return!0;if(t===i.group)return!0}}}function Z(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}class J{fields;constructor(e){if(!Array.isArray(e))throw"Template fields need to be an array!";this.fields=e}clone(){const e=[];for(const t of this.fields)e.push(t.clone());return new J(e)}specialize(e){for(const t of this.fields)void 0!==e[t.name]&&(t.defaultValue=e[t.name]);return this}instantiate(){const e=[];for(const t of this.fields)e.push(t.clone());return e}}class K{itemRepo;itemFetcher;constructor(e){this.itemRepo=e,this.itemFetcher=function(e){return e}}setItemFetcher(e){this.itemFetcher=e}setFieldsFromDatatypes(e){const t=x(e.type,!0);e.fields=t.fields||[],e.fieldSets=t.fieldSets||[]}async prepare(e){return e instanceof G?(console.warn("Trying to prepare an already prepared item: ",e),e):this.itemRepo.undoManager.ignore((async()=>{const t=new G(e);this.setFieldsFromDatatypes(t),t.fieldInstances=await this.createFieldInstances(t,t.fields,t.attributes,"","attributes",!1),t.userFieldInstances=await this.createFieldInstances(t,t.userFields,t.userAttributes,"","userAttributes",!1),t.additionalUserAttributes={},t.allowConversation=!!t.allowConversation;for(const e in t.userAttributes)if(t.userAttributes.hasOwnProperty(e)){let a=e;a.match(/(\w+)\[\d+\]->\w+/g)&&(a=a.substr(0,a.indexOf("[")));let i=!1;for(const e of t.userFields)if(e.name===a){i=!0;break}i||(t.additionalUserAttributes[e]=t.userAttributes[e])}return t.packageContent&&await this.itemRepo.traverseItems((e=>{e.readOnly=!0,e.isPackaged=!0,e.packageItem=t}),t.packageContent),t.packageItem?(t.readOnly=!0,t.isPackaged=!0):(t.isPackaged=!1,t.resultingAcl&&t.resultingAcl.length>0?t.readOnly=!q(await this.itemRepo.apiClient.me(!0),t.resultingAcl,"write"):t.readOnly=!0),t}))}async createFieldInstances(e,t,a,i,n,s=!1){if(!e)throw new w("createFieldInstances(): Item cannot be null!");if(!t)throw new w("createFieldInstances(): Fields cannot be null!");const r=[],o=i.length?`${i}->`:i;for(let a=0;a<t.length;a++){const i=t[a];if("FieldSet"===i.type){const n=this.getFieldSet(e,i.name);n?(t.splice(a,1,...structuredClone(n.fields)),a+=n.fields.length-1):console.error("Fieldset not found: "+i.name)}}for(const i of t)switch(i.type){case"Separator":{const t=new H("Separator",i.label,"Separator",null,e,this.itemRepo);t.setInfo(i.info),t.setCondition(i.if),t.setCollapsed(i.collapsed),t.setPresets(i.presets),r.push(t);break}case"Label":{const t=new H("Label","","Label",i.text,e,this.itemRepo);t.setLabelType(i.labelType),t.setCondition(i.if),r.push(t);break}case"Link":{let t;if(!s){let{id:a,linkItem:n,stopRecursion:s}=await this.fetchLinkValue(e,i.usageAs);n?t=n:s&&(t=a)}let a=new H(i.usageAs,i.displayName,i.type,t,e,this.itemRepo,this.itemRepo.linkableItemsCache);a.setInfo(i.info),a.setCondition(i.if),a.setLinkableTypes(i.linkableTypes),void 0!==i.preload&&a.setPreload(i.preload),void 0!==i.loadingManager&&a.setLoadingManagerRule(i.loadingManager),r.push(f.instance.proxyItemField(a,e));break}case"Tree":{const t=`${o}${i.name}`,s=[];for(const r of i.childTypes){const i=new J(await this.createFieldInstances(e,r.fields,a,t,n,!0));s.push({typeName:r.typeName,displayName:r.displayName||r.typeName,template:i})}s.sort((function(e,t){return e.displayName.localeCompare(t.displayName)}));const l=new X(void 0,void 0,"","Root",void 0,e),u=await this.readBlocks(e,l,s,t,a,!0,!0,"Tree");l.blocks=f.instance.proxyBlockArray(u,l,e);let c=new H(i.name,i.displayName,i.type,null,e,this.itemRepo);c.setInfo(i.info),c.setCondition(i.if),c.setBlocks([l]),c.setTemplates(s),r.push(c);break}case"List":{const t=`${o}${i.name}`,s=new J(await this.createFieldInstances(e,i.fields,a,t,n,!0)),l=[{typeName:"Entry",displayName:i.elementName,template:s}];let u=new H(i.name,i.displayName,i.type,null,e,this.itemRepo);const c=await this.readBlocks(e,void 0,l,t,a,!0,!0,"List"),d=f.instance.proxyListArray(c,u,e);u.setInfo(i.info),u.setCondition(i.if),u.setBlocks(d),u.setTemplates(l),r.push(u);break}case"NodeGraph":{const t=`${o}${i.name}`,s=[];for(const r of i.childTypes){const i=new J(await this.createFieldInstances(e,r.fields,a,t,n,!0));s.push({typeName:r.typeName,displayName:r.displayName||r.typeName,template:i,inputs:r.inputs||[],outputs:r.outputs||[]})}s.sort((function(e,t){return e.displayName.localeCompare(t.displayName)}));let l=await this.readBlocks(e,void 0,s,t,a,!1,!1,"NodeGraph"),u=this.readConnections(e,t,a),c=new H(i.name,i.displayName,i.type,null,e,this.itemRepo);c.setInfo(i.info),c.setCondition(i.if),c.setBlocks(f.instance.proxyGraphBlockArray(l,e)),c.setConnections(f.instance.proxyConnectionArray(u,e)),c.setTemplates(s),r.push(c);break}case"Attribute":{let t;s||(t=e[n]?e[n][i.name]:void 0,void 0===t&&(t=i.defaultValue));let a=new H(i.name,i.displayName,i.type,t,e,this.itemRepo);a.setInfo(i.info),a.setCondition(i.if),a.setDefaultValue(i.defaultValue),a.setMinValue(i.minValue),a.setMaxValue(i.maxValue),a.setOptions(i.options),a.setDatatype(i.datatype),a.setLanguage(i.language),a.setWidget(i.widget),a.setLength(i.length),r.push(f.instance.proxyItemField(a,e));break}}return r}getFieldSet(e,t){if(Array.isArray(e.fieldSets))for(const a of e.fieldSets)if(a.name===t)return a;return null}async fetchLinkValue(e,t){if(!e)throw new w("fetchLinkValue(): Item cannot be null!");for(const a of e.links)if(a.usage===t)return{id:a.to,linkItem:a.item?await this.itemFetcher(a.item):null,stopRecursion:a.stopRecursion};return{id:null,linkItem:null}}async readBlocks(e,t,a,i,n,s,r,o){if(!e)throw new w("readBlocks(): Item cannot be null!");const l=[];let u=0;for(;;){const c=`${i}[${u}]`;if(!this.existsBlockNamespace(e,n,c))break;{const i=`${c}#id`,u=e.attributes[i],d=`${c}#type`;let p,h,m=e.attributes[d];switch(o){case"NodeGraph":{const t=`${c}#posx`,a=`${c}#posy`;p=e.attributes[t]||0,h=e.attributes[a]||0;break}case"List":s=!1,m="Entry"}for(const i of a)if(i.typeName===m){const d=i.typeName,m=i.displayName,y=new X(u,t,d,d,m,e),g=await this.createFields(y,e,i.template,c,"NodeGraph"===o,n);if(y.setFields(g),"NodeGraph"===o&&(y.setPosition(p,h),y.setInputs(i.inputs),y.setOutputs(i.outputs)),s){const t=await this.readBlocks(e,y,a,c,n,s,r,o);y.blocks=f.instance.proxyBlockArray(t,y,e)}if(r){const t=await this.readScripts(e,y,c,n);y.scripts=f.instance.proxyScriptArray(t,y,e)}"NodeGraph"===o?l.push(f.instance.proxyGraphBlock(y,e)):l.push(f.instance.proxyBlock(y,e));break}}u++}return l}async readScripts(e,t,a,i){if(!e)throw new w("readScripts(): Item cannot be null!");const n=[];let s=0;for(;;){const r=`${a}#scripts[${s}]`;if(!this.existsScriptNamespace(e,i,r))break;{const a=i[`${r}#id`],s=`${r}#item`,o=`${r}->`,l=o.length;let{linkItem:u}=await this.fetchLinkValue(e,s);const c=new Y(a,t,e,u);n.push(c);for(const t in i)if(i.hasOwnProperty(t)&&t.startsWith(o)){const a=i[t],n=t.substring(l),s=new z(c,n,a,e);c.addField(s)}}s++}return n}existsScriptNamespace(e,t,a){if(!e)throw new w("existsScriptNamespace(): Item cannot be null!");return"Script"===t[`${a}#usage`]}readConnections(e,t,a){const i=[];let n=0;for(;;){const s=a[`${t}#connection[${n++}]`];if(!s)break;i.push(new j(s,e))}return i}existsBlockNamespace(e,t,a){if(!e)throw new w("existsBlockNamespace(): Item cannot be null!");const i=t[`${a}#usage`];if(i)return"Block"===i;for(const e in t)if(t.hasOwnProperty(e)&&e.startsWith(a))return!0;for(const t of e.links)if(t.usage.startsWith(a))return!0;return!1}async createFields(e,t,a,i,n,s){let r=a.instantiate(),o=[];for(const a of r)if(a.name){const r=`${i}->${a.name}`;switch(a.type){case"Link":if(i){let{id:e,linkItem:i,stopRecursion:n}=await this.fetchLinkValue(t,r);a.value=i||(n?e:null)}else a.value=a.defaultValue;break;case"List":{const e=await this.readBlocks(t,void 0,a.templates||[],r,s,!0,!0,"List"),i=f.instance.proxyListArray(e,a,t);a.setBlocks(i);break}case"Attribute":i?(a.value=t.attributes[r],void 0===a.value&&(a.value=a.defaultValue)):a.value=a.defaultValue}n?o.push(f.instance.proxyGraphBlockField(a,e,t)):o.push(f.instance.proxyBlockField(a,e,t))}return o}static refreshFieldDependencies(e){const t=new Map,a=new Map;for(const a of e)t.set(a.name,a);for(const i of e)if(Array.isArray(i.conditionFieldNames))for(const e of i.conditionFieldNames){const n=t.get(e);if(n){const e=a.get(n);e?e.push(i):a.set(n,[i])}}for(const i of e)i.refreshDependantFields(t,a.get(i))}}class X extends U{id="";parent=void 0;type=void 0;name="";displayName="";fields=[];blocks=[];isSelected=!1;isExpanded=!0;scripts=[];inputs=[];outputs=[];posX=0;posY=0;constructor(e=void 0,t=void 0,a=void 0,i=void 0,n=void 0,s=void 0){super(s),e instanceof $?this.restoreFromSnapshot(e,t):(this.id=e||d.createGUID(),this.parent=t,this.type=a,this.name=i||this.type||"",this.displayName=n||this.name)}getId(){return this.id}refreshFieldDependencies(){K.refreshFieldDependencies(this.fields);for(const e of this.fields)e.refreshFieldDependencies();for(const e of this.blocks)e.refreshFieldDependencies()}resetFieldValues(e=!1){for(const e of this.fields)e.resetValue();if(e)for(const t of this.blocks)t.resetFieldValues(e)}makeIdsUnique(e=new Map,t=!1){if(e.has(this.id)||t){const t=d.createGUID();e.set(this.id,t),this.id=t}else e.set(this.id,this.id);for(const a of this.fields)a.makeIdsUnique(e,t);for(const a of this.blocks)a.makeIdsUnique(e,t);for(const a of this.scripts)a.makeIdsUnique(e,t);return e}transformNodeIds(e){for(const t of this.fields)t.transformNodeIds(e);for(const t of this.blocks)t.transformNodeIds(e);for(const t of this.scripts)t.transformNodeIds(e)}clone(e,t=!0,a={},i=!1){const n=new X;i&&(n.id=this.id),n.ownerItem=this.ownerItem,n.parent=this.parent,n.type=this.type,n.name=this.name,n.displayName=this.displayName,n.isSelected=!1,n.isExpanded=!0,n.inputs=this.inputs,n.outputs=this.outputs,n.posX=0,n.posY=0;for(const t of this.fields){let s=t.clone(e,i);void 0!==a[t.name]&&(s.value=a[t.name]),e&&(s=f.instance.proxyBlockField(s,n,e)),n.fields.push(s)}if(e&&(n.scripts=f.instance.proxyScriptArray(n.scripts,n,e)),t)for(const e of this.scripts){const t=e.clone();n.scripts.push(t)}const s=n.blocks;e&&(n.blocks=f.instance.proxyBlockArray(s,n,e));for(const a of this.blocks){let r=a.clone(e,t,{},i);r.parent=n,e&&(r=f.instance.proxyBlock(r,e)),s.push(r)}return n}getDescendantBlocks(e=[]){const t=this.blocks;return e.push(...t),t.forEach((t=>t.getDescendantBlocks(e))),e}setFields(e){this.fields=e}setInputs(e){this.inputs=e}setOutputs(e){this.outputs=e}setPosition(e,t){this.posX=e,this.posY=t}setSelected(e){this.isSelected=e}setExpanded(e){this.isExpanded=e}getRoot(){return this.parent?this.parent.getRoot():this}forEachField(e){if(this.fields)for(const t of this.fields)t.forEachField(e);if(this.blocks)for(const t of this.blocks)t.forEachField(e)}findField(e){for(const t of this.fields)if(t.name===e)return t;return null}findBlock(e){if(this.id===e)return this;for(const t of this.blocks){const a=t.findBlock(e);if(a)return a}return null}removeBlock(e){this.blocks.removeObject(e)}addBlock(e,t){this.blocks.includes(e)||(void 0===t?this.blocks.push(e):this.blocks.splice(t,0,e))}moveBlock(e,t){e.parent.blocks.moveObjectToArray(e,e.parent.blocks,t)}moveToPosition(e){this.parent.moveBlock(this,e)}moveBlockToParent(e,t){this.parent.blocks.moveObjectToArray(this,e.blocks,t),this.parent=e}moveToParent(e,t){if(this.findBlock(e))return void console.error("Cannot move block to a parent that is a child.");const a=this.getRoot();if(!a)return void console.error("Cannot find root block!");const i=a.findBlock(e);i?this.parent!==i?this.moveBlockToParent(i,t):console.warn(`Node is already in parent ${e}`):console.error(`Cannot find the new parent block: ${e}`)}getField(e){for(const t of this.fields)if(t.name===e)return t;return null}hasTag(e){const t=this.getField("Tags");return!(!t||!Array.isArray(t.value))&&t.value.includes(e)}hasOneTag(e){const t=this.getField("Tags");if(t&&Array.isArray(t.value))for(const a of e)if(t.value.includes(a))return!0;return!1}getNameFieldValue(){const e=this.getField("Name");return e?e.value:null}getActiveFieldValue(){const e=this.getField("Active");return!e||e.value}createSnapshot(e=!1){const t=[];for(const a of this.fields)a.createSnapshot&&t.push(a.createSnapshot(e));const a=[];if(!e)for(const t of this.blocks)a.push(t.createSnapshot(e));const i=[];for(const e of this.scripts)i.push(e.createSnapshot());return new $(this.id,"block",{id:this.id,ownerItem:this.ownerItem,type:this.type,name:this.name,displayName:this.displayName,fields:t,blocks:a,isExpanded:this.isExpanded,scripts:i,inputs:this.inputs,outputs:this.outputs,posX:this.posX,posY:this.posY})}restoreFromSnapshot(e,t){this.id=e.data.id,this.parent=t,this.type=e.data.type,this.ownerItem=e.data.ownerItem,this.name=e.data.name,this.displayName=e.data.displayName,this.isSelected=!1,this.isExpanded=e.data.isExpanded,this.inputs=e.data.inputs,this.outputs=e.data.outputs,this.posX=e.data.posX,this.posY=e.data.posY;const a=[];this._rollbackArray(a,e.data.fields,(e=>f.instance.proxyBlockField(new H(e),this,this.ownerItem))),this.fields=a;const i=[];this._rollbackArray(i,e.data.blocks,((e,t)=>f.instance.proxyBlock(new X(e,t),this.ownerItem))),this.blocks=f.instance.proxyBlockArray(i,this,this.ownerItem);const n=[];this._rollbackArray(n,e.data.scripts,((e,t)=>new Y(e,t,this.ownerItem))),this.scripts=f.instance.proxyScriptArray(n,this,this.ownerItem)}rollbackFromSnapshot(e,t=!1){this._rollbackArray(this.fields,e.data.fields,(e=>f.instance.proxyBlockField(new H(e),this,this.ownerItem))),this._rollbackArray(this.scripts,e.data.scripts,(e=>new Y(e,this,this.ownerItem))),t||this._rollbackArray(this.blocks,e.data.blocks,((e,t)=>f.instance.proxyBlock(new X(e,t),this.ownerItem)))}_getFieldByName(e,t){for(const a of t)if(a.id===e)return a;return null}}
4
- /*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */function Q(e){let t=e.length;for(;--t>=0;)e[t]=0}const ee=256,te=286,ae=30,ie=15,ne=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),se=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),re=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),oe=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),le=new Array(576);Q(le);const ue=new Array(60);Q(ue);const ce=new Array(512);Q(ce);const de=new Array(256);Q(de);const pe=new Array(29);Q(pe);const he=new Array(ae);function me(e,t,a,i,n){this.static_tree=e,this.extra_bits=t,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=e&&e.length}let fe,ye,ge;function be(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}Q(he);const we=e=>e<256?ce[e]:ce[256+(e>>>7)],_e=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},ve=(e,t,a)=>{e.bi_valid>16-a?(e.bi_buf|=t<<e.bi_valid&65535,_e(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=a-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=a)},Ae=(e,t,a)=>{ve(e,a[2*t],a[2*t+1])},ke=(e,t)=>{let a=0;do{a|=1&e,e>>>=1,a<<=1}while(--t>0);return a>>>1},Se=(e,t,a)=>{const i=new Array(16);let n,s,r=0;for(n=1;n<=ie;n++)r=r+a[n-1]<<1,i[n]=r;for(s=0;s<=t;s++){let t=e[2*s+1];0!==t&&(e[2*s]=ke(i[t]++,t))}},Ne=e=>{let t;for(t=0;t<te;t++)e.dyn_ltree[2*t]=0;for(t=0;t<ae;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Me=e=>{e.bi_valid>8?_e(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Te=(e,t,a,i)=>{const n=2*t,s=2*a;return e[n]<e[s]||e[n]===e[s]&&i[t]<=i[a]},xe=(e,t,a)=>{const i=e.heap[a];let n=a<<1;for(;n<=e.heap_len&&(n<e.heap_len&&Te(t,e.heap[n+1],e.heap[n],e.depth)&&n++,!Te(t,i,e.heap[n],e.depth));)e.heap[a]=e.heap[n],a=n,n<<=1;e.heap[a]=i},Ve=(e,t,a)=>{let i,n,s,r,o=0;if(0!==e.sym_next)do{i=255&e.pending_buf[e.sym_buf+o++],i+=(255&e.pending_buf[e.sym_buf+o++])<<8,n=e.pending_buf[e.sym_buf+o++],0===i?Ae(e,n,t):(s=de[n],Ae(e,s+ee+1,t),r=ne[s],0!==r&&(n-=pe[s],ve(e,n,r)),i--,s=we(i),Ae(e,s,a),r=se[s],0!==r&&(i-=he[s],ve(e,i,r)))}while(o<e.sym_next);Ae(e,256,t)},Ce=(e,t)=>{const a=t.dyn_tree,i=t.stat_desc.static_tree,n=t.stat_desc.has_stree,s=t.stat_desc.elems;let r,o,l,u=-1;for(e.heap_len=0,e.heap_max=573,r=0;r<s;r++)0!==a[2*r]?(e.heap[++e.heap_len]=u=r,e.depth[r]=0):a[2*r+1]=0;for(;e.heap_len<2;)l=e.heap[++e.heap_len]=u<2?++u:0,a[2*l]=1,e.depth[l]=0,e.opt_len--,n&&(e.static_len-=i[2*l+1]);for(t.max_code=u,r=e.heap_len>>1;r>=1;r--)xe(e,a,r);l=s;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],xe(e,a,1),o=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=o,a[2*l]=a[2*r]+a[2*o],e.depth[l]=(e.depth[r]>=e.depth[o]?e.depth[r]:e.depth[o])+1,a[2*r+1]=a[2*o+1]=l,e.heap[1]=l++,xe(e,a,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const a=t.dyn_tree,i=t.max_code,n=t.stat_desc.static_tree,s=t.stat_desc.has_stree,r=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,l=t.stat_desc.max_length;let u,c,d,p,h,m,f=0;for(p=0;p<=ie;p++)e.bl_count[p]=0;for(a[2*e.heap[e.heap_max]+1]=0,u=e.heap_max+1;u<573;u++)c=e.heap[u],p=a[2*a[2*c+1]+1]+1,p>l&&(p=l,f++),a[2*c+1]=p,c>i||(e.bl_count[p]++,h=0,c>=o&&(h=r[c-o]),m=a[2*c],e.opt_len+=m*(p+h),s&&(e.static_len+=m*(n[2*c+1]+h)));if(0!==f){do{for(p=l-1;0===e.bl_count[p];)p--;e.bl_count[p]--,e.bl_count[p+1]+=2,e.bl_count[l]--,f-=2}while(f>0);for(p=l;0!==p;p--)for(c=e.bl_count[p];0!==c;)d=e.heap[--u],d>i||(a[2*d+1]!==p&&(e.opt_len+=(p-a[2*d+1])*a[2*d],a[2*d+1]=p),c--)}})(e,t),Se(a,u,e.bl_count)},Ie=(e,t,a)=>{let i,n,s=-1,r=t[1],o=0,l=7,u=4;for(0===r&&(l=138,u=3),t[2*(a+1)+1]=65535,i=0;i<=a;i++)n=r,r=t[2*(i+1)+1],++o<l&&n===r||(o<u?e.bl_tree[2*n]+=o:0!==n?(n!==s&&e.bl_tree[2*n]++,e.bl_tree[32]++):o<=10?e.bl_tree[34]++:e.bl_tree[36]++,o=0,s=n,0===r?(l=138,u=3):n===r?(l=6,u=3):(l=7,u=4))},Fe=(e,t,a)=>{let i,n,s=-1,r=t[1],o=0,l=7,u=4;for(0===r&&(l=138,u=3),i=0;i<=a;i++)if(n=r,r=t[2*(i+1)+1],!(++o<l&&n===r)){if(o<u)do{Ae(e,n,e.bl_tree)}while(0!=--o);else 0!==n?(n!==s&&(Ae(e,n,e.bl_tree),o--),Ae(e,16,e.bl_tree),ve(e,o-3,2)):o<=10?(Ae(e,17,e.bl_tree),ve(e,o-3,3)):(Ae(e,18,e.bl_tree),ve(e,o-11,7));o=0,s=n,0===r?(l=138,u=3):n===r?(l=6,u=3):(l=7,u=4)}};let Ee=!1;const De=(e,t,a,i)=>{ve(e,0+(i?1:0),3),Me(e),_e(e,a),_e(e,~a),a&&e.pending_buf.set(e.window.subarray(t,t+a),e.pending),e.pending+=a};var Pe=e=>{Ee||((()=>{let e,t,a,i,n;const s=new Array(16);for(a=0,i=0;i<28;i++)for(pe[i]=a,e=0;e<1<<ne[i];e++)de[a++]=i;for(de[a-1]=i,n=0,i=0;i<16;i++)for(he[i]=n,e=0;e<1<<se[i];e++)ce[n++]=i;for(n>>=7;i<ae;i++)for(he[i]=n<<7,e=0;e<1<<se[i]-7;e++)ce[256+n++]=i;for(t=0;t<=ie;t++)s[t]=0;for(e=0;e<=143;)le[2*e+1]=8,e++,s[8]++;for(;e<=255;)le[2*e+1]=9,e++,s[9]++;for(;e<=279;)le[2*e+1]=7,e++,s[7]++;for(;e<=287;)le[2*e+1]=8,e++,s[8]++;for(Se(le,287,s),e=0;e<ae;e++)ue[2*e+1]=5,ue[2*e]=ke(e,5);fe=new me(le,ne,257,te,ie),ye=new me(ue,se,0,ae,ie),ge=new me(new Array(0),re,0,19,7)})(),Ee=!0),e.l_desc=new be(e.dyn_ltree,fe),e.d_desc=new be(e.dyn_dtree,ye),e.bl_desc=new be(e.bl_tree,ge),e.bi_buf=0,e.bi_valid=0,Ne(e)},Le=(e,t,a,i)=>{let n,s,r=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,a=4093624447;for(t=0;t<=31;t++,a>>>=1)if(1&a&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<ee;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),Ce(e,e.l_desc),Ce(e,e.d_desc),r=(e=>{let t;for(Ie(e,e.dyn_ltree,e.l_desc.max_code),Ie(e,e.dyn_dtree,e.d_desc.max_code),Ce(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*oe[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),n=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=n&&(n=s)):n=s=a+5,a+4<=n&&-1!==t?De(e,t,a,i):4===e.strategy||s===n?(ve(e,2+(i?1:0),3),Ve(e,le,ue)):(ve(e,4+(i?1:0),3),((e,t,a,i)=>{let n;for(ve(e,t-257,5),ve(e,a-1,5),ve(e,i-4,4),n=0;n<i;n++)ve(e,e.bl_tree[2*oe[n]+1],3);Fe(e,e.dyn_ltree,t-1),Fe(e,e.dyn_dtree,a-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,r+1),Ve(e,e.dyn_ltree,e.dyn_dtree)),Ne(e),i&&Me(e)},Re={_tr_init:Pe,_tr_stored_block:De,_tr_flush_block:Le,_tr_tally:(e,t,a)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=a,0===t?e.dyn_ltree[2*a]++:(e.matches++,t--,e.dyn_ltree[2*(de[a]+ee+1)]++,e.dyn_dtree[2*we(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{ve(e,2,3),Ae(e,256,le),(e=>{16===e.bi_valid?(_e(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}};var Be=(e,t,a,i)=>{let n=65535&e,s=e>>>16&65535,r=0;for(;0!==a;){r=a>2e3?2e3:a,a-=r;do{n=n+t[i++]|0,s=s+n|0}while(--r);n%=65521,s%=65521}return n|s<<16};const Oe=new Uint32Array((()=>{let e,t=[];for(var a=0;a<256;a++){e=a;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[a]=e}return t})());var $e=(e,t,a,i)=>{const n=Oe,s=i+a;e^=-1;for(let a=i;a<s;a++)e=e>>>8^n[255&(e^t[a])];return~e},Ue={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},je={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:ze,_tr_stored_block:We,_tr_flush_block:Ye,_tr_tally:He,_tr_align:Ge}=Re,{Z_NO_FLUSH:qe,Z_PARTIAL_FLUSH:Ze,Z_FULL_FLUSH:Je,Z_FINISH:Ke,Z_BLOCK:Xe,Z_OK:Qe,Z_STREAM_END:et,Z_STREAM_ERROR:tt,Z_DATA_ERROR:at,Z_BUF_ERROR:it,Z_DEFAULT_COMPRESSION:nt,Z_FILTERED:st,Z_HUFFMAN_ONLY:rt,Z_RLE:ot,Z_FIXED:lt,Z_DEFAULT_STRATEGY:ut,Z_UNKNOWN:ct,Z_DEFLATED:dt}=je,pt=258,ht=262,mt=42,ft=113,yt=666,gt=(e,t)=>(e.msg=Ue[t],t),bt=e=>2*e-(e>4?9:0),wt=e=>{let t=e.length;for(;--t>=0;)e[t]=0},_t=e=>{let t,a,i,n=e.w_size;t=e.hash_size,i=t;do{a=e.head[--i],e.head[i]=a>=n?a-n:0}while(--t);t=n,i=t;do{a=e.prev[--i],e.prev[i]=a>=n?a-n:0}while(--t)};let vt=(e,t,a)=>(t<<e.hash_shift^a)&e.hash_mask;const At=e=>{const t=e.state;let a=t.pending;a>e.avail_out&&(a=e.avail_out),0!==a&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+a),e.next_out),e.next_out+=a,t.pending_out+=a,e.total_out+=a,e.avail_out-=a,t.pending-=a,0===t.pending&&(t.pending_out=0))},kt=(e,t)=>{Ye(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,At(e.strm)},St=(e,t)=>{e.pending_buf[e.pending++]=t},Nt=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Mt=(e,t,a,i)=>{let n=e.avail_in;return n>i&&(n=i),0===n?0:(e.avail_in-=n,t.set(e.input.subarray(e.next_in,e.next_in+n),a),1===e.state.wrap?e.adler=Be(e.adler,t,n,a):2===e.state.wrap&&(e.adler=$e(e.adler,t,n,a)),e.next_in+=n,e.total_in+=n,n)},Tt=(e,t)=>{let a,i,n=e.max_chain_length,s=e.strstart,r=e.prev_length,o=e.nice_match;const l=e.strstart>e.w_size-ht?e.strstart-(e.w_size-ht):0,u=e.window,c=e.w_mask,d=e.prev,p=e.strstart+pt;let h=u[s+r-1],m=u[s+r];e.prev_length>=e.good_match&&(n>>=2),o>e.lookahead&&(o=e.lookahead);do{if(a=t,u[a+r]===m&&u[a+r-1]===h&&u[a]===u[s]&&u[++a]===u[s+1]){s+=2,a++;do{}while(u[++s]===u[++a]&&u[++s]===u[++a]&&u[++s]===u[++a]&&u[++s]===u[++a]&&u[++s]===u[++a]&&u[++s]===u[++a]&&u[++s]===u[++a]&&u[++s]===u[++a]&&s<p);if(i=pt-(p-s),s=p-pt,i>r){if(e.match_start=t,r=i,i>=o)break;h=u[s+r-1],m=u[s+r]}}}while((t=d[t&c])>l&&0!=--n);return r<=e.lookahead?r:e.lookahead},xt=e=>{const t=e.w_size;let a,i,n;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-ht)&&(e.window.set(e.window.subarray(t,t+t-i),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),_t(e),i+=t),0===e.strm.avail_in)break;if(a=Mt(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=a,e.lookahead+e.insert>=3)for(n=e.strstart-e.insert,e.ins_h=e.window[n],e.ins_h=vt(e,e.ins_h,e.window[n+1]);e.insert&&(e.ins_h=vt(e,e.ins_h,e.window[n+3-1]),e.prev[n&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=n,n++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<ht&&0!==e.strm.avail_in)},Vt=(e,t)=>{let a,i,n,s=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r=0,o=e.strm.avail_in;do{if(a=65535,n=e.bi_valid+42>>3,e.strm.avail_out<n)break;if(n=e.strm.avail_out-n,i=e.strstart-e.block_start,a>i+e.strm.avail_in&&(a=i+e.strm.avail_in),a>n&&(a=n),a<s&&(0===a&&t!==Ke||t===qe||a!==i+e.strm.avail_in))break;r=t===Ke&&a===i+e.strm.avail_in?1:0,We(e,0,0,r),e.pending_buf[e.pending-4]=a,e.pending_buf[e.pending-3]=a>>8,e.pending_buf[e.pending-2]=~a,e.pending_buf[e.pending-1]=~a>>8,At(e.strm),i&&(i>a&&(i=a),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,a-=i),a&&(Mt(e.strm,e.strm.output,e.strm.next_out,a),e.strm.next_out+=a,e.strm.avail_out-=a,e.strm.total_out+=a)}while(0===r);return o-=e.strm.avail_in,o&&(o>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=o&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-o,e.strm.next_in),e.strstart),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),r?4:t!==qe&&t!==Ke&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(n=e.window_size-e.strstart,e.strm.avail_in>n&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,n+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),n>e.strm.avail_in&&(n=e.strm.avail_in),n&&(Mt(e.strm,e.window,e.strstart,n),e.strstart+=n,e.insert+=n>e.w_size-e.insert?e.w_size-e.insert:n),e.high_water<e.strstart&&(e.high_water=e.strstart),n=e.bi_valid+42>>3,n=e.pending_buf_size-n>65535?65535:e.pending_buf_size-n,s=n>e.w_size?e.w_size:n,i=e.strstart-e.block_start,(i>=s||(i||t===Ke)&&t!==qe&&0===e.strm.avail_in&&i<=n)&&(a=i>n?n:i,r=t===Ke&&0===e.strm.avail_in&&a===i?1:0,We(e,e.block_start,a,r),e.block_start+=a,At(e.strm)),r?3:1)},Ct=(e,t)=>{let a,i;for(;;){if(e.lookahead<ht){if(xt(e),e.lookahead<ht&&t===qe)return 1;if(0===e.lookahead)break}if(a=0,e.lookahead>=3&&(e.ins_h=vt(e,e.ins_h,e.window[e.strstart+3-1]),a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==a&&e.strstart-a<=e.w_size-ht&&(e.match_length=Tt(e,a)),e.match_length>=3)if(i=He(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=vt(e,e.ins_h,e.window[e.strstart+3-1]),a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=vt(e,e.ins_h,e.window[e.strstart+1]);else i=He(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(kt(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===Ke?(kt(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(kt(e,!1),0===e.strm.avail_out)?1:2},It=(e,t)=>{let a,i,n;for(;;){if(e.lookahead<ht){if(xt(e),e.lookahead<ht&&t===qe)return 1;if(0===e.lookahead)break}if(a=0,e.lookahead>=3&&(e.ins_h=vt(e,e.ins_h,e.window[e.strstart+3-1]),a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==a&&e.prev_length<e.max_lazy_match&&e.strstart-a<=e.w_size-ht&&(e.match_length=Tt(e,a),e.match_length<=5&&(e.strategy===st||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-3,i=He(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=n&&(e.ins_h=vt(e,e.ins_h,e.window[e.strstart+3-1]),a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,i&&(kt(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(i=He(e,0,e.window[e.strstart-1]),i&&kt(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=He(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===Ke?(kt(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(kt(e,!1),0===e.strm.avail_out)?1:2};function Ft(e,t,a,i,n){this.good_length=e,this.max_lazy=t,this.nice_length=a,this.max_chain=i,this.func=n}const Et=[new Ft(0,0,0,0,Vt),new Ft(4,4,8,4,Ct),new Ft(4,5,16,8,Ct),new Ft(4,6,32,32,Ct),new Ft(4,4,16,16,It),new Ft(8,16,32,32,It),new Ft(8,16,128,128,It),new Ft(8,32,128,256,It),new Ft(32,128,258,1024,It),new Ft(32,258,258,4096,It)];function Dt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=dt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),wt(this.dyn_ltree),wt(this.dyn_dtree),wt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),wt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),wt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Pt=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==mt&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==ft&&t.status!==yt?1:0},Lt=e=>{if(Pt(e))return gt(e,tt);e.total_in=e.total_out=0,e.data_type=ct;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?mt:ft,e.adler=2===t.wrap?0:1,t.last_flush=-2,ze(t),Qe},Rt=e=>{const t=Lt(e);var a;return t===Qe&&((a=e.state).window_size=2*a.w_size,wt(a.head),a.max_lazy_match=Et[a.level].max_lazy,a.good_match=Et[a.level].good_length,a.nice_match=Et[a.level].nice_length,a.max_chain_length=Et[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0),t},Bt=(e,t,a,i,n,s)=>{if(!e)return tt;let r=1;if(t===nt&&(t=6),i<0?(r=0,i=-i):i>15&&(r=2,i-=16),n<1||n>9||a!==dt||i<8||i>15||t<0||t>9||s<0||s>lt||8===i&&1!==r)return gt(e,tt);8===i&&(i=9);const o=new Dt;return e.state=o,o.strm=e,o.status=mt,o.wrap=r,o.gzhead=null,o.w_bits=i,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=n+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new Uint8Array(2*o.w_size),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<n+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=3*(o.lit_bufsize-1),o.level=t,o.strategy=s,o.method=a,Rt(e)};var Ot=(e,t)=>{if(Pt(e)||t>Xe||t<0)return e?gt(e,tt):tt;const a=e.state;if(!e.output||0!==e.avail_in&&!e.input||a.status===yt&&t!==Ke)return gt(e,0===e.avail_out?it:tt);const i=a.last_flush;if(a.last_flush=t,0!==a.pending){if(At(e),0===e.avail_out)return a.last_flush=-1,Qe}else if(0===e.avail_in&&bt(t)<=bt(i)&&t!==Ke)return gt(e,it);if(a.status===yt&&0!==e.avail_in)return gt(e,it);if(a.status===mt&&0===a.wrap&&(a.status=ft),a.status===mt){let t=dt+(a.w_bits-8<<4)<<8,i=-1;if(i=a.strategy>=rt||a.level<2?0:a.level<6?1:6===a.level?2:3,t|=i<<6,0!==a.strstart&&(t|=32),t+=31-t%31,Nt(a,t),0!==a.strstart&&(Nt(a,e.adler>>>16),Nt(a,65535&e.adler)),e.adler=1,a.status=ft,At(e),0!==a.pending)return a.last_flush=-1,Qe}if(57===a.status)if(e.adler=0,St(a,31),St(a,139),St(a,8),a.gzhead)St(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),St(a,255&a.gzhead.time),St(a,a.gzhead.time>>8&255),St(a,a.gzhead.time>>16&255),St(a,a.gzhead.time>>24&255),St(a,9===a.level?2:a.strategy>=rt||a.level<2?4:0),St(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(St(a,255&a.gzhead.extra.length),St(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(e.adler=$e(e.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69;else if(St(a,0),St(a,0),St(a,0),St(a,0),St(a,0),St(a,9===a.level?2:a.strategy>=rt||a.level<2?4:0),St(a,3),a.status=ft,At(e),0!==a.pending)return a.last_flush=-1,Qe;if(69===a.status){if(a.gzhead.extra){let t=a.pending,i=(65535&a.gzhead.extra.length)-a.gzindex;for(;a.pending+i>a.pending_buf_size;){let n=a.pending_buf_size-a.pending;if(a.pending_buf.set(a.gzhead.extra.subarray(a.gzindex,a.gzindex+n),a.pending),a.pending=a.pending_buf_size,a.gzhead.hcrc&&a.pending>t&&(e.adler=$e(e.adler,a.pending_buf,a.pending-t,t)),a.gzindex+=n,At(e),0!==a.pending)return a.last_flush=-1,Qe;t=0,i-=n}let n=new Uint8Array(a.gzhead.extra);a.pending_buf.set(n.subarray(a.gzindex,a.gzindex+i),a.pending),a.pending+=i,a.gzhead.hcrc&&a.pending>t&&(e.adler=$e(e.adler,a.pending_buf,a.pending-t,t)),a.gzindex=0}a.status=73}if(73===a.status){if(a.gzhead.name){let t,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(e.adler=$e(e.adler,a.pending_buf,a.pending-i,i)),At(e),0!==a.pending)return a.last_flush=-1,Qe;i=0}t=a.gzindex<a.gzhead.name.length?255&a.gzhead.name.charCodeAt(a.gzindex++):0,St(a,t)}while(0!==t);a.gzhead.hcrc&&a.pending>i&&(e.adler=$e(e.adler,a.pending_buf,a.pending-i,i)),a.gzindex=0}a.status=91}if(91===a.status){if(a.gzhead.comment){let t,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(e.adler=$e(e.adler,a.pending_buf,a.pending-i,i)),At(e),0!==a.pending)return a.last_flush=-1,Qe;i=0}t=a.gzindex<a.gzhead.comment.length?255&a.gzhead.comment.charCodeAt(a.gzindex++):0,St(a,t)}while(0!==t);a.gzhead.hcrc&&a.pending>i&&(e.adler=$e(e.adler,a.pending_buf,a.pending-i,i))}a.status=103}if(103===a.status){if(a.gzhead.hcrc){if(a.pending+2>a.pending_buf_size&&(At(e),0!==a.pending))return a.last_flush=-1,Qe;St(a,255&e.adler),St(a,e.adler>>8&255),e.adler=0}if(a.status=ft,At(e),0!==a.pending)return a.last_flush=-1,Qe}if(0!==e.avail_in||0!==a.lookahead||t!==qe&&a.status!==yt){let i=0===a.level?Vt(a,t):a.strategy===rt?((e,t)=>{let a;for(;;){if(0===e.lookahead&&(xt(e),0===e.lookahead)){if(t===qe)return 1;break}if(e.match_length=0,a=He(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,a&&(kt(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Ke?(kt(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(kt(e,!1),0===e.strm.avail_out)?1:2})(a,t):a.strategy===ot?((e,t)=>{let a,i,n,s;const r=e.window;for(;;){if(e.lookahead<=pt){if(xt(e),e.lookahead<=pt&&t===qe)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=e.strstart-1,i=r[n],i===r[++n]&&i===r[++n]&&i===r[++n])){s=e.strstart+pt;do{}while(i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&n<s);e.match_length=pt-(s-n),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(a=He(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(a=He(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),a&&(kt(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Ke?(kt(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(kt(e,!1),0===e.strm.avail_out)?1:2})(a,t):Et[a.level].func(a,t);if(3!==i&&4!==i||(a.status=yt),1===i||3===i)return 0===e.avail_out&&(a.last_flush=-1),Qe;if(2===i&&(t===Ze?Ge(a):t!==Xe&&(We(a,0,0,!1),t===Je&&(wt(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),At(e),0===e.avail_out))return a.last_flush=-1,Qe}return t!==Ke?Qe:a.wrap<=0?et:(2===a.wrap?(St(a,255&e.adler),St(a,e.adler>>8&255),St(a,e.adler>>16&255),St(a,e.adler>>24&255),St(a,255&e.total_in),St(a,e.total_in>>8&255),St(a,e.total_in>>16&255),St(a,e.total_in>>24&255)):(Nt(a,e.adler>>>16),Nt(a,65535&e.adler)),At(e),a.wrap>0&&(a.wrap=-a.wrap),0!==a.pending?Qe:et)},$t={deflateInit:(e,t)=>Bt(e,t,dt,15,8,ut),deflateInit2:Bt,deflateReset:Rt,deflateResetKeep:Lt,deflateSetHeader:(e,t)=>Pt(e)||2!==e.state.wrap?tt:(e.state.gzhead=t,Qe),deflate:Ot,deflateEnd:e=>{if(Pt(e))return tt;const t=e.state.status;return e.state=null,t===ft?gt(e,at):Qe},deflateSetDictionary:(e,t)=>{let a=t.length;if(Pt(e))return tt;const i=e.state,n=i.wrap;if(2===n||1===n&&i.status!==mt||i.lookahead)return tt;if(1===n&&(e.adler=Be(e.adler,t,a,0)),i.wrap=0,a>=i.w_size){0===n&&(wt(i.head),i.strstart=0,i.block_start=0,i.insert=0);let e=new Uint8Array(i.w_size);e.set(t.subarray(a-i.w_size,a),0),t=e,a=i.w_size}const s=e.avail_in,r=e.next_in,o=e.input;for(e.avail_in=a,e.next_in=0,e.input=t,xt(i);i.lookahead>=3;){let e=i.strstart,t=i.lookahead-2;do{i.ins_h=vt(i,i.ins_h,i.window[e+3-1]),i.prev[e&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=e,e++}while(--t);i.strstart=e,i.lookahead=2,xt(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,e.next_in=r,e.input=o,e.avail_in=s,i.wrap=n,Qe},deflateInfo:"pako deflate (from Nodeca project)"};const Ut=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var jt=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const a=t.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(const t in a)Ut(a,t)&&(e[t]=a[t])}}return e},zt=e=>{let t=0;for(let a=0,i=e.length;a<i;a++)t+=e[a].length;const a=new Uint8Array(t);for(let t=0,i=0,n=e.length;t<n;t++){let n=e[t];a.set(n,i),i+=n.length}return a};let Wt=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){Wt=!1}const Yt=new Uint8Array(256);for(let e=0;e<256;e++)Yt[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Yt[254]=Yt[254]=1;var Ht=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,a,i,n,s,r=e.length,o=0;for(n=0;n<r;n++)a=e.charCodeAt(n),55296==(64512&a)&&n+1<r&&(i=e.charCodeAt(n+1),56320==(64512&i)&&(a=65536+(a-55296<<10)+(i-56320),n++)),o+=a<128?1:a<2048?2:a<65536?3:4;for(t=new Uint8Array(o),s=0,n=0;s<o;n++)a=e.charCodeAt(n),55296==(64512&a)&&n+1<r&&(i=e.charCodeAt(n+1),56320==(64512&i)&&(a=65536+(a-55296<<10)+(i-56320),n++)),a<128?t[s++]=a:a<2048?(t[s++]=192|a>>>6,t[s++]=128|63&a):a<65536?(t[s++]=224|a>>>12,t[s++]=128|a>>>6&63,t[s++]=128|63&a):(t[s++]=240|a>>>18,t[s++]=128|a>>>12&63,t[s++]=128|a>>>6&63,t[s++]=128|63&a);return t},Gt=(e,t)=>{const a=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let i,n;const s=new Array(2*a);for(n=0,i=0;i<a;){let t=e[i++];if(t<128){s[n++]=t;continue}let r=Yt[t];if(r>4)s[n++]=65533,i+=r-1;else{for(t&=2===r?31:3===r?15:7;r>1&&i<a;)t=t<<6|63&e[i++],r--;r>1?s[n++]=65533:t<65536?s[n++]=t:(t-=65536,s[n++]=55296|t>>10&1023,s[n++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&Wt)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let a="";for(let i=0;i<t;i++)a+=String.fromCharCode(e[i]);return a})(s,n)},qt=(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let a=t-1;for(;a>=0&&128==(192&e[a]);)a--;return a<0||0===a?t:a+Yt[e[a]]>t?a:t};var Zt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Jt=Object.prototype.toString,{Z_NO_FLUSH:Kt,Z_SYNC_FLUSH:Xt,Z_FULL_FLUSH:Qt,Z_FINISH:ea,Z_OK:ta,Z_STREAM_END:aa,Z_DEFAULT_COMPRESSION:ia,Z_DEFAULT_STRATEGY:na,Z_DEFLATED:sa}=je;function ra(e){this.options=jt({level:ia,method:sa,chunkSize:16384,windowBits:15,memLevel:8,strategy:na},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Zt,this.strm.avail_out=0;let a=$t.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(a!==ta)throw new Error(Ue[a]);if(t.header&&$t.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?Ht(t.dictionary):"[object ArrayBuffer]"===Jt.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,a=$t.deflateSetDictionary(this.strm,e),a!==ta)throw new Error(Ue[a]);this._dict_set=!0}}function oa(e,t){const a=new ra(t);if(a.push(e,!0),a.err)throw a.msg||Ue[a.err];return a.result}ra.prototype.push=function(e,t){const a=this.strm,i=this.options.chunkSize;let n,s;if(this.ended)return!1;for(s=t===~~t?t:!0===t?ea:Kt,"string"==typeof e?a.input=Ht(e):"[object ArrayBuffer]"===Jt.call(e)?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;;)if(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),(s===Xt||s===Qt)&&a.avail_out<=6)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else{if(n=$t.deflate(a,s),n===aa)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),n=$t.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===ta;if(0!==a.avail_out){if(s>0&&a.next_out>0)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else if(0===a.avail_in)break}else this.onData(a.output)}return!0},ra.prototype.onData=function(e){this.chunks.push(e)},ra.prototype.onEnd=function(e){e===ta&&(this.result=zt(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var la=function(e,t){return(t=t||{}).raw=!0,oa(e,t)},ua=function(e,t){return(t=t||{}).gzip=!0,oa(e,t)},ca={Deflate:ra,deflate:oa,deflateRaw:la,gzip:ua};const da=16209;var pa=function(e,t){let a,i,n,s,r,o,l,u,c,d,p,h,m,f,y,g,b,w,_,v,A,k,S,N;const M=e.state;a=e.next_in,S=e.input,i=a+(e.avail_in-5),n=e.next_out,N=e.output,s=n-(t-e.avail_out),r=n+(e.avail_out-257),o=M.dmax,l=M.wsize,u=M.whave,c=M.wnext,d=M.window,p=M.hold,h=M.bits,m=M.lencode,f=M.distcode,y=(1<<M.lenbits)-1,g=(1<<M.distbits)-1;e:do{h<15&&(p+=S[a++]<<h,h+=8,p+=S[a++]<<h,h+=8),b=m[p&y];t:for(;;){if(w=b>>>24,p>>>=w,h-=w,w=b>>>16&255,0===w)N[n++]=65535&b;else{if(!(16&w)){if(64&w){if(32&w){M.mode=16191;break e}e.msg="invalid literal/length code",M.mode=da;break e}b=m[(65535&b)+(p&(1<<w)-1)];continue t}for(_=65535&b,w&=15,w&&(h<w&&(p+=S[a++]<<h,h+=8),_+=p&(1<<w)-1,p>>>=w,h-=w),h<15&&(p+=S[a++]<<h,h+=8,p+=S[a++]<<h,h+=8),b=f[p&g];;){if(w=b>>>24,p>>>=w,h-=w,w=b>>>16&255,16&w){if(v=65535&b,w&=15,h<w&&(p+=S[a++]<<h,h+=8,h<w&&(p+=S[a++]<<h,h+=8)),v+=p&(1<<w)-1,v>o){e.msg="invalid distance too far back",M.mode=da;break e}if(p>>>=w,h-=w,w=n-s,v>w){if(w=v-w,w>u&&M.sane){e.msg="invalid distance too far back",M.mode=da;break e}if(A=0,k=d,0===c){if(A+=l-w,w<_){_-=w;do{N[n++]=d[A++]}while(--w);A=n-v,k=N}}else if(c<w){if(A+=l+c-w,w-=c,w<_){_-=w;do{N[n++]=d[A++]}while(--w);if(A=0,c<_){w=c,_-=w;do{N[n++]=d[A++]}while(--w);A=n-v,k=N}}}else if(A+=c-w,w<_){_-=w;do{N[n++]=d[A++]}while(--w);A=n-v,k=N}for(;_>2;)N[n++]=k[A++],N[n++]=k[A++],N[n++]=k[A++],_-=3;_&&(N[n++]=k[A++],_>1&&(N[n++]=k[A++]))}else{A=n-v;do{N[n++]=N[A++],N[n++]=N[A++],N[n++]=N[A++],_-=3}while(_>2);_&&(N[n++]=N[A++],_>1&&(N[n++]=N[A++]))}break}if(64&w){e.msg="invalid distance code",M.mode=da;break e}b=f[(65535&b)+(p&(1<<w)-1)]}}break}}while(a<i&&n<r);_=h>>3,a-=_,h-=_<<3,p&=(1<<h)-1,e.next_in=a,e.next_out=n,e.avail_in=a<i?i-a+5:5-(a-i),e.avail_out=n<r?r-n+257:257-(n-r),M.hold=p,M.bits=h};const ha=15,ma=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),fa=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),ya=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),ga=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var ba=(e,t,a,i,n,s,r,o)=>{const l=o.bits;let u,c,d,p,h,m,f=0,y=0,g=0,b=0,w=0,_=0,v=0,A=0,k=0,S=0,N=null;const M=new Uint16Array(16),T=new Uint16Array(16);let x,V,C,I=null;for(f=0;f<=ha;f++)M[f]=0;for(y=0;y<i;y++)M[t[a+y]]++;for(w=l,b=ha;b>=1&&0===M[b];b--);if(w>b&&(w=b),0===b)return n[s++]=20971520,n[s++]=20971520,o.bits=1,0;for(g=1;g<b&&0===M[g];g++);for(w<g&&(w=g),A=1,f=1;f<=ha;f++)if(A<<=1,A-=M[f],A<0)return-1;if(A>0&&(0===e||1!==b))return-1;for(T[1]=0,f=1;f<ha;f++)T[f+1]=T[f]+M[f];for(y=0;y<i;y++)0!==t[a+y]&&(r[T[t[a+y]]++]=y);if(0===e?(N=I=r,m=20):1===e?(N=ma,I=fa,m=257):(N=ya,I=ga,m=0),S=0,y=0,f=g,h=s,_=w,v=0,d=-1,k=1<<w,p=k-1,1===e&&k>852||2===e&&k>592)return 1;for(;;){x=f-v,r[y]+1<m?(V=0,C=r[y]):r[y]>=m?(V=I[r[y]-m],C=N[r[y]-m]):(V=96,C=0),u=1<<f-v,c=1<<_,g=c;do{c-=u,n[h+(S>>v)+c]=x<<24|V<<16|C}while(0!==c);for(u=1<<f-1;S&u;)u>>=1;if(0!==u?(S&=u-1,S+=u):S=0,y++,0==--M[f]){if(f===b)break;f=t[a+r[y]]}if(f>w&&(S&p)!==d){for(0===v&&(v=w),h+=g,_=f-v,A=1<<_;_+v<b&&(A-=M[_+v],!(A<=0));)_++,A<<=1;if(k+=1<<_,1===e&&k>852||2===e&&k>592)return 1;d=S&p,n[d]=w<<24|_<<16|h-s}}return 0!==S&&(n[h+S]=f-v<<24|64<<16),o.bits=w,0};const{Z_FINISH:wa,Z_BLOCK:_a,Z_TREES:va,Z_OK:Aa,Z_STREAM_END:ka,Z_NEED_DICT:Sa,Z_STREAM_ERROR:Na,Z_DATA_ERROR:Ma,Z_MEM_ERROR:Ta,Z_BUF_ERROR:xa,Z_DEFLATED:Va}=je,Ca=16180,Ia=16190,Fa=16191,Ea=16192,Da=16194,Pa=16199,La=16200,Ra=16206,Ba=16209,Oa=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function $a(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Ua=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<Ca||t.mode>16211?1:0},ja=e=>{if(Ua(e))return Na;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=Ca,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,Aa},za=e=>{if(Ua(e))return Na;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,ja(e)},Wa=(e,t)=>{let a;if(Ua(e))return Na;const i=e.state;return t<0?(a=0,t=-t):(a=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Na:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=a,i.wbits=t,za(e))},Ya=(e,t)=>{if(!e)return Na;const a=new $a;e.state=a,a.strm=e,a.window=null,a.mode=Ca;const i=Wa(e,t);return i!==Aa&&(e.state=null),i};let Ha,Ga,qa=!0;const Za=e=>{if(qa){Ha=new Int32Array(512),Ga=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(ba(1,e.lens,0,288,Ha,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ba(2,e.lens,0,32,Ga,0,e.work,{bits:5}),qa=!1}e.lencode=Ha,e.lenbits=9,e.distcode=Ga,e.distbits=5},Ja=(e,t,a,i)=>{let n;const s=e.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),i>=s.wsize?(s.window.set(t.subarray(a-s.wsize,a),0),s.wnext=0,s.whave=s.wsize):(n=s.wsize-s.wnext,n>i&&(n=i),s.window.set(t.subarray(a-i,a-i+n),s.wnext),(i-=n)?(s.window.set(t.subarray(a-i,a),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=n))),0};var Ka=(e,t)=>{let a,i,n,s,r,o,l,u,c,d,p,h,m,f,y,g,b,w,_,v,A,k,S=0;const N=new Uint8Array(4);let M,T;const x=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Ua(e)||!e.output||!e.input&&0!==e.avail_in)return Na;a=e.state,a.mode===Fa&&(a.mode=Ea),r=e.next_out,n=e.output,l=e.avail_out,s=e.next_in,i=e.input,o=e.avail_in,u=a.hold,c=a.bits,d=o,p=l,k=Aa;e:for(;;)switch(a.mode){case Ca:if(0===a.wrap){a.mode=Ea;break}for(;c<16;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}if(2&a.wrap&&35615===u){0===a.wbits&&(a.wbits=15),a.check=0,N[0]=255&u,N[1]=u>>>8&255,a.check=$e(a.check,N,2,0),u=0,c=0,a.mode=16181;break}if(a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",a.mode=Ba;break}if((15&u)!==Va){e.msg="unknown compression method",a.mode=Ba;break}if(u>>>=4,c-=4,A=8+(15&u),0===a.wbits&&(a.wbits=A),A>15||A>a.wbits){e.msg="invalid window size",a.mode=Ba;break}a.dmax=1<<a.wbits,a.flags=0,e.adler=a.check=1,a.mode=512&u?16189:Fa,u=0,c=0;break;case 16181:for(;c<16;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}if(a.flags=u,(255&a.flags)!==Va){e.msg="unknown compression method",a.mode=Ba;break}if(57344&a.flags){e.msg="unknown header flags set",a.mode=Ba;break}a.head&&(a.head.text=u>>8&1),512&a.flags&&4&a.wrap&&(N[0]=255&u,N[1]=u>>>8&255,a.check=$e(a.check,N,2,0)),u=0,c=0,a.mode=16182;case 16182:for(;c<32;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}a.head&&(a.head.time=u),512&a.flags&&4&a.wrap&&(N[0]=255&u,N[1]=u>>>8&255,N[2]=u>>>16&255,N[3]=u>>>24&255,a.check=$e(a.check,N,4,0)),u=0,c=0,a.mode=16183;case 16183:for(;c<16;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}a.head&&(a.head.xflags=255&u,a.head.os=u>>8),512&a.flags&&4&a.wrap&&(N[0]=255&u,N[1]=u>>>8&255,a.check=$e(a.check,N,2,0)),u=0,c=0,a.mode=16184;case 16184:if(1024&a.flags){for(;c<16;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}a.length=u,a.head&&(a.head.extra_len=u),512&a.flags&&4&a.wrap&&(N[0]=255&u,N[1]=u>>>8&255,a.check=$e(a.check,N,2,0)),u=0,c=0}else a.head&&(a.head.extra=null);a.mode=16185;case 16185:if(1024&a.flags&&(h=a.length,h>o&&(h=o),h&&(a.head&&(A=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(i.subarray(s,s+h),A)),512&a.flags&&4&a.wrap&&(a.check=$e(a.check,i,h,s)),o-=h,s+=h,a.length-=h),a.length))break e;a.length=0,a.mode=16186;case 16186:if(2048&a.flags){if(0===o)break e;h=0;do{A=i[s+h++],a.head&&A&&a.length<65536&&(a.head.name+=String.fromCharCode(A))}while(A&&h<o);if(512&a.flags&&4&a.wrap&&(a.check=$e(a.check,i,h,s)),o-=h,s+=h,A)break e}else a.head&&(a.head.name=null);a.length=0,a.mode=16187;case 16187:if(4096&a.flags){if(0===o)break e;h=0;do{A=i[s+h++],a.head&&A&&a.length<65536&&(a.head.comment+=String.fromCharCode(A))}while(A&&h<o);if(512&a.flags&&4&a.wrap&&(a.check=$e(a.check,i,h,s)),o-=h,s+=h,A)break e}else a.head&&(a.head.comment=null);a.mode=16188;case 16188:if(512&a.flags){for(;c<16;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}if(4&a.wrap&&u!==(65535&a.check)){e.msg="header crc mismatch",a.mode=Ba;break}u=0,c=0}a.head&&(a.head.hcrc=a.flags>>9&1,a.head.done=!0),e.adler=a.check=0,a.mode=Fa;break;case 16189:for(;c<32;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}e.adler=a.check=Oa(u),u=0,c=0,a.mode=Ia;case Ia:if(0===a.havedict)return e.next_out=r,e.avail_out=l,e.next_in=s,e.avail_in=o,a.hold=u,a.bits=c,Sa;e.adler=a.check=1,a.mode=Fa;case Fa:if(t===_a||t===va)break e;case Ea:if(a.last){u>>>=7&c,c-=7&c,a.mode=Ra;break}for(;c<3;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}switch(a.last=1&u,u>>>=1,c-=1,3&u){case 0:a.mode=16193;break;case 1:if(Za(a),a.mode=Pa,t===va){u>>>=2,c-=2;break e}break;case 2:a.mode=16196;break;case 3:e.msg="invalid block type",a.mode=Ba}u>>>=2,c-=2;break;case 16193:for(u>>>=7&c,c-=7&c;c<32;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}if((65535&u)!=(u>>>16^65535)){e.msg="invalid stored block lengths",a.mode=Ba;break}if(a.length=65535&u,u=0,c=0,a.mode=Da,t===va)break e;case Da:a.mode=16195;case 16195:if(h=a.length,h){if(h>o&&(h=o),h>l&&(h=l),0===h)break e;n.set(i.subarray(s,s+h),r),o-=h,s+=h,l-=h,r+=h,a.length-=h;break}a.mode=Fa;break;case 16196:for(;c<14;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}if(a.nlen=257+(31&u),u>>>=5,c-=5,a.ndist=1+(31&u),u>>>=5,c-=5,a.ncode=4+(15&u),u>>>=4,c-=4,a.nlen>286||a.ndist>30){e.msg="too many length or distance symbols",a.mode=Ba;break}a.have=0,a.mode=16197;case 16197:for(;a.have<a.ncode;){for(;c<3;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}a.lens[x[a.have++]]=7&u,u>>>=3,c-=3}for(;a.have<19;)a.lens[x[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,M={bits:a.lenbits},k=ba(0,a.lens,0,19,a.lencode,0,a.work,M),a.lenbits=M.bits,k){e.msg="invalid code lengths set",a.mode=Ba;break}a.have=0,a.mode=16198;case 16198:for(;a.have<a.nlen+a.ndist;){for(;S=a.lencode[u&(1<<a.lenbits)-1],y=S>>>24,g=S>>>16&255,b=65535&S,!(y<=c);){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}if(b<16)u>>>=y,c-=y,a.lens[a.have++]=b;else{if(16===b){for(T=y+2;c<T;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}if(u>>>=y,c-=y,0===a.have){e.msg="invalid bit length repeat",a.mode=Ba;break}A=a.lens[a.have-1],h=3+(3&u),u>>>=2,c-=2}else if(17===b){for(T=y+3;c<T;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}u>>>=y,c-=y,A=0,h=3+(7&u),u>>>=3,c-=3}else{for(T=y+7;c<T;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}u>>>=y,c-=y,A=0,h=11+(127&u),u>>>=7,c-=7}if(a.have+h>a.nlen+a.ndist){e.msg="invalid bit length repeat",a.mode=Ba;break}for(;h--;)a.lens[a.have++]=A}}if(a.mode===Ba)break;if(0===a.lens[256]){e.msg="invalid code -- missing end-of-block",a.mode=Ba;break}if(a.lenbits=9,M={bits:a.lenbits},k=ba(1,a.lens,0,a.nlen,a.lencode,0,a.work,M),a.lenbits=M.bits,k){e.msg="invalid literal/lengths set",a.mode=Ba;break}if(a.distbits=6,a.distcode=a.distdyn,M={bits:a.distbits},k=ba(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,M),a.distbits=M.bits,k){e.msg="invalid distances set",a.mode=Ba;break}if(a.mode=Pa,t===va)break e;case Pa:a.mode=La;case La:if(o>=6&&l>=258){e.next_out=r,e.avail_out=l,e.next_in=s,e.avail_in=o,a.hold=u,a.bits=c,pa(e,p),r=e.next_out,n=e.output,l=e.avail_out,s=e.next_in,i=e.input,o=e.avail_in,u=a.hold,c=a.bits,a.mode===Fa&&(a.back=-1);break}for(a.back=0;S=a.lencode[u&(1<<a.lenbits)-1],y=S>>>24,g=S>>>16&255,b=65535&S,!(y<=c);){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}if(g&&!(240&g)){for(w=y,_=g,v=b;S=a.lencode[v+((u&(1<<w+_)-1)>>w)],y=S>>>24,g=S>>>16&255,b=65535&S,!(w+y<=c);){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}u>>>=w,c-=w,a.back+=w}if(u>>>=y,c-=y,a.back+=y,a.length=b,0===g){a.mode=16205;break}if(32&g){a.back=-1,a.mode=Fa;break}if(64&g){e.msg="invalid literal/length code",a.mode=Ba;break}a.extra=15&g,a.mode=16201;case 16201:if(a.extra){for(T=a.extra;c<T;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}a.length+=u&(1<<a.extra)-1,u>>>=a.extra,c-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=16202;case 16202:for(;S=a.distcode[u&(1<<a.distbits)-1],y=S>>>24,g=S>>>16&255,b=65535&S,!(y<=c);){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}if(!(240&g)){for(w=y,_=g,v=b;S=a.distcode[v+((u&(1<<w+_)-1)>>w)],y=S>>>24,g=S>>>16&255,b=65535&S,!(w+y<=c);){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}u>>>=w,c-=w,a.back+=w}if(u>>>=y,c-=y,a.back+=y,64&g){e.msg="invalid distance code",a.mode=Ba;break}a.offset=b,a.extra=15&g,a.mode=16203;case 16203:if(a.extra){for(T=a.extra;c<T;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}a.offset+=u&(1<<a.extra)-1,u>>>=a.extra,c-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){e.msg="invalid distance too far back",a.mode=Ba;break}a.mode=16204;case 16204:if(0===l)break e;if(h=p-l,a.offset>h){if(h=a.offset-h,h>a.whave&&a.sane){e.msg="invalid distance too far back",a.mode=Ba;break}h>a.wnext?(h-=a.wnext,m=a.wsize-h):m=a.wnext-h,h>a.length&&(h=a.length),f=a.window}else f=n,m=r-a.offset,h=a.length;h>l&&(h=l),l-=h,a.length-=h;do{n[r++]=f[m++]}while(--h);0===a.length&&(a.mode=La);break;case 16205:if(0===l)break e;n[r++]=a.length,l--,a.mode=La;break;case Ra:if(a.wrap){for(;c<32;){if(0===o)break e;o--,u|=i[s++]<<c,c+=8}if(p-=l,e.total_out+=p,a.total+=p,4&a.wrap&&p&&(e.adler=a.check=a.flags?$e(a.check,n,p,r-p):Be(a.check,n,p,r-p)),p=l,4&a.wrap&&(a.flags?u:Oa(u))!==a.check){e.msg="incorrect data check",a.mode=Ba;break}u=0,c=0}a.mode=16207;case 16207:if(a.wrap&&a.flags){for(;c<32;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}if(4&a.wrap&&u!==(4294967295&a.total)){e.msg="incorrect length check",a.mode=Ba;break}u=0,c=0}a.mode=16208;case 16208:k=ka;break e;case Ba:k=Ma;break e;case 16210:return Ta;default:return Na}return e.next_out=r,e.avail_out=l,e.next_in=s,e.avail_in=o,a.hold=u,a.bits=c,(a.wsize||p!==e.avail_out&&a.mode<Ba&&(a.mode<Ra||t!==wa))&&Ja(e,e.output,e.next_out,p-e.avail_out),d-=e.avail_in,p-=e.avail_out,e.total_in+=d,e.total_out+=p,a.total+=p,4&a.wrap&&p&&(e.adler=a.check=a.flags?$e(a.check,n,p,e.next_out-p):Be(a.check,n,p,e.next_out-p)),e.data_type=a.bits+(a.last?64:0)+(a.mode===Fa?128:0)+(a.mode===Pa||a.mode===Da?256:0),(0===d&&0===p||t===wa)&&k===Aa&&(k=xa),k},Xa={inflateReset:za,inflateReset2:Wa,inflateResetKeep:ja,inflateInit:e=>Ya(e,15),inflateInit2:Ya,inflate:Ka,inflateEnd:e=>{if(Ua(e))return Na;let t=e.state;return t.window&&(t.window=null),e.state=null,Aa},inflateGetHeader:(e,t)=>{if(Ua(e))return Na;const a=e.state;return 2&a.wrap?(a.head=t,t.done=!1,Aa):Na},inflateSetDictionary:(e,t)=>{const a=t.length;let i,n,s;return Ua(e)?Na:(i=e.state,0!==i.wrap&&i.mode!==Ia?Na:i.mode===Ia&&(n=1,n=Be(n,t,a,0),n!==i.check)?Ma:(s=Ja(e,t,a,a),s?(i.mode=16210,Ta):(i.havedict=1,Aa)))},inflateInfo:"pako inflate (from Nodeca project)"};var Qa=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const ei=Object.prototype.toString,{Z_NO_FLUSH:ti,Z_FINISH:ai,Z_OK:ii,Z_STREAM_END:ni,Z_NEED_DICT:si,Z_STREAM_ERROR:ri,Z_DATA_ERROR:oi,Z_MEM_ERROR:li}=je;function ui(e){this.options=jt({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Zt,this.strm.avail_out=0;let a=Xa.inflateInit2(this.strm,t.windowBits);if(a!==ii)throw new Error(Ue[a]);if(this.header=new Qa,Xa.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Ht(t.dictionary):"[object ArrayBuffer]"===ei.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(a=Xa.inflateSetDictionary(this.strm,t.dictionary),a!==ii)))throw new Error(Ue[a])}function ci(e,t){const a=new ui(t);if(a.push(e),a.err)throw a.msg||Ue[a.err];return a.result}ui.prototype.push=function(e,t){const a=this.strm,i=this.options.chunkSize,n=this.options.dictionary;let s,r,o;if(this.ended)return!1;for(r=t===~~t?t:!0===t?ai:ti,"[object ArrayBuffer]"===ei.call(e)?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),s=Xa.inflate(a,r),s===si&&n&&(s=Xa.inflateSetDictionary(a,n),s===ii?s=Xa.inflate(a,r):s===oi&&(s=si));a.avail_in>0&&s===ni&&a.state.wrap>0&&0!==e[a.next_in];)Xa.inflateReset(a),s=Xa.inflate(a,r);switch(s){case ri:case oi:case si:case li:return this.onEnd(s),this.ended=!0,!1}if(o=a.avail_out,a.next_out&&(0===a.avail_out||s===ni))if("string"===this.options.to){let e=qt(a.output,a.next_out),t=a.next_out-e,n=Gt(a.output,e);a.next_out=t,a.avail_out=i-t,t&&a.output.set(a.output.subarray(e,e+t),0),this.onData(n)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(s!==ii||0!==o){if(s===ni)return s=Xa.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},ui.prototype.onData=function(e){this.chunks.push(e)},ui.prototype.onEnd=function(e){e===ii&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=zt(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var di=function(e,t){return(t=t||{}).raw=!0,ci(e,t)},pi={Inflate:ui,inflate:ci,inflateRaw:di,ungzip:ci};const{Deflate:hi,deflate:mi,deflateRaw:fi,gzip:yi}=ca,{Inflate:gi,inflate:bi,inflateRaw:wi,ungzip:_i}=pi;var vi={Deflate:hi,deflate:mi,deflateRaw:fi,gzip:yi,Inflate:gi,inflate:bi,inflateRaw:wi,ungzip:_i,constants:je};const Ai={files:{},items:{},folders:{}};function ki(e){return Ai.files[e]}function Si(){return Ai.folders}function Ni(e){return Ai.folders[e]}function Mi(e,t){for(const a of Object.values(Ai.folders))if(a.name===e&&a.parent===t)return a}function Ti(e,t){for(const a of Object.values(Ai.items))if(a.name===e&&a.folder._id===t)return a}function xi(){return Ai.items}function Vi(e){return Ai.items[e]}function Ci(e,t){Ai.items[e]=t.rootItem;for(const[e,a]of Object.entries(t.metadata)){if(t.files[e]&&(Ai.files[e]={blob:new Blob([t.files[e]],{type:a.mimeType}),hash:a.hash,itemName:a.name,itemType:a.type,mimeType:a.mimeType}),a.attachments)for(const i of a.attachments){const a=Fi(e,i.name,i.queryParam,i.index);Ai.files[a]={blob:new Blob([t.files[a]],{type:i.mimeType}),hash:i.hash,itemName:i.name,itemType:i.type,mimeType:i.mimeType}}Ai.items[e]=a}for(const a of Object.values(t.folders))a._id=e+":"+a._id,a.parent=e+":"+a.parent,Ai.folders[a._id]=a}async function Ii(e,t){const a=Buffer.from(await e.arrayBuffer());let i=0;i+=8;const n=a.readInt32LE(8);i+=4;const s=new TextDecoder,r=a.subarray(i,i+n);i+=n;const o=JSON.parse(s.decode(r));o.root=t+"/"+o.root;let l=0;const u=vi.ungzip(a.subarray(i)),c=Buffer.from(u),d=c.subarray(l,l+o.metadataSize);l+=o.metadataSize;const p=JSON.parse(s.decode(d)),h={};Object.entries(p).forEach((([e,a])=>{const i=t+"/"+e;a._id=i,h[i]=a,a.folder._id=t+":"+a.folder._id;for(const e of a.links)e.to=t+"/"+e.to}));const m=c.subarray(l,l+o.foldersSize);l+=o.foldersSize;const f=JSON.parse(s.decode(m)),y={};for(const[,e]of Object.entries(h))if(e.filesize&&(y[e._id]={start:l+(e.packageFileOffset||0),end:l+(e.packageFileOffset||0)+e.filesize}),e.attachments)for(const t of e.attachments)y[Fi(e._id,t.name,t.queryParam,t.index)]={start:l+(t.packageFileOffset||0),end:l+(t.packageFileOffset||0)+t.filesize};const g={};for(const[e,t]of Object.entries(y)){const a=c.subarray(t.start,t.end);g[e]=a}const b=h[o.root],w=[],_=e=>{w.push(e._id);for(const t of e.links)t.item=structuredClone(h[t.to]),_(t.item)};return _(b),{rootItem:b,metadata:h,folders:f,files:g}}function Fi(e,t,a,i){return`${e}_${t}`+(null!=a?`_${a}`:"")+(null!=i?`_${i}`:"")}function Ei(e,t,a,i){return Array.isArray(e.attachments)?e.attachments.filter((e=>e.name===t&&(void 0===i||e.index===i))).reduce(((e,t)=>Math.abs(t.queryParam-(a??0))<Math.abs(e.queryParam-(a??0))?t:e),{queryParam:1/0}):null}function Di(e,t,a,i){const n=Vi(e);if(n){const s=Ei(n,t,a,i);if(!s)return null;return ki(Fi(e,s.name,s.queryParam,s.index))}}var Pi=Object.freeze({__proto__:null,addPackageToCache:Ci,createAttachmentID:Fi,findFolder:Mi,findItem:Ti,getAttachmentFromPackageCache:Di,getFileFromCache:ki,getFolder:Ni,getFolders:Si,getItemFromCache:Vi,getItems:xi,parsePackage:Ii,queryAttachments:Ei});class Li{id=d.createGUID();items=[]}class Ri{itemRepo;undoEvents=[];redoEvents=[];maxUndoCount=100;enabled=!0;snapshots=new Map;_undoRedoPromise=Promise.resolve();constructor(e,t=100){this.itemRepo=e,this.maxUndoCount=t,f.instance.setUndoManager(this),l.$on("undoManager:undo",(e=>this.undo(e))),l.$on("undoManager:redo",(e=>this.redo(e)))}clear(){this.undoEvents=[],this.redoEvents=[],this.snapshots.clear(),l.$emit("undoManager:undoStepsChanged",0),l.$emit("undoManager:redoStepsChanged",0)}createSnapshot(){const e=new Li;for(const t of this.itemRepo.itemInstances.values())for(const a of t.values())e.items.push({_id:a._id,instanceId:a.instanceId,data:this._grabSnapshot(a)});return this.snapshots.set(e.id,e),e.id}rollbackFromSnapshot(e){const t=this.snapshots.get(e);if(!t)throw new w("Snapshot not found");for(const e of t.items){const t=this.itemRepo.itemInstances.get(e._id);if(t){const a=t.get(e.instanceId);a?this._rollbackFromSnapshot(a,e.data):console.error(`[SNAPSHOT] - Trying to rollback snapshot for item but did not find the instance: ${e._id} -> ${e.instanceId}`)}else console.error(`[SNAPSHOT] - Trying to rollback snapshot for item but did not find the item map: ${e._id}`)}this.snapshots.delete(e)}_grabSnapshot(e){const t=[];for(const a of e.fieldInstances)try{t.push(a.createSnapshot())}catch(e){const t=`[SNAPSHOT] - Could not grab snapshot of field ${a.name}`;throw console.error(t,e),new Error(e.toString())}return new $(e._id,"item",{fieldInstances:t})}_getFieldInstance(e,t){for(const a of e.fieldInstances)if(a.getId()===t)return a;return null}_rollbackFromSnapshot(e,t){for(const a of t.data.fieldInstances){const t=this._getFieldInstance(e,a.id);t?t.rollbackFromSnapshot(a):console.warn("[SNAPSHOT] - Could not find field instance in snapshot: "+a.id)}}getEnabled(){return this.enabled}setEnabled(e){this.enabled=!!e}ignore(e){const t=this.enabled;let a=!1;try{t&&this.setEnabled(!1);const i=e();if(i&&i.then)return a=!0,i.finally((()=>{t&&this.setEnabled(!0)}))}finally{t&&!a&&this.setEnabled(!0)}}undo(e){return this._undoRedoPromise=this._undoRedoPromise.then((()=>this._performUndo(e))),this._undoRedoPromise}redo(e){return this._undoRedoPromise=this._undoRedoPromise.then((()=>this._performRedo(e))),this._undoRedoPromise}async _performUndo(e){if(this.enabled&&this.undoEvents.length){for(e=e||1;this.undoEvents.length>0&&e>0;){const t=this.spliceLastEventBundle(this.undoEvents).reverse();for(const e of t)await e.undo(),this.redoEvents.push(e);e--}l.$emit("undoManager:undoStepsChanged",this.getNumberOfUndoBundles()),l.$emit("undoManager:redoStepsChanged",this.getNumberOfRedoBundles())}}async _performRedo(e){if(this.enabled&&this.redoEvents.length){for(e=e||1;this.redoEvents.length>0&&e>0;){const t=this.spliceLastEventBundle(this.redoEvents).reverse();for(const e of t)await e.redo(),this.undoEvents.push(e);e--}l.$emit("undoManager:undoStepsChanged",this.getNumberOfUndoBundles()),l.$emit("undoManager:redoStepsChanged",this.getNumberOfRedoBundles())}}getUndoSteps(){return this.undoEvents.map((function(e){return{type:e.type,itemId:e.itemId,prop:e.prop}}))}getRedoSteps(){return this.redoEvents.map((e=>({type:e.type,itemId:e.itemId,prop:e.prop})))}event(e){if(this.enabled){if(this.redoEvents=[],l.$emit("undoManager:redoStepsChanged",0),this.assignBundleIndexToEvent(e),0!==this.undoEvents.length){let t=!1;for(let a=this.undoEvents.length-1;a>=0;a--){const i=this.undoEvents[a];if(!e.isWithinMergeDeltaOf(i))break;const n=i.merge(e);if(n){t=!0,this.undoEvents.splice(a,1),this.undoEvents.push(n);break}}t||(this.undoEvents.push(e),l.$emit("undoManager:undoStepsChanged",this.getNumberOfUndoBundles()))}else this.undoEvents.push(e),l.$emit("undoManager:undoStepsChanged",this.getNumberOfUndoBundles());if(this.getNumberOfUndoBundles()>this.maxUndoCount){this.spliceFirstEventBundle(this.undoEvents);for(const e of this.undoEvents)e.bundleIndex-=1;l.$emit("undoManager:undoStepsChanged",this.getNumberOfUndoBundles())}}}getNumberOfUndoBundles(){return 0===this.undoEvents.length?0:this.undoEvents.at(-1).bundleIndex+1}getNumberOfRedoBundles(){if(0===this.redoEvents.length)return 0;const e=this.getNumberOfUndoBundles()-1;return this.redoEvents.at(0).bundleIndex-e}spliceLastEventBundle(e){if(0===e.length)return[];const t=e.at(-1).bundleIndex;let a=e.length-1;for(let i=e.length-1;i>=0&&e[i].bundleIndex===t;i--)a=i;return e.splice(a)}spliceFirstEventBundle(e){if(0===e.length)return[];const t=e.at(0).bundleIndex;for(let a=1;a<e.length;a++)if(e[a].bundleIndex!==t)return e.splice(0,a);return e.splice(0)}assignBundleIndexToEvent(e){if(0===this.undoEvents.length)return void(e.bundleIndex=0);const t=this.undoEvents.at(-1),a=Math.abs(e.createdAt-t.createdAt);e.bundleIndex=a>75?t.bundleIndex+1:t.bundleIndex}}class Bi{updateItemLinksAndAttributes(e,t,a){try{const i=[],n={},s={};this.getLinksAndAttributes(e,i,n,s,t,a);for(const t in e.additionalUserAttributes)e.additionalUserAttributes.hasOwnProperty(t)&&(s[t]=e.additionalUserAttributes[t]);e.attributes=n,e.userAttributes=s,e.links=i}catch(e){throw console.error(e),new A(e)}}getLinksAndAttributes(e,t,a,i,n,s){e.fieldInstances.length&&this.retrieveLinksAndAttributesFromFieldInstances(e.fieldInstances,t,a,n,s),e.userFieldInstances.length&&this.retrieveLinksAndAttributesFromFieldInstances(e.userFieldInstances,t,i,n,s)}retrieveLinksAndAttributesFromFieldInstances(e,t,a,i,n){for(const s of e)switch(s.type){case"Link":if(s.value&&t){if(n&&s.hidden)continue;i?t.push({usage:s.name,to:s.value._id,item:s.value}):t.push({usage:s.name,to:s.value._id})}break;case"Attribute":a&&(a[s.name]=s.value);break;case"List":s.blocks&&this.traverseListFieldInstances(s.blocks,t,a,s.name,i);break;case"Tree":if(s.blocks){const e=s.blocks[0];e.blocks&&this.traverseTreeFieldInstance(e.blocks,t,a,s.name,i)}break;case"NodeGraph":if(s.blocks&&this.traverseTreeFieldInstance(s.blocks,t,a,s.name,i),a&&Array.isArray(s.connections)){let e=0;for(const t of s.connections){a[`${s.name}#connection[${e++}]`]={srcNode:t.srcNode,srcSlot:t.srcSlot,destNode:t.destNode,destSlot:t.destSlot}}}}}traverseTreeFieldInstance(e,t,a,i,n){let s=0;for(const r of e){const e=`${i}[${s}]`,o=e+"#type",l=e+"#id",u=e+"#posx",c=e+"#posy";a&&(a[e+"#usage"]="Block",a[o]=r.type,a[l]=r.id,void 0!==r.posX&&(a[u]=r.posX||0),void 0!==r.posY&&(a[c]=r.posY||0));for(const i of r.fields){const s=`${e}->${i.name}`;switch(i.type){case"Link":i.value&&t&&(n?t.push({usage:s,to:i.value._id,item:i.value}):t.push({usage:s,to:i.value._id}));break;case"List":i.blocks&&this.traverseListFieldInstances(i.blocks,t,a,s,n);break;case"Attribute":a&&(a[s]=i.value)}}r.scripts&&this.processScripts(r.scripts,t,a,e,n),r.blocks&&this.traverseTreeFieldInstance(r.blocks,t,a,e,n),s++}}traverseListFieldInstances(e,t,a,i,n){let s=0;for(const r of e){const e=`${i}[${s}]`;for(const i of r.fields){const s=`${e}->${i.name}`;switch(i.type){case"Link":if(i.value&&t){const e={usage:s,to:"object"==typeof i.value?i.value._id:i.value,item:null};n&&"object"===i.value&&(e.item=i.value),t.push(e)}break;case"Attribute":a&&(a[s]=i.value)}}s++}}processScripts(e,t,a,i,n){let s=0;for(const r of e){const e=`${i}#scripts[${s}]`,o=e+"#id",l=e+"#item";a&&(a[e+"#usage"]="Script",a[o]=r.id),t&&r.item.value&&(n?t.push({usage:l,to:r.item.value._id,item:r.item.value}):t.push({usage:l,to:r.item.value._id}));for(const i of r.fields){const s=`${e}->${i.name}`;if("Link"===i.type)i.value&&t&&(n?t.push({usage:s,to:i.value._id,item:i.value}):t.push({usage:s,to:i.value._id}));else a&&(a[s]=i.value)}s++}}}class Oi{apiClient;activeItem=void 0;rootItemId=void 0;loadingItems=new Map;loadedItems=new Map;itemInstances=new Map;resolvedPaths=new Map;jail;apiGateway;itemCache;linkableItemsCache;undoManager=new Ri(this);itemPreparator=new K(this);itemChangeProcessor=new Bi;usePublicApi;constructor(e,t){this.apiClient=t,this.apiGateway=new R(t),this.itemCache=new B(this.apiGateway),this.linkableItemsCache=new O(this.apiGateway,this.itemCache,e),this.usePublicApi=!!e,this.jail={active:!1,mountedFolders:[]},l.$on("item:rename",(e=>this.handleRename(e)))}_logGroup(e){}_logGroupEnd(){}_log(e){}getLoadedItems(){return Array.from(this.loadedItems.values())}getItemInstances(){return this.itemInstances}findLoadedItem(e){return this.loadedItems.get(e)}_handleError(e,t){throw console.error(e),new A("ItemRepo: "+t)}getUndoManager(){return this.undoManager}async createFieldsForItem(e,t,a){return this.itemPreparator.createFields(e,a,t,"",!1,a.attributes)}async createScriptsForItem(e,t=[],a,i=!0){const n=[];for(const i of t){if(!i.item)continue;const t=await this.loadItem(i.item);if(!t)continue;const s=new Y(void 0,e,a,t);n.push(s);for(const e of i.fields){const t=new z(s,e.name,e.value,a);s.addField(t)}}e.scripts=i?f.instance.proxyScriptArray(n,e,a):n}clear(){this.rootItemId=void 0,this.activeItem=void 0,this.linkableItemsCache.clear(),this.loadedItems.clear(),this.resolvedPaths.clear(),this.itemInstances.clear(),this.loadingItems.clear();this.apiClient.getCollab().endCollaboration()}removeBlock(e,t){t.blocks.removeObject(e),e.parent=void 0}traverseBlockPairs(e,t,a){a(e,t);for(let i=0;i<e.blocks.length&&i<t.blocks.length;i++)this.traverseBlockPairs(e.blocks[i],t.blocks[i],a)}copyScripts(e,t,a=!1){const i=new Map;this.traverseBlockPairs(e,t,((e,t)=>i.set(e.getId(),t.getId())));const n=[];return this.traverseBlockPairs(e,t,((e,t)=>{for(const s of e.scripts){const e=s.clone(i);a&&(e.deferInitCall=!0),t.scripts.push(e),n.push(e)}})),n}updateScriptFieldReferences(e,t){const a=new Map;this.traverseBlockPairs(e,t,((e,t)=>{a.set(e.id,t.id)})),this.updateScriptFieldReferencesFromMap(a,t)}updateScriptFieldReferencesFromMap(e,t){this.traverseBlocks((t=>{for(const a of t.scripts)for(const t of a.fields)e.has(t.value)&&(t.value=e.get(t.value))}),[t])}async createNewBlock(e,t,a){const i=new X(void 0,t,e.typeName,void 0,void 0,a),n=await this.createFieldsForItem(i,e.template,a);return i.setFields(n),i.blocks=f.instance.proxyBlockArray(i.blocks,i,a),await this.createScriptsForItem(i,void 0,a),this.addBlockToParent(i,t,a)}addBlockToParent(e,t,a){e.parent=t;const i=f.instance.proxyBlock(e,a);return t.blocks.push(i),i}async createNewListEntry(e,t,a){const i=new X(void 0,void 0,e.typeName,void 0,void 0,a),n=await this.createFieldsForItem(i,e.template,a);return i.setFields(n),i.blocks=f.instance.proxyListArray(i.blocks,t,a),f.instance.proxyBlock(i,a)}async createNewGraphNode(e,t,a,i,n){const s=new X(void 0,void 0,e.typeName,void 0,e.displayName,n),r=await this.itemPreparator.createFields(s,n,e.template,"",!0,n.attributes);return s.setFields(r),s.setInputs(e.inputs),s.setOutputs(e.outputs),s.setPosition(a,i),s.blocks=f.instance.proxyGraphBlockArray(s.blocks,t),this.addNodeToGraph(s,t,n),s}addNodeToGraph(e,t,a){const i=f.instance.proxyGraphBlock(e,a);t.blocks.push(i)}removeGraphNode(e,t){const a=[];for(const i of e.connections)i.srcNode!==t.id&&i.destNode!==t.id||a.push(i);for(const t of a)e.connections.removeObject(t);e.blocks.removeObject(t)}addGraphLink(e,t,a,i,n,s){e.connections.push(new j({srcNode:t,srcSlot:a,destNode:i,destSlot:n},s))}removeGraphLink(e,t,a,i,n){for(const s of e.connections)if(s.srcNode===t&&s.srcSlot===a&&s.destNode===i&&s.destSlot===n)return void e.connections.removeObject(s)}createNewScript(e,t=-1,a){t=t>=0?t:e.scripts.length;const i=new Y(void 0,e,a);return e.scripts.splice(t,0,i),i}removeScript(e,t){t.scripts.removeObject(e)}findBlock(e){for(const t of this.itemInstances.values())for(const a of t.values()){const t=a.findBlock(e);if(t)return t}return null}async loadPackage(e){const t=await fetch(e),a=await t.blob();this.apiClient.getCollab().endCollaboration();const i=new G({_id:"root",name:"Root package",type:"Package",links:[],attributes:{},fields:[],readOnly:!0,isPackaged:!1}),n=await Ii(a,i._id);Ci(i._id,structuredClone(n));const s=Object.values(n.metadata).reverse();for(const e of s)e._id===n.rootItem._id&&(i.packageContent=e,i.packageType=e.type);return await this._linkAndPrepareItems(s),i.packageContent=this.loadedItems.get(n.rootItem._id),this.activeItem=i,i}createPackageItemUrl(e){const t=ki(e);return t?URL.createObjectURL(t.blob):null}revokePackageItemUrl(e){URL.revokeObjectURL(e)}async _loadPackageContentRecursively(e,t){t("Loading from cache",0);const a=await this.apiClient.itemCache.addItemToCache(e._id,void 0,e.hash,(function(e,a,i){t("Loading from cloud",.9*e,i,a)})),i=await(await fetch(a.objectUrl)).blob();t("Unpacking",90);const n=await Ii(i,e._id);Ci(e._id,structuredClone(n));const s=Object.values(n.metadata).reverse();for(const t of s)t._id===n.rootItem._id&&(e.packageContent=t,e.packageType=t.type);return s}createNewItemInstance(e){const t=this.loadedItems.get(e);if(!t)return console.error(`Tried creating new instance of item, but it was not found: ${e}`),null;const a=t.clone(!0);return this._addItemInstance(a),a}_addLoadedItem(e){this.loadedItems.set(e._id,e),this._addItemInstance(e)}_addItemInstance(e){let t=this.itemInstances.get(e._id);t||(t=new Map,this.itemInstances.set(e._id,t)),t.set(e.instanceId,e)}async loadItemByRelativePath(e,t,a={}){try{const i=Vi(e);let n;if(i){const e=t.split("/"),a=e.pop();let s=Ni(i.folder._id);for(const t of e)if(s=".."===t?Ni(s.parent):Mi(t,s._id),!s)return;const r=Ti(a,s._id);n=r?._id}else n=await this.resolveRelativePath(t,e);return this.loadItem(n,a)}catch(e){this._handleError(e,`Unable to load item by relative path: ${t}: ${e}`)}}async _loadItemFromApi(e,t={}){let a;if(this.apiGateway.start(),t.recursive)if(this.usePublicApi)a=await this.apiGateway.call("_loadItemFromApi","getItemPublicRecursive",e,!0),a.forEach((e=>e.public=!0));else try{a=await this.apiGateway.call("_loadItemFromApi","getItemAggregatedRecursive",e,{withAttachmentInfo:!0,noFields:!0})}catch{a=await this.apiGateway.call("_loadItemFromApi","getItemPublicRecursive",e,!0),a.forEach((e=>e.public=!0))}else{let t;if(this.usePublicApi)t=await this.apiGateway.call("_loadItemFromApi","getItemPublicRecursive",e),t.public=!0;else try{t=await this.apiGateway.call("_loadItemFromApi","getItemAggregated",e,{noFields:!0})}catch{t=await this.apiGateway.call("_loadItemFromApi","getItemPublicRecursive",e),t.public=!0}a=[t]}return this.apiGateway.end(),a}_relinkItems(e,t){for(const a of e){if(Array.isArray(a.links))for(const e of a.links)e.item=t.get(e.to),e.item||e.stopRecursion||console.warn(`Missing link in item '${a.name}' (${a._id}) to: ${e.to} with usage ${e.usage}`);a.packageContent&&(a.packageContent=t.get(a.packageContent._id))}}async loadItem(e,t={}){let a,i;try{let n;if(n=this.loadedItems.get(e),n)return n;if(n=this.loadingItems.get(e),n)return n;const s=new Promise(((e,t)=>{a=e,i=t}));if(this.loadingItems.set(e,s),n=await this._loadItemInternal(e,t),a(n),!this.activeItem&&n){if(this.rootItemId=e,this.activeItem=n,t.withCollaboration){const e=this.apiClient.getCollab();await e.startCollaboration(n)}await l.$emit("itemRepo:itemLoaded",n)}return n}catch(t){return this._handleError(t,`Unable to load item ${e}: ${t}`),void i(void 0)}finally{this.loadingItems.delete(e)}}async _loadItemInternal(e,t={}){const a=(e,a,i=0,n=0)=>{"function"==typeof t.progressCallback&&t.progressCallback({phase:e,percent:a,bytesTotal:i,bytesLoaded:n})};a("Fetching metadata",1);let i=await this._loadItemFromApi(e,t);if(i=i.filter((e=>!this.loadedItems.has(e._id))),0===i.length)return console.log("After loading the item, it turns out we have them all already loaded! This should not happen!"),this.loadedItems.get(e);const n=i[0]._id;for(const e of i)if("Package"===e.type){const t=await this._loadPackageContentRecursively(e,a);for(const e of t)i.push(e)}a("Preparing data",100),await this._linkAndPrepareItems(i);return this.loadedItems.get(n)}async _linkAndPrepareItems(e){const t=new Map;for(const a of e)t.set(a._id,a);const a=new Map([...this.loadedItems,...t]);this._relinkItems(e,a);const i=[],n=()=>{const e=t.values().next().value;return t.delete(e._id),this._log(`- Fetched next item ${e.name} (${e._id})`),e},s=async e=>{this._logGroup(`- Preparing item ${e.name} (${e._id})`);const t=await this.itemPreparator.prepare(e);return i.push(t),this._addLoadedItem(t),this._logGroupEnd(),t};for(this.itemPreparator.setItemFetcher((async e=>{this._logGroup(`- Requesting item ${e.name} (${e._id})`);let a=this.loadedItems.get(e._id);if(a)return this._log("- Already prepared. Returning."),this._logGroupEnd(),a;const i=t.get(e._id);return i?(t.delete(e._id),this._log("- Don't have it yet. Preparing..."),a=await s(i),this._log("- Now prepared. Returning."),this._logGroupEnd(),a):(console.error("ItemFetcher: Could not find requested item: "+e._id,t,this.loadedItems),null)}));t.size>0;){let e=n();await s(e)}return this._relinkItems(i,this.loadedItems),i}async resolveRelativePath(e,t=null){if(!(t=t||this.activeItem?._id||null))return null;const a=`${t}#${e}`;let i;return i=this.resolvedPaths.has(a)?this.resolvedPaths.get(a):this.usePublicApi?await this.apiClient.publicResolveRelativeItem(t,e):await this.apiClient.resolveRelativeItem(t,e),this.resolvedPaths.set(a,i),i}async traverseItems(e,t=void 0){if("function"!=typeof e)return;const a=this,i=new Map;await async function t(n){if(!n)return;if(i.has(n._id))return;i.set(n._id,!0);const s=e(n);if(s&&s.then&&await s,Array.isArray(n.links))for(const e of n.links)if(e.item)await t(e.item);else if(e.to)try{const i=await a.loadItem(e.to);await t(i)}catch{console.warn(`Could not load additional item ${e.to} so cannot traverse it. Probably dead link!`)}}(t||this.activeItem)}async traverseBlocks(e,t){for(const a of t){const t=e(a);t&&t.then&&await t,Array.isArray(a.blocks)&&a.blocks?.length&&await this.traverseBlocks(e,a.blocks)}}async traverseFieldInstances(e,t){const a=this;t=t||this.activeItem?.fieldInstances||[];for(const i of t){const t=e(i);t&&t.then&&await t,Array.isArray(i.blocks)&&await this.traverseBlocks((async function(t){Array.isArray(t.fields)&&t.fields?.length&&await a.traverseFieldInstances(e,t.fields)}),i.blocks)}}async replaceLink(e,t){const a=this,i=await a.loadItem(t,{recursive:!0});await this.traverseItems((async function(n){Array.isArray(n.fieldInstances)&&n.fieldInstances.length&&await a.traverseFieldInstances((async function(t){"Link"===t.type&&t.value&&t.value._id===e&&(t.value=i)}),n.fieldInstances);for(const a of n.links)a.to===e&&(a.to=t,a.item=i)}))}saveItem(e){return e._id&&e.isDirty?(this.itemChangeProcessor.updateItemLinksAndAttributes(e,!1,!0),e.version||(e.version={major:0,minor:0,revision:1}),this.apiClient.updateItem({_id:e._id,name:e.name,attributes:e.attributes,userAttributes:e.userAttributes,links:e.links,tags:e.tags,contributors:e.contributors,description:e.description,shortDescription:e.shortDescription,categories:e.categories,license:e.license,version:e.version,allowConversation:e.allowConversation,visibility:e.visibility}).then((t=>(JSON.stringify(e.version)===JSON.stringify(t.version)?console.log(`Saved item ${e.name}. New version: ${e.version.major}.${e.version.minor}.${e.version.revision}`):console.log(`Saved item ${e.name}. Version ${e.version.major}.${e.version.minor}.${e.version.revision} -> ${t.version.major}.${t.version.minor}.${t.version.revision}`),t&&t.version&&(e.version=t.version),e.isDirty=!1,this.itemChangeProcessor.updateItemLinksAndAttributes(e,!0,!1),e))).catch((function(t){throw console.error(`Error saving item ${e.name}`,t,e),t}))):null}async save(){console.log("Saving changes in loaded items...");const e=[];for(const t of this.loadedItems.values()){const a=this.saveItem(t);a&&e.push(a)}if(0!==e.length){let t=0;for(const a of e)a.then((function(a){l.$emit("itemRepo:itemSaved",{item:a,progress:++t,total:e.length})}));return Promise.all(e).then((function(){console.log("Saved successfully"),l.$emit("itemRepo:itemsSaved")})).catch((function(e){console.error("Error saving:",e)}))}console.log("No changes detected.")}async existsUnsavedChanges(){if(!this.activeItem)return!1;for(const e of this.loadedItems.values())if(e._id&&e.isDirty)return!0;return!1}handleRename({id:e,newName:t}){for(const a of this.itemInstances.values())for(const i of a.values())i._id===e&&(i.name=t)}}var $i,Ui={exports:{}};
4
+ /*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */function Q(e){let t=e.length;for(;--t>=0;)e[t]=0}const ee=256,te=286,ae=30,ie=15,ne=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),se=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),re=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),oe=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),le=new Array(576);Q(le);const ue=new Array(60);Q(ue);const ce=new Array(512);Q(ce);const de=new Array(256);Q(de);const pe=new Array(29);Q(pe);const he=new Array(ae);function me(e,t,a,i,n){this.static_tree=e,this.extra_bits=t,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=e&&e.length}let fe,ye,ge;function be(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}Q(he);const we=e=>e<256?ce[e]:ce[256+(e>>>7)],_e=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},ve=(e,t,a)=>{e.bi_valid>16-a?(e.bi_buf|=t<<e.bi_valid&65535,_e(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=a-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=a)},Ae=(e,t,a)=>{ve(e,a[2*t],a[2*t+1])},ke=(e,t)=>{let a=0;do{a|=1&e,e>>>=1,a<<=1}while(--t>0);return a>>>1},Se=(e,t,a)=>{const i=new Array(16);let n,s,r=0;for(n=1;n<=ie;n++)r=r+a[n-1]<<1,i[n]=r;for(s=0;s<=t;s++){let t=e[2*s+1];0!==t&&(e[2*s]=ke(i[t]++,t))}},Ne=e=>{let t;for(t=0;t<te;t++)e.dyn_ltree[2*t]=0;for(t=0;t<ae;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Me=e=>{e.bi_valid>8?_e(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Te=(e,t,a,i)=>{const n=2*t,s=2*a;return e[n]<e[s]||e[n]===e[s]&&i[t]<=i[a]},xe=(e,t,a)=>{const i=e.heap[a];let n=a<<1;for(;n<=e.heap_len&&(n<e.heap_len&&Te(t,e.heap[n+1],e.heap[n],e.depth)&&n++,!Te(t,i,e.heap[n],e.depth));)e.heap[a]=e.heap[n],a=n,n<<=1;e.heap[a]=i},Ve=(e,t,a)=>{let i,n,s,r,o=0;if(0!==e.sym_next)do{i=255&e.pending_buf[e.sym_buf+o++],i+=(255&e.pending_buf[e.sym_buf+o++])<<8,n=e.pending_buf[e.sym_buf+o++],0===i?Ae(e,n,t):(s=de[n],Ae(e,s+ee+1,t),r=ne[s],0!==r&&(n-=pe[s],ve(e,n,r)),i--,s=we(i),Ae(e,s,a),r=se[s],0!==r&&(i-=he[s],ve(e,i,r)))}while(o<e.sym_next);Ae(e,256,t)},Ce=(e,t)=>{const a=t.dyn_tree,i=t.stat_desc.static_tree,n=t.stat_desc.has_stree,s=t.stat_desc.elems;let r,o,l,u=-1;for(e.heap_len=0,e.heap_max=573,r=0;r<s;r++)0!==a[2*r]?(e.heap[++e.heap_len]=u=r,e.depth[r]=0):a[2*r+1]=0;for(;e.heap_len<2;)l=e.heap[++e.heap_len]=u<2?++u:0,a[2*l]=1,e.depth[l]=0,e.opt_len--,n&&(e.static_len-=i[2*l+1]);for(t.max_code=u,r=e.heap_len>>1;r>=1;r--)xe(e,a,r);l=s;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],xe(e,a,1),o=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=o,a[2*l]=a[2*r]+a[2*o],e.depth[l]=(e.depth[r]>=e.depth[o]?e.depth[r]:e.depth[o])+1,a[2*r+1]=a[2*o+1]=l,e.heap[1]=l++,xe(e,a,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const a=t.dyn_tree,i=t.max_code,n=t.stat_desc.static_tree,s=t.stat_desc.has_stree,r=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,l=t.stat_desc.max_length;let u,c,d,p,h,m,f=0;for(p=0;p<=ie;p++)e.bl_count[p]=0;for(a[2*e.heap[e.heap_max]+1]=0,u=e.heap_max+1;u<573;u++)c=e.heap[u],p=a[2*a[2*c+1]+1]+1,p>l&&(p=l,f++),a[2*c+1]=p,c>i||(e.bl_count[p]++,h=0,c>=o&&(h=r[c-o]),m=a[2*c],e.opt_len+=m*(p+h),s&&(e.static_len+=m*(n[2*c+1]+h)));if(0!==f){do{for(p=l-1;0===e.bl_count[p];)p--;e.bl_count[p]--,e.bl_count[p+1]+=2,e.bl_count[l]--,f-=2}while(f>0);for(p=l;0!==p;p--)for(c=e.bl_count[p];0!==c;)d=e.heap[--u],d>i||(a[2*d+1]!==p&&(e.opt_len+=(p-a[2*d+1])*a[2*d],a[2*d+1]=p),c--)}})(e,t),Se(a,u,e.bl_count)},Ie=(e,t,a)=>{let i,n,s=-1,r=t[1],o=0,l=7,u=4;for(0===r&&(l=138,u=3),t[2*(a+1)+1]=65535,i=0;i<=a;i++)n=r,r=t[2*(i+1)+1],++o<l&&n===r||(o<u?e.bl_tree[2*n]+=o:0!==n?(n!==s&&e.bl_tree[2*n]++,e.bl_tree[32]++):o<=10?e.bl_tree[34]++:e.bl_tree[36]++,o=0,s=n,0===r?(l=138,u=3):n===r?(l=6,u=3):(l=7,u=4))},Fe=(e,t,a)=>{let i,n,s=-1,r=t[1],o=0,l=7,u=4;for(0===r&&(l=138,u=3),i=0;i<=a;i++)if(n=r,r=t[2*(i+1)+1],!(++o<l&&n===r)){if(o<u)do{Ae(e,n,e.bl_tree)}while(0!=--o);else 0!==n?(n!==s&&(Ae(e,n,e.bl_tree),o--),Ae(e,16,e.bl_tree),ve(e,o-3,2)):o<=10?(Ae(e,17,e.bl_tree),ve(e,o-3,3)):(Ae(e,18,e.bl_tree),ve(e,o-11,7));o=0,s=n,0===r?(l=138,u=3):n===r?(l=6,u=3):(l=7,u=4)}};let Ee=!1;const De=(e,t,a,i)=>{ve(e,0+(i?1:0),3),Me(e),_e(e,a),_e(e,~a),a&&e.pending_buf.set(e.window.subarray(t,t+a),e.pending),e.pending+=a};var Pe=e=>{Ee||((()=>{let e,t,a,i,n;const s=new Array(16);for(a=0,i=0;i<28;i++)for(pe[i]=a,e=0;e<1<<ne[i];e++)de[a++]=i;for(de[a-1]=i,n=0,i=0;i<16;i++)for(he[i]=n,e=0;e<1<<se[i];e++)ce[n++]=i;for(n>>=7;i<ae;i++)for(he[i]=n<<7,e=0;e<1<<se[i]-7;e++)ce[256+n++]=i;for(t=0;t<=ie;t++)s[t]=0;for(e=0;e<=143;)le[2*e+1]=8,e++,s[8]++;for(;e<=255;)le[2*e+1]=9,e++,s[9]++;for(;e<=279;)le[2*e+1]=7,e++,s[7]++;for(;e<=287;)le[2*e+1]=8,e++,s[8]++;for(Se(le,287,s),e=0;e<ae;e++)ue[2*e+1]=5,ue[2*e]=ke(e,5);fe=new me(le,ne,257,te,ie),ye=new me(ue,se,0,ae,ie),ge=new me(new Array(0),re,0,19,7)})(),Ee=!0),e.l_desc=new be(e.dyn_ltree,fe),e.d_desc=new be(e.dyn_dtree,ye),e.bl_desc=new be(e.bl_tree,ge),e.bi_buf=0,e.bi_valid=0,Ne(e)},Le=(e,t,a,i)=>{let n,s,r=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,a=4093624447;for(t=0;t<=31;t++,a>>>=1)if(1&a&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<ee;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),Ce(e,e.l_desc),Ce(e,e.d_desc),r=(e=>{let t;for(Ie(e,e.dyn_ltree,e.l_desc.max_code),Ie(e,e.dyn_dtree,e.d_desc.max_code),Ce(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*oe[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),n=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=n&&(n=s)):n=s=a+5,a+4<=n&&-1!==t?De(e,t,a,i):4===e.strategy||s===n?(ve(e,2+(i?1:0),3),Ve(e,le,ue)):(ve(e,4+(i?1:0),3),((e,t,a,i)=>{let n;for(ve(e,t-257,5),ve(e,a-1,5),ve(e,i-4,4),n=0;n<i;n++)ve(e,e.bl_tree[2*oe[n]+1],3);Fe(e,e.dyn_ltree,t-1),Fe(e,e.dyn_dtree,a-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,r+1),Ve(e,e.dyn_ltree,e.dyn_dtree)),Ne(e),i&&Me(e)},Re={_tr_init:Pe,_tr_stored_block:De,_tr_flush_block:Le,_tr_tally:(e,t,a)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=a,0===t?e.dyn_ltree[2*a]++:(e.matches++,t--,e.dyn_ltree[2*(de[a]+ee+1)]++,e.dyn_dtree[2*we(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{ve(e,2,3),Ae(e,256,le),(e=>{16===e.bi_valid?(_e(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}};var Be=(e,t,a,i)=>{let n=65535&e,s=e>>>16&65535,r=0;for(;0!==a;){r=a>2e3?2e3:a,a-=r;do{n=n+t[i++]|0,s=s+n|0}while(--r);n%=65521,s%=65521}return n|s<<16};const Oe=new Uint32Array((()=>{let e,t=[];for(var a=0;a<256;a++){e=a;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[a]=e}return t})());var $e=(e,t,a,i)=>{const n=Oe,s=i+a;e^=-1;for(let a=i;a<s;a++)e=e>>>8^n[255&(e^t[a])];return~e},Ue={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},je={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:ze,_tr_stored_block:We,_tr_flush_block:Ye,_tr_tally:He,_tr_align:Ge}=Re,{Z_NO_FLUSH:qe,Z_PARTIAL_FLUSH:Ze,Z_FULL_FLUSH:Je,Z_FINISH:Ke,Z_BLOCK:Xe,Z_OK:Qe,Z_STREAM_END:et,Z_STREAM_ERROR:tt,Z_DATA_ERROR:at,Z_BUF_ERROR:it,Z_DEFAULT_COMPRESSION:nt,Z_FILTERED:st,Z_HUFFMAN_ONLY:rt,Z_RLE:ot,Z_FIXED:lt,Z_DEFAULT_STRATEGY:ut,Z_UNKNOWN:ct,Z_DEFLATED:dt}=je,pt=258,ht=262,mt=42,ft=113,yt=666,gt=(e,t)=>(e.msg=Ue[t],t),bt=e=>2*e-(e>4?9:0),wt=e=>{let t=e.length;for(;--t>=0;)e[t]=0},_t=e=>{let t,a,i,n=e.w_size;t=e.hash_size,i=t;do{a=e.head[--i],e.head[i]=a>=n?a-n:0}while(--t);t=n,i=t;do{a=e.prev[--i],e.prev[i]=a>=n?a-n:0}while(--t)};let vt=(e,t,a)=>(t<<e.hash_shift^a)&e.hash_mask;const At=e=>{const t=e.state;let a=t.pending;a>e.avail_out&&(a=e.avail_out),0!==a&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+a),e.next_out),e.next_out+=a,t.pending_out+=a,e.total_out+=a,e.avail_out-=a,t.pending-=a,0===t.pending&&(t.pending_out=0))},kt=(e,t)=>{Ye(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,At(e.strm)},St=(e,t)=>{e.pending_buf[e.pending++]=t},Nt=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Mt=(e,t,a,i)=>{let n=e.avail_in;return n>i&&(n=i),0===n?0:(e.avail_in-=n,t.set(e.input.subarray(e.next_in,e.next_in+n),a),1===e.state.wrap?e.adler=Be(e.adler,t,n,a):2===e.state.wrap&&(e.adler=$e(e.adler,t,n,a)),e.next_in+=n,e.total_in+=n,n)},Tt=(e,t)=>{let a,i,n=e.max_chain_length,s=e.strstart,r=e.prev_length,o=e.nice_match;const l=e.strstart>e.w_size-ht?e.strstart-(e.w_size-ht):0,u=e.window,c=e.w_mask,d=e.prev,p=e.strstart+pt;let h=u[s+r-1],m=u[s+r];e.prev_length>=e.good_match&&(n>>=2),o>e.lookahead&&(o=e.lookahead);do{if(a=t,u[a+r]===m&&u[a+r-1]===h&&u[a]===u[s]&&u[++a]===u[s+1]){s+=2,a++;do{}while(u[++s]===u[++a]&&u[++s]===u[++a]&&u[++s]===u[++a]&&u[++s]===u[++a]&&u[++s]===u[++a]&&u[++s]===u[++a]&&u[++s]===u[++a]&&u[++s]===u[++a]&&s<p);if(i=pt-(p-s),s=p-pt,i>r){if(e.match_start=t,r=i,i>=o)break;h=u[s+r-1],m=u[s+r]}}}while((t=d[t&c])>l&&0!=--n);return r<=e.lookahead?r:e.lookahead},xt=e=>{const t=e.w_size;let a,i,n;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-ht)&&(e.window.set(e.window.subarray(t,t+t-i),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),_t(e),i+=t),0===e.strm.avail_in)break;if(a=Mt(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=a,e.lookahead+e.insert>=3)for(n=e.strstart-e.insert,e.ins_h=e.window[n],e.ins_h=vt(e,e.ins_h,e.window[n+1]);e.insert&&(e.ins_h=vt(e,e.ins_h,e.window[n+3-1]),e.prev[n&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=n,n++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<ht&&0!==e.strm.avail_in)},Vt=(e,t)=>{let a,i,n,s=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r=0,o=e.strm.avail_in;do{if(a=65535,n=e.bi_valid+42>>3,e.strm.avail_out<n)break;if(n=e.strm.avail_out-n,i=e.strstart-e.block_start,a>i+e.strm.avail_in&&(a=i+e.strm.avail_in),a>n&&(a=n),a<s&&(0===a&&t!==Ke||t===qe||a!==i+e.strm.avail_in))break;r=t===Ke&&a===i+e.strm.avail_in?1:0,We(e,0,0,r),e.pending_buf[e.pending-4]=a,e.pending_buf[e.pending-3]=a>>8,e.pending_buf[e.pending-2]=~a,e.pending_buf[e.pending-1]=~a>>8,At(e.strm),i&&(i>a&&(i=a),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,a-=i),a&&(Mt(e.strm,e.strm.output,e.strm.next_out,a),e.strm.next_out+=a,e.strm.avail_out-=a,e.strm.total_out+=a)}while(0===r);return o-=e.strm.avail_in,o&&(o>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=o&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-o,e.strm.next_in),e.strstart),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),r?4:t!==qe&&t!==Ke&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(n=e.window_size-e.strstart,e.strm.avail_in>n&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,n+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),n>e.strm.avail_in&&(n=e.strm.avail_in),n&&(Mt(e.strm,e.window,e.strstart,n),e.strstart+=n,e.insert+=n>e.w_size-e.insert?e.w_size-e.insert:n),e.high_water<e.strstart&&(e.high_water=e.strstart),n=e.bi_valid+42>>3,n=e.pending_buf_size-n>65535?65535:e.pending_buf_size-n,s=n>e.w_size?e.w_size:n,i=e.strstart-e.block_start,(i>=s||(i||t===Ke)&&t!==qe&&0===e.strm.avail_in&&i<=n)&&(a=i>n?n:i,r=t===Ke&&0===e.strm.avail_in&&a===i?1:0,We(e,e.block_start,a,r),e.block_start+=a,At(e.strm)),r?3:1)},Ct=(e,t)=>{let a,i;for(;;){if(e.lookahead<ht){if(xt(e),e.lookahead<ht&&t===qe)return 1;if(0===e.lookahead)break}if(a=0,e.lookahead>=3&&(e.ins_h=vt(e,e.ins_h,e.window[e.strstart+3-1]),a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==a&&e.strstart-a<=e.w_size-ht&&(e.match_length=Tt(e,a)),e.match_length>=3)if(i=He(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=vt(e,e.ins_h,e.window[e.strstart+3-1]),a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=vt(e,e.ins_h,e.window[e.strstart+1]);else i=He(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(kt(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===Ke?(kt(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(kt(e,!1),0===e.strm.avail_out)?1:2},It=(e,t)=>{let a,i,n;for(;;){if(e.lookahead<ht){if(xt(e),e.lookahead<ht&&t===qe)return 1;if(0===e.lookahead)break}if(a=0,e.lookahead>=3&&(e.ins_h=vt(e,e.ins_h,e.window[e.strstart+3-1]),a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==a&&e.prev_length<e.max_lazy_match&&e.strstart-a<=e.w_size-ht&&(e.match_length=Tt(e,a),e.match_length<=5&&(e.strategy===st||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-3,i=He(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=n&&(e.ins_h=vt(e,e.ins_h,e.window[e.strstart+3-1]),a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,i&&(kt(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(i=He(e,0,e.window[e.strstart-1]),i&&kt(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=He(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===Ke?(kt(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(kt(e,!1),0===e.strm.avail_out)?1:2};function Ft(e,t,a,i,n){this.good_length=e,this.max_lazy=t,this.nice_length=a,this.max_chain=i,this.func=n}const Et=[new Ft(0,0,0,0,Vt),new Ft(4,4,8,4,Ct),new Ft(4,5,16,8,Ct),new Ft(4,6,32,32,Ct),new Ft(4,4,16,16,It),new Ft(8,16,32,32,It),new Ft(8,16,128,128,It),new Ft(8,32,128,256,It),new Ft(32,128,258,1024,It),new Ft(32,258,258,4096,It)];function Dt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=dt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),wt(this.dyn_ltree),wt(this.dyn_dtree),wt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),wt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),wt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Pt=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==mt&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==ft&&t.status!==yt?1:0},Lt=e=>{if(Pt(e))return gt(e,tt);e.total_in=e.total_out=0,e.data_type=ct;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?mt:ft,e.adler=2===t.wrap?0:1,t.last_flush=-2,ze(t),Qe},Rt=e=>{const t=Lt(e);var a;return t===Qe&&((a=e.state).window_size=2*a.w_size,wt(a.head),a.max_lazy_match=Et[a.level].max_lazy,a.good_match=Et[a.level].good_length,a.nice_match=Et[a.level].nice_length,a.max_chain_length=Et[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0),t},Bt=(e,t,a,i,n,s)=>{if(!e)return tt;let r=1;if(t===nt&&(t=6),i<0?(r=0,i=-i):i>15&&(r=2,i-=16),n<1||n>9||a!==dt||i<8||i>15||t<0||t>9||s<0||s>lt||8===i&&1!==r)return gt(e,tt);8===i&&(i=9);const o=new Dt;return e.state=o,o.strm=e,o.status=mt,o.wrap=r,o.gzhead=null,o.w_bits=i,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=n+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new Uint8Array(2*o.w_size),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<n+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=3*(o.lit_bufsize-1),o.level=t,o.strategy=s,o.method=a,Rt(e)};var Ot=(e,t)=>{if(Pt(e)||t>Xe||t<0)return e?gt(e,tt):tt;const a=e.state;if(!e.output||0!==e.avail_in&&!e.input||a.status===yt&&t!==Ke)return gt(e,0===e.avail_out?it:tt);const i=a.last_flush;if(a.last_flush=t,0!==a.pending){if(At(e),0===e.avail_out)return a.last_flush=-1,Qe}else if(0===e.avail_in&&bt(t)<=bt(i)&&t!==Ke)return gt(e,it);if(a.status===yt&&0!==e.avail_in)return gt(e,it);if(a.status===mt&&0===a.wrap&&(a.status=ft),a.status===mt){let t=dt+(a.w_bits-8<<4)<<8,i=-1;if(i=a.strategy>=rt||a.level<2?0:a.level<6?1:6===a.level?2:3,t|=i<<6,0!==a.strstart&&(t|=32),t+=31-t%31,Nt(a,t),0!==a.strstart&&(Nt(a,e.adler>>>16),Nt(a,65535&e.adler)),e.adler=1,a.status=ft,At(e),0!==a.pending)return a.last_flush=-1,Qe}if(57===a.status)if(e.adler=0,St(a,31),St(a,139),St(a,8),a.gzhead)St(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),St(a,255&a.gzhead.time),St(a,a.gzhead.time>>8&255),St(a,a.gzhead.time>>16&255),St(a,a.gzhead.time>>24&255),St(a,9===a.level?2:a.strategy>=rt||a.level<2?4:0),St(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(St(a,255&a.gzhead.extra.length),St(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(e.adler=$e(e.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69;else if(St(a,0),St(a,0),St(a,0),St(a,0),St(a,0),St(a,9===a.level?2:a.strategy>=rt||a.level<2?4:0),St(a,3),a.status=ft,At(e),0!==a.pending)return a.last_flush=-1,Qe;if(69===a.status){if(a.gzhead.extra){let t=a.pending,i=(65535&a.gzhead.extra.length)-a.gzindex;for(;a.pending+i>a.pending_buf_size;){let n=a.pending_buf_size-a.pending;if(a.pending_buf.set(a.gzhead.extra.subarray(a.gzindex,a.gzindex+n),a.pending),a.pending=a.pending_buf_size,a.gzhead.hcrc&&a.pending>t&&(e.adler=$e(e.adler,a.pending_buf,a.pending-t,t)),a.gzindex+=n,At(e),0!==a.pending)return a.last_flush=-1,Qe;t=0,i-=n}let n=new Uint8Array(a.gzhead.extra);a.pending_buf.set(n.subarray(a.gzindex,a.gzindex+i),a.pending),a.pending+=i,a.gzhead.hcrc&&a.pending>t&&(e.adler=$e(e.adler,a.pending_buf,a.pending-t,t)),a.gzindex=0}a.status=73}if(73===a.status){if(a.gzhead.name){let t,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(e.adler=$e(e.adler,a.pending_buf,a.pending-i,i)),At(e),0!==a.pending)return a.last_flush=-1,Qe;i=0}t=a.gzindex<a.gzhead.name.length?255&a.gzhead.name.charCodeAt(a.gzindex++):0,St(a,t)}while(0!==t);a.gzhead.hcrc&&a.pending>i&&(e.adler=$e(e.adler,a.pending_buf,a.pending-i,i)),a.gzindex=0}a.status=91}if(91===a.status){if(a.gzhead.comment){let t,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(e.adler=$e(e.adler,a.pending_buf,a.pending-i,i)),At(e),0!==a.pending)return a.last_flush=-1,Qe;i=0}t=a.gzindex<a.gzhead.comment.length?255&a.gzhead.comment.charCodeAt(a.gzindex++):0,St(a,t)}while(0!==t);a.gzhead.hcrc&&a.pending>i&&(e.adler=$e(e.adler,a.pending_buf,a.pending-i,i))}a.status=103}if(103===a.status){if(a.gzhead.hcrc){if(a.pending+2>a.pending_buf_size&&(At(e),0!==a.pending))return a.last_flush=-1,Qe;St(a,255&e.adler),St(a,e.adler>>8&255),e.adler=0}if(a.status=ft,At(e),0!==a.pending)return a.last_flush=-1,Qe}if(0!==e.avail_in||0!==a.lookahead||t!==qe&&a.status!==yt){let i=0===a.level?Vt(a,t):a.strategy===rt?((e,t)=>{let a;for(;;){if(0===e.lookahead&&(xt(e),0===e.lookahead)){if(t===qe)return 1;break}if(e.match_length=0,a=He(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,a&&(kt(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Ke?(kt(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(kt(e,!1),0===e.strm.avail_out)?1:2})(a,t):a.strategy===ot?((e,t)=>{let a,i,n,s;const r=e.window;for(;;){if(e.lookahead<=pt){if(xt(e),e.lookahead<=pt&&t===qe)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=e.strstart-1,i=r[n],i===r[++n]&&i===r[++n]&&i===r[++n])){s=e.strstart+pt;do{}while(i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&n<s);e.match_length=pt-(s-n),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(a=He(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(a=He(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),a&&(kt(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Ke?(kt(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(kt(e,!1),0===e.strm.avail_out)?1:2})(a,t):Et[a.level].func(a,t);if(3!==i&&4!==i||(a.status=yt),1===i||3===i)return 0===e.avail_out&&(a.last_flush=-1),Qe;if(2===i&&(t===Ze?Ge(a):t!==Xe&&(We(a,0,0,!1),t===Je&&(wt(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),At(e),0===e.avail_out))return a.last_flush=-1,Qe}return t!==Ke?Qe:a.wrap<=0?et:(2===a.wrap?(St(a,255&e.adler),St(a,e.adler>>8&255),St(a,e.adler>>16&255),St(a,e.adler>>24&255),St(a,255&e.total_in),St(a,e.total_in>>8&255),St(a,e.total_in>>16&255),St(a,e.total_in>>24&255)):(Nt(a,e.adler>>>16),Nt(a,65535&e.adler)),At(e),a.wrap>0&&(a.wrap=-a.wrap),0!==a.pending?Qe:et)},$t={deflateInit:(e,t)=>Bt(e,t,dt,15,8,ut),deflateInit2:Bt,deflateReset:Rt,deflateResetKeep:Lt,deflateSetHeader:(e,t)=>Pt(e)||2!==e.state.wrap?tt:(e.state.gzhead=t,Qe),deflate:Ot,deflateEnd:e=>{if(Pt(e))return tt;const t=e.state.status;return e.state=null,t===ft?gt(e,at):Qe},deflateSetDictionary:(e,t)=>{let a=t.length;if(Pt(e))return tt;const i=e.state,n=i.wrap;if(2===n||1===n&&i.status!==mt||i.lookahead)return tt;if(1===n&&(e.adler=Be(e.adler,t,a,0)),i.wrap=0,a>=i.w_size){0===n&&(wt(i.head),i.strstart=0,i.block_start=0,i.insert=0);let e=new Uint8Array(i.w_size);e.set(t.subarray(a-i.w_size,a),0),t=e,a=i.w_size}const s=e.avail_in,r=e.next_in,o=e.input;for(e.avail_in=a,e.next_in=0,e.input=t,xt(i);i.lookahead>=3;){let e=i.strstart,t=i.lookahead-2;do{i.ins_h=vt(i,i.ins_h,i.window[e+3-1]),i.prev[e&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=e,e++}while(--t);i.strstart=e,i.lookahead=2,xt(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,e.next_in=r,e.input=o,e.avail_in=s,i.wrap=n,Qe},deflateInfo:"pako deflate (from Nodeca project)"};const Ut=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var jt=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const a=t.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(const t in a)Ut(a,t)&&(e[t]=a[t])}}return e},zt=e=>{let t=0;for(let a=0,i=e.length;a<i;a++)t+=e[a].length;const a=new Uint8Array(t);for(let t=0,i=0,n=e.length;t<n;t++){let n=e[t];a.set(n,i),i+=n.length}return a};let Wt=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){Wt=!1}const Yt=new Uint8Array(256);for(let e=0;e<256;e++)Yt[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Yt[254]=Yt[254]=1;var Ht=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,a,i,n,s,r=e.length,o=0;for(n=0;n<r;n++)a=e.charCodeAt(n),55296==(64512&a)&&n+1<r&&(i=e.charCodeAt(n+1),56320==(64512&i)&&(a=65536+(a-55296<<10)+(i-56320),n++)),o+=a<128?1:a<2048?2:a<65536?3:4;for(t=new Uint8Array(o),s=0,n=0;s<o;n++)a=e.charCodeAt(n),55296==(64512&a)&&n+1<r&&(i=e.charCodeAt(n+1),56320==(64512&i)&&(a=65536+(a-55296<<10)+(i-56320),n++)),a<128?t[s++]=a:a<2048?(t[s++]=192|a>>>6,t[s++]=128|63&a):a<65536?(t[s++]=224|a>>>12,t[s++]=128|a>>>6&63,t[s++]=128|63&a):(t[s++]=240|a>>>18,t[s++]=128|a>>>12&63,t[s++]=128|a>>>6&63,t[s++]=128|63&a);return t},Gt=(e,t)=>{const a=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let i,n;const s=new Array(2*a);for(n=0,i=0;i<a;){let t=e[i++];if(t<128){s[n++]=t;continue}let r=Yt[t];if(r>4)s[n++]=65533,i+=r-1;else{for(t&=2===r?31:3===r?15:7;r>1&&i<a;)t=t<<6|63&e[i++],r--;r>1?s[n++]=65533:t<65536?s[n++]=t:(t-=65536,s[n++]=55296|t>>10&1023,s[n++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&Wt)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let a="";for(let i=0;i<t;i++)a+=String.fromCharCode(e[i]);return a})(s,n)},qt=(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let a=t-1;for(;a>=0&&128==(192&e[a]);)a--;return a<0||0===a?t:a+Yt[e[a]]>t?a:t};var Zt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Jt=Object.prototype.toString,{Z_NO_FLUSH:Kt,Z_SYNC_FLUSH:Xt,Z_FULL_FLUSH:Qt,Z_FINISH:ea,Z_OK:ta,Z_STREAM_END:aa,Z_DEFAULT_COMPRESSION:ia,Z_DEFAULT_STRATEGY:na,Z_DEFLATED:sa}=je;function ra(e){this.options=jt({level:ia,method:sa,chunkSize:16384,windowBits:15,memLevel:8,strategy:na},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Zt,this.strm.avail_out=0;let a=$t.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(a!==ta)throw new Error(Ue[a]);if(t.header&&$t.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?Ht(t.dictionary):"[object ArrayBuffer]"===Jt.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,a=$t.deflateSetDictionary(this.strm,e),a!==ta)throw new Error(Ue[a]);this._dict_set=!0}}function oa(e,t){const a=new ra(t);if(a.push(e,!0),a.err)throw a.msg||Ue[a.err];return a.result}ra.prototype.push=function(e,t){const a=this.strm,i=this.options.chunkSize;let n,s;if(this.ended)return!1;for(s=t===~~t?t:!0===t?ea:Kt,"string"==typeof e?a.input=Ht(e):"[object ArrayBuffer]"===Jt.call(e)?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;;)if(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),(s===Xt||s===Qt)&&a.avail_out<=6)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else{if(n=$t.deflate(a,s),n===aa)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),n=$t.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===ta;if(0!==a.avail_out){if(s>0&&a.next_out>0)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else if(0===a.avail_in)break}else this.onData(a.output)}return!0},ra.prototype.onData=function(e){this.chunks.push(e)},ra.prototype.onEnd=function(e){e===ta&&(this.result=zt(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var la=function(e,t){return(t=t||{}).raw=!0,oa(e,t)},ua=function(e,t){return(t=t||{}).gzip=!0,oa(e,t)},ca={Deflate:ra,deflate:oa,deflateRaw:la,gzip:ua};const da=16209;var pa=function(e,t){let a,i,n,s,r,o,l,u,c,d,p,h,m,f,y,g,b,w,_,v,A,k,S,N;const M=e.state;a=e.next_in,S=e.input,i=a+(e.avail_in-5),n=e.next_out,N=e.output,s=n-(t-e.avail_out),r=n+(e.avail_out-257),o=M.dmax,l=M.wsize,u=M.whave,c=M.wnext,d=M.window,p=M.hold,h=M.bits,m=M.lencode,f=M.distcode,y=(1<<M.lenbits)-1,g=(1<<M.distbits)-1;e:do{h<15&&(p+=S[a++]<<h,h+=8,p+=S[a++]<<h,h+=8),b=m[p&y];t:for(;;){if(w=b>>>24,p>>>=w,h-=w,w=b>>>16&255,0===w)N[n++]=65535&b;else{if(!(16&w)){if(64&w){if(32&w){M.mode=16191;break e}e.msg="invalid literal/length code",M.mode=da;break e}b=m[(65535&b)+(p&(1<<w)-1)];continue t}for(_=65535&b,w&=15,w&&(h<w&&(p+=S[a++]<<h,h+=8),_+=p&(1<<w)-1,p>>>=w,h-=w),h<15&&(p+=S[a++]<<h,h+=8,p+=S[a++]<<h,h+=8),b=f[p&g];;){if(w=b>>>24,p>>>=w,h-=w,w=b>>>16&255,16&w){if(v=65535&b,w&=15,h<w&&(p+=S[a++]<<h,h+=8,h<w&&(p+=S[a++]<<h,h+=8)),v+=p&(1<<w)-1,v>o){e.msg="invalid distance too far back",M.mode=da;break e}if(p>>>=w,h-=w,w=n-s,v>w){if(w=v-w,w>u&&M.sane){e.msg="invalid distance too far back",M.mode=da;break e}if(A=0,k=d,0===c){if(A+=l-w,w<_){_-=w;do{N[n++]=d[A++]}while(--w);A=n-v,k=N}}else if(c<w){if(A+=l+c-w,w-=c,w<_){_-=w;do{N[n++]=d[A++]}while(--w);if(A=0,c<_){w=c,_-=w;do{N[n++]=d[A++]}while(--w);A=n-v,k=N}}}else if(A+=c-w,w<_){_-=w;do{N[n++]=d[A++]}while(--w);A=n-v,k=N}for(;_>2;)N[n++]=k[A++],N[n++]=k[A++],N[n++]=k[A++],_-=3;_&&(N[n++]=k[A++],_>1&&(N[n++]=k[A++]))}else{A=n-v;do{N[n++]=N[A++],N[n++]=N[A++],N[n++]=N[A++],_-=3}while(_>2);_&&(N[n++]=N[A++],_>1&&(N[n++]=N[A++]))}break}if(64&w){e.msg="invalid distance code",M.mode=da;break e}b=f[(65535&b)+(p&(1<<w)-1)]}}break}}while(a<i&&n<r);_=h>>3,a-=_,h-=_<<3,p&=(1<<h)-1,e.next_in=a,e.next_out=n,e.avail_in=a<i?i-a+5:5-(a-i),e.avail_out=n<r?r-n+257:257-(n-r),M.hold=p,M.bits=h};const ha=15,ma=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),fa=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),ya=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),ga=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var ba=(e,t,a,i,n,s,r,o)=>{const l=o.bits;let u,c,d,p,h,m,f=0,y=0,g=0,b=0,w=0,_=0,v=0,A=0,k=0,S=0,N=null;const M=new Uint16Array(16),T=new Uint16Array(16);let x,V,C,I=null;for(f=0;f<=ha;f++)M[f]=0;for(y=0;y<i;y++)M[t[a+y]]++;for(w=l,b=ha;b>=1&&0===M[b];b--);if(w>b&&(w=b),0===b)return n[s++]=20971520,n[s++]=20971520,o.bits=1,0;for(g=1;g<b&&0===M[g];g++);for(w<g&&(w=g),A=1,f=1;f<=ha;f++)if(A<<=1,A-=M[f],A<0)return-1;if(A>0&&(0===e||1!==b))return-1;for(T[1]=0,f=1;f<ha;f++)T[f+1]=T[f]+M[f];for(y=0;y<i;y++)0!==t[a+y]&&(r[T[t[a+y]]++]=y);if(0===e?(N=I=r,m=20):1===e?(N=ma,I=fa,m=257):(N=ya,I=ga,m=0),S=0,y=0,f=g,h=s,_=w,v=0,d=-1,k=1<<w,p=k-1,1===e&&k>852||2===e&&k>592)return 1;for(;;){x=f-v,r[y]+1<m?(V=0,C=r[y]):r[y]>=m?(V=I[r[y]-m],C=N[r[y]-m]):(V=96,C=0),u=1<<f-v,c=1<<_,g=c;do{c-=u,n[h+(S>>v)+c]=x<<24|V<<16|C}while(0!==c);for(u=1<<f-1;S&u;)u>>=1;if(0!==u?(S&=u-1,S+=u):S=0,y++,0==--M[f]){if(f===b)break;f=t[a+r[y]]}if(f>w&&(S&p)!==d){for(0===v&&(v=w),h+=g,_=f-v,A=1<<_;_+v<b&&(A-=M[_+v],!(A<=0));)_++,A<<=1;if(k+=1<<_,1===e&&k>852||2===e&&k>592)return 1;d=S&p,n[d]=w<<24|_<<16|h-s}}return 0!==S&&(n[h+S]=f-v<<24|64<<16),o.bits=w,0};const{Z_FINISH:wa,Z_BLOCK:_a,Z_TREES:va,Z_OK:Aa,Z_STREAM_END:ka,Z_NEED_DICT:Sa,Z_STREAM_ERROR:Na,Z_DATA_ERROR:Ma,Z_MEM_ERROR:Ta,Z_BUF_ERROR:xa,Z_DEFLATED:Va}=je,Ca=16180,Ia=16190,Fa=16191,Ea=16192,Da=16194,Pa=16199,La=16200,Ra=16206,Ba=16209,Oa=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function $a(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Ua=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<Ca||t.mode>16211?1:0},ja=e=>{if(Ua(e))return Na;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=Ca,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,Aa},za=e=>{if(Ua(e))return Na;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,ja(e)},Wa=(e,t)=>{let a;if(Ua(e))return Na;const i=e.state;return t<0?(a=0,t=-t):(a=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Na:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=a,i.wbits=t,za(e))},Ya=(e,t)=>{if(!e)return Na;const a=new $a;e.state=a,a.strm=e,a.window=null,a.mode=Ca;const i=Wa(e,t);return i!==Aa&&(e.state=null),i};let Ha,Ga,qa=!0;const Za=e=>{if(qa){Ha=new Int32Array(512),Ga=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(ba(1,e.lens,0,288,Ha,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ba(2,e.lens,0,32,Ga,0,e.work,{bits:5}),qa=!1}e.lencode=Ha,e.lenbits=9,e.distcode=Ga,e.distbits=5},Ja=(e,t,a,i)=>{let n;const s=e.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),i>=s.wsize?(s.window.set(t.subarray(a-s.wsize,a),0),s.wnext=0,s.whave=s.wsize):(n=s.wsize-s.wnext,n>i&&(n=i),s.window.set(t.subarray(a-i,a-i+n),s.wnext),(i-=n)?(s.window.set(t.subarray(a-i,a),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=n))),0};var Ka=(e,t)=>{let a,i,n,s,r,o,l,u,c,d,p,h,m,f,y,g,b,w,_,v,A,k,S=0;const N=new Uint8Array(4);let M,T;const x=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Ua(e)||!e.output||!e.input&&0!==e.avail_in)return Na;a=e.state,a.mode===Fa&&(a.mode=Ea),r=e.next_out,n=e.output,l=e.avail_out,s=e.next_in,i=e.input,o=e.avail_in,u=a.hold,c=a.bits,d=o,p=l,k=Aa;e:for(;;)switch(a.mode){case Ca:if(0===a.wrap){a.mode=Ea;break}for(;c<16;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}if(2&a.wrap&&35615===u){0===a.wbits&&(a.wbits=15),a.check=0,N[0]=255&u,N[1]=u>>>8&255,a.check=$e(a.check,N,2,0),u=0,c=0,a.mode=16181;break}if(a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",a.mode=Ba;break}if((15&u)!==Va){e.msg="unknown compression method",a.mode=Ba;break}if(u>>>=4,c-=4,A=8+(15&u),0===a.wbits&&(a.wbits=A),A>15||A>a.wbits){e.msg="invalid window size",a.mode=Ba;break}a.dmax=1<<a.wbits,a.flags=0,e.adler=a.check=1,a.mode=512&u?16189:Fa,u=0,c=0;break;case 16181:for(;c<16;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}if(a.flags=u,(255&a.flags)!==Va){e.msg="unknown compression method",a.mode=Ba;break}if(57344&a.flags){e.msg="unknown header flags set",a.mode=Ba;break}a.head&&(a.head.text=u>>8&1),512&a.flags&&4&a.wrap&&(N[0]=255&u,N[1]=u>>>8&255,a.check=$e(a.check,N,2,0)),u=0,c=0,a.mode=16182;case 16182:for(;c<32;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}a.head&&(a.head.time=u),512&a.flags&&4&a.wrap&&(N[0]=255&u,N[1]=u>>>8&255,N[2]=u>>>16&255,N[3]=u>>>24&255,a.check=$e(a.check,N,4,0)),u=0,c=0,a.mode=16183;case 16183:for(;c<16;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}a.head&&(a.head.xflags=255&u,a.head.os=u>>8),512&a.flags&&4&a.wrap&&(N[0]=255&u,N[1]=u>>>8&255,a.check=$e(a.check,N,2,0)),u=0,c=0,a.mode=16184;case 16184:if(1024&a.flags){for(;c<16;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}a.length=u,a.head&&(a.head.extra_len=u),512&a.flags&&4&a.wrap&&(N[0]=255&u,N[1]=u>>>8&255,a.check=$e(a.check,N,2,0)),u=0,c=0}else a.head&&(a.head.extra=null);a.mode=16185;case 16185:if(1024&a.flags&&(h=a.length,h>o&&(h=o),h&&(a.head&&(A=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(i.subarray(s,s+h),A)),512&a.flags&&4&a.wrap&&(a.check=$e(a.check,i,h,s)),o-=h,s+=h,a.length-=h),a.length))break e;a.length=0,a.mode=16186;case 16186:if(2048&a.flags){if(0===o)break e;h=0;do{A=i[s+h++],a.head&&A&&a.length<65536&&(a.head.name+=String.fromCharCode(A))}while(A&&h<o);if(512&a.flags&&4&a.wrap&&(a.check=$e(a.check,i,h,s)),o-=h,s+=h,A)break e}else a.head&&(a.head.name=null);a.length=0,a.mode=16187;case 16187:if(4096&a.flags){if(0===o)break e;h=0;do{A=i[s+h++],a.head&&A&&a.length<65536&&(a.head.comment+=String.fromCharCode(A))}while(A&&h<o);if(512&a.flags&&4&a.wrap&&(a.check=$e(a.check,i,h,s)),o-=h,s+=h,A)break e}else a.head&&(a.head.comment=null);a.mode=16188;case 16188:if(512&a.flags){for(;c<16;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}if(4&a.wrap&&u!==(65535&a.check)){e.msg="header crc mismatch",a.mode=Ba;break}u=0,c=0}a.head&&(a.head.hcrc=a.flags>>9&1,a.head.done=!0),e.adler=a.check=0,a.mode=Fa;break;case 16189:for(;c<32;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}e.adler=a.check=Oa(u),u=0,c=0,a.mode=Ia;case Ia:if(0===a.havedict)return e.next_out=r,e.avail_out=l,e.next_in=s,e.avail_in=o,a.hold=u,a.bits=c,Sa;e.adler=a.check=1,a.mode=Fa;case Fa:if(t===_a||t===va)break e;case Ea:if(a.last){u>>>=7&c,c-=7&c,a.mode=Ra;break}for(;c<3;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}switch(a.last=1&u,u>>>=1,c-=1,3&u){case 0:a.mode=16193;break;case 1:if(Za(a),a.mode=Pa,t===va){u>>>=2,c-=2;break e}break;case 2:a.mode=16196;break;case 3:e.msg="invalid block type",a.mode=Ba}u>>>=2,c-=2;break;case 16193:for(u>>>=7&c,c-=7&c;c<32;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}if((65535&u)!=(u>>>16^65535)){e.msg="invalid stored block lengths",a.mode=Ba;break}if(a.length=65535&u,u=0,c=0,a.mode=Da,t===va)break e;case Da:a.mode=16195;case 16195:if(h=a.length,h){if(h>o&&(h=o),h>l&&(h=l),0===h)break e;n.set(i.subarray(s,s+h),r),o-=h,s+=h,l-=h,r+=h,a.length-=h;break}a.mode=Fa;break;case 16196:for(;c<14;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}if(a.nlen=257+(31&u),u>>>=5,c-=5,a.ndist=1+(31&u),u>>>=5,c-=5,a.ncode=4+(15&u),u>>>=4,c-=4,a.nlen>286||a.ndist>30){e.msg="too many length or distance symbols",a.mode=Ba;break}a.have=0,a.mode=16197;case 16197:for(;a.have<a.ncode;){for(;c<3;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}a.lens[x[a.have++]]=7&u,u>>>=3,c-=3}for(;a.have<19;)a.lens[x[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,M={bits:a.lenbits},k=ba(0,a.lens,0,19,a.lencode,0,a.work,M),a.lenbits=M.bits,k){e.msg="invalid code lengths set",a.mode=Ba;break}a.have=0,a.mode=16198;case 16198:for(;a.have<a.nlen+a.ndist;){for(;S=a.lencode[u&(1<<a.lenbits)-1],y=S>>>24,g=S>>>16&255,b=65535&S,!(y<=c);){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}if(b<16)u>>>=y,c-=y,a.lens[a.have++]=b;else{if(16===b){for(T=y+2;c<T;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}if(u>>>=y,c-=y,0===a.have){e.msg="invalid bit length repeat",a.mode=Ba;break}A=a.lens[a.have-1],h=3+(3&u),u>>>=2,c-=2}else if(17===b){for(T=y+3;c<T;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}u>>>=y,c-=y,A=0,h=3+(7&u),u>>>=3,c-=3}else{for(T=y+7;c<T;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}u>>>=y,c-=y,A=0,h=11+(127&u),u>>>=7,c-=7}if(a.have+h>a.nlen+a.ndist){e.msg="invalid bit length repeat",a.mode=Ba;break}for(;h--;)a.lens[a.have++]=A}}if(a.mode===Ba)break;if(0===a.lens[256]){e.msg="invalid code -- missing end-of-block",a.mode=Ba;break}if(a.lenbits=9,M={bits:a.lenbits},k=ba(1,a.lens,0,a.nlen,a.lencode,0,a.work,M),a.lenbits=M.bits,k){e.msg="invalid literal/lengths set",a.mode=Ba;break}if(a.distbits=6,a.distcode=a.distdyn,M={bits:a.distbits},k=ba(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,M),a.distbits=M.bits,k){e.msg="invalid distances set",a.mode=Ba;break}if(a.mode=Pa,t===va)break e;case Pa:a.mode=La;case La:if(o>=6&&l>=258){e.next_out=r,e.avail_out=l,e.next_in=s,e.avail_in=o,a.hold=u,a.bits=c,pa(e,p),r=e.next_out,n=e.output,l=e.avail_out,s=e.next_in,i=e.input,o=e.avail_in,u=a.hold,c=a.bits,a.mode===Fa&&(a.back=-1);break}for(a.back=0;S=a.lencode[u&(1<<a.lenbits)-1],y=S>>>24,g=S>>>16&255,b=65535&S,!(y<=c);){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}if(g&&!(240&g)){for(w=y,_=g,v=b;S=a.lencode[v+((u&(1<<w+_)-1)>>w)],y=S>>>24,g=S>>>16&255,b=65535&S,!(w+y<=c);){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}u>>>=w,c-=w,a.back+=w}if(u>>>=y,c-=y,a.back+=y,a.length=b,0===g){a.mode=16205;break}if(32&g){a.back=-1,a.mode=Fa;break}if(64&g){e.msg="invalid literal/length code",a.mode=Ba;break}a.extra=15&g,a.mode=16201;case 16201:if(a.extra){for(T=a.extra;c<T;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}a.length+=u&(1<<a.extra)-1,u>>>=a.extra,c-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=16202;case 16202:for(;S=a.distcode[u&(1<<a.distbits)-1],y=S>>>24,g=S>>>16&255,b=65535&S,!(y<=c);){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}if(!(240&g)){for(w=y,_=g,v=b;S=a.distcode[v+((u&(1<<w+_)-1)>>w)],y=S>>>24,g=S>>>16&255,b=65535&S,!(w+y<=c);){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}u>>>=w,c-=w,a.back+=w}if(u>>>=y,c-=y,a.back+=y,64&g){e.msg="invalid distance code",a.mode=Ba;break}a.offset=b,a.extra=15&g,a.mode=16203;case 16203:if(a.extra){for(T=a.extra;c<T;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}a.offset+=u&(1<<a.extra)-1,u>>>=a.extra,c-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){e.msg="invalid distance too far back",a.mode=Ba;break}a.mode=16204;case 16204:if(0===l)break e;if(h=p-l,a.offset>h){if(h=a.offset-h,h>a.whave&&a.sane){e.msg="invalid distance too far back",a.mode=Ba;break}h>a.wnext?(h-=a.wnext,m=a.wsize-h):m=a.wnext-h,h>a.length&&(h=a.length),f=a.window}else f=n,m=r-a.offset,h=a.length;h>l&&(h=l),l-=h,a.length-=h;do{n[r++]=f[m++]}while(--h);0===a.length&&(a.mode=La);break;case 16205:if(0===l)break e;n[r++]=a.length,l--,a.mode=La;break;case Ra:if(a.wrap){for(;c<32;){if(0===o)break e;o--,u|=i[s++]<<c,c+=8}if(p-=l,e.total_out+=p,a.total+=p,4&a.wrap&&p&&(e.adler=a.check=a.flags?$e(a.check,n,p,r-p):Be(a.check,n,p,r-p)),p=l,4&a.wrap&&(a.flags?u:Oa(u))!==a.check){e.msg="incorrect data check",a.mode=Ba;break}u=0,c=0}a.mode=16207;case 16207:if(a.wrap&&a.flags){for(;c<32;){if(0===o)break e;o--,u+=i[s++]<<c,c+=8}if(4&a.wrap&&u!==(4294967295&a.total)){e.msg="incorrect length check",a.mode=Ba;break}u=0,c=0}a.mode=16208;case 16208:k=ka;break e;case Ba:k=Ma;break e;case 16210:return Ta;default:return Na}return e.next_out=r,e.avail_out=l,e.next_in=s,e.avail_in=o,a.hold=u,a.bits=c,(a.wsize||p!==e.avail_out&&a.mode<Ba&&(a.mode<Ra||t!==wa))&&Ja(e,e.output,e.next_out,p-e.avail_out),d-=e.avail_in,p-=e.avail_out,e.total_in+=d,e.total_out+=p,a.total+=p,4&a.wrap&&p&&(e.adler=a.check=a.flags?$e(a.check,n,p,e.next_out-p):Be(a.check,n,p,e.next_out-p)),e.data_type=a.bits+(a.last?64:0)+(a.mode===Fa?128:0)+(a.mode===Pa||a.mode===Da?256:0),(0===d&&0===p||t===wa)&&k===Aa&&(k=xa),k},Xa={inflateReset:za,inflateReset2:Wa,inflateResetKeep:ja,inflateInit:e=>Ya(e,15),inflateInit2:Ya,inflate:Ka,inflateEnd:e=>{if(Ua(e))return Na;let t=e.state;return t.window&&(t.window=null),e.state=null,Aa},inflateGetHeader:(e,t)=>{if(Ua(e))return Na;const a=e.state;return 2&a.wrap?(a.head=t,t.done=!1,Aa):Na},inflateSetDictionary:(e,t)=>{const a=t.length;let i,n,s;return Ua(e)?Na:(i=e.state,0!==i.wrap&&i.mode!==Ia?Na:i.mode===Ia&&(n=1,n=Be(n,t,a,0),n!==i.check)?Ma:(s=Ja(e,t,a,a),s?(i.mode=16210,Ta):(i.havedict=1,Aa)))},inflateInfo:"pako inflate (from Nodeca project)"};var Qa=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const ei=Object.prototype.toString,{Z_NO_FLUSH:ti,Z_FINISH:ai,Z_OK:ii,Z_STREAM_END:ni,Z_NEED_DICT:si,Z_STREAM_ERROR:ri,Z_DATA_ERROR:oi,Z_MEM_ERROR:li}=je;function ui(e){this.options=jt({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Zt,this.strm.avail_out=0;let a=Xa.inflateInit2(this.strm,t.windowBits);if(a!==ii)throw new Error(Ue[a]);if(this.header=new Qa,Xa.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Ht(t.dictionary):"[object ArrayBuffer]"===ei.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(a=Xa.inflateSetDictionary(this.strm,t.dictionary),a!==ii)))throw new Error(Ue[a])}function ci(e,t){const a=new ui(t);if(a.push(e),a.err)throw a.msg||Ue[a.err];return a.result}ui.prototype.push=function(e,t){const a=this.strm,i=this.options.chunkSize,n=this.options.dictionary;let s,r,o;if(this.ended)return!1;for(r=t===~~t?t:!0===t?ai:ti,"[object ArrayBuffer]"===ei.call(e)?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),s=Xa.inflate(a,r),s===si&&n&&(s=Xa.inflateSetDictionary(a,n),s===ii?s=Xa.inflate(a,r):s===oi&&(s=si));a.avail_in>0&&s===ni&&a.state.wrap>0&&0!==e[a.next_in];)Xa.inflateReset(a),s=Xa.inflate(a,r);switch(s){case ri:case oi:case si:case li:return this.onEnd(s),this.ended=!0,!1}if(o=a.avail_out,a.next_out&&(0===a.avail_out||s===ni))if("string"===this.options.to){let e=qt(a.output,a.next_out),t=a.next_out-e,n=Gt(a.output,e);a.next_out=t,a.avail_out=i-t,t&&a.output.set(a.output.subarray(e,e+t),0),this.onData(n)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(s!==ii||0!==o){if(s===ni)return s=Xa.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},ui.prototype.onData=function(e){this.chunks.push(e)},ui.prototype.onEnd=function(e){e===ii&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=zt(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var di=function(e,t){return(t=t||{}).raw=!0,ci(e,t)},pi={Inflate:ui,inflate:ci,inflateRaw:di,ungzip:ci};const{Deflate:hi,deflate:mi,deflateRaw:fi,gzip:yi}=ca,{Inflate:gi,inflate:bi,inflateRaw:wi,ungzip:_i}=pi;var vi={Deflate:hi,deflate:mi,deflateRaw:fi,gzip:yi,Inflate:gi,inflate:bi,inflateRaw:wi,ungzip:_i,constants:je};const Ai={files:{},items:{},folders:{}};function ki(e){return Ai.files[e]}function Si(){return Ai.folders}function Ni(e){return Ai.folders[e]}function Mi(e,t){for(const a of Object.values(Ai.folders))if(a.name===e&&a.parent===t)return a}function Ti(e,t){for(const a of Object.values(Ai.items))if(a.name===e&&a.folder._id===t)return a}function xi(){return Ai.items}function Vi(e){return Ai.items[e]}function Ci(e,t){Ai.items[e]=t.rootItem;for(const[e,a]of Object.entries(t.metadata)){if(t.files[e]&&(Ai.files[e]={blob:new Blob([t.files[e]],{type:a.mimeType}),hash:a.hash,itemName:a.name,itemType:a.type,mimeType:a.mimeType}),a.attachments)for(const i of a.attachments){const a=Fi(e,i.name,i.queryParam,i.index);Ai.files[a]={blob:new Blob([t.files[a]],{type:i.mimeType}),hash:i.hash,itemName:i.name,itemType:i.type,mimeType:i.mimeType}}Ai.items[e]=a}for(const a of Object.values(t.folders))a._id=e+":"+a._id,a.parent=e+":"+a.parent,Ai.folders[a._id]=a}async function Ii(e,t){const a=Buffer.from(await e.arrayBuffer());let i=0;i+=8;const n=a.readInt32LE(8);i+=4;const s=new TextDecoder,r=a.subarray(i,i+n);i+=n;const o=JSON.parse(s.decode(r));o.root=t+"/"+o.root;let l=0;const u=vi.ungzip(a.subarray(i)),c=Buffer.from(u),d=c.subarray(l,l+o.metadataSize);l+=o.metadataSize;const p=JSON.parse(s.decode(d)),h={};Object.entries(p).forEach((([e,a])=>{const i=t+"/"+e;a._id=i,h[i]=a,a.folder._id=t+":"+a.folder._id;for(const e of a.links)e.to=t+"/"+e.to}));const m=c.subarray(l,l+o.foldersSize);l+=o.foldersSize;const f=JSON.parse(s.decode(m)),y={};for(const[,e]of Object.entries(h))if(e.filesize&&(y[e._id]={start:l+(e.packageFileOffset||0),end:l+(e.packageFileOffset||0)+e.filesize}),e.attachments)for(const t of e.attachments)y[Fi(e._id,t.name,t.queryParam,t.index)]={start:l+(t.packageFileOffset||0),end:l+(t.packageFileOffset||0)+t.filesize};const g={};for(const[e,t]of Object.entries(y)){const a=c.subarray(t.start,t.end);g[e]=a}const b=h[o.root],w=[],_=e=>{w.push(e._id);for(const t of e.links)t.item=structuredClone(h[t.to]),_(t.item)};return _(b),{rootItem:b,metadata:h,folders:f,files:g}}function Fi(e,t,a,i){return`${e}_${t}`+(null!=a?`_${a}`:"")+(null!=i?`_${i}`:"")}function Ei(e,t,a,i){return Array.isArray(e.attachments)?e.attachments.filter((e=>e.name===t&&(void 0===i||e.index===i))).reduce(((e,t)=>Math.abs(t.queryParam-(a??0))<Math.abs(e.queryParam-(a??0))?t:e),{queryParam:1/0}):null}function Di(e,t,a,i){const n=Vi(e);if(n){const s=Ei(n,t,a,i);if(!s)return null;return ki(Fi(e,s.name,s.queryParam,s.index))}}var Pi=Object.freeze({__proto__:null,addPackageToCache:Ci,createAttachmentID:Fi,findFolder:Mi,findItem:Ti,getAttachmentFromPackageCache:Di,getFileFromCache:ki,getFolder:Ni,getFolders:Si,getItemFromCache:Vi,getItems:xi,parsePackage:Ii,queryAttachments:Ei});class Li{id=d.createGUID();items=[]}class Ri{itemRepo;undoEvents=[];redoEvents=[];maxUndoCount=100;enabled=!0;snapshots=new Map;_undoRedoPromise=Promise.resolve();constructor(e,t=100){this.itemRepo=e,this.maxUndoCount=t,f.instance.setUndoManager(this),l.$on("undoManager:undo",(e=>this.undo(e))),l.$on("undoManager:redo",(e=>this.redo(e)))}clear(){this.undoEvents=[],this.redoEvents=[],this.snapshots.clear(),l.$emit("undoManager:undoStepsChanged",0),l.$emit("undoManager:redoStepsChanged",0)}createSnapshot(){const e=new Li;for(const t of this.itemRepo.itemInstances.values())for(const a of t.values())e.items.push({_id:a._id,instanceId:a.instanceId,data:this._grabSnapshot(a)});return this.snapshots.set(e.id,e),e.id}rollbackFromSnapshot(e){const t=this.snapshots.get(e);if(!t)throw new w("Snapshot not found");for(const e of t.items){const t=this.itemRepo.itemInstances.get(e._id);if(t){const a=t.get(e.instanceId);a?this._rollbackFromSnapshot(a,e.data):console.error(`[SNAPSHOT] - Trying to rollback snapshot for item but did not find the instance: ${e._id} -> ${e.instanceId}`)}else console.error(`[SNAPSHOT] - Trying to rollback snapshot for item but did not find the item map: ${e._id}`)}this.snapshots.delete(e)}_grabSnapshot(e){const t=[];for(const a of e.fieldInstances)try{t.push(a.createSnapshot())}catch(e){const t=`[SNAPSHOT] - Could not grab snapshot of field ${a.name}`;throw console.error(t,e),new Error(e.toString())}return new $(e._id,"item",{fieldInstances:t})}_getFieldInstance(e,t){for(const a of e.fieldInstances)if(a.getId()===t)return a;return null}_rollbackFromSnapshot(e,t){for(const a of t.data.fieldInstances){const t=this._getFieldInstance(e,a.id);t?t.rollbackFromSnapshot(a):console.warn("[SNAPSHOT] - Could not find field instance in snapshot: "+a.id)}}getEnabled(){return this.enabled}setEnabled(e){this.enabled=!!e}ignore(e){const t=this.enabled;let a=!1;try{t&&this.setEnabled(!1);const i=e();if(i&&i.then)return a=!0,i.finally((()=>{t&&this.setEnabled(!0)}))}finally{t&&!a&&this.setEnabled(!0)}}undo(e){return this._undoRedoPromise=this._undoRedoPromise.then((()=>this._performUndo(e))),this._undoRedoPromise}redo(e){return this._undoRedoPromise=this._undoRedoPromise.then((()=>this._performRedo(e))),this._undoRedoPromise}async _performUndo(e){if(this.enabled&&this.undoEvents.length){for(e=e||1;this.undoEvents.length>0&&e>0;){const t=this.spliceLastEventBundle(this.undoEvents).reverse();for(const e of t)await e.undo(),this.redoEvents.push(e);e--}l.$emit("undoManager:undoStepsChanged",this.getNumberOfUndoBundles()),l.$emit("undoManager:redoStepsChanged",this.getNumberOfRedoBundles())}}async _performRedo(e){if(this.enabled&&this.redoEvents.length){for(e=e||1;this.redoEvents.length>0&&e>0;){const t=this.spliceLastEventBundle(this.redoEvents).reverse();for(const e of t)await e.redo(),this.undoEvents.push(e);e--}l.$emit("undoManager:undoStepsChanged",this.getNumberOfUndoBundles()),l.$emit("undoManager:redoStepsChanged",this.getNumberOfRedoBundles())}}getUndoSteps(){return this.undoEvents.map((function(e){return{type:e.type,itemId:e.itemId,prop:e.prop}}))}getRedoSteps(){return this.redoEvents.map((e=>({type:e.type,itemId:e.itemId,prop:e.prop})))}event(e){if(this.enabled){if(this.redoEvents=[],l.$emit("undoManager:redoStepsChanged",0),this.assignBundleIndexToEvent(e),0!==this.undoEvents.length){let t=!1;for(let a=this.undoEvents.length-1;a>=0;a--){const i=this.undoEvents[a];if(!e.isWithinMergeDeltaOf(i))break;const n=i.merge(e);if(n){t=!0,this.undoEvents.splice(a,1),this.undoEvents.push(n);break}}t||(this.undoEvents.push(e),l.$emit("undoManager:undoStepsChanged",this.getNumberOfUndoBundles()))}else this.undoEvents.push(e),l.$emit("undoManager:undoStepsChanged",this.getNumberOfUndoBundles());if(this.getNumberOfUndoBundles()>this.maxUndoCount){this.spliceFirstEventBundle(this.undoEvents);for(const e of this.undoEvents)e.bundleIndex-=1;l.$emit("undoManager:undoStepsChanged",this.getNumberOfUndoBundles())}}}getNumberOfUndoBundles(){return 0===this.undoEvents.length?0:this.undoEvents.at(-1).bundleIndex+1}getNumberOfRedoBundles(){if(0===this.redoEvents.length)return 0;const e=this.getNumberOfUndoBundles()-1;return this.redoEvents.at(0).bundleIndex-e}spliceLastEventBundle(e){if(0===e.length)return[];const t=e.at(-1).bundleIndex;let a=e.length-1;for(let i=e.length-1;i>=0&&e[i].bundleIndex===t;i--)a=i;return e.splice(a)}spliceFirstEventBundle(e){if(0===e.length)return[];const t=e.at(0).bundleIndex;for(let a=1;a<e.length;a++)if(e[a].bundleIndex!==t)return e.splice(0,a);return e.splice(0)}assignBundleIndexToEvent(e){if(0===this.undoEvents.length)return void(e.bundleIndex=0);const t=this.undoEvents.at(-1),a=Math.abs(e.createdAt-t.createdAt);e.bundleIndex=a>75?t.bundleIndex+1:t.bundleIndex}}class Bi{updateItemLinksAndAttributes(e,t,a){try{const i=[],n={},s={};this.getLinksAndAttributes(e,i,n,s,t,a);for(const t in e.additionalUserAttributes)e.additionalUserAttributes.hasOwnProperty(t)&&(s[t]=e.additionalUserAttributes[t]);e.attributes=n,e.userAttributes=s,e.links=i}catch(e){throw console.error(e),new A(e)}}getLinksAndAttributes(e,t,a,i,n,s){e.fieldInstances.length&&this.retrieveLinksAndAttributesFromFieldInstances(e.fieldInstances,t,a,n,s),e.userFieldInstances.length&&this.retrieveLinksAndAttributesFromFieldInstances(e.userFieldInstances,t,i,n,s)}retrieveLinksAndAttributesFromFieldInstances(e,t,a,i,n){for(const s of e)switch(s.type){case"Link":if(s.value&&t){if(n&&s.hidden)continue;i?t.push({usage:s.name,to:s.value._id,item:s.value}):t.push({usage:s.name,to:s.value._id})}break;case"Attribute":a&&(a[s.name]=s.value);break;case"List":s.blocks&&this.traverseListFieldInstances(s.blocks,t,a,s.name,i);break;case"Tree":if(s.blocks){const e=s.blocks[0];e.blocks&&this.traverseTreeFieldInstance(e.blocks,t,a,s.name,i)}break;case"NodeGraph":if(s.blocks&&this.traverseTreeFieldInstance(s.blocks,t,a,s.name,i),a&&Array.isArray(s.connections)){let e=0;for(const t of s.connections){a[`${s.name}#connection[${e++}]`]={srcNode:t.srcNode,srcSlot:t.srcSlot,destNode:t.destNode,destSlot:t.destSlot}}}}}traverseTreeFieldInstance(e,t,a,i,n){let s=0;for(const r of e){const e=`${i}[${s}]`,o=e+"#type",l=e+"#id",u=e+"#posx",c=e+"#posy";a&&(a[e+"#usage"]="Block",a[o]=r.type,a[l]=r.id,void 0!==r.posX&&(a[u]=r.posX||0),void 0!==r.posY&&(a[c]=r.posY||0));for(const i of r.fields){const s=`${e}->${i.name}`;switch(i.type){case"Link":i.value&&t&&(n?t.push({usage:s,to:i.value._id,item:i.value}):t.push({usage:s,to:i.value._id}));break;case"List":i.blocks&&this.traverseListFieldInstances(i.blocks,t,a,s,n);break;case"Attribute":a&&(a[s]=i.value)}}r.scripts&&this.processScripts(r.scripts,t,a,e,n),r.blocks&&this.traverseTreeFieldInstance(r.blocks,t,a,e,n),s++}}traverseListFieldInstances(e,t,a,i,n){let s=0;for(const r of e){const e=`${i}[${s}]`;for(const i of r.fields){const s=`${e}->${i.name}`;switch(i.type){case"Link":if(i.value&&t){const e={usage:s,to:"object"==typeof i.value?i.value._id:i.value,item:null};n&&"object"===i.value&&(e.item=i.value),t.push(e)}break;case"Attribute":a&&(a[s]=i.value)}}s++}}processScripts(e,t,a,i,n){let s=0;for(const r of e){const e=`${i}#scripts[${s}]`,o=e+"#id",l=e+"#item";a&&(a[e+"#usage"]="Script",a[o]=r.id),t&&r.item.value&&(n?t.push({usage:l,to:r.item.value._id,item:r.item.value}):t.push({usage:l,to:r.item.value._id}));for(const i of r.fields){const s=`${e}->${i.name}`;if("Link"===i.type)i.value&&t&&(n?t.push({usage:s,to:i.value._id,item:i.value}):t.push({usage:s,to:i.value._id}));else a&&(a[s]=i.value)}s++}}}class Oi{apiClient;activeItem=void 0;rootItemId=void 0;loadingItems=new Map;loadedItems=new Map;itemInstances=new Map;resolvedPaths=new Map;jail;apiGateway;itemCache;linkableItemsCache;undoManager=new Ri(this);itemPreparator=new K(this);itemChangeProcessor=new Bi;usePublicApi;constructor(e,t){this.apiClient=t,this.apiGateway=new R(t),this.itemCache=new B(this.apiGateway),this.linkableItemsCache=new O(this.apiGateway,this.itemCache,e),this.usePublicApi=!!e,this.jail={active:!1,mountedFolders:[]},l.$on("item:rename",(e=>this.handleRename(e)))}_logGroup(e){}_logGroupEnd(){}_log(e){}getLoadedItems(){return Array.from(this.loadedItems.values())}getItemInstances(){return this.itemInstances}findLoadedItem(e){return this.loadedItems.get(e)}_handleError(e,t){throw console.error(e),new A("ItemRepo: "+t)}getUndoManager(){return this.undoManager}async createFieldsForItem(e,t,a){return this.itemPreparator.createFields(e,a,t,"",!1,a.attributes)}async createScriptsForItem(e,t=[],a,i=!0){const n=[];for(const i of t){if(!i.item)continue;const t=await this.loadItem(i.item);if(!t)continue;const s=new Y(void 0,e,a,t);n.push(s);for(const e of i.fields){const t=new z(s,e.name,e.value,a);s.addField(t)}}e.scripts=i?f.instance.proxyScriptArray(n,e,a):n}clear(){this.rootItemId=void 0,this.activeItem=void 0,this.linkableItemsCache.clear(),this.loadedItems.clear(),this.resolvedPaths.clear(),this.itemInstances.clear(),this.loadingItems.clear();this.apiClient.getCollab().endCollaboration()}removeBlock(e,t){t.blocks.removeObject(e),e.parent=void 0}traverseBlockPairs(e,t,a){a(e,t);for(let i=0;i<e.blocks.length&&i<t.blocks.length;i++)this.traverseBlockPairs(e.blocks[i],t.blocks[i],a)}copyScripts(e,t,a=!1){const i=new Map;this.traverseBlockPairs(e,t,((e,t)=>i.set(e.getId(),t.getId())));const n=[];return this.traverseBlockPairs(e,t,((e,t)=>{for(const s of e.scripts){const e=s.clone(i);a&&(e.deferInitCall=!0),t.scripts.push(e),n.push(e)}})),n}updateScriptFieldReferences(e,t){const a=new Map;this.traverseBlockPairs(e,t,((e,t)=>{a.set(e.id,t.id)})),this.updateScriptFieldReferencesFromMap(a,t)}updateScriptFieldReferencesFromMap(e,t){this.traverseBlocks((t=>{for(const a of t.scripts)for(const t of a.fields)e.has(t.value)&&(t.value=e.get(t.value))}),[t])}async createNewBlock(e,t,a){const i=new X(void 0,t,e.typeName,void 0,void 0,a),n=await this.createFieldsForItem(i,e.template,a);return i.setFields(n),i.blocks=f.instance.proxyBlockArray(i.blocks,i,a),await this.createScriptsForItem(i,void 0,a),this.addBlockToParent(i,t,a)}addBlockToParent(e,t,a){e.parent=t;const i=f.instance.proxyBlock(e,a);return t.blocks.push(i),i}async createNewListEntry(e,t,a){const i=new X(void 0,void 0,e.typeName,void 0,void 0,a),n=await this.createFieldsForItem(i,e.template,a);return i.setFields(n),i.blocks=f.instance.proxyListArray(i.blocks,t,a),f.instance.proxyBlock(i,a)}async createNewGraphNode(e,t,a,i,n){const s=new X(void 0,void 0,e.typeName,void 0,e.displayName,n),r=await this.itemPreparator.createFields(s,n,e.template,"",!0,n.attributes);return s.setFields(r),s.setInputs(e.inputs),s.setOutputs(e.outputs),s.setPosition(a,i),s.blocks=f.instance.proxyGraphBlockArray(s.blocks,t),this.addNodeToGraph(s,t,n),s}addNodeToGraph(e,t,a){const i=f.instance.proxyGraphBlock(e,a);t.blocks.push(i)}removeGraphNode(e,t){const a=[];for(const i of e.connections)i.srcNode!==t.id&&i.destNode!==t.id||a.push(i);for(const t of a)e.connections.removeObject(t);e.blocks.removeObject(t)}addGraphLink(e,t,a,i,n,s){e.connections.push(new j({srcNode:t,srcSlot:a,destNode:i,destSlot:n},s))}removeGraphLink(e,t,a,i,n){for(const s of e.connections)if(s.srcNode===t&&s.srcSlot===a&&s.destNode===i&&s.destSlot===n)return void e.connections.removeObject(s)}createNewScript(e,t=-1,a){t=t>=0?t:e.scripts.length;const i=new Y(void 0,e,a);return e.scripts.splice(t,0,i),i}removeScript(e,t){t.scripts.removeObject(e)}findBlock(e){for(const t of this.itemInstances.values())for(const a of t.values()){const t=a.findBlock(e);if(t)return t}return null}async loadPackage(e){const t=await fetch(e),a=await t.blob();this.apiClient.getCollab().endCollaboration();const i=new G({_id:"root",name:"Root package",type:"Package",links:[],attributes:{},fields:[],readOnly:!0,isPackaged:!1}),n=await Ii(a,i._id);Ci(i._id,structuredClone(n));const s=Object.values(n.metadata).reverse();for(const e of s)e._id===n.rootItem._id&&(i.packageContent=e,i.packageType=e.type);return await this._linkAndPrepareItems(s),i.packageContent=this.loadedItems.get(n.rootItem._id),this.activeItem=i,i}createPackageItemUrl(e){const t=ki(e);return t?URL.createObjectURL(t.blob):null}revokePackageItemUrl(e){URL.revokeObjectURL(e)}async _loadPackageContentRecursively(e,t){t("Loading from cache",0);const a=await this.apiClient.itemCache.addItemToCache(e._id,void 0,e.hash,(function(e,a,i){t("Loading from cloud",.9*e,i,a)})),i=await(await fetch(a.objectUrl)).blob();t("Unpacking",90);const n=await Ii(i,e._id);Ci(e._id,structuredClone(n));const s=Object.values(n.metadata).reverse();for(const t of s)t._id===n.rootItem._id&&(e.packageContent=t,e.packageType=t.type);return s}createNewItemInstance(e){const t=this.loadedItems.get(e);if(!t)return console.error(`Tried creating new instance of item, but it was not found: ${e}`),null;const a=t.clone(!0);return this._addItemInstance(a),a}_addLoadedItem(e){this.loadedItems.set(e._id,e),this._addItemInstance(e)}_addItemInstance(e){let t=this.itemInstances.get(e._id);t||(t=new Map,this.itemInstances.set(e._id,t)),t.set(e.instanceId,e)}async loadItemByRelativePath(e,t,a={}){try{const i=Vi(e);let n;if(i){const e=t.split("/"),a=e.pop();let s=Ni(i.folder._id);for(const t of e)if(s=".."===t?Ni(s.parent):Mi(t,s._id),!s)return;const r=Ti(a,s._id);n=r?._id}else n=await this.resolveRelativePath(t,e);return this.loadItem(n,a)}catch(e){this._handleError(e,`Unable to load item by relative path: ${t}: ${e}`)}}async _loadItemFromApi(e,t={}){let a;if(this.apiGateway.start(),t.recursive)if(this.usePublicApi)a=await this.apiGateway.call("_loadItemFromApi","getItemPublicRecursive",e,!0),a.forEach((e=>e.public=!0));else try{a=await this.apiGateway.call("_loadItemFromApi","getItemAggregatedRecursive",e,{withAttachmentInfo:!0,noFields:!0})}catch{a=await this.apiGateway.call("_loadItemFromApi","getItemPublicRecursive",e,!0),a.forEach((e=>e.public=!0))}else{let t;if(this.usePublicApi)t=await this.apiGateway.call("_loadItemFromApi","getItemPublicRecursive",e),t.public=!0;else try{t=await this.apiGateway.call("_loadItemFromApi","getItemAggregated",e,{noFields:!0})}catch{t=await this.apiGateway.call("_loadItemFromApi","getItemPublicRecursive",e),t.public=!0}a=[t]}return this.apiGateway.end(),a}_relinkItems(e,t){for(const a of e){if(Array.isArray(a.links))for(const e of a.links)e.item=t.get(e.to),e.item||e.stopRecursion||console.warn(`Missing link in item '${a.name}' (${a._id}) to: ${e.to} with usage ${e.usage}`);a.packageContent&&(a.packageContent=t.get(a.packageContent._id))}}async loadItem(e,t={}){let a,i;try{let n;if(n=this.loadedItems.get(e),n)return n;if(n=this.loadingItems.get(e),n)return n;const s=new Promise(((e,t)=>{a=e,i=t}));if(this.loadingItems.set(e,s),n=await this._loadItemInternal(e,t),a(n),!this.activeItem&&n){if(this.rootItemId=e,this.activeItem=n,t.withCollaboration){const e=this.apiClient.getCollab();await e.startCollaboration(n)}await l.$emit("itemRepo:itemLoaded",n)}return n}catch(t){return this._handleError(t,`Unable to load item ${e}: ${t}`),void i(void 0)}finally{this.loadingItems.delete(e)}}async _loadItemInternal(e,t={}){const a=(e,a,i=0,n=0)=>{"function"==typeof t.progressCallback&&t.progressCallback({phase:e,percent:a,bytesTotal:i,bytesLoaded:n})};a("Fetching metadata",1);let i=await this._loadItemFromApi(e,t);if(i=i.filter((e=>!this.loadedItems.has(e._id))),0===i.length)return console.log("After loading the item, it turns out we have them all already loaded! This should not happen!"),this.loadedItems.get(e);const n=i[0]._id;for(const e of i)if("Package"===e.type){const t=await this._loadPackageContentRecursively(e,a);for(const e of t)i.push(e)}a("Preparing data",100),await this._linkAndPrepareItems(i);return this.loadedItems.get(n)}async _linkAndPrepareItems(e){const t=new Map;for(const a of e)t.set(a._id,a);const a=new Map([...this.loadedItems,...t]);this._relinkItems(e,a);const i=[],n=()=>{const e=t.values().next().value;return t.delete(e._id),this._log(`- Fetched next item ${e.name} (${e._id})`),e},s=async e=>{this._logGroup(`- Preparing item ${e.name} (${e._id})`);const t=await this.itemPreparator.prepare(e);return i.push(t),this._addLoadedItem(t),this._logGroupEnd(),t};for(this.itemPreparator.setItemFetcher((async e=>{this._logGroup(`- Requesting item ${e.name} (${e._id})`);let a=this.loadedItems.get(e._id);if(a)return this._log("- Already prepared. Returning."),this._logGroupEnd(),a;const i=t.get(e._id);return i?(t.delete(e._id),this._log("- Don't have it yet. Preparing..."),a=await s(i),this._log("- Now prepared. Returning."),this._logGroupEnd(),a):(console.error("ItemFetcher: Could not find requested item: "+e._id,t,this.loadedItems),null)}));t.size>0;){let e=n();await s(e)}return this._relinkItems(i,this.loadedItems),i}async resolveRelativePath(e,t=null){if(!(t=t||this.activeItem?._id||null))return null;const a=`${t}#${e}`;let i;return i=this.resolvedPaths.has(a)?this.resolvedPaths.get(a):this.usePublicApi?await this.apiClient.publicResolveRelativeItem(t,e):await this.apiClient.resolveRelativeItem(t,e),this.resolvedPaths.set(a,i),i}async traverseItems(e,t=void 0){if("function"!=typeof e)return;const a=this,i=new Map;await async function t(n){if(!n)return;if(i.has(n._id))return;i.set(n._id,!0);const s=e(n);if(s&&s.then&&await s,Array.isArray(n.links))for(const e of n.links)if(e.item)await t(e.item);else if(e.to)try{const i=await a.loadItem(e.to);await t(i)}catch{console.warn(`Could not load additional item ${e.to} so cannot traverse it. Probably dead link!`)}}(t||this.activeItem)}async traverseBlocks(e,t){for(const a of t){const t=e(a);t&&t.then&&await t,Array.isArray(a.blocks)&&a.blocks?.length&&await this.traverseBlocks(e,a.blocks)}}async traverseFieldInstances(e,t){const a=this;t=t||this.activeItem?.fieldInstances||[];for(const i of t){const t=e(i);t&&t.then&&await t,Array.isArray(i.blocks)&&await this.traverseBlocks((async function(t){Array.isArray(t.fields)&&t.fields?.length&&await a.traverseFieldInstances(e,t.fields)}),i.blocks)}}async _updateLinkReferences(e,t,a,i){t?await this.traverseItems((async n=>{if(Array.isArray(n.fieldInstances)&&n.fieldInstances.length&&await this.traverseFieldInstances((async a=>{"Link"===a.type&&a.value&&a.value._id===e&&(i&&(a.value=null),a.value=t)}),n.fieldInstances),n.links)for(const s of n.links)s.to===e&&(i&&(s.to=null,s.item=null),s.to=a,s.item=t)})):console.warn(`Aborting link update: Could not load item ${a}`)}async replaceLink(e,t){const a=await this.loadItem(t,{recursive:!0});await this._updateLinkReferences(e,a,t,!1)}async forceUpdateLink(e){const t=await this.loadItem(e,{recursive:!0});await this._updateLinkReferences(e,t,e,!0)}saveItem(e){return e._id&&e.isDirty?(this.itemChangeProcessor.updateItemLinksAndAttributes(e,!1,!0),e.version||(e.version={major:0,minor:0,revision:1}),this.apiClient.updateItem({_id:e._id,name:e.name,attributes:e.attributes,userAttributes:e.userAttributes,links:e.links,tags:e.tags,contributors:e.contributors,description:e.description,shortDescription:e.shortDescription,categories:e.categories,license:e.license,version:e.version,allowConversation:e.allowConversation,visibility:e.visibility}).then((t=>(JSON.stringify(e.version)===JSON.stringify(t.version)?console.log(`Saved item ${e.name}. New version: ${e.version.major}.${e.version.minor}.${e.version.revision}`):console.log(`Saved item ${e.name}. Version ${e.version.major}.${e.version.minor}.${e.version.revision} -> ${t.version.major}.${t.version.minor}.${t.version.revision}`),t&&t.version&&(e.version=t.version),e.isDirty=!1,this.itemChangeProcessor.updateItemLinksAndAttributes(e,!0,!1),e))).catch((function(t){throw console.error(`Error saving item ${e.name}`,t,e),t}))):null}async save(){console.log("Saving changes in loaded items...");const e=[];for(const t of this.loadedItems.values()){const a=this.saveItem(t);a&&e.push(a)}if(0!==e.length){let t=0;for(const a of e)a.then((function(a){l.$emit("itemRepo:itemSaved",{item:a,progress:++t,total:e.length})}));return Promise.all(e).then((function(){console.log("Saved successfully"),l.$emit("itemRepo:itemsSaved")})).catch((function(e){console.error("Error saving:",e)}))}console.log("No changes detected.")}async existsUnsavedChanges(){if(!this.activeItem)return!1;for(const e of this.loadedItems.values())if(e._id&&e.isDirty)return!0;return!1}handleRename({id:e,newName:t}){for(const a of this.itemInstances.values())for(const i of a.values())i._id===e&&(i.name=t)}invalidateId(e){this.loadedItems.delete(e),this.itemInstances.delete(e),this.loadingItems.delete(e)}}var $i,Ui={exports:{}};
5
5
  /*!
6
6
  localForage -- Offline Storage, Improved
7
7
  Version 1.10.0