@entropic-bond/crud-panel 4.1.2 → 4.2.0

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,10 +1,10 @@
1
- (function(ee,J){typeof exports=="object"&&typeof module<"u"?J(exports):typeof define=="function"&&define.amd?define(["exports"],J):(ee=typeof globalThis<"u"?globalThis:ee||self,J(ee["entropic-bond-crud-panel"]={}))})(this,function(ee){"use strict";class J{constructor(){this.subscribers=new Set}subscribe(t){return this.subscribers.add(t),()=>this.unsubscribe(t)}unsubscribe(t){this.subscribers.delete(t)}notify(t){this.subscribers.forEach(s=>s(t))}get subscribersCount(){return this.subscribers.size}}let we;const Bt=new Uint8Array(16);function zt(){if(!we&&(we=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!we))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return we(Bt)}const I=[];for(let n=0;n<256;++n)I.push((n+256).toString(16).slice(1));function qt(n,t=0){return I[n[t+0]]+I[n[t+1]]+I[n[t+2]]+I[n[t+3]]+"-"+I[n[t+4]]+I[n[t+5]]+"-"+I[n[t+6]]+I[n[t+7]]+"-"+I[n[t+8]]+I[n[t+9]]+"-"+I[n[t+10]]+I[n[t+11]]+I[n[t+12]]+I[n[t+13]]+I[n[t+14]]+I[n[t+15]]}const Kt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),nt={randomUUID:Kt};function Gt(n,t,s){if(nt.randomUUID&&!t&&!n)return nt.randomUUID();n=n||{};const l=n.random||(n.rng||zt)();if(l[6]=l[6]&15|64,l[8]=l[8]&63|128,t){s=s||0;for(let c=0;c<16;++c)t[s+c]=l[c];return t}return qt(l)}var Jt=Object.defineProperty,Qt=Object.getOwnPropertyDescriptor,Xt=(n,t,s,l)=>{for(var c=l>1?void 0:l?Qt(t,s):t,y=n.length-1,D;y>=0;y--)(D=n[y])&&(c=(l?D(t,s,c):D(c))||c);return l&&c&&Jt(t,s,c),c},U;const ot=(U=class{static registerFactory(n,t,s){this._factoryMap[n]={factory:t,annotation:s}}static classFactory(n){if(!n)throw new Error("You should provide a class name.");if(!this._factoryMap[n])throw new Error(`You should register class ${n} prior to use.`);return this._factoryMap[n].factory}static registeredClasses(){return Object.keys(this._factoryMap)}static classesExtending(n){return Object.entries(this._factoryMap).filter(([,t])=>new t.factory instanceof n).map(([t])=>t)}static annotations(n){if(n instanceof U?n=n.className:typeof n=="string"||(n=new n().className),!this._factoryMap[n])throw new Error(`You should register class ${n} prior to use.`);return this._factoryMap[n].annotation}constructor(n=Gt()){this._id=n}get className(){return this.__className}setId(n){this._id=n}get id(){return this._id}afterDeserialize(){}beforeSerialize(){}getPersistentProperties(){return this._persistentProperties?this._persistentProperties.map(n=>({...n,name:n.name.slice(1)})):[]}getPropInfo(n){const t=this.getPersistentProperties().find(s=>s.name===n);if(!t)throw new Error(`Property "${n}" has not been registered.`);return t}isRequired(n){return this.getPropInfo(n).validator!=null}isPropValueValid(n){const t=this.getPropInfo(n);return t.validator?t.validator(this[t.name],t,this):!0}clone(n){const t=n.toObject();return delete t.id,this.fromObject(t)}fromObject(n){return this.fromObj(n),this.afterDeserialize(),this}fromObj(n){return this._persistentProperties?(this._persistentProperties.forEach(t=>{const s=this.removeUnderscore(t),l=n[s];l!=null&&(this[t.name]=this.fromDeepObject(l))}),this):this}toObject(){const n={},t=this.toObj(n);return this.pushDocument(n,this.className,t),{...t,__rootCollections:n}}toObj(n){if(!this._persistentProperties)return{};this.beforeSerialize();const t={};if(!this.className)throw new Error("You should register this class prior to streaming it.");return this._persistentProperties.forEach(s=>{const l=this[s.name],c=this.removeUnderscore(s);l!=null&&(s.isReference?t[c]=this.toReferenceObj(s,n):t[c]=this.toDeepObj(l,n),s.searchableArray&&(t[U.searchableArrayNameFor(c)]=l.map(y=>y.id)))}),t.__className=this.className,t}static searchableArrayNameFor(n){return`__${n}_searchable`}fromDeepObject(n){if(n==null)return n;if(Array.isArray(n))return n.map(t=>this.fromDeepObject(t));if(n.__documentReference){const t=n,s=U.createInstance(t);return s.__documentReference=n.__documentReference,s}if(n.__className)return U.createInstance(n);if(typeof n=="object"){const t={};return Object.entries(n).forEach(([s,l])=>t[s]=this.fromDeepObject(l)),t}return n}toDeepObj(n,t){if(n!=null){if(Array.isArray(n))return n.map(s=>this.toDeepObj(s,t));if(n.__documentReference)return n;if(n instanceof U)return n.toObj(t);if(typeof n=="object"){const s={};return Object.entries(n).forEach(([l,c])=>s[l]=this.toDeepObj(c,t)),s}return n}}toReferenceObj(n,t){const s=this[n.name],l=c=>{let y;return typeof n.storeInCollection=="function"?y=n.storeInCollection(c,n):y=n.storeInCollection||c.className,y};return Array.isArray(s)?s.map(c=>(n.isPureReference||this.pushDocument(t,l(c),c),this.buildRefObject(c,l(c),n.forcedPersistentProps))):(n.isPureReference||this.pushDocument(t,l(s),s),this.buildRefObject(s,l(s),n.forcedPersistentProps))}buildRefObject(n,t,s){const l=s==null?void 0:s.reduce((c,y)=>(n[y]!==void 0&&(c[y]=n[y]),c),{});return{id:n.id,__className:n.className||n.__className,__documentReference:{storedInCollection:t},...l}}pushDocument(n,t,s){if("__documentReference"in s&&s.__documentReference)return;n[t]||(n[t]=[]);const l=this.toDeepObj(s,n);n[t].push(l)}removeUnderscore(n){return n.name.slice(1)}static createReference(n){const t=U.createInstance(n);return t.__documentReference=n.__documentReference||{storedInCollection:t.className},t}static createInstance(n){if(typeof n=="string")return new(U.classFactory(n));try{return new(U.classFactory(n.__className))().fromObject(n)}catch(t){const s=Object.entries(n).filter(([l,c])=>c!=null&&typeof c!="function").map(([l,c])=>`${l}: ${c}`).join(`,
1
+ (function(ee,J){typeof exports=="object"&&typeof module<"u"?J(exports):typeof define=="function"&&define.amd?define(["exports"],J):(ee=typeof globalThis<"u"?globalThis:ee||self,J(ee["entropic-bond-crud-panel"]={}))})(this,function(ee){"use strict";class J{constructor(){this.subscribers=new Set}subscribe(t){return this.subscribers.add(t),()=>this.unsubscribe(t)}unsubscribe(t){this.subscribers.delete(t)}notify(t){this.subscribers.forEach(s=>s(t))}get subscribersCount(){return this.subscribers.size}}let we;const Bt=new Uint8Array(16);function zt(){if(!we&&(we=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!we))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return we(Bt)}const I=[];for(let n=0;n<256;++n)I.push((n+256).toString(16).slice(1));function qt(n,t=0){return I[n[t+0]]+I[n[t+1]]+I[n[t+2]]+I[n[t+3]]+"-"+I[n[t+4]]+I[n[t+5]]+"-"+I[n[t+6]]+I[n[t+7]]+"-"+I[n[t+8]]+I[n[t+9]]+"-"+I[n[t+10]]+I[n[t+11]]+I[n[t+12]]+I[n[t+13]]+I[n[t+14]]+I[n[t+15]]}const Kt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),nt={randomUUID:Kt};function Gt(n,t,s){if(nt.randomUUID&&!t&&!n)return nt.randomUUID();n=n||{};const c=n.random||(n.rng||zt)();if(c[6]=c[6]&15|64,c[8]=c[8]&63|128,t){s=s||0;for(let l=0;l<16;++l)t[s+l]=c[l];return t}return qt(c)}var Jt=Object.defineProperty,Qt=Object.getOwnPropertyDescriptor,Xt=(n,t,s,c)=>{for(var l=c>1?void 0:c?Qt(t,s):t,y=n.length-1,D;y>=0;y--)(D=n[y])&&(l=(c?D(t,s,l):D(l))||l);return c&&l&&Jt(t,s,l),l},V;const ot=(V=class{static registerFactory(n,t,s){this._factoryMap[n]={factory:t,annotation:s}}static classFactory(n){if(!n)throw new Error("You should provide a class name.");if(!this._factoryMap[n])throw new Error(`You should register class ${n} prior to use.`);return this._factoryMap[n].factory}static registeredClasses(){return Object.keys(this._factoryMap)}static classesExtending(n){return Object.entries(this._factoryMap).filter(([,t])=>new t.factory instanceof n).map(([t])=>t)}static annotations(n){if(n instanceof V?n=n.className:typeof n=="string"||(n=new n().className),!this._factoryMap[n])throw new Error(`You should register class ${n} prior to use.`);return this._factoryMap[n].annotation}constructor(n=Gt()){this._id=n}get className(){return this.__className}setId(n){this._id=n}get id(){return this._id}afterDeserialize(){}beforeSerialize(){}getPersistentProperties(){return this._persistentProperties?this._persistentProperties.map(n=>({...n,name:n.name.slice(1)})):[]}getPropInfo(n){const t=this.getPersistentProperties().find(s=>s.name===n);if(!t)throw new Error(`Property "${n}" has not been registered.`);return t}isRequired(n){return this.getPropInfo(n).validator!=null}isPropValueValid(n){const t=this.getPropInfo(n);return t.validator?t.validator(this[t.name],t,this):!0}clone(n){const t=n.toObject();return delete t.id,this.fromObject(t)}fromObject(n){return this.fromObj(n),this.afterDeserialize(),this}fromObj(n){return this._persistentProperties?(this._persistentProperties.forEach(t=>{const s=this.removeUnderscore(t),c=n[s];c!=null&&(this[t.name]=this.fromDeepObject(c))}),this):this}toObject(){const n={},t=this.toObj(n);return this.pushDocument(n,this.className,t),{...t,__rootCollections:n}}toObj(n){if(!this._persistentProperties)return{};this.beforeSerialize();const t={};if(!this.className)throw new Error("You should register this class prior to streaming it.");return this._persistentProperties.forEach(s=>{const c=this[s.name],l=this.removeUnderscore(s);c!=null&&(s.isReference?t[l]=this.toReferenceObj(s,n):t[l]=this.toDeepObj(c,n),s.searchableArray&&(t[V.searchableArrayNameFor(l)]=c.map(y=>y.id)))}),t.__className=this.className,t}static searchableArrayNameFor(n){return`__${n}_searchable`}fromDeepObject(n){if(n==null)return n;if(Array.isArray(n))return n.map(t=>this.fromDeepObject(t));if(n.__documentReference){const t=n,s=V.createInstance(t);return s.__documentReference=n.__documentReference,s}if(n.__className)return V.createInstance(n);if(typeof n=="object"){const t={};return Object.entries(n).forEach(([s,c])=>t[s]=this.fromDeepObject(c)),t}return n}toDeepObj(n,t){if(n!=null){if(Array.isArray(n))return n.map(s=>this.toDeepObj(s,t));if(n.__documentReference)return n;if(n instanceof V)return n.toObj(t);if(typeof n=="object"){const s={};return Object.entries(n).forEach(([c,l])=>s[c]=this.toDeepObj(l,t)),s}return n}}toReferenceObj(n,t){const s=this[n.name],c=l=>{let y;return typeof n.storeInCollection=="function"?y=n.storeInCollection(l,n):y=n.storeInCollection||l.className,y};return Array.isArray(s)?s.map(l=>(n.isPureReference||this.pushDocument(t,c(l),l),this.buildRefObject(l,c(l),n.forcedPersistentProps))):(n.isPureReference||this.pushDocument(t,c(s),s),this.buildRefObject(s,c(s),n.forcedPersistentProps))}buildRefObject(n,t,s){const c=s==null?void 0:s.reduce((l,y)=>(n[y]!==void 0&&(l[y]=n[y]),l),{});return{id:n.id,__className:n.className||n.__className,__documentReference:{storedInCollection:t},...c}}pushDocument(n,t,s){if("__documentReference"in s&&s.__documentReference)return;n[t]||(n[t]=[]);const c=this.toDeepObj(s,n);n[t].push(c)}removeUnderscore(n){return n.name.slice(1)}static createReference(n){const t=V.createInstance(n);return t.__documentReference=n.__documentReference||{storedInCollection:t.className},t}static createInstance(n){if(typeof n=="string")return new(V.classFactory(n));try{return new(V.classFactory(n.__className))().fromObject(n)}catch(t){const s=Object.entries(n).filter(([c,l])=>l!=null&&typeof l!="function").map(([c,l])=>`${c}: ${l}`).join(`,
2
2
  `);throw new Error(`${t}
3
3
  -----> Class name not found in object:
4
4
  {
5
5
  ${s}
6
6
  }
7
- `)}}static propInfo(n,t){return U.createInstance(n).getPropInfo(t)}},U._factoryMap={},U);Xt([se],ot.prototype,"_id",2);let it=ot;function se(n,t){return Zt()(n,t)}function Zt(n){return function(t,s){Object.getOwnPropertyDescriptor(t,"_persistentProperties")||(t._persistentProperties?t._persistentProperties=[...t._persistentProperties]:t._persistentProperties=[]);const l=t._persistentProperties.find(c=>c.name===s);l?Object.assign(l,n):t._persistentProperties.push({name:s,...n})}}function er(n,t){return s=>{it.registerFactory(n,s,t),s.prototype.__className=n}}const st=class me{static registerCloudStorage(t,s){me._cloudStorageFactoryMap[t]=s}static createInstance(t){const s=me._cloudStorageFactoryMap[t];if(!s)throw new Error(`You should register the ${t} cloud storage provider prior to use it`);return s()}get className(){return this.__className}static useCloudStorage(t){me._defaultCloudStorage=t}static get defaultCloudStorage(){if(!me._defaultCloudStorage)throw new Error("You should define a default cloud storage provider prior to use it");return me._defaultCloudStorage}};st._cloudStorageFactoryMap={};let ye=st;function tr(n,t){return ye.registerCloudStorage(n,t),s=>{s.prototype.__className=n}}var rr=Object.defineProperty,nr=Object.getOwnPropertyDescriptor,or=(n,t,s,l)=>{for(var c=l>1?void 0:l?nr(t,s):t,y=n.length-1,D;y>=0;y--)(D=n[y])&&(c=(l?D(t,s,c):D(c))||c);return l&&c&&rr(t,s,c),c};let Ve=class extends ye{constructor(n=""){super(),this._simulateDelay=0,this._pendingPromises=[],this.mockFileSystem={},this._pathToMockFiles=n}simulateDelay(n){return this._simulateDelay=n,this}resolveWithDelay(n){if(this._simulateDelay<=0)return Promise.resolve(n);const t=new Promise(s=>{setTimeout(()=>s(n),this._simulateDelay)});return this._pendingPromises.push(t),t.finally(()=>this._pendingPromises=this._pendingPromises.filter(s=>s===t)),t}save(n,t){const s=n;this._onProgress&&this._onProgress(0,100),this.mockFileSystem[n]=JSON.stringify(t),this._onProgress&&this._onProgress(100,100);const l=t instanceof File?t.name:s;return this.resolveWithDelay(l)}uploadControl(){return{resume:()=>{},pause:()=>{},cancel:()=>{},onProgress:n=>this._onProgress=n}}getUrl(n){return Promise.resolve(this._pathToMockFiles+n)}delete(n){return delete this.mockFileSystem[n],this.resolveWithDelay()}};Ve=or([tr("MockCloudStorage",()=>new Ve)],Ve);var ir=Object.defineProperty,sr=Object.getOwnPropertyDescriptor,ae=(n,t,s,l)=>{for(var c=l>1?void 0:l?sr(t,s):t,y=n.length-1,D;y>=0;y--)(D=n[y])&&(c=(l?D(t,s,c):D(c))||c);return l&&c&&ir(t,s,c),c};let te=class extends it{constructor(){super(...arguments),this._onChange=new J}async save({data:n,fileName:t,progress:s,cloudStorageProvider:l}={}){const c=n||this._pendingData;c&&(this._reference&&await this.delete(),this.provider=l||ye.defaultCloudStorage,this._originalFileName=t||(c instanceof File?c.name:void 0),this._reference=await this.provider.save(this.id,c,s),this._url=await this.provider.getUrl(this._reference),this._pendingData=void 0,this._onChange.notify({event:0,storedFile:this}))}uploadControl(){return this.provider.uploadControl()}async delete(){if(!this._reference)throw new Error("Cannot delete a not stored file");await this.provider.delete(this._reference),this._reference=void 0,this._url=void 0,this._onChange.notify({event:2,storedFile:this})}set provider(n){this._provider=n,this._cloudStorageProviderName=n.className}get provider(){if(!this._provider)try{this._provider=ye.createInstance(this._cloudStorageProviderName)}catch{this._provider=ye.defaultCloudStorage}return this._provider}get url(){return this._url}get mimeType(){return this._mimeType}setDataToStore(n){return this._pendingData=n,this._originalFileName=n instanceof File?n.name:void 0,this._mimeType=n instanceof Blob?n.type:void 0,this._onChange.notify({event:1,pendingData:n,storedFile:this}),this}get originalFileName(){return this._originalFileName}onChange(n){return this._onChange.subscribe(n)}};ae([se],te.prototype,"_reference",2),ae([se],te.prototype,"_url",2),ae([se],te.prototype,"_cloudStorageProviderName",2),ae([se],te.prototype,"_originalFileName",2),ae([se],te.prototype,"_mimeType",2),te=ae([er("StoredFile")],te);function ar(n,t="-"){if(!n)return"";const s=n.slice(1).replace(/( |[A-Z])/g,l=>l===" "?"-":t+l[0].toLowerCase());return n[0].toLocaleLowerCase()+s.replace(/--/g,"-")}class ur{constructor(){this._stages={},this._onProgress=new J}notifyBusy(t,s){this.pushStage({name:s??"",progress:t?0:1,total:1})}pushStage(t){this._stages[t.name]=t;const s=Object.values(this._stages).reduce((l,c,y,D)=>l+c.progress/c.total/D.length,0);this._onProgress.notify({busy:s<1,overallProgress:s,stages:this._stages}),s>=1&&(this._stages={})}onProgress(t){return this._onProgress.subscribe(t)}}const re=class re{constructor(t){this.progressController=new ur,this.onChangeHdl=new J,this.onErrorHdl=new J,this.validator={},this.setDocument(t||this.createDocument())}allRequiredPropertiesFilled(){return this.nonFilledRequiredProperties.length<=0}get nonFilledRequiredProperties(){return this.requiredProperties.filter(t=>this.validateProp(t))}get requiredProperties(){if(!this.document)throw new Error(re.errorMessages.missedDocument);return this.document.getPersistentProperties().filter(t=>this.document.isRequired(t.name)).map(t=>t.name).concat(Object.keys(this.validator))}addValidator(t,s,l){this.validator[t]={func:s,errorMessage:l}}removeValidator(t){delete this.validator[t]}failedValidationError(t){var s;return(s=this.validator[t])==null?void 0:s.errorMessage}validateProp(t){if(!this.document)throw new Error(re.errorMessages.missedDocument);const s=this.document[t];return this.validator[t]?!this.validator[t].func(s):!this.document.isPropValueValid(t)}storeDoc(){if(!this.document)throw new Error(re.errorMessages.missedDocument);return this.model.save(this.document)}deleteDoc(){if(!this.document)throw new Error(re.errorMessages.missedDocument);return this.model.delete(this.document.id)}queryDocs(t){let s=this.model.find();return t&&(s=s.limit(t)),s}findDocs(t){}async setFilter(t){return this._filter=t,this.onChangeHdl.notify({action:"filterChange"}),this}resetFilter(){return this._filter=void 0,this.onChangeHdl.notify({action:"filterChange"}),this}onChange(t){return this.onChangeHdl.subscribe(t)}onError(t){return this.onErrorHdl.subscribe(t)}notifyChange(t){this.onChangeHdl.notify(t)}newDocument(){return this.setDocument(this.createDocument())}async storeDocument(){const t="Saving main document";try{this.progressController.notifyBusy(!0,t),await this.storeDoc(),this.onChangeHdl.notify({documentCollection:await this.documentCollection(),action:"saved"})}catch(s){if(this.onChangeHdl.notify({error:this.errorToError(s)}),this.onErrorHdl.notify(this.errorToError(s)),this.throwOnError)throw s}finally{this.progressController.notifyBusy(!1,t)}}async deleteDocument(){const t="Delete main document";try{this.progressController.notifyBusy(!0,t),await this.deleteDoc(),this.onChangeHdl.notify({documentCollection:await this.documentCollection(),action:"deleted"})}catch(s){if(this.onChangeHdl.notify({error:this.errorToError(s)}),this.onErrorHdl.notify(this.errorToError(s)),this.throwOnError)throw s}finally{this.progressController.notifyBusy(!1,t)}}async documentCollection(t){const s="Retrieving document collection";let l=[];try{this.progressController.notifyBusy(!0,s);const c=this.findDocs(t);c?l=await c:l=await this.queryDocs(t).get()}catch(c){if(this.onChangeHdl.notify({error:this.errorToError(c)}),this.onErrorHdl.notify(this.errorToError(c)),this.throwOnError)throw c}finally{this.progressController.notifyBusy(!1,s)}return l}filter(t){return t.filter(s=>{var l;return((l=this._filter)==null?void 0:l.call(this,s))??!0})}onProgress(t){return this.progressController.onProgress(t)}get model(){return this._model||(this._model=this.getModel())}setDocument(t){return this._document!==t&&(this.unsubscribeDocument&&this.unsubscribeDocument(),t&&(this.unsubscribeDocument=t.onChange(s=>this.onChangeHdl.notify({documentProps:s}))),this._document=t,this.onChangeHdl.notify({documentChanged:this._document})),this}set document(t){this.setDocument(t)}get document(){return this._document}managedThrow(t){if(this.onChangeHdl.notify({error:this.errorToError(t)}),this.onErrorHdl.notify(this.errorToError(t)),this.throwOnError)throw this.errorToError(t)}errorToError(t){return t instanceof Error?t:typeof t=="string"?new Error(t):"code"in t?new Error(t.code):"message"in t?new Error(t.error):new Error(JSON.stringify(t))}get throwOnError(){return this.onErrorHdl.subscribersCount===0}};re.errorMessages={missedDocument:"No document to save"};let xe=re;function cr(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var We={exports:{}},g={};/**
7
+ `)}}static propInfo(n,t){return V.createInstance(n).getPropInfo(t)}},V._factoryMap={},V);Xt([se],ot.prototype,"_id",2);let it=ot;function se(n,t){return Zt()(n,t)}function Zt(n){return function(t,s){Object.getOwnPropertyDescriptor(t,"_persistentProperties")||(t._persistentProperties?t._persistentProperties=[...t._persistentProperties]:t._persistentProperties=[]);const c=t._persistentProperties.find(l=>l.name===s);c?Object.assign(c,n):t._persistentProperties.push({name:s,...n})}}function er(n,t){return s=>{it.registerFactory(n,s,t),s.prototype.__className=n}}const st=class me{static registerCloudStorage(t,s){me._cloudStorageFactoryMap[t]=s}static createInstance(t){const s=me._cloudStorageFactoryMap[t];if(!s)throw new Error(`You should register the ${t} cloud storage provider prior to use it`);return s()}get className(){return this.__className}static useCloudStorage(t){me._defaultCloudStorage=t}static get defaultCloudStorage(){if(!me._defaultCloudStorage)throw new Error("You should define a default cloud storage provider prior to use it");return me._defaultCloudStorage}};st._cloudStorageFactoryMap={};let ye=st;function tr(n,t){return ye.registerCloudStorage(n,t),s=>{s.prototype.__className=n}}var rr=Object.defineProperty,nr=Object.getOwnPropertyDescriptor,or=(n,t,s,c)=>{for(var l=c>1?void 0:c?nr(t,s):t,y=n.length-1,D;y>=0;y--)(D=n[y])&&(l=(c?D(t,s,l):D(l))||l);return c&&l&&rr(t,s,l),l};let Ue=class extends ye{constructor(n=""){super(),this._simulateDelay=0,this._pendingPromises=[],this.mockFileSystem={},this._pathToMockFiles=n}simulateDelay(n){return this._simulateDelay=n,this}resolveWithDelay(n){if(this._simulateDelay<=0)return Promise.resolve(n);const t=new Promise(s=>{setTimeout(()=>s(n),this._simulateDelay)});return this._pendingPromises.push(t),t.finally(()=>this._pendingPromises=this._pendingPromises.filter(s=>s===t)),t}save(n,t){const s=n;this._onProgress&&this._onProgress(0,100),this.mockFileSystem[n]=JSON.stringify(t),this._onProgress&&this._onProgress(100,100);const c=t instanceof File?t.name:s;return this.resolveWithDelay(c)}uploadControl(){return{resume:()=>{},pause:()=>{},cancel:()=>{},onProgress:n=>this._onProgress=n}}getUrl(n){return Promise.resolve(this._pathToMockFiles+n)}delete(n){return delete this.mockFileSystem[n],this.resolveWithDelay()}};Ue=or([tr("MockCloudStorage",()=>new Ue)],Ue);var ir=Object.defineProperty,sr=Object.getOwnPropertyDescriptor,ae=(n,t,s,c)=>{for(var l=c>1?void 0:c?sr(t,s):t,y=n.length-1,D;y>=0;y--)(D=n[y])&&(l=(c?D(t,s,l):D(l))||l);return c&&l&&ir(t,s,l),l};let te=class extends it{constructor(){super(...arguments),this._onChange=new J}async save({data:n,fileName:t,progress:s,cloudStorageProvider:c}={}){const l=n||this._pendingData;l&&(this._reference&&await this.delete(),this.provider=c||ye.defaultCloudStorage,this._originalFileName=t||(l instanceof File?l.name:void 0),this._reference=await this.provider.save(this.id,l,s),this._url=await this.provider.getUrl(this._reference),this._pendingData=void 0,this._onChange.notify({event:0,storedFile:this}))}uploadControl(){return this.provider.uploadControl()}async delete(){if(!this._reference)throw new Error("Cannot delete a not stored file");await this.provider.delete(this._reference),this._reference=void 0,this._url=void 0,this._onChange.notify({event:2,storedFile:this})}set provider(n){this._provider=n,this._cloudStorageProviderName=n.className}get provider(){if(!this._provider)try{this._provider=ye.createInstance(this._cloudStorageProviderName)}catch{this._provider=ye.defaultCloudStorage}return this._provider}get url(){return this._url}get mimeType(){return this._mimeType}setDataToStore(n){return this._pendingData=n,this._originalFileName=n instanceof File?n.name:void 0,this._mimeType=n instanceof Blob?n.type:void 0,this._onChange.notify({event:1,pendingData:n,storedFile:this}),this}get originalFileName(){return this._originalFileName}onChange(n){return this._onChange.subscribe(n)}};ae([se],te.prototype,"_reference",2),ae([se],te.prototype,"_url",2),ae([se],te.prototype,"_cloudStorageProviderName",2),ae([se],te.prototype,"_originalFileName",2),ae([se],te.prototype,"_mimeType",2),te=ae([er("StoredFile")],te);function ar(n,t="-"){if(!n)return"";const s=n.slice(1).replace(/( |[A-Z])/g,c=>c===" "?"-":t+c[0].toLowerCase());return n[0].toLocaleLowerCase()+s.replace(/--/g,"-")}class ur{constructor(){this._debug=!1,this._stages={},this._onProgress=new J}notifyBusy(t,s){this.pushStage({name:s??"",progress:t?0:1,total:1})}pushStage(t){this._stages[t.name]=t;const s=Object.values(this._stages).reduce((c,l,y,D)=>c+l.progress/l.total/D.length,0);this._onProgress.notify({busy:s<1,overallProgress:s,stages:this._stages}),s>=1&&(this._stages={}),this.debug&&console.log(`ProgressController ${t.name}: Progress: ${t.progress} Stages: ${t.total}`)}onProgress(t){return this._onProgress.subscribe(t)}set debug(t){this._debug=t}get debug(){return this._debug}}const re=class re{constructor(t){this.progressController=new ur,this.onChangeHdl=new J,this.onErrorHdl=new J,this.validator={},this.setDocument(t||this.createDocument())}allRequiredPropertiesFilled(){return this.nonFilledRequiredProperties.length<=0}get nonFilledRequiredProperties(){return this.requiredProperties.filter(t=>this.validateProp(t))}get requiredProperties(){if(!this.document)throw new Error(re.errorMessages.missedDocument);const t=this.document.getPersistentProperties().filter(c=>this.document.isRequired(c.name)).map(c=>c.name);return[...new Set(t.concat(Object.keys(this.validator)))]}addValidator(t,s,c){this.validator[t]={func:s,errorMessage:c}}removeValidator(t){delete this.validator[t]}failedValidationError(t){var s;return(s=this.validator[t])==null?void 0:s.errorMessage}validateProp(t){if(!this.document)throw new Error(re.errorMessages.missedDocument);const s=this.document[t];return this.validator[t]?!this.validator[t].func(s):!this.document.isPropValueValid(t)}storeDoc(){if(!this.document)throw new Error(re.errorMessages.missedDocument);return this.model.save(this.document)}deleteDoc(){if(!this.document)throw new Error(re.errorMessages.missedDocument);return this.model.delete(this.document.id)}queryDocs(t){let s=this.model.find();return t&&(s=s.limit(t)),s}findDocs(t){}async setFilter(t){return this._filter=t,this.onChangeHdl.notify({action:"filterChange"}),this}resetFilter(){return this._filter=void 0,this.onChangeHdl.notify({action:"filterChange"}),this}onChange(t){return this.onChangeHdl.subscribe(t)}onError(t){return this.onErrorHdl.subscribe(t)}notifyChange(t){this.onChangeHdl.notify(t)}newDocument(){return this.setDocument(this.createDocument())}async storeDocument(){const t="Saving main document";try{this.progressController.notifyBusy(!0,t),await this.storeDoc(),this.onChangeHdl.notify({documentCollection:await this.documentCollection(),action:"saved"})}catch(s){if(this.onChangeHdl.notify({error:this.errorToError(s)}),this.onErrorHdl.notify(this.errorToError(s)),this.throwOnError)throw s}finally{this.progressController.notifyBusy(!1,t)}}async deleteDocument(){const t="Delete main document";try{this.progressController.notifyBusy(!0,t),await this.deleteDoc(),this.onChangeHdl.notify({documentCollection:await this.documentCollection(),action:"deleted"})}catch(s){if(this.onChangeHdl.notify({error:this.errorToError(s)}),this.onErrorHdl.notify(this.errorToError(s)),this.throwOnError)throw s}finally{this.progressController.notifyBusy(!1,t)}}async documentCollection(t){const s="Retrieving document collection";let c=[];try{this.progressController.notifyBusy(!0,s);const l=this.findDocs(t);l?c=await l:c=await this.queryDocs(t).get()}catch(l){if(this.onChangeHdl.notify({error:this.errorToError(l)}),this.onErrorHdl.notify(this.errorToError(l)),this.throwOnError)throw l}finally{this.progressController.notifyBusy(!1,s)}return c}filter(t){return t.filter(s=>{var c;return((c=this._filter)==null?void 0:c.call(this,s))??!0})}onProgress(t){return this.progressController.onProgress(t)}get model(){return this._model||(this._model=this.getModel())}setDocument(t){return this._document!==t&&(this.unsubscribeDocument&&this.unsubscribeDocument(),t&&(this.unsubscribeDocument=t.onChange(s=>this.onChangeHdl.notify({documentProps:s}))),this._document=t,this.onChangeHdl.notify({documentChanged:this._document})),this}set document(t){this.setDocument(t)}get document(){return this._document}managedThrow(t){if(this.onChangeHdl.notify({error:this.errorToError(t)}),this.onErrorHdl.notify(this.errorToError(t)),this.throwOnError)throw this.errorToError(t)}errorToError(t){return t instanceof Error?t:typeof t=="string"?new Error(t):"code"in t?new Error(t.code):"message"in t?new Error(t.error):new Error(JSON.stringify(t))}get throwOnError(){return this.onErrorHdl.subscribersCount===0}};re.errorMessages={missedDocument:"No document to save"};let xe=re;function cr(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var We={exports:{}},g={};/**
8
8
  * @license React
9
9
  * react.production.min.js
10
10
  *
@@ -12,7 +12,7 @@
12
12
  *
13
13
  * This source code is licensed under the MIT license found in the
14
14
  * LICENSE file in the root directory of this source tree.
15
- */var at;function lr(){if(at)return g;at=1;var n=Symbol.for("react.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),y=Symbol.for("react.provider"),D=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),B=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),H=Symbol.iterator;function ne(o){return o===null||typeof o!="object"?null:(o=H&&o[H]||o["@@iterator"],typeof o=="function"?o:null)}var W={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},q=Object.assign,Re={};function K(o,f,v){this.props=o,this.context=f,this.refs=Re,this.updater=v||W}K.prototype.isReactComponent={},K.prototype.setState=function(o,f){if(typeof o!="object"&&typeof o!="function"&&o!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,o,f,"setState")},K.prototype.forceUpdate=function(o){this.updater.enqueueForceUpdate(this,o,"forceUpdate")};function Pe(){}Pe.prototype=K.prototype;function ce(o,f,v){this.props=o,this.context=f,this.refs=Re,this.updater=v||W}var le=ce.prototype=new Pe;le.constructor=ce,q(le,K.prototype),le.isPureReactComponent=!0;var G=Array.isArray,A=Object.prototype.hasOwnProperty,L={current:null},Q={key:!0,ref:!0,__self:!0,__source:!0};function oe(o,f,v){var E,_={},w=null,k=null;if(f!=null)for(E in f.ref!==void 0&&(k=f.ref),f.key!==void 0&&(w=""+f.key),f)A.call(f,E)&&!Q.hasOwnProperty(E)&&(_[E]=f[E]);var R=arguments.length-2;if(R===1)_.children=v;else if(1<R){for(var P=Array(R),$=0;$<R;$++)P[$]=arguments[$+2];_.children=P}if(o&&o.defaultProps)for(E in R=o.defaultProps,R)_[E]===void 0&&(_[E]=R[E]);return{$$typeof:n,type:o,key:w,ref:k,props:_,_owner:L.current}}function Se(o,f){return{$$typeof:n,type:o.type,key:f,ref:o.ref,props:o.props,_owner:o._owner}}function ge(o){return typeof o=="object"&&o!==null&&o.$$typeof===n}function Ye(o){var f={"=":"=0",":":"=2"};return"$"+o.replace(/[=:]/g,function(v){return f[v]})}var Oe=/\/+/g;function _e(o,f){return typeof o=="object"&&o!==null&&o.key!=null?Ye(""+o.key):f.toString(36)}function fe(o,f,v,E,_){var w=typeof o;(w==="undefined"||w==="boolean")&&(o=null);var k=!1;if(o===null)k=!0;else switch(w){case"string":case"number":k=!0;break;case"object":switch(o.$$typeof){case n:case t:k=!0}}if(k)return k=o,_=_(k),o=E===""?"."+_e(k,0):E,G(_)?(v="",o!=null&&(v=o.replace(Oe,"$&/")+"/"),fe(_,f,v,"",function($){return $})):_!=null&&(ge(_)&&(_=Se(_,v+(!_.key||k&&k.key===_.key?"":(""+_.key).replace(Oe,"$&/")+"/")+o)),f.push(_)),1;if(k=0,E=E===""?".":E+":",G(o))for(var R=0;R<o.length;R++){w=o[R];var P=E+_e(w,R);k+=fe(w,f,v,P,_)}else if(P=ne(o),typeof P=="function")for(o=P.call(o),R=0;!(w=o.next()).done;)w=w.value,P=E+_e(w,R++),k+=fe(w,f,v,P,_);else if(w==="object")throw f=String(o),Error("Objects are not valid as a React child (found: "+(f==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":f)+"). If you meant to render a collection of children, use an array instead.");return k}function Y(o,f,v){if(o==null)return o;var E=[],_=0;return fe(o,E,"","",function(w){return f.call(v,w,_++)}),E}function X(o){if(o._status===-1){var f=o._result;f=f(),f.then(function(v){(o._status===0||o._status===-1)&&(o._status=1,o._result=v)},function(v){(o._status===0||o._status===-1)&&(o._status=2,o._result=v)}),o._status===-1&&(o._status=0,o._result=f)}if(o._status===1)return o._result.default;throw o._result}var h={current:null},ie={transition:null},De={ReactCurrentDispatcher:h,ReactCurrentBatchConfig:ie,ReactCurrentOwner:L};return g.Children={map:Y,forEach:function(o,f,v){Y(o,function(){f.apply(this,arguments)},v)},count:function(o){var f=0;return Y(o,function(){f++}),f},toArray:function(o){return Y(o,function(f){return f})||[]},only:function(o){if(!ge(o))throw Error("React.Children.only expected to receive a single React element child.");return o}},g.Component=K,g.Fragment=s,g.Profiler=c,g.PureComponent=ce,g.StrictMode=l,g.Suspense=x,g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=De,g.cloneElement=function(o,f,v){if(o==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+o+".");var E=q({},o.props),_=o.key,w=o.ref,k=o._owner;if(f!=null){if(f.ref!==void 0&&(w=f.ref,k=L.current),f.key!==void 0&&(_=""+f.key),o.type&&o.type.defaultProps)var R=o.type.defaultProps;for(P in f)A.call(f,P)&&!Q.hasOwnProperty(P)&&(E[P]=f[P]===void 0&&R!==void 0?R[P]:f[P])}var P=arguments.length-2;if(P===1)E.children=v;else if(1<P){R=Array(P);for(var $=0;$<P;$++)R[$]=arguments[$+2];E.children=R}return{$$typeof:n,type:o.type,key:_,ref:w,props:E,_owner:k}},g.createContext=function(o){return o={$$typeof:D,_currentValue:o,_currentValue2:o,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},o.Provider={$$typeof:y,_context:o},o.Consumer=o},g.createElement=oe,g.createFactory=function(o){var f=oe.bind(null,o);return f.type=o,f},g.createRef=function(){return{current:null}},g.forwardRef=function(o){return{$$typeof:F,render:o}},g.isValidElement=ge,g.lazy=function(o){return{$$typeof:z,_payload:{_status:-1,_result:o},_init:X}},g.memo=function(o,f){return{$$typeof:B,type:o,compare:f===void 0?null:f}},g.startTransition=function(o){var f=ie.transition;ie.transition={};try{o()}finally{ie.transition=f}},g.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},g.useCallback=function(o,f){return h.current.useCallback(o,f)},g.useContext=function(o){return h.current.useContext(o)},g.useDebugValue=function(){},g.useDeferredValue=function(o){return h.current.useDeferredValue(o)},g.useEffect=function(o,f){return h.current.useEffect(o,f)},g.useId=function(){return h.current.useId()},g.useImperativeHandle=function(o,f,v){return h.current.useImperativeHandle(o,f,v)},g.useInsertionEffect=function(o,f){return h.current.useInsertionEffect(o,f)},g.useLayoutEffect=function(o,f){return h.current.useLayoutEffect(o,f)},g.useMemo=function(o,f){return h.current.useMemo(o,f)},g.useReducer=function(o,f,v){return h.current.useReducer(o,f,v)},g.useRef=function(o){return h.current.useRef(o)},g.useState=function(o){return h.current.useState(o)},g.useSyncExternalStore=function(o,f,v){return h.current.useSyncExternalStore(o,f,v)},g.useTransition=function(){return h.current.useTransition()},g.version="18.2.0",g}var ve={exports:{}};/**
15
+ */var at;function lr(){if(at)return g;at=1;var n=Symbol.for("react.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),y=Symbol.for("react.provider"),D=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),B=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),H=Symbol.iterator;function ne(o){return o===null||typeof o!="object"?null:(o=H&&o[H]||o["@@iterator"],typeof o=="function"?o:null)}var W={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},q=Object.assign,Re={};function K(o,f,v){this.props=o,this.context=f,this.refs=Re,this.updater=v||W}K.prototype.isReactComponent={},K.prototype.setState=function(o,f){if(typeof o!="object"&&typeof o!="function"&&o!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,o,f,"setState")},K.prototype.forceUpdate=function(o){this.updater.enqueueForceUpdate(this,o,"forceUpdate")};function Pe(){}Pe.prototype=K.prototype;function ce(o,f,v){this.props=o,this.context=f,this.refs=Re,this.updater=v||W}var le=ce.prototype=new Pe;le.constructor=ce,q(le,K.prototype),le.isPureReactComponent=!0;var G=Array.isArray,A=Object.prototype.hasOwnProperty,L={current:null},Q={key:!0,ref:!0,__self:!0,__source:!0};function oe(o,f,v){var E,_={},w=null,k=null;if(f!=null)for(E in f.ref!==void 0&&(k=f.ref),f.key!==void 0&&(w=""+f.key),f)A.call(f,E)&&!Q.hasOwnProperty(E)&&(_[E]=f[E]);var R=arguments.length-2;if(R===1)_.children=v;else if(1<R){for(var P=Array(R),$=0;$<R;$++)P[$]=arguments[$+2];_.children=P}if(o&&o.defaultProps)for(E in R=o.defaultProps,R)_[E]===void 0&&(_[E]=R[E]);return{$$typeof:n,type:o,key:w,ref:k,props:_,_owner:L.current}}function Se(o,f){return{$$typeof:n,type:o.type,key:f,ref:o.ref,props:o.props,_owner:o._owner}}function ge(o){return typeof o=="object"&&o!==null&&o.$$typeof===n}function Ye(o){var f={"=":"=0",":":"=2"};return"$"+o.replace(/[=:]/g,function(v){return f[v]})}var Oe=/\/+/g;function _e(o,f){return typeof o=="object"&&o!==null&&o.key!=null?Ye(""+o.key):f.toString(36)}function fe(o,f,v,E,_){var w=typeof o;(w==="undefined"||w==="boolean")&&(o=null);var k=!1;if(o===null)k=!0;else switch(w){case"string":case"number":k=!0;break;case"object":switch(o.$$typeof){case n:case t:k=!0}}if(k)return k=o,_=_(k),o=E===""?"."+_e(k,0):E,G(_)?(v="",o!=null&&(v=o.replace(Oe,"$&/")+"/"),fe(_,f,v,"",function($){return $})):_!=null&&(ge(_)&&(_=Se(_,v+(!_.key||k&&k.key===_.key?"":(""+_.key).replace(Oe,"$&/")+"/")+o)),f.push(_)),1;if(k=0,E=E===""?".":E+":",G(o))for(var R=0;R<o.length;R++){w=o[R];var P=E+_e(w,R);k+=fe(w,f,v,P,_)}else if(P=ne(o),typeof P=="function")for(o=P.call(o),R=0;!(w=o.next()).done;)w=w.value,P=E+_e(w,R++),k+=fe(w,f,v,P,_);else if(w==="object")throw f=String(o),Error("Objects are not valid as a React child (found: "+(f==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":f)+"). If you meant to render a collection of children, use an array instead.");return k}function Y(o,f,v){if(o==null)return o;var E=[],_=0;return fe(o,E,"","",function(w){return f.call(v,w,_++)}),E}function X(o){if(o._status===-1){var f=o._result;f=f(),f.then(function(v){(o._status===0||o._status===-1)&&(o._status=1,o._result=v)},function(v){(o._status===0||o._status===-1)&&(o._status=2,o._result=v)}),o._status===-1&&(o._status=0,o._result=f)}if(o._status===1)return o._result.default;throw o._result}var h={current:null},ie={transition:null},De={ReactCurrentDispatcher:h,ReactCurrentBatchConfig:ie,ReactCurrentOwner:L};return g.Children={map:Y,forEach:function(o,f,v){Y(o,function(){f.apply(this,arguments)},v)},count:function(o){var f=0;return Y(o,function(){f++}),f},toArray:function(o){return Y(o,function(f){return f})||[]},only:function(o){if(!ge(o))throw Error("React.Children.only expected to receive a single React element child.");return o}},g.Component=K,g.Fragment=s,g.Profiler=l,g.PureComponent=ce,g.StrictMode=c,g.Suspense=x,g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=De,g.cloneElement=function(o,f,v){if(o==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+o+".");var E=q({},o.props),_=o.key,w=o.ref,k=o._owner;if(f!=null){if(f.ref!==void 0&&(w=f.ref,k=L.current),f.key!==void 0&&(_=""+f.key),o.type&&o.type.defaultProps)var R=o.type.defaultProps;for(P in f)A.call(f,P)&&!Q.hasOwnProperty(P)&&(E[P]=f[P]===void 0&&R!==void 0?R[P]:f[P])}var P=arguments.length-2;if(P===1)E.children=v;else if(1<P){R=Array(P);for(var $=0;$<P;$++)R[$]=arguments[$+2];E.children=R}return{$$typeof:n,type:o.type,key:_,ref:w,props:E,_owner:k}},g.createContext=function(o){return o={$$typeof:D,_currentValue:o,_currentValue2:o,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},o.Provider={$$typeof:y,_context:o},o.Consumer=o},g.createElement=oe,g.createFactory=function(o){var f=oe.bind(null,o);return f.type=o,f},g.createRef=function(){return{current:null}},g.forwardRef=function(o){return{$$typeof:F,render:o}},g.isValidElement=ge,g.lazy=function(o){return{$$typeof:z,_payload:{_status:-1,_result:o},_init:X}},g.memo=function(o,f){return{$$typeof:B,type:o,compare:f===void 0?null:f}},g.startTransition=function(o){var f=ie.transition;ie.transition={};try{o()}finally{ie.transition=f}},g.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},g.useCallback=function(o,f){return h.current.useCallback(o,f)},g.useContext=function(o){return h.current.useContext(o)},g.useDebugValue=function(){},g.useDeferredValue=function(o){return h.current.useDeferredValue(o)},g.useEffect=function(o,f){return h.current.useEffect(o,f)},g.useId=function(){return h.current.useId()},g.useImperativeHandle=function(o,f,v){return h.current.useImperativeHandle(o,f,v)},g.useInsertionEffect=function(o,f){return h.current.useInsertionEffect(o,f)},g.useLayoutEffect=function(o,f){return h.current.useLayoutEffect(o,f)},g.useMemo=function(o,f){return h.current.useMemo(o,f)},g.useReducer=function(o,f,v){return h.current.useReducer(o,f,v)},g.useRef=function(o){return h.current.useRef(o)},g.useState=function(o){return h.current.useState(o)},g.useSyncExternalStore=function(o,f,v){return h.current.useSyncExternalStore(o,f,v)},g.useTransition=function(){return h.current.useTransition()},g.version="18.2.0",g}var ve={exports:{}};/**
16
16
  * @license React
17
17
  * react.development.js
18
18
  *
@@ -20,7 +20,7 @@
20
20
  *
21
21
  * This source code is licensed under the MIT license found in the
22
22
  * LICENSE file in the root directory of this source tree.
23
- */ve.exports;var ut;function fr(){return ut||(ut=1,function(n,t){process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var s="18.2.0",l=Symbol.for("react.element"),c=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),x=Symbol.for("react.provider"),B=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),Re=Symbol.for("react.offscreen"),K=Symbol.iterator,Pe="@@iterator";function ce(e){if(e===null||typeof e!="object")return null;var r=K&&e[K]||e[Pe];return typeof r=="function"?r:null}var le={current:null},G={transition:null},A={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},L={current:null},Q={},oe=null;function Se(e){oe=e}Q.setExtraStackFrame=function(e){oe=e},Q.getCurrentStack=null,Q.getStackAddendum=function(){var e="";oe&&(e+=oe);var r=Q.getCurrentStack;return r&&(e+=r()||""),e};var ge=!1,Ye=!1,Oe=!1,_e=!1,fe=!1,Y={ReactCurrentDispatcher:le,ReactCurrentBatchConfig:G,ReactCurrentOwner:L};Y.ReactDebugCurrentFrame=Q,Y.ReactCurrentActQueue=A;function X(e){{for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];ie("warn",e,i)}}function h(e){{for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];ie("error",e,i)}}function ie(e,r,i){{var a=Y.ReactDebugCurrentFrame,u=a.getStackAddendum();u!==""&&(r+="%s",i=i.concat([u]));var p=i.map(function(d){return String(d)});p.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,p)}}var De={};function o(e,r){{var i=e.constructor,a=i&&(i.displayName||i.name)||"ReactClass",u=a+"."+r;if(De[u])return;h("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",r,a),De[u]=!0}}var f={isMounted:function(e){return!1},enqueueForceUpdate:function(e,r,i){o(e,"forceUpdate")},enqueueReplaceState:function(e,r,i,a){o(e,"replaceState")},enqueueSetState:function(e,r,i,a){o(e,"setState")}},v=Object.assign,E={};Object.freeze(E);function _(e,r,i){this.props=e,this.context=r,this.refs=E,this.updater=i||f}_.prototype.isReactComponent={},_.prototype.setState=function(e,r){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,r,"setState")},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};{var w={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},k=function(e,r){Object.defineProperty(_.prototype,e,{get:function(){X("%s(...) is deprecated in plain JavaScript React classes. %s",r[0],r[1])}})};for(var R in w)w.hasOwnProperty(R)&&k(R,w[R])}function P(){}P.prototype=_.prototype;function $(e,r,i){this.props=e,this.context=r,this.refs=E,this.updater=i||f}var He=$.prototype=new P;He.constructor=$,v(He,_.prototype),He.isPureReactComponent=!0;function pr(){var e={current:null};return Object.seal(e),e}var hr=Array.isArray;function Te(e){return hr(e)}function mr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,i=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return i}}function yr(e){try{return ct(e),!1}catch{return!0}}function ct(e){return""+e}function ke(e){if(yr(e))return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",mr(e)),ct(e)}function vr(e,r,i){var a=e.displayName;if(a)return a;var u=r.displayName||r.name||"";return u!==""?i+"("+u+")":i}function lt(e){return e.displayName||"Context"}function Z(e){if(e==null)return null;if(typeof e.tag=="number"&&h("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case y:return"Fragment";case c:return"Portal";case F:return"Profiler";case D:return"StrictMode";case H:return"Suspense";case ne:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case B:var r=e;return lt(r)+".Consumer";case x:var i=e;return lt(i._context)+".Provider";case z:return vr(e,e.render,"ForwardRef");case W:var a=e.displayName||null;return a!==null?a:Z(e.type)||"Memo";case q:{var u=e,p=u._payload,d=u._init;try{return Z(d(p))}catch{return null}}}return null}var be=Object.prototype.hasOwnProperty,ft={key:!0,ref:!0,__self:!0,__source:!0},dt,pt,Be;Be={};function ht(e){if(be.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function mt(e){if(be.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function gr(e,r){var i=function(){dt||(dt=!0,h("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};i.isReactWarning=!0,Object.defineProperty(e,"key",{get:i,configurable:!0})}function _r(e,r){var i=function(){pt||(pt=!0,h("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};i.isReactWarning=!0,Object.defineProperty(e,"ref",{get:i,configurable:!0})}function br(e){if(typeof e.ref=="string"&&L.current&&e.__self&&L.current.stateNode!==e.__self){var r=Z(L.current.type);Be[r]||(h('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',r,e.ref),Be[r]=!0)}}var ze=function(e,r,i,a,u,p,d){var m={$$typeof:l,type:e,key:r,ref:i,props:d,_owner:p};return m._store={},Object.defineProperty(m._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(m,"_self",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.defineProperty(m,"_source",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.freeze&&(Object.freeze(m.props),Object.freeze(m)),m};function Er(e,r,i){var a,u={},p=null,d=null,m=null,b=null;if(r!=null){ht(r)&&(d=r.ref,br(r)),mt(r)&&(ke(r.key),p=""+r.key),m=r.__self===void 0?null:r.__self,b=r.__source===void 0?null:r.__source;for(a in r)be.call(r,a)&&!ft.hasOwnProperty(a)&&(u[a]=r[a])}var C=arguments.length-2;if(C===1)u.children=i;else if(C>1){for(var S=Array(C),O=0;O<C;O++)S[O]=arguments[O+2];Object.freeze&&Object.freeze(S),u.children=S}if(e&&e.defaultProps){var T=e.defaultProps;for(a in T)u[a]===void 0&&(u[a]=T[a])}if(p||d){var j=typeof e=="function"?e.displayName||e.name||"Unknown":e;p&&gr(u,j),d&&_r(u,j)}return ze(e,p,d,m,b,L.current,u)}function Cr(e,r){var i=ze(e.type,r,e.ref,e._self,e._source,e._owner,e.props);return i}function wr(e,r,i){if(e==null)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var a,u=v({},e.props),p=e.key,d=e.ref,m=e._self,b=e._source,C=e._owner;if(r!=null){ht(r)&&(d=r.ref,C=L.current),mt(r)&&(ke(r.key),p=""+r.key);var S;e.type&&e.type.defaultProps&&(S=e.type.defaultProps);for(a in r)be.call(r,a)&&!ft.hasOwnProperty(a)&&(r[a]===void 0&&S!==void 0?u[a]=S[a]:u[a]=r[a])}var O=arguments.length-2;if(O===1)u.children=i;else if(O>1){for(var T=Array(O),j=0;j<O;j++)T[j]=arguments[j+2];u.children=T}return ze(e.type,p,d,m,b,C,u)}function de(e){return typeof e=="object"&&e!==null&&e.$$typeof===l}var yt=".",Rr=":";function Pr(e){var r=/[=:]/g,i={"=":"=0",":":"=2"},a=e.replace(r,function(u){return i[u]});return"$"+a}var vt=!1,Sr=/\/+/g;function gt(e){return e.replace(Sr,"$&/")}function qe(e,r){return typeof e=="object"&&e!==null&&e.key!=null?(ke(e.key),Pr(""+e.key)):r.toString(36)}function je(e,r,i,a,u){var p=typeof e;(p==="undefined"||p==="boolean")&&(e=null);var d=!1;if(e===null)d=!0;else switch(p){case"string":case"number":d=!0;break;case"object":switch(e.$$typeof){case l:case c:d=!0}}if(d){var m=e,b=u(m),C=a===""?yt+qe(m,0):a;if(Te(b)){var S="";C!=null&&(S=gt(C)+"/"),je(b,r,S,"",function(bn){return bn})}else b!=null&&(de(b)&&(b.key&&(!m||m.key!==b.key)&&ke(b.key),b=Cr(b,i+(b.key&&(!m||m.key!==b.key)?gt(""+b.key)+"/":"")+C)),r.push(b));return 1}var O,T,j=0,N=a===""?yt:a+Rr;if(Te(e))for(var Ue=0;Ue<e.length;Ue++)O=e[Ue],T=N+qe(O,Ue),j+=je(O,r,i,T,u);else{var rt=ce(e);if(typeof rt=="function"){var Wt=e;rt===Wt.entries&&(vt||X("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),vt=!0);for(var gn=rt.call(Wt),Yt,_n=0;!(Yt=gn.next()).done;)O=Yt.value,T=N+qe(O,_n++),j+=je(O,r,i,T,u)}else if(p==="object"){var Ht=String(e);throw new Error("Objects are not valid as a React child (found: "+(Ht==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":Ht)+"). If you meant to render a collection of children, use an array instead.")}}return j}function Ae(e,r,i){if(e==null)return e;var a=[],u=0;return je(e,a,"","",function(p){return r.call(i,p,u++)}),a}function Or(e){var r=0;return Ae(e,function(){r++}),r}function Dr(e,r,i){Ae(e,function(){r.apply(this,arguments)},i)}function Tr(e){return Ae(e,function(r){return r})||[]}function kr(e){if(!de(e))throw new Error("React.Children.only expected to receive a single React element child.");return e}function jr(e){var r={$$typeof:B,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};r.Provider={$$typeof:x,_context:r};var i=!1,a=!1,u=!1;{var p={$$typeof:B,_context:r};Object.defineProperties(p,{Provider:{get:function(){return a||(a=!0,h("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),r.Provider},set:function(d){r.Provider=d}},_currentValue:{get:function(){return r._currentValue},set:function(d){r._currentValue=d}},_currentValue2:{get:function(){return r._currentValue2},set:function(d){r._currentValue2=d}},_threadCount:{get:function(){return r._threadCount},set:function(d){r._threadCount=d}},Consumer:{get:function(){return i||(i=!0,h("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),r.Consumer}},displayName:{get:function(){return r.displayName},set:function(d){u||(X("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",d),u=!0)}}}),r.Consumer=p}return r._currentRenderer=null,r._currentRenderer2=null,r}var Ee=-1,Ke=0,_t=1,Ar=2;function Ir(e){if(e._status===Ee){var r=e._result,i=r();if(i.then(function(p){if(e._status===Ke||e._status===Ee){var d=e;d._status=_t,d._result=p}},function(p){if(e._status===Ke||e._status===Ee){var d=e;d._status=Ar,d._result=p}}),e._status===Ee){var a=e;a._status=Ke,a._result=i}}if(e._status===_t){var u=e._result;return u===void 0&&h(`lazy: Expected the result of a dynamic import() call. Instead received: %s
23
+ */ve.exports;var ut;function fr(){return ut||(ut=1,function(n,t){process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var s="18.2.0",c=Symbol.for("react.element"),l=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),x=Symbol.for("react.provider"),B=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),Re=Symbol.for("react.offscreen"),K=Symbol.iterator,Pe="@@iterator";function ce(e){if(e===null||typeof e!="object")return null;var r=K&&e[K]||e[Pe];return typeof r=="function"?r:null}var le={current:null},G={transition:null},A={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},L={current:null},Q={},oe=null;function Se(e){oe=e}Q.setExtraStackFrame=function(e){oe=e},Q.getCurrentStack=null,Q.getStackAddendum=function(){var e="";oe&&(e+=oe);var r=Q.getCurrentStack;return r&&(e+=r()||""),e};var ge=!1,Ye=!1,Oe=!1,_e=!1,fe=!1,Y={ReactCurrentDispatcher:le,ReactCurrentBatchConfig:G,ReactCurrentOwner:L};Y.ReactDebugCurrentFrame=Q,Y.ReactCurrentActQueue=A;function X(e){{for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];ie("warn",e,i)}}function h(e){{for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];ie("error",e,i)}}function ie(e,r,i){{var a=Y.ReactDebugCurrentFrame,u=a.getStackAddendum();u!==""&&(r+="%s",i=i.concat([u]));var p=i.map(function(d){return String(d)});p.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,p)}}var De={};function o(e,r){{var i=e.constructor,a=i&&(i.displayName||i.name)||"ReactClass",u=a+"."+r;if(De[u])return;h("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",r,a),De[u]=!0}}var f={isMounted:function(e){return!1},enqueueForceUpdate:function(e,r,i){o(e,"forceUpdate")},enqueueReplaceState:function(e,r,i,a){o(e,"replaceState")},enqueueSetState:function(e,r,i,a){o(e,"setState")}},v=Object.assign,E={};Object.freeze(E);function _(e,r,i){this.props=e,this.context=r,this.refs=E,this.updater=i||f}_.prototype.isReactComponent={},_.prototype.setState=function(e,r){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,r,"setState")},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};{var w={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},k=function(e,r){Object.defineProperty(_.prototype,e,{get:function(){X("%s(...) is deprecated in plain JavaScript React classes. %s",r[0],r[1])}})};for(var R in w)w.hasOwnProperty(R)&&k(R,w[R])}function P(){}P.prototype=_.prototype;function $(e,r,i){this.props=e,this.context=r,this.refs=E,this.updater=i||f}var He=$.prototype=new P;He.constructor=$,v(He,_.prototype),He.isPureReactComponent=!0;function pr(){var e={current:null};return Object.seal(e),e}var hr=Array.isArray;function Te(e){return hr(e)}function mr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,i=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return i}}function yr(e){try{return ct(e),!1}catch{return!0}}function ct(e){return""+e}function ke(e){if(yr(e))return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",mr(e)),ct(e)}function vr(e,r,i){var a=e.displayName;if(a)return a;var u=r.displayName||r.name||"";return u!==""?i+"("+u+")":i}function lt(e){return e.displayName||"Context"}function Z(e){if(e==null)return null;if(typeof e.tag=="number"&&h("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case y:return"Fragment";case l:return"Portal";case F:return"Profiler";case D:return"StrictMode";case H:return"Suspense";case ne:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case B:var r=e;return lt(r)+".Consumer";case x:var i=e;return lt(i._context)+".Provider";case z:return vr(e,e.render,"ForwardRef");case W:var a=e.displayName||null;return a!==null?a:Z(e.type)||"Memo";case q:{var u=e,p=u._payload,d=u._init;try{return Z(d(p))}catch{return null}}}return null}var be=Object.prototype.hasOwnProperty,ft={key:!0,ref:!0,__self:!0,__source:!0},dt,pt,Be;Be={};function ht(e){if(be.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function mt(e){if(be.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function gr(e,r){var i=function(){dt||(dt=!0,h("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};i.isReactWarning=!0,Object.defineProperty(e,"key",{get:i,configurable:!0})}function _r(e,r){var i=function(){pt||(pt=!0,h("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};i.isReactWarning=!0,Object.defineProperty(e,"ref",{get:i,configurable:!0})}function br(e){if(typeof e.ref=="string"&&L.current&&e.__self&&L.current.stateNode!==e.__self){var r=Z(L.current.type);Be[r]||(h('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',r,e.ref),Be[r]=!0)}}var ze=function(e,r,i,a,u,p,d){var m={$$typeof:c,type:e,key:r,ref:i,props:d,_owner:p};return m._store={},Object.defineProperty(m._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(m,"_self",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.defineProperty(m,"_source",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.freeze&&(Object.freeze(m.props),Object.freeze(m)),m};function Er(e,r,i){var a,u={},p=null,d=null,m=null,b=null;if(r!=null){ht(r)&&(d=r.ref,br(r)),mt(r)&&(ke(r.key),p=""+r.key),m=r.__self===void 0?null:r.__self,b=r.__source===void 0?null:r.__source;for(a in r)be.call(r,a)&&!ft.hasOwnProperty(a)&&(u[a]=r[a])}var C=arguments.length-2;if(C===1)u.children=i;else if(C>1){for(var S=Array(C),O=0;O<C;O++)S[O]=arguments[O+2];Object.freeze&&Object.freeze(S),u.children=S}if(e&&e.defaultProps){var T=e.defaultProps;for(a in T)u[a]===void 0&&(u[a]=T[a])}if(p||d){var j=typeof e=="function"?e.displayName||e.name||"Unknown":e;p&&gr(u,j),d&&_r(u,j)}return ze(e,p,d,m,b,L.current,u)}function Cr(e,r){var i=ze(e.type,r,e.ref,e._self,e._source,e._owner,e.props);return i}function wr(e,r,i){if(e==null)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var a,u=v({},e.props),p=e.key,d=e.ref,m=e._self,b=e._source,C=e._owner;if(r!=null){ht(r)&&(d=r.ref,C=L.current),mt(r)&&(ke(r.key),p=""+r.key);var S;e.type&&e.type.defaultProps&&(S=e.type.defaultProps);for(a in r)be.call(r,a)&&!ft.hasOwnProperty(a)&&(r[a]===void 0&&S!==void 0?u[a]=S[a]:u[a]=r[a])}var O=arguments.length-2;if(O===1)u.children=i;else if(O>1){for(var T=Array(O),j=0;j<O;j++)T[j]=arguments[j+2];u.children=T}return ze(e.type,p,d,m,b,C,u)}function de(e){return typeof e=="object"&&e!==null&&e.$$typeof===c}var yt=".",Rr=":";function Pr(e){var r=/[=:]/g,i={"=":"=0",":":"=2"},a=e.replace(r,function(u){return i[u]});return"$"+a}var vt=!1,Sr=/\/+/g;function gt(e){return e.replace(Sr,"$&/")}function qe(e,r){return typeof e=="object"&&e!==null&&e.key!=null?(ke(e.key),Pr(""+e.key)):r.toString(36)}function je(e,r,i,a,u){var p=typeof e;(p==="undefined"||p==="boolean")&&(e=null);var d=!1;if(e===null)d=!0;else switch(p){case"string":case"number":d=!0;break;case"object":switch(e.$$typeof){case c:case l:d=!0}}if(d){var m=e,b=u(m),C=a===""?yt+qe(m,0):a;if(Te(b)){var S="";C!=null&&(S=gt(C)+"/"),je(b,r,S,"",function(bn){return bn})}else b!=null&&(de(b)&&(b.key&&(!m||m.key!==b.key)&&ke(b.key),b=Cr(b,i+(b.key&&(!m||m.key!==b.key)?gt(""+b.key)+"/":"")+C)),r.push(b));return 1}var O,T,j=0,N=a===""?yt:a+Rr;if(Te(e))for(var Ve=0;Ve<e.length;Ve++)O=e[Ve],T=N+qe(O,Ve),j+=je(O,r,i,T,u);else{var rt=ce(e);if(typeof rt=="function"){var Wt=e;rt===Wt.entries&&(vt||X("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),vt=!0);for(var gn=rt.call(Wt),Yt,_n=0;!(Yt=gn.next()).done;)O=Yt.value,T=N+qe(O,_n++),j+=je(O,r,i,T,u)}else if(p==="object"){var Ht=String(e);throw new Error("Objects are not valid as a React child (found: "+(Ht==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":Ht)+"). If you meant to render a collection of children, use an array instead.")}}return j}function Ae(e,r,i){if(e==null)return e;var a=[],u=0;return je(e,a,"","",function(p){return r.call(i,p,u++)}),a}function Or(e){var r=0;return Ae(e,function(){r++}),r}function Dr(e,r,i){Ae(e,function(){r.apply(this,arguments)},i)}function Tr(e){return Ae(e,function(r){return r})||[]}function kr(e){if(!de(e))throw new Error("React.Children.only expected to receive a single React element child.");return e}function jr(e){var r={$$typeof:B,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};r.Provider={$$typeof:x,_context:r};var i=!1,a=!1,u=!1;{var p={$$typeof:B,_context:r};Object.defineProperties(p,{Provider:{get:function(){return a||(a=!0,h("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),r.Provider},set:function(d){r.Provider=d}},_currentValue:{get:function(){return r._currentValue},set:function(d){r._currentValue=d}},_currentValue2:{get:function(){return r._currentValue2},set:function(d){r._currentValue2=d}},_threadCount:{get:function(){return r._threadCount},set:function(d){r._threadCount=d}},Consumer:{get:function(){return i||(i=!0,h("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),r.Consumer}},displayName:{get:function(){return r.displayName},set:function(d){u||(X("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",d),u=!0)}}}),r.Consumer=p}return r._currentRenderer=null,r._currentRenderer2=null,r}var Ee=-1,Ke=0,_t=1,Ar=2;function Ir(e){if(e._status===Ee){var r=e._result,i=r();if(i.then(function(p){if(e._status===Ke||e._status===Ee){var d=e;d._status=_t,d._result=p}},function(p){if(e._status===Ke||e._status===Ee){var d=e;d._status=Ar,d._result=p}}),e._status===Ee){var a=e;a._status=Ke,a._result=i}}if(e._status===_t){var u=e._result;return u===void 0&&h(`lazy: Expected the result of a dynamic import() call. Instead received: %s
24
24
 
25
25
  Your code should look like:
26
26
  const MyComponent = lazy(() => import('./MyComponent'))
@@ -32,7 +32,7 @@ Your code should look like:
32
32
  1. You might have mismatching versions of React and the renderer (such as React DOM)
33
33
  2. You might be breaking the Rules of Hooks
34
34
  3. You might have more than one copy of React in the same app
35
- See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`),e}function Mr(e){var r=M();if(e._context!==void 0){var i=e._context;i.Consumer===e?h("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):i.Provider===e&&h("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return r.useContext(e)}function Lr(e){var r=M();return r.useState(e)}function Ur(e,r,i){var a=M();return a.useReducer(e,r,i)}function Vr(e){var r=M();return r.useRef(e)}function xr(e,r){var i=M();return i.useEffect(e,r)}function Wr(e,r){var i=M();return i.useInsertionEffect(e,r)}function Yr(e,r){var i=M();return i.useLayoutEffect(e,r)}function Hr(e,r){var i=M();return i.useCallback(e,r)}function Br(e,r){var i=M();return i.useMemo(e,r)}function zr(e,r,i){var a=M();return a.useImperativeHandle(e,r,i)}function qr(e,r){{var i=M();return i.useDebugValue(e,r)}}function Kr(){var e=M();return e.useTransition()}function Gr(e){var r=M();return r.useDeferredValue(e)}function Jr(){var e=M();return e.useId()}function Qr(e,r,i){var a=M();return a.useSyncExternalStore(e,r,i)}var Ce=0,Ct,wt,Rt,Pt,St,Ot,Dt;function Tt(){}Tt.__reactDisabledLog=!0;function Xr(){{if(Ce===0){Ct=console.log,wt=console.info,Rt=console.warn,Pt=console.error,St=console.group,Ot=console.groupCollapsed,Dt=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Tt,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Ce++}}function Zr(){{if(Ce--,Ce===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:v({},e,{value:Ct}),info:v({},e,{value:wt}),warn:v({},e,{value:Rt}),error:v({},e,{value:Pt}),group:v({},e,{value:St}),groupCollapsed:v({},e,{value:Ot}),groupEnd:v({},e,{value:Dt})})}Ce<0&&h("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ge=Y.ReactCurrentDispatcher,Je;function Ie(e,r,i){{if(Je===void 0)try{throw Error()}catch(u){var a=u.stack.trim().match(/\n( *(at )?)/);Je=a&&a[1]||""}return`
35
+ See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`),e}function Mr(e){var r=M();if(e._context!==void 0){var i=e._context;i.Consumer===e?h("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):i.Provider===e&&h("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return r.useContext(e)}function Lr(e){var r=M();return r.useState(e)}function Vr(e,r,i){var a=M();return a.useReducer(e,r,i)}function Ur(e){var r=M();return r.useRef(e)}function xr(e,r){var i=M();return i.useEffect(e,r)}function Wr(e,r){var i=M();return i.useInsertionEffect(e,r)}function Yr(e,r){var i=M();return i.useLayoutEffect(e,r)}function Hr(e,r){var i=M();return i.useCallback(e,r)}function Br(e,r){var i=M();return i.useMemo(e,r)}function zr(e,r,i){var a=M();return a.useImperativeHandle(e,r,i)}function qr(e,r){{var i=M();return i.useDebugValue(e,r)}}function Kr(){var e=M();return e.useTransition()}function Gr(e){var r=M();return r.useDeferredValue(e)}function Jr(){var e=M();return e.useId()}function Qr(e,r,i){var a=M();return a.useSyncExternalStore(e,r,i)}var Ce=0,Ct,wt,Rt,Pt,St,Ot,Dt;function Tt(){}Tt.__reactDisabledLog=!0;function Xr(){{if(Ce===0){Ct=console.log,wt=console.info,Rt=console.warn,Pt=console.error,St=console.group,Ot=console.groupCollapsed,Dt=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Tt,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Ce++}}function Zr(){{if(Ce--,Ce===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:v({},e,{value:Ct}),info:v({},e,{value:wt}),warn:v({},e,{value:Rt}),error:v({},e,{value:Pt}),group:v({},e,{value:St}),groupCollapsed:v({},e,{value:Ot}),groupEnd:v({},e,{value:Dt})})}Ce<0&&h("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ge=Y.ReactCurrentDispatcher,Je;function Ie(e,r,i){{if(Je===void 0)try{throw Error()}catch(u){var a=u.stack.trim().match(/\n( *(at )?)/);Je=a&&a[1]||""}return`
36
36
  `+Je+e}}var Qe=!1,Ne;{var en=typeof WeakMap=="function"?WeakMap:Map;Ne=new en}function kt(e,r){if(!e||Qe)return"";{var i=Ne.get(e);if(i!==void 0)return i}var a;Qe=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var p;p=Ge.current,Ge.current=null,Xr();try{if(r){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(N){a=N}Reflect.construct(e,[],d)}else{try{d.call()}catch(N){a=N}e.call(d.prototype)}}else{try{throw Error()}catch(N){a=N}e()}}catch(N){if(N&&a&&typeof N.stack=="string"){for(var m=N.stack.split(`
37
37
  `),b=a.stack.split(`
38
38
  `),C=m.length-1,S=b.length-1;C>=1&&S>=0&&m[C]!==b[S];)S--;for(;C>=1&&S>=0;C--,S--)if(m[C]!==b[S]){if(C!==1||S!==1)do if(C--,S--,S<0||m[C]!==b[S]){var O=`
@@ -42,5 +42,5 @@ Check the render method of \``+e+"`."}return""}function on(e){if(e!==void 0){var
42
42
 
43
43
  Check your code at `+r+":"+i+"."}return""}function sn(e){return e!=null?on(e.__source):""}var Nt={};function an(e){var r=It();if(!r){var i=typeof e=="string"?e:e.displayName||e.name;i&&(r=`
44
44
 
45
- Check the top-level render call using <`+i+">.")}return r}function Ft(e,r){if(!(!e._store||e._store.validated||e.key!=null)){e._store.validated=!0;var i=an(r);if(!Nt[i]){Nt[i]=!0;var a="";e&&e._owner&&e._owner!==L.current&&(a=" It was passed a child from "+Z(e._owner.type)+"."),pe(e),h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',i,a),pe(null)}}}function $t(e,r){if(typeof e=="object"){if(Te(e))for(var i=0;i<e.length;i++){var a=e[i];de(a)&&Ft(a,r)}else if(de(e))e._store&&(e._store.validated=!0);else if(e){var u=ce(e);if(typeof u=="function"&&u!==e.entries)for(var p=u.call(e),d;!(d=p.next()).done;)de(d.value)&&Ft(d.value,r)}}}function Mt(e){{var r=e.type;if(r==null||typeof r=="string")return;var i;if(typeof r=="function")i=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===z||r.$$typeof===W))i=r.propTypes;else return;if(i){var a=Z(r);nn(i,e.props,"prop",a,e)}else if(r.PropTypes!==void 0&&!Xe){Xe=!0;var u=Z(r);h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",u||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function un(e){{for(var r=Object.keys(e.props),i=0;i<r.length;i++){var a=r[i];if(a!=="children"&&a!=="key"){pe(e),h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",a),pe(null);break}}e.ref!==null&&(pe(e),h("Invalid attribute `ref` supplied to `React.Fragment`."),pe(null))}}function Lt(e,r,i){var a=Et(e);if(!a){var u="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(u+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var p=sn(r);p?u+=p:u+=It();var d;e===null?d="null":Te(e)?d="array":e!==void 0&&e.$$typeof===l?(d="<"+(Z(e.type)||"Unknown")+" />",u=" Did you accidentally export a JSX literal instead of a component?"):d=typeof e,h("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",d,u)}var m=Er.apply(this,arguments);if(m==null)return m;if(a)for(var b=2;b<arguments.length;b++)$t(arguments[b],e);return e===y?un(m):Mt(m),m}var Ut=!1;function cn(e){var r=Lt.bind(null,e);return r.type=e,Ut||(Ut=!0,X("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(r,"type",{enumerable:!1,get:function(){return X("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),r}function ln(e,r,i){for(var a=wr.apply(this,arguments),u=2;u<arguments.length;u++)$t(arguments[u],a.type);return Mt(a),a}function fn(e,r){var i=G.transition;G.transition={};var a=G.transition;G.transition._updatedFibers=new Set;try{e()}finally{if(G.transition=i,i===null&&a._updatedFibers){var u=a._updatedFibers.size;u>10&&X("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),a._updatedFibers.clear()}}}var Vt=!1,Me=null;function dn(e){if(Me===null)try{var r=("require"+Math.random()).slice(0,7),i=n&&n[r];Me=i.call(n,"timers").setImmediate}catch{Me=function(u){Vt===!1&&(Vt=!0,typeof MessageChannel>"u"&&h("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var p=new MessageChannel;p.port1.onmessage=u,p.port2.postMessage(void 0)}}return Me(e)}var he=0,xt=!1;function pn(e){{var r=he;he++,A.current===null&&(A.current=[]);var i=A.isBatchingLegacy,a;try{if(A.isBatchingLegacy=!0,a=e(),!i&&A.didScheduleLegacyUpdate){var u=A.current;u!==null&&(A.didScheduleLegacyUpdate=!1,tt(u))}}catch(T){throw Le(r),T}finally{A.isBatchingLegacy=i}if(a!==null&&typeof a=="object"&&typeof a.then=="function"){var p=a,d=!1,m={then:function(T,j){d=!0,p.then(function(N){Le(r),he===0?Ze(N,T,j):T(N)},function(N){Le(r),j(N)})}};return!xt&&typeof Promise<"u"&&Promise.resolve().then(function(){}).then(function(){d||(xt=!0,h("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),m}else{var b=a;if(Le(r),he===0){var C=A.current;C!==null&&(tt(C),A.current=null);var S={then:function(T,j){A.current===null?(A.current=[],Ze(b,T,j)):T(b)}};return S}else{var O={then:function(T,j){T(b)}};return O}}}}function Le(e){e!==he-1&&h("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),he=e}function Ze(e,r,i){{var a=A.current;if(a!==null)try{tt(a),dn(function(){a.length===0?(A.current=null,r(e)):Ze(e,r,i)})}catch(u){i(u)}else r(e)}}var et=!1;function tt(e){if(!et){et=!0;var r=0;try{for(;r<e.length;r++){var i=e[r];do i=i(!0);while(i!==null)}e.length=0}catch(a){throw e=e.slice(r+1),a}finally{et=!1}}}var hn=Lt,mn=ln,yn=cn,vn={map:Ae,forEach:Dr,count:Or,toArray:Tr,only:kr};t.Children=vn,t.Component=_,t.Fragment=y,t.Profiler=F,t.PureComponent=$,t.StrictMode=D,t.Suspense=H,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y,t.cloneElement=mn,t.createContext=jr,t.createElement=hn,t.createFactory=yn,t.createRef=pr,t.forwardRef=Fr,t.isValidElement=de,t.lazy=Nr,t.memo=$r,t.startTransition=fn,t.unstable_act=pn,t.useCallback=Hr,t.useContext=Mr,t.useDebugValue=qr,t.useDeferredValue=Gr,t.useEffect=xr,t.useId=Jr,t.useImperativeHandle=zr,t.useInsertionEffect=Wr,t.useLayoutEffect=Yr,t.useMemo=Br,t.useReducer=Ur,t.useRef=Vr,t.useState=Lr,t.useSyncExternalStore=Qr,t.useTransition=Kr,t.version=s,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()}(ve,ve.exports)),ve.exports}process.env.NODE_ENV==="production"?We.exports=lr():We.exports=fr();var ue=We.exports;const V=cr(ue);class dr extends ue.Component{constructor(t){super(t),this.unfilteredDocuments=[],this.state={documents:[],mode:0}}async componentDidMount(){const{controller:t}=this.props;this.unsubscriber=t.onChange(s=>{s.documentCollection&&(this.unfilteredDocuments=s.documentCollection,this.setState({documents:t.filter(this.unfilteredDocuments)})),s.action==="filterChange"?this.setState({documents:t.filter(this.unfilteredDocuments)}):this.setState({})}),this.unfilteredDocuments=await t.documentCollection(),this.setState({documents:t.filter(this.unfilteredDocuments)})}componentWillUnmount(){var t;(t=this.unsubscriber)==null||t.call(this)}newDocument(){this.props.controller.newDocument(),this.setState({mode:1})}editDocument(t){this.props.controller.setDocument(t),this.setState({mode:2})}async storeDocument(t){const{controller:s,layout:l}=this.props;s.setDocument(t),await s.storeDocument(),l==="formAndItems"?this.newDocument():this.setState({mode:0})}invokeContentViewChild(t){const{children:s,layout:l,controller:c}=this.props,{mode:y}=this.state,D=l!=="formAndItems";if(!c.document)return;const F={controller:c,submitButtonCaption:y==2?t==null?void 0:t.updateButtonLabel:t==null?void 0:t.addButtonLabel,onSubmit:x=>this.storeDocument(x),onCancel:D?()=>this.setState({mode:0}):()=>this.newDocument()};return typeof s[0]=="function"?ue.cloneElement(s[0](F),{key:c.document.id}):ue.cloneElement(s[0],{key:c.document.id,...F})}invokeDetailViewChild(t){const{children:s,controller:l}=this.props,c={document:t,onSelect:y=>this.editDocument(y),onDelete:y=>l.setDocument(y).deleteDocument()};return typeof s[1]=="function"?ue.cloneElement(s[1](c),{key:t.id}):ue.cloneElement(s[1],{key:t.id,...c})}render(){var W;const{mode:t,documents:s}=this.state,{className:l,cardAddButton:c,controller:y}=this.props,D=ar((W=y.document)==null?void 0:W.className);let F=this.props.labels||{};const x=this.props.layout||"itemsAlways";typeof F=="function"&&(F=F(y));const{addNewDocumentLabel:B,singularDocumentInCollectionCaption:z,documentsInCollectionCaption:H,noDocumentsFoundLabel:ne}=F;return V.createElement("div",{className:`crud-panel ${D} ${l||""}`},t===0&&x!=="formAndItems"&&!c&&V.createElement("div",{className:"header"},this.props.header?typeof this.props.header=="function"?this.props.header(y,()=>this.newDocument(),F):this.props.header:V.createElement("button",{onClick:()=>this.newDocument()},B)),(x==="formAndItems"||t===1||t===2)&&V.createElement("div",{className:"content-panel"},this.invokeContentViewChild(F)),(x==="itemsAlways"||x==="formAndItems"||t===0)&&V.createElement("div",{className:"collection-panel"},(s==null?void 0:s.length)>0&&V.createElement("h3",null,s.length>1?H:z||H),V.createElement("div",{className:"documents"},c&&V.createElement("div",{className:"crud-card card-add-button clickable",onClick:()=>this.newDocument()},V.createElement("div",{className:"button-element"},c),V.createElement("div",{className:"add-label"},B)),s!=null&&s.length?s.map(q=>this.invokeDetailViewChild(q)):V.createElement("p",null,ne))),V.createElement("div",{className:"footer"},this.props.footer&&typeof this.props.footer=="function"?this.props.footer(y,()=>this.newDocument(),F):this.props.footer))}}ee.CrudController=xe,ee.CrudPanel=dr,Object.defineProperty(ee,Symbol.toStringTag,{value:"Module"})});
45
+ Check the top-level render call using <`+i+">.")}return r}function Ft(e,r){if(!(!e._store||e._store.validated||e.key!=null)){e._store.validated=!0;var i=an(r);if(!Nt[i]){Nt[i]=!0;var a="";e&&e._owner&&e._owner!==L.current&&(a=" It was passed a child from "+Z(e._owner.type)+"."),pe(e),h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',i,a),pe(null)}}}function $t(e,r){if(typeof e=="object"){if(Te(e))for(var i=0;i<e.length;i++){var a=e[i];de(a)&&Ft(a,r)}else if(de(e))e._store&&(e._store.validated=!0);else if(e){var u=ce(e);if(typeof u=="function"&&u!==e.entries)for(var p=u.call(e),d;!(d=p.next()).done;)de(d.value)&&Ft(d.value,r)}}}function Mt(e){{var r=e.type;if(r==null||typeof r=="string")return;var i;if(typeof r=="function")i=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===z||r.$$typeof===W))i=r.propTypes;else return;if(i){var a=Z(r);nn(i,e.props,"prop",a,e)}else if(r.PropTypes!==void 0&&!Xe){Xe=!0;var u=Z(r);h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",u||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function un(e){{for(var r=Object.keys(e.props),i=0;i<r.length;i++){var a=r[i];if(a!=="children"&&a!=="key"){pe(e),h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",a),pe(null);break}}e.ref!==null&&(pe(e),h("Invalid attribute `ref` supplied to `React.Fragment`."),pe(null))}}function Lt(e,r,i){var a=Et(e);if(!a){var u="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(u+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var p=sn(r);p?u+=p:u+=It();var d;e===null?d="null":Te(e)?d="array":e!==void 0&&e.$$typeof===c?(d="<"+(Z(e.type)||"Unknown")+" />",u=" Did you accidentally export a JSX literal instead of a component?"):d=typeof e,h("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",d,u)}var m=Er.apply(this,arguments);if(m==null)return m;if(a)for(var b=2;b<arguments.length;b++)$t(arguments[b],e);return e===y?un(m):Mt(m),m}var Vt=!1;function cn(e){var r=Lt.bind(null,e);return r.type=e,Vt||(Vt=!0,X("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(r,"type",{enumerable:!1,get:function(){return X("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),r}function ln(e,r,i){for(var a=wr.apply(this,arguments),u=2;u<arguments.length;u++)$t(arguments[u],a.type);return Mt(a),a}function fn(e,r){var i=G.transition;G.transition={};var a=G.transition;G.transition._updatedFibers=new Set;try{e()}finally{if(G.transition=i,i===null&&a._updatedFibers){var u=a._updatedFibers.size;u>10&&X("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),a._updatedFibers.clear()}}}var Ut=!1,Me=null;function dn(e){if(Me===null)try{var r=("require"+Math.random()).slice(0,7),i=n&&n[r];Me=i.call(n,"timers").setImmediate}catch{Me=function(u){Ut===!1&&(Ut=!0,typeof MessageChannel>"u"&&h("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var p=new MessageChannel;p.port1.onmessage=u,p.port2.postMessage(void 0)}}return Me(e)}var he=0,xt=!1;function pn(e){{var r=he;he++,A.current===null&&(A.current=[]);var i=A.isBatchingLegacy,a;try{if(A.isBatchingLegacy=!0,a=e(),!i&&A.didScheduleLegacyUpdate){var u=A.current;u!==null&&(A.didScheduleLegacyUpdate=!1,tt(u))}}catch(T){throw Le(r),T}finally{A.isBatchingLegacy=i}if(a!==null&&typeof a=="object"&&typeof a.then=="function"){var p=a,d=!1,m={then:function(T,j){d=!0,p.then(function(N){Le(r),he===0?Ze(N,T,j):T(N)},function(N){Le(r),j(N)})}};return!xt&&typeof Promise<"u"&&Promise.resolve().then(function(){}).then(function(){d||(xt=!0,h("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),m}else{var b=a;if(Le(r),he===0){var C=A.current;C!==null&&(tt(C),A.current=null);var S={then:function(T,j){A.current===null?(A.current=[],Ze(b,T,j)):T(b)}};return S}else{var O={then:function(T,j){T(b)}};return O}}}}function Le(e){e!==he-1&&h("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),he=e}function Ze(e,r,i){{var a=A.current;if(a!==null)try{tt(a),dn(function(){a.length===0?(A.current=null,r(e)):Ze(e,r,i)})}catch(u){i(u)}else r(e)}}var et=!1;function tt(e){if(!et){et=!0;var r=0;try{for(;r<e.length;r++){var i=e[r];do i=i(!0);while(i!==null)}e.length=0}catch(a){throw e=e.slice(r+1),a}finally{et=!1}}}var hn=Lt,mn=ln,yn=cn,vn={map:Ae,forEach:Dr,count:Or,toArray:Tr,only:kr};t.Children=vn,t.Component=_,t.Fragment=y,t.Profiler=F,t.PureComponent=$,t.StrictMode=D,t.Suspense=H,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y,t.cloneElement=mn,t.createContext=jr,t.createElement=hn,t.createFactory=yn,t.createRef=pr,t.forwardRef=Fr,t.isValidElement=de,t.lazy=Nr,t.memo=$r,t.startTransition=fn,t.unstable_act=pn,t.useCallback=Hr,t.useContext=Mr,t.useDebugValue=qr,t.useDeferredValue=Gr,t.useEffect=xr,t.useId=Jr,t.useImperativeHandle=zr,t.useInsertionEffect=Wr,t.useLayoutEffect=Yr,t.useMemo=Br,t.useReducer=Vr,t.useRef=Ur,t.useState=Lr,t.useSyncExternalStore=Qr,t.useTransition=Kr,t.version=s,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()}(ve,ve.exports)),ve.exports}process.env.NODE_ENV==="production"?We.exports=lr():We.exports=fr();var ue=We.exports;const U=cr(ue);class dr extends ue.Component{constructor(t){super(t),this.unfilteredDocuments=[],this.state={documents:[],mode:0}}async componentDidMount(){const{controller:t}=this.props;this.unsubscriber=t.onChange(s=>{s.documentCollection&&(this.unfilteredDocuments=s.documentCollection,this.setState({documents:t.filter(this.unfilteredDocuments)})),s.action==="filterChange"?this.setState({documents:t.filter(this.unfilteredDocuments)}):this.setState({})}),this.unfilteredDocuments=await t.documentCollection(),this.setState({documents:t.filter(this.unfilteredDocuments)})}componentWillUnmount(){var t;(t=this.unsubscriber)==null||t.call(this)}newDocument(){this.props.controller.newDocument(),this.setState({mode:1})}editDocument(t){this.props.controller.setDocument(t),this.setState({mode:2})}async storeDocument(t){const{controller:s,layout:c}=this.props;s.setDocument(t),await s.storeDocument(),c==="formAndItems"?this.newDocument():this.setState({mode:0})}invokeContentViewChild(t){const{children:s,layout:c,controller:l}=this.props,{mode:y}=this.state,D=c!=="formAndItems";if(!l.document)return;const F={controller:l,submitButtonCaption:y==2?t==null?void 0:t.updateButtonLabel:t==null?void 0:t.addButtonLabel,onSubmit:x=>this.storeDocument(x),onCancel:D?()=>this.setState({mode:0}):()=>this.newDocument()};return typeof s[0]=="function"?ue.cloneElement(s[0](F),{key:l.document.id}):ue.cloneElement(s[0],{key:l.document.id,...F})}invokeDetailViewChild(t){const{children:s,controller:c}=this.props,l={document:t,onSelect:y=>this.editDocument(y),onDelete:y=>c.setDocument(y).deleteDocument()};return typeof s[1]=="function"?ue.cloneElement(s[1](l),{key:t.id}):ue.cloneElement(s[1],{key:t.id,...l})}render(){var W;const{mode:t,documents:s}=this.state,{className:c,cardAddButton:l,controller:y}=this.props,D=ar((W=y.document)==null?void 0:W.className);let F=this.props.labels||{};const x=this.props.layout||"itemsAlways";typeof F=="function"&&(F=F(y));const{addNewDocumentLabel:B,singularDocumentInCollectionCaption:z,documentsInCollectionCaption:H,noDocumentsFoundLabel:ne}=F;return U.createElement("div",{className:`crud-panel ${D} ${c||""}`},t===0&&x!=="formAndItems"&&!l&&U.createElement("div",{className:"header"},this.props.header?typeof this.props.header=="function"?this.props.header(y,()=>this.newDocument(),F):this.props.header:U.createElement("button",{onClick:()=>this.newDocument()},B)),(x==="formAndItems"||t===1||t===2)&&U.createElement("div",{className:"content-panel"},this.invokeContentViewChild(F)),(x==="itemsAlways"||x==="formAndItems"||t===0)&&U.createElement("div",{className:"collection-panel"},(s==null?void 0:s.length)>0&&U.createElement("h3",null,s.length>1?H:z||H),U.createElement("div",{className:"documents"},l&&U.createElement("div",{className:"crud-card card-add-button clickable",onClick:()=>this.newDocument()},U.createElement("div",{className:"button-element"},l),U.createElement("div",{className:"add-label"},B)),s!=null&&s.length?s.map(q=>this.invokeDetailViewChild(q)):U.createElement("p",null,ne))),U.createElement("div",{className:"footer"},this.props.footer&&typeof this.props.footer=="function"?this.props.footer(y,()=>this.newDocument(),F):this.props.footer))}}ee.CrudController=xe,ee.CrudPanel=dr,Object.defineProperty(ee,Symbol.toStringTag,{value:"Module"})});
46
46
  //# sourceMappingURL=entropic-bond-crud-panel.umd.cjs.map