limbo-component 3.7.2 → 3.7.3

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.
package/dist/limbo.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import e,{useState as t,useEffect as n,useCallback as l,useRef as r,useId as a,useMemo as i}from"react";import o from"react-dom";import{jsx as s,jsxs as c,Fragment as u}from"react/jsx-runtime";const d={jpg:["image/jpeg"],jpeg:["image/jpeg"],png:["image/png"],gif:["image/gif"],webp:["image/webp"],svg:["image/svg+xml"],mp4:["video/mp4"],webm:["video/webm"],mov:["video/quicktime"],avi:["video/x-msvideo"],mkv:["video/x-matroska"],pdf:["application/pdf"],doc:["application/msword"],docx:["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],xls:["application/vnd.ms-excel"],xlsx:["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],ppt:["application/vnd.ms-powerpoint"],pptx:["application/vnd.openxmlformats-officedocument.presentationml.presentation"],txt:["text/plain"],csv:["text/csv"],json:["application/json"],xml:["application/xml","text/xml"],html:["text/html"],css:["text/css"],js:["text/javascript","application/javascript"],md:["text/markdown"],mp3:["audio/mpeg"],wav:["audio/wav"],ogg:["audio/ogg"],aac:["audio/aac"],flac:["audio/flac"]},b={image:["image/jpeg","image/png","image/webp","image/svg+xml"],video:["image/gif","video/mp4","video/webm","video/quicktime","video/x-msvideo","video/x-matroska"],document:["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","text/plain","text/csv"],audio:["audio/mpeg","audio/wav","audio/ogg","audio/webm","audio/aac","audio/flac"]},m=/* @__PURE__ */new Set(["jpg","jpeg","png","webp","svg","bmp","tiff","ico"]),h=/* @__PURE__ */new Set(["mp4","webm","mov","avi","mkv","gif"]),p=Object.freeze({categories:[],extensions:[],mimeTypes:[],acceptString:"",includesImages:!0,includesVideos:!0,isAllTypes:!0,raw:null});function f(e){if(!e)return p;const t=Array.isArray(e)?e.join(","):String(e),n=t.split(",").map(e=>e.trim()).filter(Boolean);if(0===n.length)return p;const l=[],r=[],a=/* @__PURE__ */new Set;for(const s of n)if(s.endsWith("/*")){const e=s.replace("/*","");b[e]&&(l.push(e),b[e].forEach(e=>a.add(e)))}else if(s.startsWith(".")){const e=s.slice(1).toLowerCase();r.push(e),(d[e]||[]).forEach(e=>a.add(e))}else s.includes("/")&&a.add(s);const i=l.includes("image")||r.some(e=>m.has(e)),o=l.includes("video")||r.some(e=>h.has(e));return{categories:l,extensions:r,mimeTypes:[...a],acceptString:[...a].join(","),includesImages:i,includesVideos:o,isAllTypes:!1,raw:t}}function g(e){if(!e||e.isAllTypes)return"Todos los formatos";const t=/* @__PURE__ */new Set;for(const n of e.categories)switch(n){case"image":t.add("Imágenes");break;case"video":t.add("Videos");break;case"document":t.add("Documentos");break;case"audio":t.add("Audio")}for(const n of e.extensions)t.add(n.toUpperCase());return[...t].join(", ")||"Todos los formatos"}const v={es:{"button.select":"Seleccionar","button.upload":"Subir archivo","button.cancel":"Cancelar","button.close":"Cerrar","button.save":"Guardar","button.delete":"Eliminar","button.download":"Descargar","button.copy":"Copiar URL","button.crop":"Recortar","button.apply":"Aplicar","button.reset":"Reiniciar","button.back":"Volver","button.next":"Siguiente","button.previous":"Anterior","tab.gallery":"Galería","tab.upload":"Subir","tab.ia":"IA","tab.stock":"Stock","tab.cropper":"Recortar","message.loading":"Cargando...","message.uploading":"Subiendo archivo...","message.processing":"Procesando...","message.no_images":"No hay archivos disponibles","message.upload_success":"Archivo subido correctamente","message.upload_error":"Error al subir el archivo","message.delete_confirm":"¿Estás seguro de que deseas eliminar este archivo? Esta acción también eliminará todos sus recortes.","message.copy_success":"URL copiada al portapapeles","message.copy_error":"Error al copiar URL","error.file_too_large":"El archivo es demasiado grande","error.invalid_format":"Formato de archivo no válido","error.upload_failed":"Error al subir el archivo","error.network":"Error de conexión","error.unknown":"Error desconocido","error.api_key_missing":"API Key no proporcionada","placeholder.search":"Buscar archivos...","placeholder.prompt":"Describe la imagen que quieres generar...","label.file_name":"Nombre del archivo","label.file_size":"Tamaño","label.dimensions":"Dimensiones","label.format":"Formato","label.uploaded_by":"Subido por","label.uploaded_at":"Fecha de subida","preset.square":"Cuadrado","preset.landscape":"Paisaje","preset.portrait":"Retrato","preset.thumbnail":"Miniatura","preset.medium":"Medio","preset.large":"Grande","preset.custom":"Personalizado"},en:{"button.select":"Select","button.upload":"Upload file","button.cancel":"Cancel","button.close":"Close","button.save":"Save","button.delete":"Delete","button.download":"Download","button.copy":"Copy URL","button.crop":"Crop","button.apply":"Apply","button.reset":"Reset","button.back":"Back","button.next":"Next","button.previous":"Previous","tab.gallery":"Gallery","tab.upload":"Upload","tab.ia":"AI","tab.stock":"Stock","tab.cropper":"Crop","message.loading":"Loading...","message.uploading":"Uploading file...","message.processing":"Processing...","message.no_images":"No files available","message.upload_success":"File uploaded successfully","message.upload_error":"Error uploading file","message.delete_confirm":"Are you sure you want to delete this file?","message.copy_success":"URL copied to clipboard","message.copy_error":"Error copying URL","error.file_too_large":"File is too large","error.invalid_format":"Invalid file format","error.upload_failed":"Upload failed","error.network":"Network error","error.unknown":"Unknown error","error.api_key_missing":"API Key not provided","placeholder.search":"Search files...","placeholder.prompt":"Describe the image you want to generate...","label.file_name":"File name","label.file_size":"Size","label.dimensions":"Dimensions","label.format":"Format","label.uploaded_by":"Uploaded by","label.uploaded_at":"Upload date","preset.square":"Square","preset.landscape":"Landscape","preset.portrait":"Portrait","preset.thumbnail":"Thumbnail","preset.medium":"Medium","preset.large":"Large","preset.custom":"Custom"}};class y{constructor(e="es",t={}){this.locale=e,this.messages=this._mergeMessages(t)}_mergeMessages(e){const t={...v};return Object.keys(e).forEach(n=>{t[n]={...t[n]||{},...e[n]}}),t}t(e,t={}){let n=(this.messages[this.locale]||this.messages.es)[e]||e;return Object.keys(t).forEach(e=>{n=n.replace(`{${e}}`,t[e])}),n}setLocale(e){this.messages[e]?this.locale=e:console.warn(`Locale ${e} not available, keeping ${this.locale}`)}getLocale(){return this.locale}getAvailableLocales(){return Object.keys(this.messages)}addMessages(e,t){this.messages[e]={...this.messages[e]||{},...t}}hasKey(e){return e in(this.messages[this.locale]||this.messages.es)}}new y;class w{constructor(){this.globalConfig={},this.defaults={container:"#limbo-default",mode:"embed",modeUI:"full",features:["gallery","upload","cropper"],ui:{showActions:["select","download","copy","delete","crop","rename"],hideActions:[],theme:"light",language:"es",compactMode:!1,showTabs:!0,showPreview:!0},cropper:{quality:.9,format:"webp",aspectRatio:null,lockAspectRatio:!1,showFreeAspectRatio:!0,showDimensionInputs:!1,enableEditMode:!0,showDownloadInCropper:!1,showCropName:!1,mandatoryCrops:[],allowCustomCrops:!0},gallery:{filters:{showNameFilter:!0,showUploadedByFilter:!1,showDateFilter:!0,showTypeFilter:!1,enabledFilters:["name","date"],customFilters:[]},loading:{showPlaceholders:!0,placeholderCount:10,showSpinner:!0},pagination:{itemsPerPage:20,showPageSize:!0}},validation:{accept:null,maxSize:"10MB",formats:["jpg","jpeg","png","webp","gif"],minWidth:null,minHeight:null,maxWidth:null,maxHeight:null,allowedCategories:null},folders:{include:[],exclude:[],includeNoFolder:!0,showFolderSelector:!0,showFolderFilter:!0,showFolderInfo:!0,allowMoveFolder:!0,allowCreateFolder:!0,defaultFolder:null},downloadFormat:"webp",return:{format:"url",autoAssign:!0,includeMetadata:!1},autoInputs:{dataset:"data-limbo-input-file",buttonText:"Seleccionar archivo",buttonStyle:"primary",buttonClass:"limbo-auto-button",scanOnLoad:!0,observeChanges:!0},presets:{aspects:[{name:"square",ratio:"1:1",label:"Cuadrado"},{name:"landscape",ratio:"16:9",label:"Paisaje"},{name:"portrait",ratio:"9:16",label:"Retrato"}],sizes:[{name:"thumbnail",width:300,height:300,fit:"cover",label:"Miniatura"},{name:"medium",width:800,height:600,fit:"cover",label:"Medio"},{name:"large",width:1920,height:1080,fit:"cover",label:"Grande"}],required:[],lockUserCrop:!1,allowArbitrary:!0,defaultAspect:"square",defaultSize:"medium"},modal:{size:"medium",title:"Limbo Image Manager",backdrop:!0,closeOnEscape:!0,closeOnBackdrop:!0,showCloseButton:!0},callbacks:{onUpload:null,onSelect:null,onDelete:null,onCropsSaved:null,onCropperComplete:null,onCropperCancelled:null,onCropperError:null},autoDestroy:!1,autoHideOnComplete:!1,debug:!1,apiEndpoint:null,auth:{apiKey:null,publicKey:null,portal:null,authMode:"jwt",tokenStorage:"memory",autoRefresh:!0,refreshBuffer:30},apiKey:null}}setGlobal(e){return this.globalConfig={...this.globalConfig,...e},this}getGlobal(){return{...this.globalConfig}}merge(e={}){return this._deepMerge(this.defaults,this.globalConfig,e)}_deepMerge(...e){const t={};return e.forEach(e=>{e&&"object"==typeof e&&Object.keys(e).forEach(n=>{e[n]&&"object"==typeof e[n]&&!Array.isArray(e[n])?t[n]=this._deepMerge(t[n]||{},e[n]):t[n]=e[n]})}),t}setDefaults(e){return this.defaults=this._deepMerge(this.defaults,e),this}getDefaults(){return JSON.parse(JSON.stringify(this.defaults))}resetDefaults(){return this.defaults=this._getOriginalDefaults(),this}get(e,t=null){const n=t||this.merge();return this._getValueByPath(n,e)}set(e,t){return this._setValueByPath(this.globalConfig,e,t),this}_getValueByPath(e,t){return t.split(".").reduce((e,t)=>e&&void 0!==e[t]?e[t]:void 0,e)}_setValueByPath(e,t,n){const l=t.split("."),r=l.pop();l.reduce((e,t)=>(e[t]&&"object"==typeof e[t]||(e[t]={}),e[t]),e)[r]=n}_getOriginalDefaults(){return{container:"#limbo-default",mode:"embed",modeUI:"full",features:["gallery","upload","cropper"],ui:{showActions:["select","download","copy","delete","crop","rename"],hideActions:[],theme:"light",language:"es",compactMode:!1,showTabs:!0,showPreview:!0},interaction:{allowSelection:!1,allowCropping:!0,requiresCropping:!1,selectionMode:"direct"},cropper:{quality:.9,format:"webp",aspectRatio:null,lockAspectRatio:!1,showFreeAspectRatio:!0,showDimensionInputs:!1,enableEditMode:!0,showDownloadInCropper:!1,showCropName:!1,mandatoryCrops:[],allowCustomCrops:!0},gallery:{filters:{showNameFilter:!0,showUploadedByFilter:!1,showDateFilter:!0,showTypeFilter:!1,enabledFilters:["name","date"],customFilters:[]},loading:{showPlaceholders:!0,placeholderCount:10,showSpinner:!0},pagination:{itemsPerPage:20,showPageSize:!0}},validation:{accept:null,maxSize:"10MB",formats:["jpg","jpeg","png","webp","gif"],minWidth:null,minHeight:null,maxWidth:null,maxHeight:null,allowedCategories:null},folders:{include:[],exclude:[],includeNoFolder:!0,showFolderSelector:!1,showFolderFilter:!1,showFolderInfo:!0,allowMoveFolder:!0,allowCreateFolder:!0,defaultFolder:null},return:{format:"url",autoAssign:!0,includeMetadata:!1},autoInputs:{dataset:"data-limbo-input-file",buttonText:"Seleccionar archivo",buttonStyle:"primary",buttonClass:"limbo-auto-button",scanOnLoad:!0,observeChanges:!0},modal:{size:"medium",title:"Limbo Image Manager",backdrop:!0,closeOnEscape:!0,closeOnBackdrop:!0,showCloseButton:!0},i18n:{locale:"es",messages:{},autoDetect:!0},theme:{colors:{},spacing:{},typography:{},borderRadius:{},shadows:{},customProperties:{}},callbacks:{onUpload:null,onSelect:null,onDelete:null,onCropsSaved:null,onCropperComplete:null,onCropperCancelled:null,onCropperError:null},autoDestroy:!1,autoHideOnComplete:!1,debug:!1,apiEndpoint:null,auth:{apiKey:null,publicKey:null,portal:null,authMode:"jwt",tokenStorage:"memory",autoRefresh:!0,refreshBuffer:30},apiKey:null}}_validatePresets(e){const t=[];if(e.aspects&&e.aspects.forEach((e,n)=>{e.name&&e.ratio||t.push(`Aspect preset ${n}: name and ratio are required`),e.ratio&&!/^\d+:\d+$/.test(e.ratio)&&t.push(`Aspect preset ${e.name}: ratio must be in format "w:h"`)}),e.sizes&&e.sizes.forEach((e,n)=>{e.name&&e.width||t.push(`Size preset ${n}: name and width are required`),e.width&&e.width<=0&&t.push(`Size preset ${e.name}: width must be positive`),e.height&&e.height<=0&&t.push(`Size preset ${e.name}: height must be positive`)}),e.required&&Array.isArray(e.required)){const n=[...e.aspects?.map(e=>e.name)||[],...e.sizes?.map(e=>e.name)||[]];e.required.forEach(e=>{n.includes(e)||t.push(`Required preset "${e}" not found in available presets`)})}return t}getPreset(e,t,n="aspect"){const l=e.presets||this.defaults.presets;return"aspect"===n?l.aspects?.find(e=>e.name===t):"size"===n?l.sizes?.find(e=>e.name===t):null}isPresetRequired(e,t){const n=e.presets||this.defaults.presets;return n.required?.includes(t)||!1}getAvailableAspects(e){return(e.presets||this.defaults.presets).aspects||[]}getAvailableSizes(e){return(e.presets||this.defaults.presets).sizes||[]}createI18n(e){const t=e.i18n||this.defaults.i18n;let n=t.locale;if(t.autoDetect&&"auto"===n){const e=(navigator.language||navigator.userLanguage).split("-")[0];n=["es","en"].includes(e)?e:"es"}else t.autoDetect&&!n&&(n="es");return new y(n,t.messages)}validate(e){const t=[],n=this._deepMerge(this.globalConfig.auth||{},e.auth||{}),l=e.apiKey||this.globalConfig.apiKey;if("jwt"!==n.authMode&&l||n.apiKey||t.push("auth.apiKey es requerido para autenticación JWT"),"legacy"!==n.authMode||l||t.push("apiKey es requerido para modo legacy"),n.apiKey||l||t.push("Se requiere configuración de autenticación (auth.apiKey o apiKey legacy)"),e.mode&&!["embed","modal","button"].includes(e.mode)&&t.push("mode debe ser: embed, modal o button"),e.features&&!Array.isArray(e.features)&&t.push("features debe ser un array"),e.presets){const n=this._validatePresets(e.presets);t.push(...n)}return{isValid:0===t.length,errors:t}}setJWTAuth(e,t=null,n={}){const l={apiKey:e,publicKey:t,authMode:"jwt",tokenStorage:n.tokenStorage||"memory",autoRefresh:!1!==n.autoRefresh,refreshBuffer:n.refreshBuffer||30,portal:n.portal||null,...n};return this.set("auth",l),this}getAuthConfig(e=null){const t=e||this.merge();return{authMode:t.auth?.authMode||(t.apiKey?"legacy":"jwt"),apiKey:t.auth?.apiKey||t.apiKey,publicKey:t.auth?.publicKey,portal:t.auth?.portal,tokenStorage:t.auth?.tokenStorage||"memory",autoRefresh:!1!==t.auth?.autoRefresh,refreshBuffer:t.auth?.refreshBuffer||30}}isJWTMode(e=null){return"jwt"===this.getAuthConfig(e).authMode}isLegacyMode(e=null){return"legacy"===this.getAuthConfig(e).authMode}migrateToJWT(e=null){const t=e||this.globalConfig.apiKey;if(!t)throw new Error("No hay apiKey para migrar a JWT");return this.setJWTAuth(t),this}getMandatoryCrops(e=null){const t=e||this.merge();return t.cropper?.mandatoryCrops||[]}hasMandatoryCrops(e=null){return this.getMandatoryCrops(e).length>0}isEditModeEnabled(e=null){const t=e||this.merge();return!1!==t.cropper?.enableEditMode}showDimensionInputs(e=null){const t=e||this.merge();return!0===t.cropper?.showDimensionInputs}showDownloadInCropper(e=null){const t=e||this.merge();return!0===t.cropper?.showDownloadInCropper}showCropName(e=null){const t=e||this.merge();return!0===t.cropper?.showCropName}allowCustomCrops(e=null){const t=e||this.merge();return!1!==t.cropper?.allowCustomCrops}getGalleryFilters(e=null){const t=e||this.merge();return t.gallery?.filters||this.defaults.gallery.filters}isGalleryFilterEnabled(e,t=null){const n=this.getGalleryFilters(t);return n.enabledFilters?.includes(e)||!1}getCustomGalleryFilters(e=null){return this.getGalleryFilters(e).customFilters||[]}getGalleryLoadingConfig(e=null){const t=e||this.merge();return t.gallery?.loading||this.defaults.gallery.loading}showGalleryPlaceholders(e=null){return!1!==this.getGalleryLoadingConfig(e).showPlaceholders}getPlaceholderCount(e=null){return this.getGalleryLoadingConfig(e).placeholderCount||10}showGallerySpinner(e=null){return!1!==this.getGalleryLoadingConfig(e).showSpinner}getGalleryPagination(e=null){const t=e||this.merge();return t.gallery?.pagination||this.defaults.gallery.pagination}getItemsPerPage(e=null){return this.getGalleryPagination(e).itemsPerPage||20}getFolderConfig(e=null){return(e||this.merge()).folders||this.defaults.folders}hasFolderFilters(e=null){const t=this.getFolderConfig(e);return t.include?.length>0||t.exclude?.length>0}getFolderApiParams(e=null){const t=this.getFolderConfig(e),n={};return t.include?.length>0?n.folders_include=t.include.join(","):t.exclude?.length>0&&(n.folders_exclude=t.exclude.join(",")),this.hasFolderFilters(e)&&void 0!==t.includeNoFolder&&(n.include_no_folder=t.includeNoFolder?"1":"0"),n}showFolderSelectorInUpload(e=null){const t=e||this.merge();return!0===t.folders?.showFolderSelector}showFolderFilterInGallery(e=null){const t=e||this.merge();return!0===t.folders?.showFolderFilter}canCreateFolder(e=null){const t=e||this.merge();return!1!==t.folders?.allowCreateFolder}getDefaultUploadFolder(e=null){const t=e||this.merge();return t.folders?.defaultFolder||null}getAllowedFolderSlugs(e=null){const t=e||this.merge(),n=t.folders?.include;return n&&n.length>0?n:null}getAllowedCategories(e=null){const t=e||this.merge();return t.validation?.allowedCategories||null}isCategoryAllowed(e,t=null){const n=this.getAllowedCategories(t);return null===n||n.includes(e)}isMultiTypeEnabled(e=null){const t=this.getAllowedCategories(e);return null===t||(t.length>1||1===t.length&&"image"!==t[0])}showTypeFilter(e=null){const t=e||this.merge();return!0===t.gallery?.filters?.showTypeFilter}getTypeFilterOptions(e=null){const t=this.getAllowedCategories(e),n=[{value:"",label:"Todos los tipos"},{value:"image",label:"Imágenes"},{value:"video",label:"Videos"},{value:"document",label:"Documentos"},{value:"audio",label:"Audio"}];return null===t?n:n.filter(e=>""===e.value||t.includes(e.value))}getResolvedAccept(e=null){const t=e||this.merge();return t.validation?.accept?f(t.validation.accept):t.validation?.allowedCategories?f(t.validation.allowedCategories.map(e=>`${e}/*`).join(",")):f(null)}}var x,k,C,N,S={exports:{}},E={},$={exports:{}},_={};function z(){return k||(k=1,$.exports=(x||(x=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var l=n-1>>>1,a=e[l];if(!(0<r(a,t)))break e;e[l]=t,e[n]=a,n=l}}function n(e){return 0===e.length?null:e[0]}function l(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var l=0,a=e.length,i=a>>>1;l<i;){var o=2*(l+1)-1,s=e[o],c=o+1,u=e[c];if(0>r(s,n))c<a&&0>r(u,s)?(e[l]=u,e[c]=n,l=c):(e[l]=s,e[o]=n,l=o);else{if(!(c<a&&0>r(u,n)))break e;e[l]=u,e[c]=n,l=c}}}return t}function r(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(e.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var a=performance;e.unstable_now=function(){return a.now()}}else{var i=Date,o=i.now();e.unstable_now=function(){return i.now()-o}}var s=[],c=[],u=1,d=null,b=3,m=!1,h=!1,p=!1,f=!1,g="function"==typeof setTimeout?setTimeout:null,v="function"==typeof clearTimeout?clearTimeout:null,y="undefined"!=typeof setImmediate?setImmediate:null;function w(e){for(var r=n(c);null!==r;){if(null===r.callback)l(c);else{if(!(r.startTime<=e))break;l(c),r.sortIndex=r.expirationTime,t(s,r)}r=n(c)}}function x(e){if(p=!1,w(e),!h)if(null!==n(s))h=!0,C||(C=!0,k());else{var t=n(c);null!==t&&L(x,t.startTime-e)}}var k,C=!1,N=-1,S=5,E=-1;function $(){return!(!f&&e.unstable_now()-E<S)}function _(){if(f=!1,C){var t=e.unstable_now();E=t;var r=!0;try{e:{h=!1,p&&(p=!1,v(N),N=-1),m=!0;var a=b;try{t:{for(w(t),d=n(s);null!==d&&!(d.expirationTime>t&&$());){var i=d.callback;if("function"==typeof i){d.callback=null,b=d.priorityLevel;var o=i(d.expirationTime<=t);if(t=e.unstable_now(),"function"==typeof o){d.callback=o,w(t),r=!0;break t}d===n(s)&&l(s),w(t)}else l(s);d=n(s)}if(null!==d)r=!0;else{var u=n(c);null!==u&&L(x,u.startTime-t),r=!1}}break e}finally{d=null,b=a,m=!1}r=void 0}}finally{r?k():C=!1}}}if("function"==typeof y)k=function(){y(_)};else if("undefined"!=typeof MessageChannel){var z=new MessageChannel,T=z.port2;z.port1.onmessage=_,k=function(){T.postMessage(null)}}else k=function(){g(_,0)};function L(t,n){N=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):S=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(e){switch(b){case 1:case 2:case 3:var t=3;break;default:t=b}var n=b;b=t;try{return e()}finally{b=n}},e.unstable_requestPaint=function(){f=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=b;b=e;try{return t()}finally{b=n}},e.unstable_scheduleCallback=function(l,r,a){var i=e.unstable_now();switch(a="object"==typeof a&&null!==a&&"number"==typeof(a=a.delay)&&0<a?i+a:i,l){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return l={id:u++,callback:r,priorityLevel:l,startTime:a,expirationTime:o=a+o,sortIndex:-1},a>i?(l.sortIndex=a,t(c,l),null===n(s)&&l===n(c)&&(p?(v(N),N=-1):p=!0,L(x,a-i))):(l.sortIndex=o,t(s,l),h||m||(h=!0,C||(C=!0,k()))),l},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(e){var t=b;return function(){var n=b;b=t;try{return e.apply(this,arguments)}finally{b=n}}}}(_)),_)),$.exports}function T(){if(C)return E;C=1;var t=z(),n=e,l=o;function r(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function i(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function s(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function c(e){if(31===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function u(e){if(i(e)!==e)throw Error(r(188))}function d(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e;for(e=e.child;null!==e;){if(null!==(t=d(e)))return t;e=e.sibling}return null}var b=Object.assign,m=/* @__PURE__ */Symbol.for("react.element"),h=/* @__PURE__ */Symbol.for("react.transitional.element"),p=/* @__PURE__ */Symbol.for("react.portal"),f=/* @__PURE__ */Symbol.for("react.fragment"),g=/* @__PURE__ */Symbol.for("react.strict_mode"),v=/* @__PURE__ */Symbol.for("react.profiler"),y=/* @__PURE__ */Symbol.for("react.consumer"),w=/* @__PURE__ */Symbol.for("react.context"),x=/* @__PURE__ */Symbol.for("react.forward_ref"),k=/* @__PURE__ */Symbol.for("react.suspense"),N=/* @__PURE__ */Symbol.for("react.suspense_list"),S=/* @__PURE__ */Symbol.for("react.memo"),$=/* @__PURE__ */Symbol.for("react.lazy"),_=/* @__PURE__ */Symbol.for("react.activity"),T=/* @__PURE__ */Symbol.for("react.memo_cache_sentinel"),L=Symbol.iterator;function A(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=L&&e[L]||e["@@iterator"])?e:null}var M=/* @__PURE__ */Symbol.for("react.client.reference");function P(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===M?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case f:return"Fragment";case v:return"Profiler";case g:return"StrictMode";case k:return"Suspense";case N:return"SuspenseList";case _:return"Activity"}if("object"==typeof e)switch(e.$$typeof){case p:return"Portal";case w:return e.displayName||"Context";case y:return(e._context.displayName||"Context")+".Consumer";case x:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case S:return null!==(t=e.displayName||null)?t:P(e.type)||"Memo";case $:t=e._payload,e=e._init;try{return P(e(t))}catch(n){}}return null}var I=Array.isArray,D=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R={pending:!1,data:null,method:null,action:null},j=[],F=-1;function U(e){return{current:e}}function B(e){0>F||(e.current=j[F],j[F]=null,F--)}function W(e,t){F++,j[F]=e.current,e.current=t}var q,V,H=U(null),K=U(null),G=U(null),Q=U(null);function X(e,t){switch(W(G,t),W(K,e),W(H,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?yd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=wd(t=yd(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}B(H),W(H,e)}function Y(){B(H),B(K),B(G)}function J(e){null!==e.memoizedState&&W(Q,e);var t=H.current,n=wd(t,e.type);t!==n&&(W(K,e),W(H,n))}function Z(e){K.current===e&&(B(H),B(K)),Q.current===e&&(B(Q),bb._currentValue=R)}function ee(e){if(void 0===q)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);q=t&&t[1]||"",V=-1<n.stack.indexOf("\n at")?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+q+e+V}var te=!1;function ne(e,t){if(!e||te)return"";te=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(n,[])}catch(r){var l=r}Reflect.construct(e,[],n)}else{try{n.call()}catch(a){l=a}e.call(n.prototype)}}else{try{throw Error()}catch(i){l=i}(n=e())&&"function"==typeof n.catch&&n.catch(function(){})}}catch(o){if(o&&l&&"string"==typeof o.stack)return[o.stack,l.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=l.DetermineComponentFrameRoot(),i=a[0],o=a[1];if(i&&o){var s=i.split("\n"),c=o.split("\n");for(r=l=0;l<s.length&&!s[l].includes("DetermineComponentFrameRoot");)l++;for(;r<c.length&&!c[r].includes("DetermineComponentFrameRoot");)r++;if(l===s.length||r===c.length)for(l=s.length-1,r=c.length-1;1<=l&&0<=r&&s[l]!==c[r];)r--;for(;1<=l&&0<=r;l--,r--)if(s[l]!==c[r]){if(1!==l||1!==r)do{if(l--,0>--r||s[l]!==c[r]){var u="\n"+s[l].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}}while(1<=l&&0<=r);break}}}finally{te=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ee(n):""}function le(e,t){switch(e.tag){case 26:case 27:case 5:return ee(e.type);case 16:return ee("Lazy");case 13:return e.child!==t&&null!==t?ee("Suspense Fallback"):ee("Suspense");case 19:return ee("SuspenseList");case 0:case 15:return ne(e.type,!1);case 11:return ne(e.type.render,!1);case 1:return ne(e.type,!0);case 31:return ee("Activity");default:return""}}function re(e){try{var t="",n=null;do{t+=le(e,n),n=e,e=e.return}while(e);return t}catch(l){return"\nError generating stack: "+l.message+"\n"+l.stack}}var ae=Object.prototype.hasOwnProperty,ie=t.unstable_scheduleCallback,oe=t.unstable_cancelCallback,se=t.unstable_shouldYield,ce=t.unstable_requestPaint,ue=t.unstable_now,de=t.unstable_getCurrentPriorityLevel,be=t.unstable_ImmediatePriority,me=t.unstable_UserBlockingPriority,he=t.unstable_NormalPriority,pe=t.unstable_LowPriority,fe=t.unstable_IdlePriority,ge=t.log,ve=t.unstable_setDisableYieldValue,ye=null,we=null;function xe(e){if("function"==typeof ge&&ve(e),we&&"function"==typeof we.setStrictMode)try{we.setStrictMode(ye,e)}catch(t){}}var ke=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-(Ce(e)/Ne|0)|0},Ce=Math.log,Ne=Math.LN2;var Se=256,Ee=262144,$e=4194304;function _e(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ze(e,t,n){var l=e.pendingLanes;if(0===l)return 0;var r=0,a=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var o=134217727&l;return 0!==o?0!==(l=o&~a)?r=_e(l):0!==(i&=o)?r=_e(i):n||0!==(n=o&~e)&&(r=_e(n)):0!==(o=l&~a)?r=_e(o):0!==i?r=_e(i):n||0!==(n=l&~e)&&(r=_e(n)),0===r?0:0!==t&&t!==r&&0===(t&a)&&((a=r&-r)>=(n=t&-t)||32===a&&4194048&n)?t:r}function Te(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function Le(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function Ae(){var e=$e;return!(62914560&($e<<=1))&&($e=4194304),e}function Me(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Pe(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ie(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-ke(t);e.entangledLanes|=t,e.entanglements[l]=1073741824|e.entanglements[l]|261930&n}function De(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-ke(n),r=1<<l;r&t|e[l]&t&&(e[l]|=t),n&=~r}}function Oe(e,t){var n=t&-t;return 0!==((n=42&n?1:Re(n))&(e.suspendedLanes|t))?0:n}function Re(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function je(e){return 2<(e&=-e)?8<e?134217727&e?32:268435456:8:2}function Fe(){var e=O.p;return 0!==e?e:void 0===(e=window.event)?32:_b(e.type)}function Ue(e,t){var n=O.p;try{return O.p=e,t()}finally{O.p=n}}var Be=Math.random().toString(36).slice(2),We="__reactFiber$"+Be,qe="__reactProps$"+Be,Ve="__reactContainer$"+Be,He="__reactEvents$"+Be,Ke="__reactListeners$"+Be,Ge="__reactHandles$"+Be,Qe="__reactResources$"+Be,Xe="__reactMarker$"+Be;function Ye(e){delete e[We],delete e[qe],delete e[He],delete e[Ke],delete e[Ge]}function Je(e){var t=e[We];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ve]||n[We]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Rd(e);null!==e;){if(n=e[We])return n;e=Rd(e)}return t}n=(e=n).parentNode}return null}function Ze(e){if(e=e[We]||e[Ve]){var t=e.tag;if(5===t||6===t||13===t||31===t||26===t||27===t||3===t)return e}return null}function et(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e.stateNode;throw Error(r(33))}function tt(e){var t=e[Qe];return t||(t=e[Qe]={hoistableStyles:/* @__PURE__ */new Map,hoistableScripts:/* @__PURE__ */new Map}),t}function nt(e){e[Xe]=!0}var lt=/* @__PURE__ */new Set,rt={};function at(e,t){it(e,t),it(e+"Capture",t)}function it(e,t){for(rt[e]=t,e=0;e<t.length;e++)lt.add(t[e])}var ot=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),st={},ct={};function ut(e,t,n){if(r=t,ae.call(ct,r)||!ae.call(st,r)&&(ot.test(r)?ct[r]=!0:(st[r]=!0,0)))if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":return void e.removeAttribute(t);case"boolean":var l=t.toLowerCase().slice(0,5);if("data-"!==l&&"aria-"!==l)return void e.removeAttribute(t)}e.setAttribute(t,""+n)}var r}function dt(e,t,n){if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(t)}e.setAttribute(t,""+n)}}function bt(e,t,n,l){if(null===l)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(n)}e.setAttributeNS(t,n,""+l)}}function mt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function ht(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function pt(e){if(!e._valueTracker){var t=ht(e)?"checked":"value";e._valueTracker=function(e,t,n){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&void 0!==l&&"function"==typeof l.get&&"function"==typeof l.set){var r=l.get,a=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(e){n=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(e){n=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e,t,""+e[t])}}function ft(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=ht(e)?e.checked?"true":"false":e.value),(e=l)!==n&&(t.setValue(e),!0)}function gt(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}var vt=/[\n"\\]/g;function yt(e){return e.replace(vt,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function wt(e,t,n,l,r,a,i,o){e.name="",null!=i&&"function"!=typeof i&&"symbol"!=typeof i&&"boolean"!=typeof i?e.type=i:e.removeAttribute("type"),null!=t?"number"===i?(0===t&&""===e.value||e.value!=t)&&(e.value=""+mt(t)):e.value!==""+mt(t)&&(e.value=""+mt(t)):"submit"!==i&&"reset"!==i||e.removeAttribute("value"),null!=t?kt(e,i,mt(t)):null!=n?kt(e,i,mt(n)):null!=l&&e.removeAttribute("value"),null==r&&null!=a&&(e.defaultChecked=!!a),null!=r&&(e.checked=r&&"function"!=typeof r&&"symbol"!=typeof r),null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o?e.name=""+mt(o):e.removeAttribute("name")}function xt(e,t,n,l,r,a,i,o){if(null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a&&(e.type=a),null!=t||null!=n){if(("submit"===a||"reset"===a)&&null==t)return void pt(e);n=null!=n?""+mt(n):"",t=null!=t?""+mt(t):n,o||t===e.value||(e.value=t),e.defaultValue=t}l="function"!=typeof(l=null!=l?l:r)&&"symbol"!=typeof l&&!!l,e.checked=o?e.checked:!!l,e.defaultChecked=!!l,null!=i&&"function"!=typeof i&&"symbol"!=typeof i&&"boolean"!=typeof i&&(e.name=i),pt(e)}function kt(e,t,n){"number"===t&&gt(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Ct(e,t,n,l){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&l&&(e[n].defaultSelected=!0)}else{for(n=""+mt(n),t=null,r=0;r<e.length;r++){if(e[r].value===n)return e[r].selected=!0,void(l&&(e[r].defaultSelected=!0));null!==t||e[r].disabled||(t=e[r])}null!==t&&(t.selected=!0)}}function Nt(e,t,n){null==t||((t=""+mt(t))!==e.value&&(e.value=t),null!=n)?e.defaultValue=null!=n?""+mt(n):"":e.defaultValue!==t&&(e.defaultValue=t)}function St(e,t,n,l){if(null==t){if(null!=l){if(null!=n)throw Error(r(92));if(I(l)){if(1<l.length)throw Error(r(93));l=l[0]}n=l}null==n&&(n=""),t=n}n=mt(t),e.defaultValue=n,(l=e.textContent)===n&&""!==l&&null!==l&&(e.value=l),pt(e)}function Et(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var $t=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function _t(e,t,n){var l=0===t.indexOf("--");null==n||"boolean"==typeof n||""===n?l?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":l?e.setProperty(t,n):"number"!=typeof n||0===n||$t.has(t)?"float"===t?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function zt(e,t,n){if(null!=t&&"object"!=typeof t)throw Error(r(62));if(e=e.style,null!=n){for(var l in n)!n.hasOwnProperty(l)||null!=t&&t.hasOwnProperty(l)||(0===l.indexOf("--")?e.setProperty(l,""):"float"===l?e.cssFloat="":e[l]="");for(var a in t)l=t[a],t.hasOwnProperty(a)&&n[a]!==l&&_t(e,a,l)}else for(var i in t)t.hasOwnProperty(i)&&_t(e,i,t[i])}function Tt(e){if(-1===e.indexOf("-"))return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Lt=/* @__PURE__ */new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),At=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Mt(e){return At.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Pt(){}var It=null;function Dt(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Ot=null,Rt=null;function jt(e){var t=Ze(e);if(t&&(e=t.stateNode)){var n=e[qe]||null;e:switch(e=t.stateNode,t.type){case"input":if(wt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+yt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var a=l[qe]||null;if(!a)throw Error(r(90));wt(l,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)(l=n[t]).form===e.form&&ft(l)}break e;case"textarea":Nt(e,n.value,n.defaultValue);break e;case"select":null!=(t=n.value)&&Ct(e,!!n.multiple,t,!1)}}}var Ft=!1;function Ut(e,t,n){if(Ft)return e(t,n);Ft=!0;try{return e(t)}finally{if(Ft=!1,(null!==Ot||null!==Rt)&&(tu(),Ot&&(t=Ot,e=Rt,Rt=Ot=null,jt(t),e)))for(t=0;t<e.length;t++)jt(e[t])}}function Bt(e,t){var n=e.stateNode;if(null===n)return null;var l=n[qe]||null;if(null===l)return null;n=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(l=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!l;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(r(231,t,typeof n));return n}var Wt=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),qt=!1;if(Wt)try{var Vt={};Object.defineProperty(Vt,"passive",{get:function(){qt=!0}}),window.addEventListener("test",Vt,Vt),window.removeEventListener("test",Vt,Vt)}catch(Zb){qt=!1}var Ht=null,Kt=null,Gt=null;function Qt(){if(Gt)return Gt;var e,t,n=Kt,l=n.length,r="value"in Ht?Ht.value:Ht.textContent,a=r.length;for(e=0;e<l&&n[e]===r[e];e++);var i=l-e;for(t=1;t<=i&&n[l-t]===r[a-t];t++);return Gt=r.slice(e,1<t?1-t:void 0)}function Xt(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function Yt(){return!0}function Jt(){return!1}function Zt(e){function t(t,n,l,r,a){for(var i in this._reactName=t,this._targetInst=l,this.type=n,this.nativeEvent=r,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(i)&&(t=e[i],this[i]=t?t(r):r[i]);return this.isDefaultPrevented=(null!=r.defaultPrevented?r.defaultPrevented:!1===r.returnValue)?Yt:Jt,this.isPropagationStopped=Jt,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Yt)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Yt)},persist:function(){},isPersistent:Yt}),t}var en,tn,nn,ln={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rn=Zt(ln),an=b({},ln,{view:0,detail:0}),on=Zt(an),sn=b({},an,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==nn&&(nn&&"mousemove"===e.type?(en=e.screenX-nn.screenX,tn=e.screenY-nn.screenY):tn=en=0,nn=e),en)},movementY:function(e){return"movementY"in e?e.movementY:tn}}),cn=Zt(sn),un=Zt(b({},sn,{dataTransfer:0})),dn=Zt(b({},an,{relatedTarget:0})),bn=Zt(b({},ln,{animationName:0,elapsedTime:0,pseudoElement:0})),mn=Zt(b({},ln,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),hn=Zt(b({},ln,{data:0})),pn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},gn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function vn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=gn[e])&&!!t[e]}function yn(){return vn}var wn=Zt(b({},an,{key:function(e){if(e.key){var t=pn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Xt(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?fn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yn,charCode:function(e){return"keypress"===e.type?Xt(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Xt(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),xn=Zt(b({},sn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),kn=Zt(b({},an,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yn})),Cn=Zt(b({},ln,{propertyName:0,elapsedTime:0,pseudoElement:0})),Nn=Zt(b({},sn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Sn=Zt(b({},ln,{newState:0,oldState:0})),En=[9,13,27,32],$n=Wt&&"CompositionEvent"in window,_n=null;Wt&&"documentMode"in document&&(_n=document.documentMode);var zn=Wt&&"TextEvent"in window&&!_n,Tn=Wt&&(!$n||_n&&8<_n&&11>=_n),Ln=String.fromCharCode(32),An=!1;function Mn(e,t){switch(e){case"keyup":return-1!==En.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var In=!1;var Dn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function On(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Dn[e.type]:"textarea"===t}function Rn(e,t,n,l){Ot?Rt?Rt.push(l):Rt=[l]:Ot=l,0<(t=ad(t,"onChange")).length&&(n=new rn("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var jn=null,Fn=null;function Un(e){Yu(e,0)}function Bn(e){if(ft(et(e)))return e}function Wn(e,t){if("change"===e)return t}var qn=!1;if(Wt){var Vn;if(Wt){var Hn="oninput"in document;if(!Hn){var Kn=document.createElement("div");Kn.setAttribute("oninput","return;"),Hn="function"==typeof Kn.oninput}Vn=Hn}else Vn=!1;qn=Vn&&(!document.documentMode||9<document.documentMode)}function Gn(){jn&&(jn.detachEvent("onpropertychange",Qn),Fn=jn=null)}function Qn(e){if("value"===e.propertyName&&Bn(Fn)){var t=[];Rn(t,Fn,e,Dt(e)),Ut(Un,t)}}function Xn(e,t,n){"focusin"===e?(Gn(),Fn=n,(jn=t).attachEvent("onpropertychange",Qn)):"focusout"===e&&Gn()}function Yn(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Bn(Fn)}function Jn(e,t){if("click"===e)return Bn(t)}function Zn(e,t){if("input"===e||"change"===e)return Bn(t)}var el="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function tl(e,t){if(el(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var r=n[l];if(!ae.call(t,r)||!el(e[r],t[r]))return!1}return!0}function nl(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ll(e,t){var n,l=nl(e);for(e=0;l;){if(3===l.nodeType){if(n=e+l.textContent.length,e<=t&&n>=t)return{node:l,offset:t-e};e=n}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=nl(l)}}function rl(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?rl(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function al(e){for(var t=gt((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(l){n=!1}if(!n)break;t=gt((e=t.contentWindow).document)}return t}function il(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var ol=Wt&&"documentMode"in document&&11>=document.documentMode,sl=null,cl=null,ul=null,dl=!1;function bl(e,t,n){var l=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;dl||null==sl||sl!==gt(l)||("selectionStart"in(l=sl)&&il(l)?l={start:l.selectionStart,end:l.selectionEnd}:l={anchorNode:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset},ul&&tl(ul,l)||(ul=l,0<(l=ad(cl,"onSelect")).length&&(t=new rn("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=sl)))}function ml(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var hl={animationend:ml("Animation","AnimationEnd"),animationiteration:ml("Animation","AnimationIteration"),animationstart:ml("Animation","AnimationStart"),transitionrun:ml("Transition","TransitionRun"),transitionstart:ml("Transition","TransitionStart"),transitioncancel:ml("Transition","TransitionCancel"),transitionend:ml("Transition","TransitionEnd")},pl={},fl={};function gl(e){if(pl[e])return pl[e];if(!hl[e])return e;var t,n=hl[e];for(t in n)if(n.hasOwnProperty(t)&&t in fl)return pl[e]=n[t];return e}Wt&&(fl=document.createElement("div").style,"AnimationEvent"in window||(delete hl.animationend.animation,delete hl.animationiteration.animation,delete hl.animationstart.animation),"TransitionEvent"in window||delete hl.transitionend.transition);var vl=gl("animationend"),yl=gl("animationiteration"),wl=gl("animationstart"),xl=gl("transitionrun"),kl=gl("transitionstart"),Cl=gl("transitioncancel"),Nl=gl("transitionend"),Sl=/* @__PURE__ */new Map,El="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function $l(e,t){Sl.set(e,t),at(t,[e])}El.push("scrollEnd");var _l="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},zl=[],Tl=0,Ll=0;function Al(){for(var e=Tl,t=Ll=Tl=0;t<e;){var n=zl[t];zl[t++]=null;var l=zl[t];zl[t++]=null;var r=zl[t];zl[t++]=null;var a=zl[t];if(zl[t++]=null,null!==l&&null!==r){var i=l.pending;null===i?r.next=r:(r.next=i.next,i.next=r),l.pending=r}0!==a&&Dl(n,r,a)}}function Ml(e,t,n,l){zl[Tl++]=e,zl[Tl++]=t,zl[Tl++]=n,zl[Tl++]=l,Ll|=l,e.lanes|=l,null!==(e=e.alternate)&&(e.lanes|=l)}function Pl(e,t,n,l){return Ml(e,t,n,l),Ol(e)}function Il(e,t){return Ml(e,null,null,t),Ol(e)}function Dl(e,t,n){e.lanes|=n;var l=e.alternate;null!==l&&(l.lanes|=n);for(var r=!1,a=e.return;null!==a;)a.childLanes|=n,null!==(l=a.alternate)&&(l.childLanes|=n),22===a.tag&&(null===(e=a.stateNode)||1&e._visibility||(r=!0)),e=a,a=a.return;return 3===e.tag?(a=e.stateNode,r&&null!==t&&(r=31-ke(n),null===(l=(e=a.hiddenUpdates)[r])?e[r]=[t]:l.push(t),t.lane=536870912|n),a):null}function Ol(e){if(50<Hc)throw Hc=0,Kc=null,Error(r(185));for(var t=e.return;null!==t;)t=(e=t).return;return 3===e.tag?e.stateNode:null}var Rl={};function jl(e,t,n,l){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fl(e,t,n,l){return new jl(e,t,n,l)}function Ul(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Bl(e,t){var n=e.alternate;return null===n?((n=Fl(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=65011712&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Wl(e,t){e.flags&=65011714;var n=e.alternate;return null===n?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ql(e,t,n,l,a,i){var o=0;if(l=e,"function"==typeof e)Ul(e)&&(o=1);else if("string"==typeof e)o=function(e,t,n){if(1===n||null!=t.itemProp)return!1;switch(e){case"meta":case"title":return!0;case"style":if("string"!=typeof t.precedence||"string"!=typeof t.href||""===t.href)break;return!0;case"link":if("string"!=typeof t.rel||"string"!=typeof t.href||""===t.href||t.onLoad||t.onError)break;return"stylesheet"!==t.rel||(e=t.disabled,"string"==typeof t.precedence&&null==e);case"script":if(t.async&&"function"!=typeof t.async&&"symbol"!=typeof t.async&&!t.onLoad&&!t.onError&&t.src&&"string"==typeof t.src)return!0}return!1}(e,n,H.current)?26:"html"===e||"head"===e||"body"===e?27:5;else e:switch(e){case _:return(e=Fl(31,n,t,a)).elementType=_,e.lanes=i,e;case f:return Vl(n.children,a,i,t);case g:o=8,a|=24;break;case v:return(e=Fl(12,n,t,2|a)).elementType=v,e.lanes=i,e;case k:return(e=Fl(13,n,t,a)).elementType=k,e.lanes=i,e;case N:return(e=Fl(19,n,t,a)).elementType=N,e.lanes=i,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case w:o=10;break e;case y:o=9;break e;case x:o=11;break e;case S:o=14;break e;case $:o=16,l=null;break e}o=29,n=Error(r(130,null===e?"null":typeof e,"")),l=null}return(t=Fl(o,n,t,a)).elementType=e,t.type=l,t.lanes=i,t}function Vl(e,t,n,l){return(e=Fl(7,e,l,t)).lanes=n,e}function Hl(e,t,n){return(e=Fl(6,e,null,t)).lanes=n,e}function Kl(e){var t=Fl(18,null,null,0);return t.stateNode=e,t}function Gl(e,t,n){return(t=Fl(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ql=/* @__PURE__ */new WeakMap;function Xl(e,t){if("object"==typeof e&&null!==e){var n=Ql.get(e);return void 0!==n?n:(t={value:e,source:t,stack:re(t)},Ql.set(e,t),t)}return{value:e,source:t,stack:re(t)}}var Yl=[],Jl=0,Zl=null,er=0,tr=[],nr=0,lr=null,rr=1,ar="";function ir(e,t){Yl[Jl++]=er,Yl[Jl++]=Zl,Zl=e,er=t}function or(e,t,n){tr[nr++]=rr,tr[nr++]=ar,tr[nr++]=lr,lr=e;var l=rr;e=ar;var r=32-ke(l)-1;l&=~(1<<r),n+=1;var a=32-ke(t)+r;if(30<a){var i=r-r%5;a=(l&(1<<i)-1).toString(32),l>>=i,r-=i,rr=1<<32-ke(t)+r|n<<r|l,ar=a+e}else rr=1<<a|n<<r|l,ar=e}function sr(e){null!==e.return&&(ir(e,1),or(e,1,0))}function cr(e){for(;e===Zl;)Zl=Yl[--Jl],Yl[Jl]=null,er=Yl[--Jl],Yl[Jl]=null;for(;e===lr;)lr=tr[--nr],tr[nr]=null,ar=tr[--nr],tr[nr]=null,rr=tr[--nr],tr[nr]=null}function ur(e,t){tr[nr++]=rr,tr[nr++]=ar,tr[nr++]=lr,rr=t.id,ar=t.overflow,lr=e}var dr=null,br=null,mr=!1,hr=null,pr=!1,fr=Error(r(519));function gr(e){throw Cr(Xl(Error(r(418,1<arguments.length&&void 0!==arguments[1]&&arguments[1]?"text":"HTML","")),e)),fr}function vr(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[We]=e,t[qe]=l,n){case"dialog":Ju("cancel",t),Ju("close",t);break;case"iframe":case"object":case"embed":Ju("load",t);break;case"video":case"audio":for(n=0;n<Qu.length;n++)Ju(Qu[n],t);break;case"source":Ju("error",t);break;case"img":case"image":case"link":Ju("error",t),Ju("load",t);break;case"details":Ju("toggle",t);break;case"input":Ju("invalid",t),xt(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ju("invalid",t);break;case"textarea":Ju("invalid",t),St(t,l.value,l.defaultValue,l.children)}"string"!=typeof(n=l.children)&&"number"!=typeof n&&"bigint"!=typeof n||t.textContent===""+n||!0===l.suppressHydrationWarning||dd(t.textContent,n)?(null!=l.popover&&(Ju("beforetoggle",t),Ju("toggle",t)),null!=l.onScroll&&Ju("scroll",t),null!=l.onScrollEnd&&Ju("scrollend",t),null!=l.onClick&&(t.onclick=Pt),t=!0):t=!1,t||gr(e,!0)}function yr(e){for(dr=e.return;dr;)switch(dr.tag){case 5:case 31:case 13:return void(pr=!1);case 27:case 3:return void(pr=!0);default:dr=dr.return}}function wr(e){if(e!==dr)return!1;if(!mr)return yr(e),mr=!0,!1;var t,n=e.tag;if((t=3!==n&&27!==n)&&((t=5===n)&&(t=!("form"!==(t=e.type)&&"button"!==t)||xd(e.type,e.memoizedProps)),t=!t),t&&br&&gr(e),yr(e),13===n){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(r(317));br=Od(e)}else if(31===n){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(r(317));br=Od(e)}else 27===n?(n=br,_d(e.type)?(e=Dd,Dd=null,br=e):br=n):br=dr?Id(e.stateNode.nextSibling):null;return!0}function xr(){br=dr=null,mr=!1}function kr(){var e=hr;return null!==e&&(null===Ac?Ac=e:Ac.push.apply(Ac,e),hr=null),e}function Cr(e){null===hr?hr=[e]:hr.push(e)}var Nr=U(null),Sr=null,Er=null;function $r(e,t,n){W(Nr,t._currentValue),t._currentValue=n}function _r(e){e._currentValue=Nr.current,B(Nr)}function zr(e,t,n){for(;null!==e;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==l&&(l.childLanes|=t)):null!==l&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===n)break;e=e.return}}function Tr(e,t,n,l){var a=e.child;for(null!==a&&(a.return=e);null!==a;){var i=a.dependencies;if(null!==i){var o=a.child;i=i.firstContext;e:for(;null!==i;){var s=i;i=a;for(var c=0;c<t.length;c++)if(s.context===t[c]){i.lanes|=n,null!==(s=i.alternate)&&(s.lanes|=n),zr(i.return,n,e),l||(o=null);break e}i=s.next}}else if(18===a.tag){if(null===(o=a.return))throw Error(r(341));o.lanes|=n,null!==(i=o.alternate)&&(i.lanes|=n),zr(o,n,e),o=null}else o=a.child;if(null!==o)o.return=a;else for(o=a;null!==o;){if(o===e){o=null;break}if(null!==(a=o.sibling)){a.return=o.return,o=a;break}o=o.return}a=o}}function Lr(e,t,n,l){e=null;for(var a=t,i=!1;null!==a;){if(!i)if(524288&a.flags)i=!0;else if(262144&a.flags)break;if(10===a.tag){var o=a.alternate;if(null===o)throw Error(r(387));if(null!==(o=o.memoizedProps)){var s=a.type;el(a.pendingProps.value,o.value)||(null!==e?e.push(s):e=[s])}}else if(a===Q.current){if(null===(o=a.alternate))throw Error(r(387));o.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(null!==e?e.push(bb):e=[bb])}a=a.return}null!==e&&Tr(t,e,n,l),t.flags|=262144}function Ar(e){for(e=e.firstContext;null!==e;){if(!el(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Mr(e){Sr=e,Er=null,null!==(e=e.dependencies)&&(e.firstContext=null)}function Pr(e){return Dr(Sr,e)}function Ir(e,t){return null===Sr&&Mr(e),Dr(e,t)}function Dr(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},null===Er){if(null===e)throw Error(r(308));Er=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Er=Er.next=t;return n}var Or="undefined"!=typeof AbortController?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Rr=t.unstable_scheduleCallback,jr=t.unstable_NormalPriority,Fr={$$typeof:w,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ur(){return{controller:new Or,data:/* @__PURE__ */new Map,refCount:0}}function Br(e){e.refCount--,0===e.refCount&&Rr(jr,function(){e.controller.abort()})}var Wr=null,qr=0,Vr=0,Hr=null;function Kr(){if(0===--qr&&null!==Wr){null!==Hr&&(Hr.status="fulfilled");var e=Wr;Wr=null,Vr=0,Hr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}var Gr=D.S;D.S=function(e,t){Ic=ue(),"object"==typeof t&&null!==t&&"function"==typeof t.then&&function(e,t){if(null===Wr){var n=Wr=[];qr=0,Vr=qu(),Hr={status:"pending",value:void 0,then:function(e){n.push(e)}}}qr++,t.then(Kr,Kr)}(0,t),null!==Gr&&Gr(e,t)};var Qr=U(null);function Xr(){var e=Qr.current;return null!==e?e:fc.pooledCache}function Yr(e,t){W(Qr,null===t?Qr.current:t.pool)}function Jr(){var e=Xr();return null===e?null:{parent:Fr._currentValue,pool:e}}var Zr=Error(r(460)),ea=Error(r(474)),ta=Error(r(542)),na={then:function(){}};function la(e){return"fulfilled"===(e=e.status)||"rejected"===e}function ra(e,t,n){switch(void 0===(n=e[n])?e.push(t):n!==t&&(t.then(Pt,Pt),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw sa(e=t.reason),e;default:if("string"==typeof t.status)t.then(Pt,Pt);else{if(null!==(e=fc)&&100<e.shellSuspendCounter)throw Error(r(482));(e=t).status="pending",e.then(function(e){if("pending"===t.status){var n=t;n.status="fulfilled",n.value=e}},function(e){if("pending"===t.status){var n=t;n.status="rejected",n.reason=e}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw sa(e=t.reason),e}throw ia=t,Zr}}function aa(e){try{return(0,e._init)(e._payload)}catch(t){if(null!==t&&"object"==typeof t&&"function"==typeof t.then)throw ia=t,Zr;throw t}}var ia=null;function oa(){if(null===ia)throw Error(r(459));var e=ia;return ia=null,e}function sa(e){if(e===Zr||e===ta)throw Error(r(483))}var ca=null,ua=0;function da(e){var t=ua;return ua+=1,null===ca&&(ca=[]),ra(ca,e,t)}function ba(e,t){t=t.props.ref,e.ref=void 0!==t?t:null}function ma(e,t){if(t.$$typeof===m)throw Error(r(525));throw e=Object.prototype.toString.call(t),Error(r(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ha(e){function t(t,n){if(e){var l=t.deletions;null===l?(t.deletions=[n],t.flags|=16):l.push(n)}}function n(n,l){if(!e)return null;for(;null!==l;)t(n,l),l=l.sibling;return null}function l(e){for(var t=/* @__PURE__ */new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function a(e,t){return(e=Bl(e,t)).index=0,e.sibling=null,e}function i(t,n,l){return t.index=l,e?null!==(l=t.alternate)?(l=l.index)<n?(t.flags|=67108866,n):l:(t.flags|=67108866,n):(t.flags|=1048576,n)}function o(t){return e&&null===t.alternate&&(t.flags|=67108866),t}function s(e,t,n,l){return null===t||6!==t.tag?((t=Hl(n,e.mode,l)).return=e,t):((t=a(t,n)).return=e,t)}function c(e,t,n,l){var r=n.type;return r===f?d(e,t,n.props.children,l,n.key):null!==t&&(t.elementType===r||"object"==typeof r&&null!==r&&r.$$typeof===$&&aa(r)===t.type)?(ba(t=a(t,n.props),n),t.return=e,t):(ba(t=ql(n.type,n.key,n.props,null,e.mode,l),n),t.return=e,t)}function u(e,t,n,l){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Gl(n,e.mode,l)).return=e,t):((t=a(t,n.children||[])).return=e,t)}function d(e,t,n,l,r){return null===t||7!==t.tag?((t=Vl(n,e.mode,l,r)).return=e,t):((t=a(t,n)).return=e,t)}function b(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t||"bigint"==typeof t)return(t=Hl(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case h:return ba(n=ql(t.type,t.key,t.props,null,e.mode,n),t),n.return=e,n;case p:return(t=Gl(t,e.mode,n)).return=e,t;case $:return b(e,t=aa(t),n)}if(I(t)||A(t))return(t=Vl(t,e.mode,n,null)).return=e,t;if("function"==typeof t.then)return b(e,da(t),n);if(t.$$typeof===w)return b(e,Ir(e,t),n);ma(e,t)}return null}function m(e,t,n,l){var r=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n||"bigint"==typeof n)return null!==r?null:s(e,t,""+n,l);if("object"==typeof n&&null!==n){switch(n.$$typeof){case h:return n.key===r?c(e,t,n,l):null;case p:return n.key===r?u(e,t,n,l):null;case $:return m(e,t,n=aa(n),l)}if(I(n)||A(n))return null!==r?null:d(e,t,n,l,null);if("function"==typeof n.then)return m(e,t,da(n),l);if(n.$$typeof===w)return m(e,t,Ir(e,n),l);ma(e,n)}return null}function g(e,t,n,l,r){if("string"==typeof l&&""!==l||"number"==typeof l||"bigint"==typeof l)return s(t,e=e.get(n)||null,""+l,r);if("object"==typeof l&&null!==l){switch(l.$$typeof){case h:return c(t,e=e.get(null===l.key?n:l.key)||null,l,r);case p:return u(t,e=e.get(null===l.key?n:l.key)||null,l,r);case $:return g(e,t,n,l=aa(l),r)}if(I(l)||A(l))return d(t,e=e.get(n)||null,l,r,null);if("function"==typeof l.then)return g(e,t,n,da(l),r);if(l.$$typeof===w)return g(e,t,n,Ir(t,l),r);ma(t,l)}return null}function v(s,c,u,d){if("object"==typeof u&&null!==u&&u.type===f&&null===u.key&&(u=u.props.children),"object"==typeof u&&null!==u){switch(u.$$typeof){case h:e:{for(var y=u.key;null!==c;){if(c.key===y){if((y=u.type)===f){if(7===c.tag){n(s,c.sibling),(d=a(c,u.props.children)).return=s,s=d;break e}}else if(c.elementType===y||"object"==typeof y&&null!==y&&y.$$typeof===$&&aa(y)===c.type){n(s,c.sibling),ba(d=a(c,u.props),u),d.return=s,s=d;break e}n(s,c);break}t(s,c),c=c.sibling}u.type===f?((d=Vl(u.props.children,s.mode,d,u.key)).return=s,s=d):(ba(d=ql(u.type,u.key,u.props,null,s.mode,d),u),d.return=s,s=d)}return o(s);case p:e:{for(y=u.key;null!==c;){if(c.key===y){if(4===c.tag&&c.stateNode.containerInfo===u.containerInfo&&c.stateNode.implementation===u.implementation){n(s,c.sibling),(d=a(c,u.children||[])).return=s,s=d;break e}n(s,c);break}t(s,c),c=c.sibling}(d=Gl(u,s.mode,d)).return=s,s=d}return o(s);case $:return v(s,c,u=aa(u),d)}if(I(u))return function(r,a,o,s){for(var c=null,u=null,d=a,h=a=0,p=null;null!==d&&h<o.length;h++){d.index>h?(p=d,d=null):p=d.sibling;var f=m(r,d,o[h],s);if(null===f){null===d&&(d=p);break}e&&d&&null===f.alternate&&t(r,d),a=i(f,a,h),null===u?c=f:u.sibling=f,u=f,d=p}if(h===o.length)return n(r,d),mr&&ir(r,h),c;if(null===d){for(;h<o.length;h++)null!==(d=b(r,o[h],s))&&(a=i(d,a,h),null===u?c=d:u.sibling=d,u=d);return mr&&ir(r,h),c}for(d=l(d);h<o.length;h++)null!==(p=g(d,r,h,o[h],s))&&(e&&null!==p.alternate&&d.delete(null===p.key?h:p.key),a=i(p,a,h),null===u?c=p:u.sibling=p,u=p);return e&&d.forEach(function(e){return t(r,e)}),mr&&ir(r,h),c}(s,c,u,d);if(A(u)){if("function"!=typeof(y=A(u)))throw Error(r(150));return function(a,o,s,c){if(null==s)throw Error(r(151));for(var u=null,d=null,h=o,p=o=0,f=null,v=s.next();null!==h&&!v.done;p++,v=s.next()){h.index>p?(f=h,h=null):f=h.sibling;var y=m(a,h,v.value,c);if(null===y){null===h&&(h=f);break}e&&h&&null===y.alternate&&t(a,h),o=i(y,o,p),null===d?u=y:d.sibling=y,d=y,h=f}if(v.done)return n(a,h),mr&&ir(a,p),u;if(null===h){for(;!v.done;p++,v=s.next())null!==(v=b(a,v.value,c))&&(o=i(v,o,p),null===d?u=v:d.sibling=v,d=v);return mr&&ir(a,p),u}for(h=l(h);!v.done;p++,v=s.next())null!==(v=g(h,a,p,v.value,c))&&(e&&null!==v.alternate&&h.delete(null===v.key?p:v.key),o=i(v,o,p),null===d?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),mr&&ir(a,p),u}(s,c,u=y.call(u),d)}if("function"==typeof u.then)return v(s,c,da(u),d);if(u.$$typeof===w)return v(s,c,Ir(s,u),d);ma(s,u)}return"string"==typeof u&&""!==u||"number"==typeof u||"bigint"==typeof u?(u=""+u,null!==c&&6===c.tag?(n(s,c.sibling),(d=a(c,u)).return=s,s=d):(n(s,c),(d=Hl(u,s.mode,d)).return=s,s=d),o(s)):n(s,c)}return function(e,t,n,l){try{ua=0;var r=v(e,t,n,l);return ca=null,r}catch(i){if(i===Zr||i===ta)throw i;var a=Fl(29,i,null,e.mode);return a.lanes=l,a.return=e,a}}}var pa=ha(!0),fa=ha(!1),ga=!1;function va(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ya(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function wa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xa(e,t,n){var l=e.updateQueue;if(null===l)return null;if(l=l.shared,2&pc){var r=l.pending;return null===r?t.next=t:(t.next=r.next,r.next=t),l.pending=t,t=Ol(e),Dl(e,null,n),t}return Ml(e,l,t,n),Ol(e)}function ka(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194048&n)){var l=t.lanes;n|=l&=e.pendingLanes,t.lanes=n,De(e,n)}}function Ca(e,t){var n=e.updateQueue,l=e.alternate;if(null!==l&&n===(l=l.updateQueue)){var r=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var i={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===a?r=a=i:a=a.next=i,n=n.next}while(null!==n);null===a?r=a=t:a=a.next=t}else r=a=t;return n={baseState:l.baseState,firstBaseUpdate:r,lastBaseUpdate:a,shared:l.shared,callbacks:l.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Na=!1;function Sa(){if(Na){if(null!==Hr)throw Hr}}function Ea(e,t,n,l){Na=!1;var r=e.updateQueue;ga=!1;var a=r.firstBaseUpdate,i=r.lastBaseUpdate,o=r.shared.pending;if(null!==o){r.shared.pending=null;var s=o,c=s.next;s.next=null,null===i?a=c:i.next=c,i=s;var u=e.alternate;null!==u&&((o=(u=u.updateQueue).lastBaseUpdate)!==i&&(null===o?u.firstBaseUpdate=c:o.next=c,u.lastBaseUpdate=s))}if(null!==a){var d=r.baseState;for(i=0,u=c=s=null,o=a;;){var m=-536870913&o.lane,h=m!==o.lane;if(h?(vc&m)===m:(l&m)===m){0!==m&&m===Vr&&(Na=!0),null!==u&&(u=u.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var p=e,f=o;m=t;var g=n;switch(f.tag){case 1:if("function"==typeof(p=f.payload)){d=p.call(g,d,m);break e}d=p;break e;case 3:p.flags=-65537&p.flags|128;case 0:if(null==(m="function"==typeof(p=f.payload)?p.call(g,d,m):p))break e;d=b({},d,m);break e;case 2:ga=!0}}null!==(m=o.callback)&&(e.flags|=64,h&&(e.flags|=8192),null===(h=r.callbacks)?r.callbacks=[m]:h.push(m))}else h={lane:m,tag:o.tag,payload:o.payload,callback:o.callback,next:null},null===u?(c=u=h,s=d):u=u.next=h,i|=m;if(null===(o=o.next)){if(null===(o=r.shared.pending))break;o=(h=o).next,h.next=null,r.lastBaseUpdate=h,r.shared.pending=null}}null===u&&(s=d),r.baseState=s,r.firstBaseUpdate=c,r.lastBaseUpdate=u,null===a&&(r.shared.lanes=0),Ec|=i,e.lanes=i,e.memoizedState=d}}function $a(e,t){if("function"!=typeof e)throw Error(r(191,e));e.call(t)}function _a(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;e<n.length;e++)$a(n[e],t)}var za=U(null),Ta=U(0);function La(e,t){W(Ta,e=Nc),W(za,t),Nc=e|t.baseLanes}function Aa(){W(Ta,Nc),W(za,za.current)}function Ma(){Nc=Ta.current,B(za),B(Ta)}var Pa=U(null),Ia=null;function Da(e){var t=e.alternate;W(Ua,1&Ua.current),W(Pa,e),null===Ia&&(null===t||null!==za.current||null!==t.memoizedState)&&(Ia=e)}function Oa(e){W(Ua,Ua.current),W(Pa,e),null===Ia&&(Ia=e)}function Ra(e){22===e.tag?(W(Ua,Ua.current),W(Pa,e),null===Ia&&(Ia=e)):ja()}function ja(){W(Ua,Ua.current),W(Pa,Pa.current)}function Fa(e){B(Pa),Ia===e&&(Ia=null),B(Ua)}var Ua=U(0);function Ba(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||Md(n)||Pd(n)))return t}else if(19!==t.tag||"forwards"!==t.memoizedProps.revealOrder&&"backwards"!==t.memoizedProps.revealOrder&&"unstable_legacy-backwards"!==t.memoizedProps.revealOrder&&"together"!==t.memoizedProps.revealOrder){if(null!==t.child){t.child.return=t,t=t.child;continue}}else if(128&t.flags)return t;if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Wa=0,qa=null,Va=null,Ha=null,Ka=!1,Ga=!1,Qa=!1,Xa=0,Ya=0,Ja=null,Za=0;function ei(){throw Error(r(321))}function ti(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!el(e[n],t[n]))return!1;return!0}function ni(e,t,n,l,r,a){return Wa=a,qa=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,D.H=null===e||null===e.memoizedState?vo:yo,Qa=!1,a=n(l,r),Qa=!1,Ga&&(a=ri(t,n,l,r)),li(e),a}function li(e){D.H=go;var t=null!==Va&&null!==Va.next;if(Wa=0,Ha=Va=qa=null,Ka=!1,Ya=0,Ja=null,t)throw Error(r(300));null===e||Io||null!==(e=e.dependencies)&&Ar(e)&&(Io=!0)}function ri(e,t,n,l){qa=e;var a=0;do{if(Ga&&(Ja=null),Ya=0,Ga=!1,25<=a)throw Error(r(301));if(a+=1,Ha=Va=null,null!=e.updateQueue){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,null!=i.memoCache&&(i.memoCache.index=0)}D.H=wo,i=t(n,l)}while(Ga);return i}function ai(){var e=D.H,t=e.useState()[0];return t="function"==typeof t.then?di(t):t,e=e.useState()[0],(null!==Va?Va.memoizedState:null)!==e&&(qa.flags|=1024),t}function ii(){var e=0!==Xa;return Xa=0,e}function oi(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function si(e){if(Ka){for(e=e.memoizedState;null!==e;){var t=e.queue;null!==t&&(t.pending=null),e=e.next}Ka=!1}Wa=0,Ha=Va=qa=null,Ga=!1,Ya=Xa=0,Ja=null}function ci(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Ha?qa.memoizedState=Ha=e:Ha=Ha.next=e,Ha}function ui(){if(null===Va){var e=qa.alternate;e=null!==e?e.memoizedState:null}else e=Va.next;var t=null===Ha?qa.memoizedState:Ha.next;if(null!==t)Ha=t,Va=e;else{if(null===e){if(null===qa.alternate)throw Error(r(467));throw Error(r(310))}e={memoizedState:(Va=e).memoizedState,baseState:Va.baseState,baseQueue:Va.baseQueue,queue:Va.queue,next:null},null===Ha?qa.memoizedState=Ha=e:Ha=Ha.next=e}return Ha}function di(e){var t=Ya;return Ya+=1,null===Ja&&(Ja=[]),e=ra(Ja,e,t),t=qa,null===(null===Ha?t.memoizedState:Ha.next)&&(t=t.alternate,D.H=null===t||null===t.memoizedState?vo:yo),e}function bi(e){if(null!==e&&"object"==typeof e){if("function"==typeof e.then)return di(e);if(e.$$typeof===w)return Pr(e)}throw Error(r(438,String(e)))}function mi(e){var t=null,n=qa.updateQueue;if(null!==n&&(t=n.memoCache),null==t){var l=qa.alternate;null!==l&&(null!==(l=l.updateQueue)&&(null!=(l=l.memoCache)&&(t={data:l.data.map(function(e){return e.slice()}),index:0})))}if(null==t&&(t={data:[],index:0}),null===n&&(n={lastEffect:null,events:null,stores:null,memoCache:null},qa.updateQueue=n),n.memoCache=t,void 0===(n=t.data[t.index]))for(n=t.data[t.index]=Array(e),l=0;l<e;l++)n[l]=T;return t.index++,n}function hi(e,t){return"function"==typeof t?t(e):t}function pi(e){return fi(ui(),Va,e)}function fi(e,t,n){var l=e.queue;if(null===l)throw Error(r(311));l.lastRenderedReducer=n;var a=e.baseQueue,i=l.pending;if(null!==i){if(null!==a){var o=a.next;a.next=i.next,i.next=o}t.baseQueue=a=i,l.pending=null}if(i=e.baseState,null===a)e.memoizedState=i;else{var s=o=null,c=null,u=t=a.next,d=!1;do{var b=-536870913&u.lane;if(b!==u.lane?(vc&b)===b:(Wa&b)===b){var m=u.revertLane;if(0===m)null!==c&&(c=c.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),b===Vr&&(d=!0);else{if((Wa&m)===m){u=u.next,m===Vr&&(d=!0);continue}b={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===c?(s=c=b,o=i):c=c.next=b,qa.lanes|=m,Ec|=m}b=u.action,Qa&&n(i,b),i=u.hasEagerState?u.eagerState:n(i,b)}else m={lane:b,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===c?(s=c=m,o=i):c=c.next=m,qa.lanes|=b,Ec|=b;u=u.next}while(null!==u&&u!==t);if(null===c?o=i:c.next=s,!el(i,e.memoizedState)&&(Io=!0,d&&null!==(n=Hr)))throw n;e.memoizedState=i,e.baseState=o,e.baseQueue=c,l.lastRenderedState=i}return null===a&&(l.lanes=0),[e.memoizedState,l.dispatch]}function gi(e){var t=ui(),n=t.queue;if(null===n)throw Error(r(311));n.lastRenderedReducer=e;var l=n.dispatch,a=n.pending,i=t.memoizedState;if(null!==a){n.pending=null;var o=a=a.next;do{i=e(i,o.action),o=o.next}while(o!==a);el(i,t.memoizedState)||(Io=!0),t.memoizedState=i,null===t.baseQueue&&(t.baseState=i),n.lastRenderedState=i}return[i,l]}function vi(e,t,n){var l=qa,a=ui(),i=mr;if(i){if(void 0===n)throw Error(r(407));n=n()}else n=t();var o=!el((Va||a).memoizedState,n);if(o&&(a.memoizedState=n,Io=!0),a=a.queue,Wi(xi.bind(null,l,a,e),[e]),a.getSnapshot!==t||o||null!==Ha&&1&Ha.memoizedState.tag){if(l.flags|=2048,Ri(9,{destroy:void 0},wi.bind(null,l,a,n,t),null),null===fc)throw Error(r(349));i||127&Wa||yi(l,t,n)}return n}function yi(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=qa.updateQueue)?(t={lastEffect:null,events:null,stores:null,memoCache:null},qa.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function wi(e,t,n,l){t.value=n,t.getSnapshot=l,ki(t)&&Ci(e)}function xi(e,t,n){return n(function(){ki(t)&&Ci(e)})}function ki(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!el(e,n)}catch(l){return!0}}function Ci(e){var t=Il(e,2);null!==t&&Xc(t,e,2)}function Ni(e){var t=ci();if("function"==typeof e){var n=e;if(e=n(),Qa){xe(!0);try{n()}finally{xe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hi,lastRenderedState:e},t}function Si(e,t,n,l){return e.baseState=n,fi(e,Va,"function"==typeof l?l:hi)}function Ei(e,t,n,l,a){if(ho(e))throw Error(r(485));if(null!==(e=t.action)){var i={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(e){i.listeners.push(e)}};null!==D.T?n(!0):i.isTransition=!1,l(i),null===(n=t.pending)?(i.next=t.pending=i,$i(t,i)):(i.next=n.next,t.pending=n.next=i)}}function $i(e,t){var n=t.action,l=t.payload,r=e.state;if(t.isTransition){var a=D.T,i={};D.T=i;try{var o=n(r,l),s=D.S;null!==s&&s(i,o),_i(e,t,o)}catch(c){Ti(e,t,c)}finally{null!==a&&null!==i.types&&(a.types=i.types),D.T=a}}else try{_i(e,t,a=n(r,l))}catch(u){Ti(e,t,u)}}function _i(e,t,n){null!==n&&"object"==typeof n&&"function"==typeof n.then?n.then(function(n){zi(e,t,n)},function(n){return Ti(e,t,n)}):zi(e,t,n)}function zi(e,t,n){t.status="fulfilled",t.value=n,Li(t),e.state=n,null!==(t=e.pending)&&((n=t.next)===t?e.pending=null:(n=n.next,t.next=n,$i(e,n)))}function Ti(e,t,n){var l=e.pending;if(e.pending=null,null!==l){l=l.next;do{t.status="rejected",t.reason=n,Li(t),t=t.next}while(t!==l)}e.action=null}function Li(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ai(e,t){return t}function Mi(e,t){if(mr){var n=fc.formState;if(null!==n){e:{var l=qa;if(mr){if(br){t:{for(var r=br,a=pr;8!==r.nodeType;){if(!a){r=null;break t}if(null===(r=Id(r.nextSibling))){r=null;break t}}r="F!"===(a=r.data)||"F"===a?r:null}if(r){br=Id(r.nextSibling),l="F!"===r.data;break e}}gr(l)}l=!1}l&&(t=n[0])}}return(n=ci()).memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ai,lastRenderedState:t},n.queue=l,n=uo.bind(null,qa,l),l.dispatch=n,l=Ni(!1),a=mo.bind(null,qa,!1,l.queue),r={state:t,dispatch:null,action:e,pending:null},(l=ci()).queue=r,n=Ei.bind(null,qa,r,a,n),r.dispatch=n,l.memoizedState=e,[t,n,!1]}function Pi(e){return Ii(ui(),Va,e)}function Ii(e,t,n){if(t=fi(e,t,Ai)[0],e=pi(hi)[0],"object"==typeof t&&null!==t&&"function"==typeof t.then)try{var l=di(t)}catch(i){if(i===Zr)throw ta;throw i}else l=t;var r=(t=ui()).queue,a=r.dispatch;return n!==t.memoizedState&&(qa.flags|=2048,Ri(9,{destroy:void 0},Di.bind(null,r,n),null)),[l,a,e]}function Di(e,t){e.action=t}function Oi(e){var t=ui(),n=Va;if(null!==n)return Ii(t,n,e);ui(),t=t.memoizedState;var l=(n=ui()).queue.dispatch;return n.memoizedState=e,[t,l,!1]}function Ri(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},null===(t=qa.updateQueue)&&(t={lastEffect:null,events:null,stores:null,memoCache:null},qa.updateQueue=t),null===(n=t.lastEffect)?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e),e}function ji(){return ui().memoizedState}function Fi(e,t,n,l){var r=ci();qa.flags|=e,r.memoizedState=Ri(1|t,{destroy:void 0},n,void 0===l?null:l)}function Ui(e,t,n,l){var r=ui();l=void 0===l?null:l;var a=r.memoizedState.inst;null!==Va&&null!==l&&ti(l,Va.memoizedState.deps)?r.memoizedState=Ri(t,a,n,l):(qa.flags|=e,r.memoizedState=Ri(1|t,a,n,l))}function Bi(e,t){Fi(8390656,8,e,t)}function Wi(e,t){Ui(2048,8,e,t)}function qi(e){var t=ui().memoizedState;return function(e){qa.flags|=4;var t=qa.updateQueue;if(null===t)t={lastEffect:null,events:null,stores:null,memoCache:null},qa.updateQueue=t,t.events=[e];else{var n=t.events;null===n?t.events=[e]:n.push(e)}}({ref:t,nextImpl:e}),function(){if(2&pc)throw Error(r(440));return t.impl.apply(void 0,arguments)}}function Vi(e,t){return Ui(4,2,e,t)}function Hi(e,t){return Ui(4,4,e,t)}function Ki(e,t){if("function"==typeof t){e=e();var n=t(e);return function(){"function"==typeof n?n():t(null)}}if(null!=t)return e=e(),t.current=e,function(){t.current=null}}function Gi(e,t,n){n=null!=n?n.concat([e]):null,Ui(4,4,Ki.bind(null,t,e),n)}function Qi(){}function Xi(e,t){var n=ui();t=void 0===t?null:t;var l=n.memoizedState;return null!==t&&ti(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function Yi(e,t){var n=ui();t=void 0===t?null:t;var l=n.memoizedState;if(null!==t&&ti(t,l[1]))return l[0];if(l=e(),Qa){xe(!0);try{e()}finally{xe(!1)}}return n.memoizedState=[l,t],l}function Ji(e,t,n){return void 0===n||1073741824&Wa&&!(261930&vc)?e.memoizedState=t:(e.memoizedState=n,e=Qc(),qa.lanes|=e,Ec|=e,n)}function Zi(e,t,n,l){return el(n,t)?n:null!==za.current?(e=Ji(e,n,l),el(e,t)||(Io=!0),e):42&Wa&&(!(1073741824&Wa)||261930&vc)?(e=Qc(),qa.lanes|=e,Ec|=e,t):(Io=!0,e.memoizedState=n)}function eo(e,t,n,l,r){var a=O.p;O.p=0!==a&&8>a?a:8;var i,o,s,c=D.T,u={};D.T=u,mo(e,!1,t,n);try{var d=r(),b=D.S;if(null!==b&&b(u,d),null!==d&&"object"==typeof d&&"function"==typeof d.then)bo(e,t,(i=l,o=[],s={status:"pending",value:null,reason:null,then:function(e){o.push(e)}},d.then(function(){s.status="fulfilled",s.value=i;for(var e=0;e<o.length;e++)(0,o[e])(i)},function(e){for(s.status="rejected",s.reason=e,e=0;e<o.length;e++)(0,o[e])(void 0)}),s),Gc());else bo(e,t,l,Gc())}catch(m){bo(e,t,{then:function(){},status:"rejected",reason:m},Gc())}finally{O.p=a,null!==c&&null!==u.types&&(c.types=u.types),D.T=c}}function to(){}function no(e,t,n,l){if(5!==e.tag)throw Error(r(476));var a=lo(e).queue;eo(e,a,t,R,null===n?to:function(){return ro(e),n(l)})}function lo(e){var t=e.memoizedState;if(null!==t)return t;var n={};return(t={memoizedState:R,baseState:R,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hi,lastRenderedState:R},next:null}).next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hi,lastRenderedState:n},next:null},e.memoizedState=t,null!==(e=e.alternate)&&(e.memoizedState=t),t}function ro(e){var t=lo(e);null===t.next&&(t=e.alternate.memoizedState),bo(e,t.next.queue,{},Gc())}function ao(){return Pr(bb)}function io(){return ui().memoizedState}function oo(){return ui().memoizedState}function so(e){for(var t=e.return;null!==t;){switch(t.tag){case 24:case 3:var n=Gc(),l=xa(t,e=wa(n),n);return null!==l&&(Xc(l,t,n),ka(l,t,n)),t={cache:Ur()},void(e.payload=t)}t=t.return}}function co(e,t,n){var l=Gc();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ho(e)?po(t,n):null!==(n=Pl(e,t,n,l))&&(Xc(n,e,l),fo(n,t,l))}function uo(e,t,n){bo(e,t,n,Gc())}function bo(e,t,n,l){var r={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ho(e))po(t,r);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var i=t.lastRenderedState,o=a(i,n);if(r.hasEagerState=!0,r.eagerState=o,el(o,i))return Ml(e,t,r,0),null===fc&&Al(),!1}catch(s){}if(null!==(n=Pl(e,t,r,l)))return Xc(n,e,l),fo(n,t,l),!0}return!1}function mo(e,t,n,l){if(l={lane:2,revertLane:qu(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ho(e)){if(t)throw Error(r(479))}else null!==(t=Pl(e,n,l,2))&&Xc(t,e,2)}function ho(e){var t=e.alternate;return e===qa||null!==t&&t===qa}function po(e,t){Ga=Ka=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function fo(e,t,n){if(4194048&n){var l=t.lanes;n|=l&=e.pendingLanes,t.lanes=n,De(e,n)}}var go={readContext:Pr,use:bi,useCallback:ei,useContext:ei,useEffect:ei,useImperativeHandle:ei,useLayoutEffect:ei,useInsertionEffect:ei,useMemo:ei,useReducer:ei,useRef:ei,useState:ei,useDebugValue:ei,useDeferredValue:ei,useTransition:ei,useSyncExternalStore:ei,useId:ei,useHostTransitionStatus:ei,useFormState:ei,useActionState:ei,useOptimistic:ei,useMemoCache:ei,useCacheRefresh:ei};go.useEffectEvent=ei;var vo={readContext:Pr,use:bi,useCallback:function(e,t){return ci().memoizedState=[e,void 0===t?null:t],e},useContext:Pr,useEffect:Bi,useImperativeHandle:function(e,t,n){n=null!=n?n.concat([e]):null,Fi(4194308,4,Ki.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Fi(4194308,4,e,t)},useInsertionEffect:function(e,t){Fi(4,2,e,t)},useMemo:function(e,t){var n=ci();t=void 0===t?null:t;var l=e();if(Qa){xe(!0);try{e()}finally{xe(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=ci();if(void 0!==n){var r=n(t);if(Qa){xe(!0);try{n(t)}finally{xe(!1)}}}else r=t;return l.memoizedState=l.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},l.queue=e,e=e.dispatch=co.bind(null,qa,e),[l.memoizedState,e]},useRef:function(e){return e={current:e},ci().memoizedState=e},useState:function(e){var t=(e=Ni(e)).queue,n=uo.bind(null,qa,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Qi,useDeferredValue:function(e,t){return Ji(ci(),e,t)},useTransition:function(){var e=Ni(!1);return e=eo.bind(null,qa,e.queue,!0,!1),ci().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=qa,a=ci();if(mr){if(void 0===n)throw Error(r(407));n=n()}else{if(n=t(),null===fc)throw Error(r(349));127&vc||yi(l,t,n)}a.memoizedState=n;var i={value:n,getSnapshot:t};return a.queue=i,Bi(xi.bind(null,l,i,e),[e]),l.flags|=2048,Ri(9,{destroy:void 0},wi.bind(null,l,i,n,t),null),n},useId:function(){var e=ci(),t=fc.identifierPrefix;if(mr){var n=ar;t="_"+t+"R_"+(n=(rr&~(1<<32-ke(rr)-1)).toString(32)+n),0<(n=Xa++)&&(t+="H"+n.toString(32)),t+="_"}else t="_"+t+"r_"+(n=Za++).toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:ao,useFormState:Mi,useActionState:Mi,useOptimistic:function(e){var t=ci();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=mo.bind(null,qa,!0,n),n.dispatch=t,[e,t]},useMemoCache:mi,useCacheRefresh:function(){return ci().memoizedState=so.bind(null,qa)},useEffectEvent:function(e){var t=ci(),n={impl:e};return t.memoizedState=n,function(){if(2&pc)throw Error(r(440));return n.impl.apply(void 0,arguments)}}},yo={readContext:Pr,use:bi,useCallback:Xi,useContext:Pr,useEffect:Wi,useImperativeHandle:Gi,useInsertionEffect:Vi,useLayoutEffect:Hi,useMemo:Yi,useReducer:pi,useRef:ji,useState:function(){return pi(hi)},useDebugValue:Qi,useDeferredValue:function(e,t){return Zi(ui(),Va.memoizedState,e,t)},useTransition:function(){var e=pi(hi)[0],t=ui().memoizedState;return["boolean"==typeof e?e:di(e),t]},useSyncExternalStore:vi,useId:io,useHostTransitionStatus:ao,useFormState:Pi,useActionState:Pi,useOptimistic:function(e,t){return Si(ui(),0,e,t)},useMemoCache:mi,useCacheRefresh:oo};yo.useEffectEvent=qi;var wo={readContext:Pr,use:bi,useCallback:Xi,useContext:Pr,useEffect:Wi,useImperativeHandle:Gi,useInsertionEffect:Vi,useLayoutEffect:Hi,useMemo:Yi,useReducer:gi,useRef:ji,useState:function(){return gi(hi)},useDebugValue:Qi,useDeferredValue:function(e,t){var n=ui();return null===Va?Ji(n,e,t):Zi(n,Va.memoizedState,e,t)},useTransition:function(){var e=gi(hi)[0],t=ui().memoizedState;return["boolean"==typeof e?e:di(e),t]},useSyncExternalStore:vi,useId:io,useHostTransitionStatus:ao,useFormState:Oi,useActionState:Oi,useOptimistic:function(e,t){var n=ui();return null!==Va?Si(n,0,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:mi,useCacheRefresh:oo};function xo(e,t,n,l){n=null==(n=n(l,t=e.memoizedState))?t:b({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}wo.useEffectEvent=qi;var ko={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=Gc(),r=wa(l);r.payload=t,null!=n&&(r.callback=n),null!==(t=xa(e,r,l))&&(Xc(t,e,l),ka(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=Gc(),r=wa(l);r.tag=1,r.payload=t,null!=n&&(r.callback=n),null!==(t=xa(e,r,l))&&(Xc(t,e,l),ka(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Gc(),l=wa(n);l.tag=2,null!=t&&(l.callback=t),null!==(t=xa(e,l,n))&&(Xc(t,e,n),ka(t,e,n))}};function Co(e,t,n,l,r,a,i){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(l,a,i):!t.prototype||!t.prototype.isPureReactComponent||(!tl(n,l)||!tl(r,a))}function No(e,t,n,l){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,l),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&ko.enqueueReplaceState(t,t.state,null)}function So(e,t){var n=t;if("ref"in t)for(var l in n={},t)"ref"!==l&&(n[l]=t[l]);if(e=e.defaultProps)for(var r in n===t&&(n=b({},n)),e)void 0===n[r]&&(n[r]=e[r]);return n}function Eo(e){_l(e)}function $o(e){console.error(e)}function _o(e){_l(e)}function zo(e,t){try{(0,e.onUncaughtError)(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function To(e,t,n){try{(0,e.onCaughtError)(n.value,{componentStack:n.stack,errorBoundary:1===t.tag?t.stateNode:null})}catch(l){setTimeout(function(){throw l})}}function Lo(e,t,n){return(n=wa(n)).tag=3,n.payload={element:null},n.callback=function(){zo(e,t)},n}function Ao(e){return(e=wa(e)).tag=3,e}function Mo(e,t,n,l){var r=n.type.getDerivedStateFromError;if("function"==typeof r){var a=l.value;e.payload=function(){return r(a)},e.callback=function(){To(t,n,l)}}var i=n.stateNode;null!==i&&"function"==typeof i.componentDidCatch&&(e.callback=function(){To(t,n,l),"function"!=typeof r&&(null===Rc?Rc=/* @__PURE__ */new Set([this]):Rc.add(this));var e=l.stack;this.componentDidCatch(l.value,{componentStack:null!==e?e:""})})}var Po=Error(r(461)),Io=!1;function Do(e,t,n,l){t.child=null===e?fa(t,null,n,l):pa(t,e.child,n,l)}function Oo(e,t,n,l,r){n=n.render;var a=t.ref;if("ref"in l){var i={};for(var o in l)"ref"!==o&&(i[o]=l[o])}else i=l;return Mr(t),l=ni(e,t,n,i,a,r),o=ii(),null===e||Io?(mr&&o&&sr(t),t.flags|=1,Do(e,t,l,r),t.child):(oi(e,t,r),is(e,t,r))}function Ro(e,t,n,l,r){if(null===e){var a=n.type;return"function"!=typeof a||Ul(a)||void 0!==a.defaultProps||null!==n.compare?((e=ql(n.type,null,l,t,t.mode,r)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,jo(e,t,a,l,r))}if(a=e.child,!os(e,r)){var i=a.memoizedProps;if((n=null!==(n=n.compare)?n:tl)(i,l)&&e.ref===t.ref)return is(e,t,r)}return t.flags|=1,(e=Bl(a,l)).ref=t.ref,e.return=t,t.child=e}function jo(e,t,n,l,r){if(null!==e){var a=e.memoizedProps;if(tl(a,l)&&e.ref===t.ref){if(Io=!1,t.pendingProps=l=a,!os(e,r))return t.lanes=e.lanes,is(e,t,r);131072&e.flags&&(Io=!0)}}return Ho(e,t,n,l,r)}function Fo(e,t,n,l){var r=l.children,a=null!==e?e.memoizedState:null;if(null===e&&null===t.stateNode&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),"hidden"===l.mode){if(128&t.flags){if(a=null!==a?a.baseLanes|n:n,null!==e){for(l=t.child=e.child,r=0;null!==l;)r=r|l.lanes|l.childLanes,l=l.sibling;l=r&~a}else l=0,t.child=null;return Bo(e,t,a,n,l)}if(!(536870912&n))return l=t.lanes=536870912,Bo(e,t,null!==a?a.baseLanes|n:n,n,l);t.memoizedState={baseLanes:0,cachePool:null},null!==e&&Yr(0,null!==a?a.cachePool:null),null!==a?La(t,a):Aa(),Ra(t)}else null!==a?(Yr(0,a.cachePool),La(t,a),ja(),t.memoizedState=null):(null!==e&&Yr(0,null),Aa(),ja());return Do(e,t,r,n),t.child}function Uo(e,t){return null!==e&&22===e.tag||null!==t.stateNode||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Bo(e,t,n,l,r){var a=Xr();return a=null===a?null:{parent:Fr._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},null!==e&&Yr(0,null),Aa(),Ra(t),null!==e&&Lr(e,t,l,!0),t.childLanes=r,null}function Wo(e,t){return(t=ts({mode:t.mode,children:t.children},e.mode)).ref=e.ref,e.child=t,t.return=e,t}function qo(e,t,n){return pa(t,e.child,null,n),(e=Wo(t,t.pendingProps)).flags|=2,Fa(t),t.memoizedState=null,e}function Vo(e,t){var n=t.ref;if(null===n)null!==e&&null!==e.ref&&(t.flags|=4194816);else{if("function"!=typeof n&&"object"!=typeof n)throw Error(r(284));null!==e&&e.ref===n||(t.flags|=4194816)}}function Ho(e,t,n,l,r){return Mr(t),n=ni(e,t,n,l,void 0,r),l=ii(),null===e||Io?(mr&&l&&sr(t),t.flags|=1,Do(e,t,n,r),t.child):(oi(e,t,r),is(e,t,r))}function Ko(e,t,n,l,r,a){return Mr(t),t.updateQueue=null,n=ri(t,l,n,r),li(e),l=ii(),null===e||Io?(mr&&l&&sr(t),t.flags|=1,Do(e,t,n,a),t.child):(oi(e,t,a),is(e,t,a))}function Go(e,t,n,l,r){if(Mr(t),null===t.stateNode){var a=Rl,i=n.contextType;"object"==typeof i&&null!==i&&(a=Pr(i)),a=new n(l,a),t.memoizedState=null!==a.state&&void 0!==a.state?a.state:null,a.updater=ko,t.stateNode=a,a._reactInternals=t,(a=t.stateNode).props=l,a.state=t.memoizedState,a.refs={},va(t),i=n.contextType,a.context="object"==typeof i&&null!==i?Pr(i):Rl,a.state=t.memoizedState,"function"==typeof(i=n.getDerivedStateFromProps)&&(xo(t,n,i,l),a.state=t.memoizedState),"function"==typeof n.getDerivedStateFromProps||"function"==typeof a.getSnapshotBeforeUpdate||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||(i=a.state,"function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount(),i!==a.state&&ko.enqueueReplaceState(a,a.state,null),Ea(t,l,a,r),Sa(),a.state=t.memoizedState),"function"==typeof a.componentDidMount&&(t.flags|=4194308),l=!0}else if(null===e){a=t.stateNode;var o=t.memoizedProps,s=So(n,o);a.props=s;var c=a.context,u=n.contextType;i=Rl,"object"==typeof u&&null!==u&&(i=Pr(u));var d=n.getDerivedStateFromProps;u="function"==typeof d||"function"==typeof a.getSnapshotBeforeUpdate,o=t.pendingProps!==o,u||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o||c!==i)&&No(t,a,l,i),ga=!1;var b=t.memoizedState;a.state=b,Ea(t,l,a,r),Sa(),c=t.memoizedState,o||b!==c||ga?("function"==typeof d&&(xo(t,n,d,l),c=t.memoizedState),(s=ga||Co(t,n,s,l,b,c,i))?(u||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=c),a.props=l,a.state=c,a.context=i,l=s):("function"==typeof a.componentDidMount&&(t.flags|=4194308),l=!1)}else{a=t.stateNode,ya(e,t),u=So(n,i=t.memoizedProps),a.props=u,d=t.pendingProps,b=a.context,c=n.contextType,s=Rl,"object"==typeof c&&null!==c&&(s=Pr(c)),(c="function"==typeof(o=n.getDerivedStateFromProps)||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(i!==d||b!==s)&&No(t,a,l,s),ga=!1,b=t.memoizedState,a.state=b,Ea(t,l,a,r),Sa();var m=t.memoizedState;i!==d||b!==m||ga||null!==e&&null!==e.dependencies&&Ar(e.dependencies)?("function"==typeof o&&(xo(t,n,o,l),m=t.memoizedState),(u=ga||Co(t,n,u,l,b,m,s)||null!==e&&null!==e.dependencies&&Ar(e.dependencies))?(c||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(l,m,s),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(l,m,s)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||i===e.memoizedProps&&b===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||i===e.memoizedProps&&b===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=m),a.props=l,a.state=m,a.context=s,l=u):("function"!=typeof a.componentDidUpdate||i===e.memoizedProps&&b===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||i===e.memoizedProps&&b===e.memoizedState||(t.flags|=1024),l=!1)}return a=l,Vo(e,t),l=!!(128&t.flags),a||l?(a=t.stateNode,n=l&&"function"!=typeof n.getDerivedStateFromError?null:a.render(),t.flags|=1,null!==e&&l?(t.child=pa(t,e.child,null,r),t.child=pa(t,null,n,r)):Do(e,t,n,r),t.memoizedState=a.state,e=t.child):e=is(e,t,r),e}function Qo(e,t,n,l){return xr(),t.flags|=256,Do(e,t,n,l),t.child}var Xo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Yo(e){return{baseLanes:e,cachePool:Jr()}}function Jo(e,t,n){return e=null!==e?e.childLanes&~n:0,t&&(e|=zc),e}function Zo(e,t,n){var l,a=t.pendingProps,i=!1,o=!!(128&t.flags);if((l=o)||(l=(null===e||null!==e.memoizedState)&&!!(2&Ua.current)),l&&(i=!0,t.flags&=-129),l=!!(32&t.flags),t.flags&=-33,null===e){if(mr){if(i?Da(t):ja(),(e=br)?null!==(e=null!==(e=Ad(e,pr))&&"&"!==e.data?e:null)&&(t.memoizedState={dehydrated:e,treeContext:null!==lr?{id:rr,overflow:ar}:null,retryLane:536870912,hydrationErrors:null},(n=Kl(e)).return=t,t.child=n,dr=t,br=null):e=null,null===e)throw gr(t);return Pd(e)?t.lanes=32:t.lanes=536870912,null}var s=a.children;return a=a.fallback,i?(ja(),s=ts({mode:"hidden",children:s},i=t.mode),a=Vl(a,i,n,null),s.return=t,a.return=t,s.sibling=a,t.child=s,(a=t.child).memoizedState=Yo(n),a.childLanes=Jo(e,l,n),t.memoizedState=Xo,Uo(null,a)):(Da(t),es(t,s))}var c=e.memoizedState;if(null!==c&&null!==(s=c.dehydrated)){if(o)256&t.flags?(Da(t),t.flags&=-257,t=ns(e,t,n)):null!==t.memoizedState?(ja(),t.child=e.child,t.flags|=128,t=null):(ja(),s=a.fallback,i=t.mode,a=ts({mode:"visible",children:a.children},i),(s=Vl(s,i,n,null)).flags|=2,a.return=t,s.return=t,a.sibling=s,t.child=a,pa(t,e.child,null,n),(a=t.child).memoizedState=Yo(n),a.childLanes=Jo(e,l,n),t.memoizedState=Xo,t=Uo(null,a));else if(Da(t),Pd(s)){if(l=s.nextSibling&&s.nextSibling.dataset)var u=l.dgst;l=u,(a=Error(r(419))).stack="",a.digest=l,Cr({value:a,source:null,stack:null}),t=ns(e,t,n)}else if(Io||Lr(e,t,n,!1),l=0!==(n&e.childLanes),Io||l){if(null!==(l=fc)&&(0!==(a=Oe(l,n))&&a!==c.retryLane))throw c.retryLane=a,Il(e,a),Xc(l,e,a),Po;Md(s)||su(),t=ns(e,t,n)}else Md(s)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,br=Id(s.nextSibling),dr=t,mr=!0,hr=null,pr=!1,null!==e&&ur(t,e),(t=es(t,a.children)).flags|=4096);return t}return i?(ja(),s=a.fallback,i=t.mode,u=(c=e.child).sibling,(a=Bl(c,{mode:"hidden",children:a.children})).subtreeFlags=65011712&c.subtreeFlags,null!==u?s=Bl(u,s):(s=Vl(s,i,n,null)).flags|=2,s.return=t,a.return=t,a.sibling=s,t.child=a,Uo(null,a),a=t.child,null===(s=e.child.memoizedState)?s=Yo(n):(null!==(i=s.cachePool)?(c=Fr._currentValue,i=i.parent!==c?{parent:c,pool:c}:i):i=Jr(),s={baseLanes:s.baseLanes|n,cachePool:i}),a.memoizedState=s,a.childLanes=Jo(e,l,n),t.memoizedState=Xo,Uo(e.child,a)):(Da(t),e=(n=e.child).sibling,(n=Bl(n,{mode:"visible",children:a.children})).return=t,n.sibling=null,null!==e&&(null===(l=t.deletions)?(t.deletions=[e],t.flags|=16):l.push(e)),t.child=n,t.memoizedState=null,n)}function es(e,t){return(t=ts({mode:"visible",children:t},e.mode)).return=e,e.child=t}function ts(e,t){return(e=Fl(22,e,null,t)).lanes=0,e}function ns(e,t,n){return pa(t,e.child,null,n),(e=es(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function ls(e,t,n){e.lanes|=t;var l=e.alternate;null!==l&&(l.lanes|=t),zr(e.return,t,n)}function rs(e,t,n,l,r,a){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:r,treeForkCount:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=l,i.tail=n,i.tailMode=r,i.treeForkCount=a)}function as(e,t,n){var l=t.pendingProps,r=l.revealOrder,a=l.tail;l=l.children;var i=Ua.current,o=!!(2&i);if(o?(i=1&i|2,t.flags|=128):i&=1,W(Ua,i),Do(e,t,l,n),l=mr?er:0,!o&&null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&ls(e,n,t);else if(19===e.tag)ls(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(r){case"forwards":for(n=t.child,r=null;null!==n;)null!==(e=n.alternate)&&null===Ba(e)&&(r=n),n=n.sibling;null===(n=r)?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),rs(t,!1,r,n,a,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,r=t.child,t.child=null;null!==r;){if(null!==(e=r.alternate)&&null===Ba(e)){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}rs(t,!0,n,null,a,l);break;case"together":rs(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function is(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Ec|=t.lanes,0===(n&t.childLanes)){if(null===e)return null;if(Lr(e,t,n,!1),0===(n&t.childLanes))return null}if(null!==e&&t.child!==e.child)throw Error(r(153));if(null!==t.child){for(n=Bl(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Bl(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function os(e,t){return 0!==(e.lanes&t)||!(null===(e=e.dependencies)||!Ar(e))}function ss(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps)Io=!0;else{if(!(os(e,n)||128&t.flags))return Io=!1,function(e,t,n){switch(t.tag){case 3:X(t,t.stateNode.containerInfo),$r(0,Fr,e.memoizedState.cache),xr();break;case 27:case 5:J(t);break;case 4:X(t,t.stateNode.containerInfo);break;case 10:$r(0,t.type,t.memoizedProps.value);break;case 31:if(null!==t.memoizedState)return t.flags|=128,Oa(t),null;break;case 13:var l=t.memoizedState;if(null!==l)return null!==l.dehydrated?(Da(t),t.flags|=128,null):0!==(n&t.child.childLanes)?Zo(e,t,n):(Da(t),null!==(e=is(e,t,n))?e.sibling:null);Da(t);break;case 19:var r=!!(128&e.flags);if((l=0!==(n&t.childLanes))||(Lr(e,t,n,!1),l=0!==(n&t.childLanes)),r){if(l)return as(e,t,n);t.flags|=128}if(null!==(r=t.memoizedState)&&(r.rendering=null,r.tail=null,r.lastEffect=null),W(Ua,Ua.current),l)break;return null;case 22:return t.lanes=0,Fo(e,t,n,t.pendingProps);case 24:$r(0,Fr,e.memoizedState.cache)}return is(e,t,n)}(e,t,n);Io=!!(131072&e.flags)}else Io=!1,mr&&1048576&t.flags&&or(t,er,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=aa(t.elementType),t.type=e,"function"!=typeof e){if(null!=e){var a=e.$$typeof;if(a===x){t.tag=11,t=Oo(null,t,e,l,n);break e}if(a===S){t.tag=14,t=Ro(null,t,e,l,n);break e}}throw t=P(e)||e,Error(r(306,t,""))}Ul(e)?(l=So(e,l),t.tag=1,t=Go(null,t,e,l,n)):(t.tag=0,t=Ho(null,t,e,l,n))}return t;case 0:return Ho(e,t,t.type,t.pendingProps,n);case 1:return Go(e,t,l=t.type,a=So(l,t.pendingProps),n);case 3:e:{if(X(t,t.stateNode.containerInfo),null===e)throw Error(r(387));l=t.pendingProps;var i=t.memoizedState;a=i.element,ya(e,t),Ea(t,l,null,n);var o=t.memoizedState;if(l=o.cache,$r(0,Fr,l),l!==i.cache&&Tr(t,[Fr],n,!0),Sa(),l=o.element,i.isDehydrated){if(i={element:l,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=i,t.memoizedState=i,256&t.flags){t=Qo(e,t,l,n);break e}if(l!==a){Cr(a=Xl(Error(r(424)),t)),t=Qo(e,t,l,n);break e}if(9===(e=t.stateNode.containerInfo).nodeType)e=e.body;else e="HTML"===e.nodeName?e.ownerDocument.body:e;for(br=Id(e.firstChild),dr=t,mr=!0,hr=null,pr=!0,n=fa(t,null,l,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(xr(),l===a){t=is(e,t,n);break e}Do(e,t,l,n)}t=t.child}return t;case 26:return Vo(e,t),null===e?(n=Kd(t.type,null,t.pendingProps,null))?t.memoizedState=n:mr||(n=t.type,e=t.pendingProps,(l=vd(G.current).createElement(n))[We]=t,l[qe]=e,hd(l,n,e),nt(l),t.stateNode=l):t.memoizedState=Kd(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return J(t),null===e&&mr&&(l=t.stateNode=jd(t.type,t.pendingProps,G.current),dr=t,pr=!0,a=br,_d(t.type)?(Dd=a,br=Id(l.firstChild)):br=a),Do(e,t,t.pendingProps.children,n),Vo(e,t),null===e&&(t.flags|=4194304),t.child;case 5:return null===e&&mr&&((a=l=br)&&(null!==(l=function(e,t,n,l){for(;1===e.nodeType;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&("INPUT"!==e.nodeName||"hidden"!==e.type))break}else if(l){if(!e[Xe])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if("stylesheet"===(a=e.getAttribute("rel"))&&e.hasAttribute("data-precedence"))break;if(a!==r.rel||e.getAttribute("href")!==(null==r.href||""===r.href?null:r.href)||e.getAttribute("crossorigin")!==(null==r.crossOrigin?null:r.crossOrigin)||e.getAttribute("title")!==(null==r.title?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(((a=e.getAttribute("src"))!==(null==r.src?null:r.src)||e.getAttribute("type")!==(null==r.type?null:r.type)||e.getAttribute("crossorigin")!==(null==r.crossOrigin?null:r.crossOrigin))&&a&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else{if("input"!==t||"hidden"!==e.type)return e;var a=null==r.name?null:""+r.name;if("hidden"===r.type&&e.getAttribute("name")===a)return e}if(null===(e=Id(e.nextSibling)))break}return null}(l,t.type,t.pendingProps,pr))?(t.stateNode=l,dr=t,br=Id(l.firstChild),pr=!1,a=!0):a=!1),a||gr(t)),J(t),a=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,l=i.children,xd(a,i)?l=null:null!==o&&xd(a,o)&&(t.flags|=32),null!==t.memoizedState&&(a=ni(e,t,ai,null,null,n),bb._currentValue=a),Vo(e,t),Do(e,t,l,n),t.child;case 6:return null===e&&mr&&((e=n=br)&&(null!==(n=function(e,t,n){if(""===t)return null;for(;3!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!n)return null;if(null===(e=Id(e.nextSibling)))return null}return e}(n,t.pendingProps,pr))?(t.stateNode=n,dr=t,br=null,e=!0):e=!1),e||gr(t)),null;case 13:return Zo(e,t,n);case 4:return X(t,t.stateNode.containerInfo),l=t.pendingProps,null===e?t.child=pa(t,null,l,n):Do(e,t,l,n),t.child;case 11:return Oo(e,t,t.type,t.pendingProps,n);case 7:return Do(e,t,t.pendingProps,n),t.child;case 8:case 12:return Do(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,$r(0,t.type,l.value),Do(e,t,l.children,n),t.child;case 9:return a=t.type._context,l=t.pendingProps.children,Mr(t),l=l(a=Pr(a)),t.flags|=1,Do(e,t,l,n),t.child;case 14:return Ro(e,t,t.type,t.pendingProps,n);case 15:return jo(e,t,t.type,t.pendingProps,n);case 19:return as(e,t,n);case 31:return function(e,t,n){var l=t.pendingProps,a=!!(128&t.flags);if(t.flags&=-129,null===e){if(mr){if("hidden"===l.mode)return e=Wo(t,l),t.lanes=536870912,Uo(null,e);if(Oa(t),(e=br)?null!==(e=null!==(e=Ad(e,pr))&&"&"===e.data?e:null)&&(t.memoizedState={dehydrated:e,treeContext:null!==lr?{id:rr,overflow:ar}:null,retryLane:536870912,hydrationErrors:null},(n=Kl(e)).return=t,t.child=n,dr=t,br=null):e=null,null===e)throw gr(t);return t.lanes=536870912,null}return Wo(t,l)}var i=e.memoizedState;if(null!==i){var o=i.dehydrated;if(Oa(t),a)if(256&t.flags)t.flags&=-257,t=qo(e,t,n);else{if(null===t.memoizedState)throw Error(r(558));t.child=e.child,t.flags|=128,t=null}else if(Io||Lr(e,t,n,!1),a=0!==(n&e.childLanes),Io||a){if(null!==(l=fc)&&0!==(o=Oe(l,n))&&o!==i.retryLane)throw i.retryLane=o,Il(e,o),Xc(l,e,o),Po;su(),t=qo(e,t,n)}else e=i.treeContext,br=Id(o.nextSibling),dr=t,mr=!0,hr=null,pr=!1,null!==e&&ur(t,e),(t=Wo(t,l)).flags|=4096;return t}return(e=Bl(e.child,{mode:l.mode,children:l.children})).ref=t.ref,t.child=e,e.return=t,e}(e,t,n);case 22:return Fo(e,t,n,t.pendingProps);case 24:return Mr(t),l=Pr(Fr),null===e?(null===(a=Xr())&&(a=fc,i=Ur(),a.pooledCache=i,i.refCount++,null!==i&&(a.pooledCacheLanes|=n),a=i),t.memoizedState={parent:l,cache:a},va(t),$r(0,Fr,a)):(0!==(e.lanes&n)&&(ya(e,t),Ea(t,null,null,n),Sa()),a=e.memoizedState,i=t.memoizedState,a.parent!==l?(a={parent:l,cache:l},t.memoizedState=a,0===t.lanes&&(t.memoizedState=t.updateQueue.baseState=a),$r(0,Fr,l)):(l=i.cache,$r(0,Fr,l),l!==a.cache&&Tr(t,[Fr],n,!0))),Do(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function cs(e){e.flags|=4}function us(e,t,n,l,r){if((t=!!(32&e.mode))&&(t=!1),t){if(e.flags|=16777216,(335544128&r)===r)if(e.stateNode.complete)e.flags|=8192;else{if(!au())throw ia=na,ea;e.flags|=8192}}else e.flags&=-16777217}function ds(e,t){if("stylesheet"!==t.type||4&t.state.loading)e.flags&=-16777217;else if(e.flags|=16777216,!ib(t)){if(!au())throw ia=na,ea;e.flags|=8192}}function bs(e,t){null!==t&&(e.flags|=4),16384&e.flags&&(t=22!==e.tag?Ae():536870912,e.lanes|=t,Tc|=t)}function ms(e,t){if(!mr)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var l=null;null!==n;)null!==n.alternate&&(l=n),n=n.sibling;null===l?t||null===e.tail?e.tail=null:e.tail.sibling=null:l.sibling=null}}function hs(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,l=0;if(t)for(var r=e.child;null!==r;)n|=r.lanes|r.childLanes,l|=65011712&r.subtreeFlags,l|=65011712&r.flags,r.return=e,r=r.sibling;else for(r=e.child;null!==r;)n|=r.lanes|r.childLanes,l|=r.subtreeFlags,l|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function ps(e,t,n){var l=t.pendingProps;switch(cr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return hs(t),null;case 3:return n=t.stateNode,l=null,null!==e&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),_r(Fr),Y(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(wr(t)?cs(t):null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,kr())),hs(t),null;case 26:var a=t.type,i=t.memoizedState;return null===e?(cs(t),null!==i?(hs(t),ds(t,i)):(hs(t),us(t,a,0,0,n))):i?i!==e.memoizedState?(cs(t),hs(t),ds(t,i)):(hs(t),t.flags&=-16777217):((e=e.memoizedProps)!==l&&cs(t),hs(t),us(t,a,0,0,n)),null;case 27:if(Z(t),n=G.current,a=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==l&&cs(t);else{if(!l){if(null===t.stateNode)throw Error(r(166));return hs(t),null}e=H.current,wr(t)?vr(t):(e=jd(a,l,n),t.stateNode=e,cs(t))}return hs(t),null;case 5:if(Z(t),a=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==l&&cs(t);else{if(!l){if(null===t.stateNode)throw Error(r(166));return hs(t),null}if(i=H.current,wr(t))vr(t);else{var o=vd(G.current);switch(i){case 1:i=o.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:i=o.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":i=o.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":i=o.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":(i=o.createElement("div")).innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i="string"==typeof l.is?o.createElement("select",{is:l.is}):o.createElement("select"),l.multiple?i.multiple=!0:l.size&&(i.size=l.size);break;default:i="string"==typeof l.is?o.createElement(a,{is:l.is}):o.createElement(a)}}i[We]=t,i[qe]=l;e:for(o=t.child;null!==o;){if(5===o.tag||6===o.tag)i.appendChild(o.stateNode);else if(4!==o.tag&&27!==o.tag&&null!==o.child){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;null===o.sibling;){if(null===o.return||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=i;e:switch(hd(i,a,l),a){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&cs(t)}}return hs(t),us(t,t.type,null===e||e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==l&&cs(t);else{if("string"!=typeof l&&null===t.stateNode)throw Error(r(166));if(e=G.current,wr(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,null!==(a=dr))switch(a.tag){case 27:case 5:l=a.memoizedProps}e[We]=t,(e=!!(e.nodeValue===n||null!==l&&!0===l.suppressHydrationWarning||dd(e.nodeValue,n)))||gr(t,!0)}else(e=vd(e).createTextNode(l))[We]=t,t.stateNode=e}return hs(t),null;case 31:if(n=t.memoizedState,null===e||null!==e.memoizedState){if(l=wr(t),null!==n){if(null===e){if(!l)throw Error(r(318));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(r(557));e[We]=t}else xr(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hs(t),e=!1}else n=kr(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return 256&t.flags?(Fa(t),t):(Fa(t),null);if(128&t.flags)throw Error(r(558))}return hs(t),null;case 13:if(l=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(a=wr(t),null!==l&&null!==l.dehydrated){if(null===e){if(!a)throw Error(r(318));if(!(a=null!==(a=t.memoizedState)?a.dehydrated:null))throw Error(r(317));a[We]=t}else xr(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;hs(t),a=!1}else a=kr(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return 256&t.flags?(Fa(t),t):(Fa(t),null)}return Fa(t),128&t.flags?(t.lanes=n,t):(n=null!==l,e=null!==e&&null!==e.memoizedState,n&&(a=null,null!==(l=t.child).alternate&&null!==l.alternate.memoizedState&&null!==l.alternate.memoizedState.cachePool&&(a=l.alternate.memoizedState.cachePool.pool),i=null,null!==l.memoizedState&&null!==l.memoizedState.cachePool&&(i=l.memoizedState.cachePool.pool),i!==a&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),bs(t,t.updateQueue),hs(t),null);case 4:return Y(),null===e&&td(t.stateNode.containerInfo),hs(t),null;case 10:return _r(t.type),hs(t),null;case 19:if(B(Ua),null===(l=t.memoizedState))return hs(t),null;if(a=!!(128&t.flags),null===(i=l.rendering))if(a)ms(l,!1);else{if(0!==Sc||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(i=Ba(e))){for(t.flags|=128,ms(l,!1),e=i.updateQueue,t.updateQueue=e,bs(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)Wl(n,e),n=n.sibling;return W(Ua,1&Ua.current|2),mr&&ir(t,l.treeForkCount),t.child}e=e.sibling}null!==l.tail&&ue()>Dc&&(t.flags|=128,a=!0,ms(l,!1),t.lanes=4194304)}else{if(!a)if(null!==(e=Ba(i))){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,bs(t,e),ms(l,!0),null===l.tail&&"hidden"===l.tailMode&&!i.alternate&&!mr)return hs(t),null}else 2*ue()-l.renderingStartTime>Dc&&536870912!==n&&(t.flags|=128,a=!0,ms(l,!1),t.lanes=4194304);l.isBackwards?(i.sibling=t.child,t.child=i):(null!==(e=l.last)?e.sibling=i:t.child=i,l.last=i)}return null!==l.tail?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=ue(),e.sibling=null,n=Ua.current,W(Ua,a?1&n|2:1&n),mr&&ir(t,l.treeForkCount),e):(hs(t),null);case 22:case 23:return Fa(t),Ma(),l=null!==t.memoizedState,null!==e?null!==e.memoizedState!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?!!(536870912&n)&&!(128&t.flags)&&(hs(t),6&t.subtreeFlags&&(t.flags|=8192)):hs(t),null!==(n=t.updateQueue)&&bs(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),l=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),null!==e&&B(Qr),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),_r(Fr),hs(t),null;case 25:case 30:return null}throw Error(r(156,t.tag))}function fs(e,t){switch(cr(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return _r(Fr),Y(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return Z(t),null;case 31:if(null!==t.memoizedState){if(Fa(t),null===t.alternate)throw Error(r(340));xr()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(Fa(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(r(340));xr()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return B(Ua),null;case 4:return Y(),null;case 10:return _r(t.type),null;case 22:case 23:return Fa(t),Ma(),null!==e&&B(Qr),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return _r(Fr),null;default:return null}}function gs(e,t){switch(cr(t),t.tag){case 3:_r(Fr),Y();break;case 26:case 27:case 5:Z(t);break;case 4:Y();break;case 31:null!==t.memoizedState&&Fa(t);break;case 13:Fa(t);break;case 19:B(Ua);break;case 10:_r(t.type);break;case 22:case 23:Fa(t),Ma(),null!==e&&B(Qr);break;case 24:_r(Fr)}}function vs(e,t){try{var n=t.updateQueue,l=null!==n?n.lastEffect:null;if(null!==l){var r=l.next;n=r;do{if((n.tag&e)===e){l=void 0;var a=n.create,i=n.inst;l=a(),i.destroy=l}n=n.next}while(n!==r)}}catch(o){Su(t,t.return,o)}}function ys(e,t,n){try{var l=t.updateQueue,r=null!==l?l.lastEffect:null;if(null!==r){var a=r.next;l=a;do{if((l.tag&e)===e){var i=l.inst,o=i.destroy;if(void 0!==o){i.destroy=void 0,r=t;var s=n,c=o;try{c()}catch(u){Su(r,s,u)}}}l=l.next}while(l!==a)}}catch(u){Su(t,t.return,u)}}function ws(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{_a(t,n)}catch(l){Su(e,e.return,l)}}}function xs(e,t,n){n.props=So(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){Su(e,t,l)}}function ks(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;default:l=e.stateNode}"function"==typeof n?e.refCleanup=n(l):n.current=l}}catch(r){Su(e,t,r)}}function Cs(e,t){var n=e.ref,l=e.refCleanup;if(null!==n)if("function"==typeof l)try{l()}catch(r){Su(e,t,r)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(a){Su(e,t,a)}else n.current=null}function Ns(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(r){Su(e,e.return,r)}}function Ss(e,t,n){try{var l=e.stateNode;!function(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,i=null,o=null,s=null,c=null,u=null,d=null;for(h in n){var b=n[h];if(n.hasOwnProperty(h)&&null!=b)switch(h){case"checked":case"value":break;case"defaultValue":c=b;default:l.hasOwnProperty(h)||bd(e,t,h,null,l,b)}}for(var m in l){var h=l[m];if(b=n[m],l.hasOwnProperty(m)&&(null!=h||null!=b))switch(m){case"type":i=h;break;case"name":a=h;break;case"checked":u=h;break;case"defaultChecked":d=h;break;case"value":o=h;break;case"defaultValue":s=h;break;case"children":case"dangerouslySetInnerHTML":if(null!=h)throw Error(r(137,t));break;default:h!==b&&bd(e,t,m,h,l,b)}}return void wt(e,o,s,c,u,d,i,a);case"select":for(i in h=o=s=m=null,n)if(c=n[i],n.hasOwnProperty(i)&&null!=c)switch(i){case"value":break;case"multiple":h=c;default:l.hasOwnProperty(i)||bd(e,t,i,null,l,c)}for(a in l)if(i=l[a],c=n[a],l.hasOwnProperty(a)&&(null!=i||null!=c))switch(a){case"value":m=i;break;case"defaultValue":s=i;break;case"multiple":o=i;default:i!==c&&bd(e,t,a,i,l,c)}return t=s,n=o,l=h,void(null!=m?Ct(e,!!n,m,!1):!!l!=!!n&&(null!=t?Ct(e,!!n,t,!0):Ct(e,!!n,n?[]:"",!1)));case"textarea":for(s in h=m=null,n)if(a=n[s],n.hasOwnProperty(s)&&null!=a&&!l.hasOwnProperty(s))switch(s){case"value":case"children":break;default:bd(e,t,s,null,l,a)}for(o in l)if(a=l[o],i=n[o],l.hasOwnProperty(o)&&(null!=a||null!=i))switch(o){case"value":m=a;break;case"defaultValue":h=a;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=a)throw Error(r(91));break;default:a!==i&&bd(e,t,o,a,l,i)}return void Nt(e,m,h);case"option":for(var p in n)if(m=n[p],n.hasOwnProperty(p)&&null!=m&&!l.hasOwnProperty(p))if("selected"===p)e.selected=!1;else bd(e,t,p,null,l,m);for(c in l)if(m=l[c],h=n[c],l.hasOwnProperty(c)&&m!==h&&(null!=m||null!=h))if("selected"===c)e.selected=m&&"function"!=typeof m&&"symbol"!=typeof m;else bd(e,t,c,m,l,h);return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var f in n)m=n[f],n.hasOwnProperty(f)&&null!=m&&!l.hasOwnProperty(f)&&bd(e,t,f,null,l,m);for(u in l)if(m=l[u],h=n[u],l.hasOwnProperty(u)&&m!==h&&(null!=m||null!=h))switch(u){case"children":case"dangerouslySetInnerHTML":if(null!=m)throw Error(r(137,t));break;default:bd(e,t,u,m,l,h)}return;default:if(Tt(t)){for(var g in n)m=n[g],n.hasOwnProperty(g)&&void 0!==m&&!l.hasOwnProperty(g)&&md(e,t,g,void 0,l,m);for(d in l)m=l[d],h=n[d],!l.hasOwnProperty(d)||m===h||void 0===m&&void 0===h||md(e,t,d,m,l,h);return}}for(var v in n)m=n[v],n.hasOwnProperty(v)&&null!=m&&!l.hasOwnProperty(v)&&bd(e,t,v,null,l,m);for(b in l)m=l[b],h=n[b],!l.hasOwnProperty(b)||m===h||null==m&&null==h||bd(e,t,b,m,l,h)}(l,e.type,n,t),l[qe]=t}catch(a){Su(e,e.return,a)}}function Es(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&_d(e.type)||4===e.tag}function $s(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Es(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&_d(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function _s(e,t,n){var l=e.tag;if(5===l||6===l)e=e.stateNode,t?(9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).insertBefore(e,t):((t=9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Pt));else if(4!==l&&(27===l&&_d(e.type)&&(n=e.stateNode,t=null),null!==(e=e.child)))for(_s(e,t,n),e=e.sibling;null!==e;)_s(e,t,n),e=e.sibling}function zs(e,t,n){var l=e.tag;if(5===l||6===l)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==l&&(27===l&&_d(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(zs(e,t,n),e=e.sibling;null!==e;)zs(e,t,n),e=e.sibling}function Ts(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);hd(t,l,n),t[We]=e,t[qe]=n}catch(a){Su(e,e.return,a)}}var Ls=!1,As=!1,Ms=!1,Ps="function"==typeof WeakSet?WeakSet:Set,Is=null;function Ds(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:Xs(e,n),4&l&&vs(5,n);break;case 1:if(Xs(e,n),4&l)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(i){Su(n,n.return,i)}else{var r=So(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){Su(n,n.return,o)}}64&l&&ws(n),512&l&&ks(n,n.return);break;case 3:if(Xs(e,n),64&l&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{_a(e,t)}catch(i){Su(n,n.return,i)}}break;case 27:null===t&&4&l&&Ts(n);case 26:case 5:Xs(e,n),null===t&&4&l&&Ns(n),512&l&&ks(n,n.return);break;case 12:Xs(e,n);break;case 31:Xs(e,n),4&l&&Bs(e,n);break;case 13:Xs(e,n),4&l&&Ws(e,n),64&l&&(null!==(e=n.memoizedState)&&(null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$~"===e.data)e._reactRetry=t;else if("$?"!==e.data||"loading"!==n.readyState)t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}(e,n=zu.bind(null,n))));break;case 22:if(!(l=null!==n.memoizedState||Ls)){t=null!==t&&null!==t.memoizedState||As,r=Ls;var a=As;Ls=l,(As=t)&&!a?Js(e,n,!!(8772&n.subtreeFlags)):Xs(e,n),Ls=r,As=a}break;case 30:break;default:Xs(e,n)}}function Os(e){var t=e.alternate;null!==t&&(e.alternate=null,Os(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&Ye(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Rs=null,js=!1;function Fs(e,t,n){for(n=n.child;null!==n;)Us(e,t,n),n=n.sibling}function Us(e,t,n){if(we&&"function"==typeof we.onCommitFiberUnmount)try{we.onCommitFiberUnmount(ye,n)}catch(a){}switch(n.tag){case 26:As||Cs(n,t),Fs(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:As||Cs(n,t);var l=Rs,r=js;_d(n.type)&&(Rs=n.stateNode,js=!1),Fs(e,t,n),Fd(n.stateNode),Rs=l,js=r;break;case 5:As||Cs(n,t);case 6:if(l=Rs,r=js,Rs=null,Fs(e,t,n),js=r,null!==(Rs=l))if(js)try{(9===Rs.nodeType?Rs.body:"HTML"===Rs.nodeName?Rs.ownerDocument.body:Rs).removeChild(n.stateNode)}catch(i){Su(n,t,i)}else try{Rs.removeChild(n.stateNode)}catch(i){Su(n,t,i)}break;case 18:null!==Rs&&(js?(zd(9===(e=Rs).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),Hb(e)):zd(Rs,n.stateNode));break;case 4:l=Rs,r=js,Rs=n.stateNode.containerInfo,js=!0,Fs(e,t,n),Rs=l,js=r;break;case 0:case 11:case 14:case 15:ys(2,n,t),As||ys(4,n,t),Fs(e,t,n);break;case 1:As||(Cs(n,t),"function"==typeof(l=n.stateNode).componentWillUnmount&&xs(n,t,l)),Fs(e,t,n);break;case 21:Fs(e,t,n);break;case 22:As=(l=As)||null!==n.memoizedState,Fs(e,t,n),As=l;break;default:Fs(e,t,n)}}function Bs(e,t){if(null===t.memoizedState&&(null!==(e=t.alternate)&&null!==(e=e.memoizedState))){e=e.dehydrated;try{Hb(e)}catch(n){Su(t,t.return,n)}}}function Ws(e,t){if(null===t.memoizedState&&(null!==(e=t.alternate)&&(null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))))try{Hb(e)}catch(n){Su(t,t.return,n)}}function qs(e,t){var n=function(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new Ps),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new Ps),t;default:throw Error(r(435,e.tag))}}(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var l=Tu.bind(null,e,t);t.then(l,l)}})}function Vs(e,t){var n=t.deletions;if(null!==n)for(var l=0;l<n.length;l++){var a=n[l],i=e,o=t,s=o;e:for(;null!==s;){switch(s.tag){case 27:if(_d(s.type)){Rs=s.stateNode,js=!1;break e}break;case 5:Rs=s.stateNode,js=!1;break e;case 3:case 4:Rs=s.stateNode.containerInfo,js=!0;break e}s=s.return}if(null===Rs)throw Error(r(160));Us(i,o,a),Rs=null,js=!1,null!==(i=a.alternate)&&(i.return=null),a.return=null}if(13886&t.subtreeFlags)for(t=t.child;null!==t;)Ks(t,e),t=t.sibling}var Hs=null;function Ks(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Vs(t,e),Gs(e),4&l&&(ys(3,e,e.return),vs(3,e),ys(5,e,e.return));break;case 1:Vs(t,e),Gs(e),512&l&&(As||null===n||Cs(n,n.return)),64&l&&Ls&&(null!==(e=e.updateQueue)&&(null!==(l=e.callbacks)&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=null===n?l:n.concat(l))));break;case 26:var a=Hs;if(Vs(t,e),Gs(e),512&l&&(As||null===n||Cs(n,n.return)),4&l){var i=null!==n?n.memoizedState:null;if(l=e.memoizedState,null===n)if(null===l)if(null===e.stateNode){e:{l=e.type,n=e.memoizedProps,a=a.ownerDocument||a;t:switch(l){case"title":(!(i=a.getElementsByTagName("title")[0])||i[Xe]||i[We]||"http://www.w3.org/2000/svg"===i.namespaceURI||i.hasAttribute("itemprop"))&&(i=a.createElement(l),a.head.insertBefore(i,a.querySelector("head > title"))),hd(i,l,n),i[We]=e,nt(i),l=i;break e;case"link":var o=rb("link","href",a).get(l+(n.href||""));if(o)for(var s=0;s<o.length;s++)if((i=o[s]).getAttribute("href")===(null==n.href||""===n.href?null:n.href)&&i.getAttribute("rel")===(null==n.rel?null:n.rel)&&i.getAttribute("title")===(null==n.title?null:n.title)&&i.getAttribute("crossorigin")===(null==n.crossOrigin?null:n.crossOrigin)){o.splice(s,1);break t}hd(i=a.createElement(l),l,n),a.head.appendChild(i);break;case"meta":if(o=rb("meta","content",a).get(l+(n.content||"")))for(s=0;s<o.length;s++)if((i=o[s]).getAttribute("content")===(null==n.content?null:""+n.content)&&i.getAttribute("name")===(null==n.name?null:n.name)&&i.getAttribute("property")===(null==n.property?null:n.property)&&i.getAttribute("http-equiv")===(null==n.httpEquiv?null:n.httpEquiv)&&i.getAttribute("charset")===(null==n.charSet?null:n.charSet)){o.splice(s,1);break t}hd(i=a.createElement(l),l,n),a.head.appendChild(i);break;default:throw Error(r(468,l))}i[We]=e,nt(i),l=i}e.stateNode=l}else ab(a,e.type,e.stateNode);else e.stateNode=Zd(a,l,e.memoizedProps);else i!==l?(null===i?null!==n.stateNode&&(n=n.stateNode).parentNode.removeChild(n):i.count--,null===l?ab(a,e.type,e.stateNode):Zd(a,l,e.memoizedProps)):null===l&&null!==e.stateNode&&Ss(e,e.memoizedProps,n.memoizedProps)}break;case 27:Vs(t,e),Gs(e),512&l&&(As||null===n||Cs(n,n.return)),null!==n&&4&l&&Ss(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Vs(t,e),Gs(e),512&l&&(As||null===n||Cs(n,n.return)),32&e.flags){a=e.stateNode;try{Et(a,"")}catch(p){Su(e,e.return,p)}}4&l&&null!=e.stateNode&&Ss(e,a=e.memoizedProps,null!==n?n.memoizedProps:a),1024&l&&(Ms=!0);break;case 6:if(Vs(t,e),Gs(e),4&l){if(null===e.stateNode)throw Error(r(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(p){Su(e,e.return,p)}}break;case 3:if(lb=null,a=Hs,Hs=Wd(t.containerInfo),Vs(t,e),Hs=a,Gs(e),4&l&&null!==n&&n.memoizedState.isDehydrated)try{Hb(t.containerInfo)}catch(p){Su(e,e.return,p)}Ms&&(Ms=!1,Qs(e));break;case 4:l=Hs,Hs=Wd(e.stateNode.containerInfo),Vs(t,e),Gs(e),Hs=l;break;case 12:default:Vs(t,e),Gs(e);break;case 31:case 19:Vs(t,e),Gs(e),4&l&&(null!==(l=e.updateQueue)&&(e.updateQueue=null,qs(e,l)));break;case 13:Vs(t,e),Gs(e),8192&e.child.flags&&null!==e.memoizedState!=(null!==n&&null!==n.memoizedState)&&(Pc=ue()),4&l&&(null!==(l=e.updateQueue)&&(e.updateQueue=null,qs(e,l)));break;case 22:a=null!==e.memoizedState;var c=null!==n&&null!==n.memoizedState,u=Ls,d=As;if(Ls=u||a,As=d||c,Vs(t,e),As=d,Ls=u,Gs(e),8192&l)e:for(t=e.stateNode,t._visibility=a?-2&t._visibility:1|t._visibility,a&&(null===n||c||Ls||As||Ys(e)),n=null,t=e;;){if(5===t.tag||26===t.tag){if(null===n){c=n=t;try{if(i=c.stateNode,a)"function"==typeof(o=i.style).setProperty?o.setProperty("display","none","important"):o.display="none";else{s=c.stateNode;var b=c.memoizedProps.style,m=null!=b&&b.hasOwnProperty("display")?b.display:null;s.style.display=null==m||"boolean"==typeof m?"":(""+m).trim()}}catch(p){Su(c,c.return,p)}}}else if(6===t.tag){if(null===n){c=t;try{c.stateNode.nodeValue=a?"":c.memoizedProps}catch(p){Su(c,c.return,p)}}}else if(18===t.tag){if(null===n){c=t;try{var h=c.stateNode;a?Td(h,!0):Td(c.stateNode,!1)}catch(p){Su(c,c.return,p)}}}else if((22!==t.tag&&23!==t.tag||null===t.memoizedState||t===e)&&null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;null===t.sibling;){if(null===t.return||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}4&l&&(null!==(l=e.updateQueue)&&(null!==(n=l.retryQueue)&&(l.retryQueue=null,qs(e,n))));case 30:case 21:}}function Gs(e){var t=e.flags;if(2&t){try{for(var n,l=e.return;null!==l;){if(Es(l)){n=l;break}l=l.return}if(null==n)throw Error(r(160));switch(n.tag){case 27:var a=n.stateNode;zs(e,$s(e),a);break;case 5:var i=n.stateNode;32&n.flags&&(Et(i,""),n.flags&=-33),zs(e,$s(e),i);break;case 3:case 4:var o=n.stateNode.containerInfo;_s(e,$s(e),o);break;default:throw Error(r(161))}}catch(s){Su(e,e.return,s)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function Qs(e){if(1024&e.subtreeFlags)for(e=e.child;null!==e;){var t=e;Qs(t),5===t.tag&&1024&t.flags&&t.stateNode.reset(),e=e.sibling}}function Xs(e,t){if(8772&t.subtreeFlags)for(t=t.child;null!==t;)Ds(e,t.alternate,t),t=t.sibling}function Ys(e){for(e=e.child;null!==e;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ys(4,t,t.return),Ys(t);break;case 1:Cs(t,t.return);var n=t.stateNode;"function"==typeof n.componentWillUnmount&&xs(t,t.return,n),Ys(t);break;case 27:Fd(t.stateNode);case 26:case 5:Cs(t,t.return),Ys(t);break;case 22:null===t.memoizedState&&Ys(t);break;default:Ys(t)}e=e.sibling}}function Js(e,t,n){for(n=n&&!!(8772&t.subtreeFlags),t=t.child;null!==t;){var l=t.alternate,r=e,a=t,i=a.flags;switch(a.tag){case 0:case 11:case 15:Js(r,a,n),vs(4,a);break;case 1:if(Js(r,a,n),"function"==typeof(r=(l=a).stateNode).componentDidMount)try{r.componentDidMount()}catch(c){Su(l,l.return,c)}if(null!==(r=(l=a).updateQueue)){var o=l.stateNode;try{var s=r.shared.hiddenCallbacks;if(null!==s)for(r.shared.hiddenCallbacks=null,r=0;r<s.length;r++)$a(s[r],o)}catch(c){Su(l,l.return,c)}}n&&64&i&&ws(a),ks(a,a.return);break;case 27:Ts(a);case 26:case 5:Js(r,a,n),n&&null===l&&4&i&&Ns(a),ks(a,a.return);break;case 12:Js(r,a,n);break;case 31:Js(r,a,n),n&&4&i&&Bs(r,a);break;case 13:Js(r,a,n),n&&4&i&&Ws(r,a);break;case 22:null===a.memoizedState&&Js(r,a,n),ks(a,a.return);break;case 30:break;default:Js(r,a,n)}t=t.sibling}}function Zs(e,t){var n=null;null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),e=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(e=t.memoizedState.cachePool.pool),e!==n&&(null!=e&&e.refCount++,null!=n&&Br(n))}function ec(e,t){e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&Br(e))}function tc(e,t,n,l){if(10256&t.subtreeFlags)for(t=t.child;null!==t;)nc(e,t,n,l),t=t.sibling}function nc(e,t,n,l){var r=t.flags;switch(t.tag){case 0:case 11:case 15:tc(e,t,n,l),2048&r&&vs(9,t);break;case 1:case 31:case 13:default:tc(e,t,n,l);break;case 3:tc(e,t,n,l),2048&r&&(e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&Br(e)));break;case 12:if(2048&r){tc(e,t,n,l),e=t.stateNode;try{var a=t.memoizedProps,i=a.id,o=a.onPostCommit;"function"==typeof o&&o(i,null===t.alternate?"mount":"update",e.passiveEffectDuration,-0)}catch(s){Su(t,t.return,s)}}else tc(e,t,n,l);break;case 23:break;case 22:a=t.stateNode,i=t.alternate,null!==t.memoizedState?2&a._visibility?tc(e,t,n,l):rc(e,t):2&a._visibility?tc(e,t,n,l):(a._visibility|=2,lc(e,t,n,l,!!(10256&t.subtreeFlags)||!1)),2048&r&&Zs(i,t);break;case 24:tc(e,t,n,l),2048&r&&ec(t.alternate,t)}}function lc(e,t,n,l,r){for(r=r&&(!!(10256&t.subtreeFlags)||!1),t=t.child;null!==t;){var a=e,i=t,o=n,s=l,c=i.flags;switch(i.tag){case 0:case 11:case 15:lc(a,i,o,s,r),vs(8,i);break;case 23:break;case 22:var u=i.stateNode;null!==i.memoizedState?2&u._visibility?lc(a,i,o,s,r):rc(a,i):(u._visibility|=2,lc(a,i,o,s,r)),r&&2048&c&&Zs(i.alternate,i);break;case 24:lc(a,i,o,s,r),r&&2048&c&&ec(i.alternate,i);break;default:lc(a,i,o,s,r)}t=t.sibling}}function rc(e,t){if(10256&t.subtreeFlags)for(t=t.child;null!==t;){var n=e,l=t,r=l.flags;switch(l.tag){case 22:rc(n,l),2048&r&&Zs(l.alternate,l);break;case 24:rc(n,l),2048&r&&ec(l.alternate,l);break;default:rc(n,l)}t=t.sibling}}var ac=8192;function ic(e,t,n){if(e.subtreeFlags&ac)for(e=e.child;null!==e;)oc(e,t,n),e=e.sibling}function oc(e,t,n){switch(e.tag){case 26:ic(e,t,n),e.flags&ac&&null!==e.memoizedState&&function(e,t,n,l){if(!("stylesheet"!==n.type||"string"==typeof l.media&&!1===matchMedia(l.media).matches||4&n.state.loading)){if(null===n.instance){var r=Gd(l.href),a=t.querySelector(Qd(r));if(a)return null!==(t=a._p)&&"object"==typeof t&&"function"==typeof t.then&&(e.count++,e=sb.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,void nt(a);a=t.ownerDocument||t,l=Xd(l),(r=Ud.get(r))&&tb(l,r),nt(a=a.createElement("link"));var i=a;i._p=new Promise(function(e,t){i.onload=e,i.onerror=t}),hd(a,"link",l),n.instance=a}null===e.stylesheets&&(e.stylesheets=/* @__PURE__ */new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(3&n.state.loading)&&(e.count++,n=sb.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}(n,Hs,e.memoizedState,e.memoizedProps);break;case 5:default:ic(e,t,n);break;case 3:case 4:var l=Hs;Hs=Wd(e.stateNode.containerInfo),ic(e,t,n),Hs=l;break;case 22:null===e.memoizedState&&(null!==(l=e.alternate)&&null!==l.memoizedState?(l=ac,ac=16777216,ic(e,t,n),ac=l):ic(e,t,n))}}function sc(e){var t=e.alternate;if(null!==t&&null!==(e=t.child)){t.child=null;do{t=e.sibling,e.sibling=null,e=t}while(null!==e)}}function cc(e){var t=e.deletions;if(16&e.flags){if(null!==t)for(var n=0;n<t.length;n++){var l=t[n];Is=l,bc(l,e)}sc(e)}if(10256&e.subtreeFlags)for(e=e.child;null!==e;)uc(e),e=e.sibling}function uc(e){switch(e.tag){case 0:case 11:case 15:cc(e),2048&e.flags&&ys(9,e,e.return);break;case 3:case 12:default:cc(e);break;case 22:var t=e.stateNode;null!==e.memoizedState&&2&t._visibility&&(null===e.return||13!==e.return.tag)?(t._visibility&=-3,dc(e)):cc(e)}}function dc(e){var t=e.deletions;if(16&e.flags){if(null!==t)for(var n=0;n<t.length;n++){var l=t[n];Is=l,bc(l,e)}sc(e)}for(e=e.child;null!==e;){switch((t=e).tag){case 0:case 11:case 15:ys(8,t,t.return),dc(t);break;case 22:2&(n=t.stateNode)._visibility&&(n._visibility&=-3,dc(t));break;default:dc(t)}e=e.sibling}}function bc(e,t){for(;null!==Is;){var n=Is;switch(n.tag){case 0:case 11:case 15:ys(8,n,t);break;case 23:case 22:if(null!==n.memoizedState&&null!==n.memoizedState.cachePool){var l=n.memoizedState.cachePool.pool;null!=l&&l.refCount++}break;case 24:Br(n.memoizedState.cache)}if(null!==(l=n.child))l.return=n,Is=l;else e:for(n=e;null!==Is;){var r=(l=Is).sibling,a=l.return;if(Os(l),l===n){Is=null;break e}if(null!==r){r.return=a,Is=r;break e}Is=a}}}var mc={getCacheForType:function(e){var t=Pr(Fr),n=t.data.get(e);return void 0===n&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Pr(Fr).controller.signal}},hc="function"==typeof WeakMap?WeakMap:Map,pc=0,fc=null,gc=null,vc=0,yc=0,wc=null,xc=!1,kc=!1,Cc=!1,Nc=0,Sc=0,Ec=0,$c=0,_c=0,zc=0,Tc=0,Lc=null,Ac=null,Mc=!1,Pc=0,Ic=0,Dc=1/0,Oc=null,Rc=null,jc=0,Fc=null,Uc=null,Bc=0,Wc=0,qc=null,Vc=null,Hc=0,Kc=null;function Gc(){return 2&pc&&0!==vc?vc&-vc:null!==D.T?qu():Fe()}function Qc(){if(0===zc)if(536870912&vc&&!mr)zc=536870912;else{var e=Ee;!(3932160&(Ee<<=1))&&(Ee=262144),zc=e}return null!==(e=Pa.current)&&(e.flags|=32),zc}function Xc(e,t,n){(e!==fc||2!==yc&&9!==yc)&&null===e.cancelPendingCommit||(lu(e,0),eu(e,vc,zc,!1)),Pe(e,n),2&pc&&e===fc||(e===fc&&(!(2&pc)&&($c|=n),4===Sc&&eu(e,vc,zc,!1)),Ou(e))}function Yc(e,t,n){if(6&pc)throw Error(r(327));for(var l=!n&&!(127&t)&&0===(t&e.expiredLanes)||Te(e,t),a=l?function(e,t){var n=pc;pc|=2;var l=iu(),a=ou();fc!==e||vc!==t?(Oc=null,Dc=ue()+500,lu(e,t)):kc=Te(e,t);e:for(;;)try{if(0!==yc&&null!==gc){t=gc;var i=wc;t:switch(yc){case 1:yc=0,wc=null,hu(e,t,i,1);break;case 2:case 9:if(la(i)){yc=0,wc=null,mu(t);break}t=function(){2!==yc&&9!==yc||fc!==e||(yc=7),Ou(e)},i.then(t,t);break e;case 3:yc=7;break e;case 4:yc=5;break e;case 7:la(i)?(yc=0,wc=null,mu(t)):(yc=0,wc=null,hu(e,t,i,7));break;case 5:var o=null;switch(gc.tag){case 26:o=gc.memoizedState;case 5:case 27:var s=gc;if(o?ib(o):s.stateNode.complete){yc=0,wc=null;var c=s.sibling;if(null!==c)gc=c;else{var u=s.return;null!==u?(gc=u,pu(u)):gc=null}break t}}yc=0,wc=null,hu(e,t,i,5);break;case 6:yc=0,wc=null,hu(e,t,i,6);break;case 8:nu(),Sc=6;break e;default:throw Error(r(462))}}du();break}catch(d){ru(e,d)}return Er=Sr=null,D.H=l,D.A=a,pc=n,null!==gc?0:(fc=null,vc=0,Al(),Sc)}(e,t):cu(e,t,!0),i=l;;){if(0===a){kc&&!l&&eu(e,t,0,!1);break}if(n=e.current.alternate,!i||Zc(n)){if(2===a){if(i=t,e.errorRecoveryDisabledLanes&i)var o=0;else o=0!==(o=-536870913&e.pendingLanes)?o:536870912&o?536870912:0;if(0!==o){t=o;e:{var s=e;a=Lc;var c=s.current.memoizedState.isDehydrated;if(c&&(lu(s,o).flags|=256),2!==(o=cu(s,o,!1))){if(Cc&&!c){s.errorRecoveryDisabledLanes|=i,$c|=i,a=4;break e}i=Ac,Ac=a,null!==i&&(null===Ac?Ac=i:Ac.push.apply(Ac,i))}a=o}if(i=!1,2!==a)continue}}if(1===a){lu(e,0),eu(e,t,0,!0);break}e:{switch(l=e,i=a){case 0:case 1:throw Error(r(345));case 4:if((4194048&t)!==t)break;case 6:eu(l,t,zc,!xc);break e;case 2:Ac=null;break;case 3:case 5:break;default:throw Error(r(329))}if((62914560&t)===t&&10<(a=Pc+300-ue())){if(eu(l,t,zc,!xc),0!==ze(l,0,!0))break e;Bc=t,l.timeoutHandle=Cd(Jc.bind(null,l,n,Ac,Oc,Mc,t,zc,$c,Tc,xc,i,"Throttled",-0,0),a)}else Jc(l,n,Ac,Oc,Mc,t,zc,$c,Tc,xc,i,null,-0,0)}break}a=cu(e,t,!1),i=!1}Ou(e)}function Jc(e,t,n,l,r,a,i,o,s,c,u,d,b,m){if(e.timeoutHandle=-1,8192&(d=t.subtreeFlags)||!(16785408&~d)){oc(t,a,d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Pt});var h=(62914560&a)===a?Pc-ue():(4194048&a)===a?Ic-ue():0;if(null!==(h=function(e,t){return e.stylesheets&&0===e.count&&ub(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&ub(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&0===ob&&(ob=62500*function(){if("function"==typeof performance.getEntriesByType){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var r=n[l],a=r.transferSize,i=r.initiatorType,o=r.duration;if(a&&o&&pd(i)){for(i=0,o=r.responseEnd,l+=1;l<n.length;l++){var s=n[l],c=s.startTime;if(c>o)break;var u=s.transferSize,d=s.initiatorType;u&&pd(d)&&(i+=u*((s=s.responseEnd)<o?1:(o-c)/(s-c)))}if(--l,t+=8*(a+i)/(r.duration/1e3),10<++e)break}}if(0<e)return t/e/1e6}return navigator.connection&&"number"==typeof(e=navigator.connection.downlink)?e:5}());var r=setTimeout(function(){if(e.waitingForImages=!1,0===e.count&&(e.stylesheets&&ub(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ob?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(r)}}:null}(d,h)))return Bc=a,e.cancelPendingCommit=h(gu.bind(null,e,t,a,n,l,r,i,o,s,u,d,null,b,m)),void eu(e,a,i,!c)}gu(e,t,a,n,l,r,i,o,s)}function Zc(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&(null!==(n=t.updateQueue)&&null!==(n=n.stores)))for(var l=0;l<n.length;l++){var r=n[l],a=r.getSnapshot;r=r.value;try{if(!el(a(),r))return!1}catch(i){return!1}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function eu(e,t,n,l){t&=~_c,t&=~$c,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var r=t;0<r;){var a=31-ke(r),i=1<<a;l[a]=-1,r&=~i}0!==n&&Ie(e,n,t)}function tu(){return!!(6&pc)||(Ru(0),!1)}function nu(){if(null!==gc){if(0===yc)var e=gc.return;else Er=Sr=null,si(e=gc),ca=null,ua=0,e=gc;for(;null!==e;)gs(e.alternate,e),e=e.return;gc=null}}function lu(e,t){var n=e.timeoutHandle;-1!==n&&(e.timeoutHandle=-1,Nd(n)),null!==(n=e.cancelPendingCommit)&&(e.cancelPendingCommit=null,n()),Bc=0,nu(),fc=e,gc=n=Bl(e.current,null),vc=t,yc=0,wc=null,xc=!1,kc=Te(e,t),Cc=!1,Tc=zc=_c=$c=Ec=Sc=0,Ac=Lc=null,Mc=!1,8&t&&(t|=32&t);var l=e.entangledLanes;if(0!==l)for(e=e.entanglements,l&=t;0<l;){var r=31-ke(l),a=1<<r;t|=e[r],l&=~a}return Nc=t,Al(),n}function ru(e,t){qa=null,D.H=go,t===Zr||t===ta?(t=oa(),yc=3):t===ea?(t=oa(),yc=4):yc=t===Po?8:null!==t&&"object"==typeof t&&"function"==typeof t.then?6:1,wc=t,null===gc&&(Sc=1,zo(e,Xl(t,e.current)))}function au(){var e=Pa.current;return null===e||((4194048&vc)===vc?null===Ia:!!((62914560&vc)===vc||536870912&vc)&&e===Ia)}function iu(){var e=D.H;return D.H=go,null===e?go:e}function ou(){var e=D.A;return D.A=mc,e}function su(){Sc=4,xc||(4194048&vc)!==vc&&null!==Pa.current||(kc=!0),!(134217727&Ec)&&!(134217727&$c)||null===fc||eu(fc,vc,zc,!1)}function cu(e,t,n){var l=pc;pc|=2;var r=iu(),a=ou();fc===e&&vc===t||(Oc=null,lu(e,t)),t=!1;var i=Sc;e:for(;;)try{if(0!==yc&&null!==gc){var o=gc,s=wc;switch(yc){case 8:nu(),i=6;break e;case 3:case 2:case 9:case 6:null===Pa.current&&(t=!0);var c=yc;if(yc=0,wc=null,hu(e,o,s,c),n&&kc){i=0;break e}break;default:c=yc,yc=0,wc=null,hu(e,o,s,c)}}uu(),i=Sc;break}catch(u){ru(e,u)}return t&&e.shellSuspendCounter++,Er=Sr=null,pc=l,D.H=r,D.A=a,null===gc&&(fc=null,vc=0,Al()),i}function uu(){for(;null!==gc;)bu(gc)}function du(){for(;null!==gc&&!se();)bu(gc)}function bu(e){var t=ss(e.alternate,e,Nc);e.memoizedProps=e.pendingProps,null===t?pu(e):gc=t}function mu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Ko(n,t,t.pendingProps,t.type,void 0,vc);break;case 11:t=Ko(n,t,t.pendingProps,t.type.render,t.ref,vc);break;case 5:si(t);default:gs(n,t),t=ss(n,t=gc=Wl(t,Nc),Nc)}e.memoizedProps=e.pendingProps,null===t?pu(e):gc=t}function hu(e,t,n,l){Er=Sr=null,si(t),ca=null,ua=0;var a=t.return;try{if(function(e,t,n,l,a){if(n.flags|=32768,null!==l&&"object"==typeof l&&"function"==typeof l.then){if(null!==(t=n.alternate)&&Lr(t,n,a,!0),null!==(n=Pa.current)){switch(n.tag){case 31:case 13:return null===Ia?su():null===n.alternate&&0===Sc&&(Sc=3),n.flags&=-257,n.flags|=65536,n.lanes=a,l===na?n.flags|=16384:(null===(t=n.updateQueue)?n.updateQueue=/* @__PURE__ */new Set([l]):t.add(l),Eu(e,l,a)),!1;case 22:return n.flags|=65536,l===na?n.flags|=16384:(null===(t=n.updateQueue)?(t={transitions:null,markerInstances:null,retryQueue:/* @__PURE__ */new Set([l])},n.updateQueue=t):null===(n=t.retryQueue)?t.retryQueue=/* @__PURE__ */new Set([l]):n.add(l),Eu(e,l,a)),!1}throw Error(r(435,n.tag))}return Eu(e,l,a),su(),!1}if(mr)return null!==(t=Pa.current)?(!(65536&t.flags)&&(t.flags|=256),t.flags|=65536,t.lanes=a,l!==fr&&Cr(Xl(e=Error(r(422),{cause:l}),n))):(l!==fr&&Cr(Xl(t=Error(r(423),{cause:l}),n)),(e=e.current.alternate).flags|=65536,a&=-a,e.lanes|=a,l=Xl(l,n),Ca(e,a=Lo(e.stateNode,l,a)),4!==Sc&&(Sc=2)),!1;var i=Error(r(520),{cause:l});if(i=Xl(i,n),null===Lc?Lc=[i]:Lc.push(i),4!==Sc&&(Sc=2),null===t)return!0;l=Xl(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,Ca(n,e=Lo(n.stateNode,l,e)),!1;case 1:if(t=n.type,i=n.stateNode,!(128&n.flags||"function"!=typeof t.getDerivedStateFromError&&(null===i||"function"!=typeof i.componentDidCatch||null!==Rc&&Rc.has(i))))return n.flags|=65536,a&=-a,n.lanes|=a,Mo(a=Ao(a),e,n,l),Ca(n,a),!1}n=n.return}while(null!==n);return!1}(e,a,t,n,vc))return Sc=1,zo(e,Xl(n,e.current)),void(gc=null)}catch(i){if(null!==a)throw gc=a,i;return Sc=1,zo(e,Xl(n,e.current)),void(gc=null)}32768&t.flags?(mr||1===l?e=!0:kc||536870912&vc?e=!1:(xc=e=!0,(2===l||9===l||3===l||6===l)&&(null!==(l=Pa.current)&&13===l.tag&&(l.flags|=16384))),fu(t,e)):pu(t)}function pu(e){var t=e;do{if(32768&t.flags)return void fu(t,xc);e=t.return;var n=ps(t.alternate,t,Nc);if(null!==n)return void(gc=n);if(null!==(t=t.sibling))return void(gc=t);gc=t=e}while(null!==t);0===Sc&&(Sc=5)}function fu(e,t){do{var n=fs(e.alternate,e);if(null!==n)return n.flags&=32767,void(gc=n);if(null!==(n=e.return)&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&null!==(e=e.sibling))return void(gc=e);gc=e=n}while(null!==e);Sc=6,gc=null}function gu(e,t,n,l,a,i,o,s,c){e.cancelPendingCommit=null;do{ku()}while(0!==jc);if(6&pc)throw Error(r(327));if(null!==t){if(t===e.current)throw Error(r(177));if(i=t.lanes|t.childLanes,function(e,t,n,l,r,a){var i=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var o=e.entanglements,s=e.expirationTimes,c=e.hiddenUpdates;for(n=i&~n;0<n;){var u=31-ke(n),d=1<<u;o[u]=0,s[u]=-1;var b=c[u];if(null!==b)for(c[u]=null,u=0;u<b.length;u++){var m=b[u];null!==m&&(m.lane&=-536870913)}n&=~d}0!==l&&Ie(e,l,0),0!==a&&0===r&&0!==e.tag&&(e.suspendedLanes|=a&~(i&~t))}(e,n,i|=Ll,o,s,c),e===fc&&(gc=fc=null,vc=0),Uc=t,Fc=e,Bc=n,Wc=i,qc=a,Vc=l,10256&t.subtreeFlags||10256&t.flags?(e.callbackNode=null,e.callbackPriority=0,ie(he,function(){return Cu(),null})):(e.callbackNode=null,e.callbackPriority=0),l=!!(13878&t.flags),13878&t.subtreeFlags||l){l=D.T,D.T=null,a=O.p,O.p=2,o=pc,pc|=4;try{!function(e,t){if(e=e.containerInfo,fd=xb,il(e=al(e))){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var l=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(l&&0!==l.rangeCount){n=l.anchorNode;var a=l.anchorOffset,i=l.focusNode;l=l.focusOffset;try{n.nodeType,i.nodeType}catch(f){n=null;break e}var o=0,s=-1,c=-1,u=0,d=0,b=e,m=null;t:for(;;){for(var h;b!==n||0!==a&&3!==b.nodeType||(s=o+a),b!==i||0!==l&&3!==b.nodeType||(c=o+l),3===b.nodeType&&(o+=b.nodeValue.length),null!==(h=b.firstChild);)m=b,b=h;for(;;){if(b===e)break t;if(m===n&&++u===a&&(s=o),m===i&&++d===l&&(c=o),null!==(h=b.nextSibling))break;m=(b=m).parentNode}b=h}n=-1===s||-1===c?null:{start:s,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(gd={focusedElem:e,selectionRange:n},xb=!1,Is=t;null!==Is;)if(e=(t=Is).child,1028&t.subtreeFlags&&null!==e)e.return=t,Is=e;else for(;null!==Is;){switch(i=(t=Is).alternate,e=t.flags,t.tag){case 0:if(4&e&&null!==(e=null!==(e=t.updateQueue)?e.events:null))for(n=0;n<e.length;n++)(a=e[n]).ref.impl=a.nextImpl;break;case 11:case 15:case 5:case 26:case 27:case 6:case 4:case 17:break;case 1:if(1024&e&&null!==i){e=void 0,n=t,a=i.memoizedProps,i=i.memoizedState,l=n.stateNode;try{var p=So(n.type,a);e=l.getSnapshotBeforeUpdate(p,i),l.__reactInternalSnapshotBeforeUpdate=e}catch(g){Su(n,n.return,g)}}break;case 3:if(1024&e)if(9===(n=(e=t.stateNode.containerInfo).nodeType))Ld(e);else if(1===n)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ld(e);break;default:e.textContent=""}break;default:if(1024&e)throw Error(r(163))}if(null!==(e=t.sibling)){e.return=t.return,Is=e;break}Is=t.return}}(e,t)}finally{pc=o,O.p=a,D.T=l}}jc=1,vu(),yu(),wu()}}function vu(){if(1===jc){jc=0;var e=Fc,t=Uc,n=!!(13878&t.flags);if(13878&t.subtreeFlags||n){n=D.T,D.T=null;var l=O.p;O.p=2;var r=pc;pc|=4;try{Ks(t,e);var a=gd,i=al(e.containerInfo),o=a.focusedElem,s=a.selectionRange;if(i!==o&&o&&o.ownerDocument&&rl(o.ownerDocument.documentElement,o)){if(null!==s&&il(o)){var c=s.start,u=s.end;if(void 0===u&&(u=c),"selectionStart"in o)o.selectionStart=c,o.selectionEnd=Math.min(u,o.value.length);else{var d=o.ownerDocument||document,b=d&&d.defaultView||window;if(b.getSelection){var m=b.getSelection(),h=o.textContent.length,p=Math.min(s.start,h),f=void 0===s.end?p:Math.min(s.end,h);!m.extend&&p>f&&(i=f,f=p,p=i);var g=ll(o,p),v=ll(o,f);if(g&&v&&(1!==m.rangeCount||m.anchorNode!==g.node||m.anchorOffset!==g.offset||m.focusNode!==v.node||m.focusOffset!==v.offset)){var y=d.createRange();y.setStart(g.node,g.offset),m.removeAllRanges(),p>f?(m.addRange(y),m.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),m.addRange(y))}}}}for(d=[],m=o;m=m.parentNode;)1===m.nodeType&&d.push({element:m,left:m.scrollLeft,top:m.scrollTop});for("function"==typeof o.focus&&o.focus(),o=0;o<d.length;o++){var w=d[o];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}xb=!!fd,gd=fd=null}finally{pc=r,O.p=l,D.T=n}}e.current=t,jc=2}}function yu(){if(2===jc){jc=0;var e=Fc,t=Uc,n=!!(8772&t.flags);if(8772&t.subtreeFlags||n){n=D.T,D.T=null;var l=O.p;O.p=2;var r=pc;pc|=4;try{Ds(e,t.alternate,t)}finally{pc=r,O.p=l,D.T=n}}jc=3}}function wu(){if(4===jc||3===jc){jc=0,ce();var e=Fc,t=Uc,n=Bc,l=Vc;10256&t.subtreeFlags||10256&t.flags?jc=5:(jc=0,Uc=Fc=null,xu(e,e.pendingLanes));var r=e.pendingLanes;if(0===r&&(Rc=null),je(n),t=t.stateNode,we&&"function"==typeof we.onCommitFiberRoot)try{we.onCommitFiberRoot(ye,t,void 0,!(128&~t.current.flags))}catch(s){}if(null!==l){t=D.T,r=O.p,O.p=2,D.T=null;try{for(var a=e.onRecoverableError,i=0;i<l.length;i++){var o=l[i];a(o.value,{componentStack:o.stack})}}finally{D.T=t,O.p=r}}3&Bc&&ku(),Ou(e),r=e.pendingLanes,261930&n&&42&r?e===Kc?Hc++:(Hc=0,Kc=e):Hc=0,Ru(0)}}function xu(e,t){0===(e.pooledCacheLanes&=t)&&(null!=(t=e.pooledCache)&&(e.pooledCache=null,Br(t)))}function ku(){return vu(),yu(),wu(),Cu()}function Cu(){if(5!==jc)return!1;var e=Fc,t=Wc;Wc=0;var n=je(Bc),l=D.T,a=O.p;try{O.p=32>n?32:n,D.T=null,n=qc,qc=null;var i=Fc,o=Bc;if(jc=0,Uc=Fc=null,Bc=0,6&pc)throw Error(r(331));var s=pc;if(pc|=4,uc(i.current),nc(i,i.current,o,n),pc=s,Ru(0,!1),we&&"function"==typeof we.onPostCommitFiberRoot)try{we.onPostCommitFiberRoot(ye,i)}catch(c){}return!0}finally{O.p=a,D.T=l,xu(e,t)}}function Nu(e,t,n){t=Xl(n,t),null!==(e=xa(e,t=Lo(e.stateNode,t,2),2))&&(Pe(e,2),Ou(e))}function Su(e,t,n){if(3===e.tag)Nu(e,e,n);else for(;null!==t;){if(3===t.tag){Nu(t,e,n);break}if(1===t.tag){var l=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof l.componentDidCatch&&(null===Rc||!Rc.has(l))){e=Xl(n,e),null!==(l=xa(t,n=Ao(2),2))&&(Mo(n,l,t,e),Pe(l,2),Ou(l));break}}t=t.return}}function Eu(e,t,n){var l=e.pingCache;if(null===l){l=e.pingCache=new hc;var r=/* @__PURE__ */new Set;l.set(t,r)}else void 0===(r=l.get(t))&&(r=/* @__PURE__ */new Set,l.set(t,r));r.has(n)||(Cc=!0,r.add(n),e=$u.bind(null,e,t,n),t.then(e,e))}function $u(e,t,n){var l=e.pingCache;null!==l&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,fc===e&&(vc&n)===n&&(4===Sc||3===Sc&&(62914560&vc)===vc&&300>ue()-Pc?!(2&pc)&&lu(e,0):_c|=n,Tc===vc&&(Tc=0)),Ou(e)}function _u(e,t){0===t&&(t=Ae()),null!==(e=Il(e,t))&&(Pe(e,t),Ou(e))}function zu(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),_u(e,n)}function Tu(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,a=e.memoizedState;null!==a&&(n=a.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(r(314))}null!==l&&l.delete(t),_u(e,n)}var Lu=null,Au=null,Mu=!1,Pu=!1,Iu=!1,Du=0;function Ou(e){e!==Au&&null===e.next&&(null===Au?Lu=Au=e:Au=Au.next=e),Pu=!0,Mu||(Mu=!0,Ed(function(){6&pc?ie(be,ju):Fu()}))}function Ru(e,t){if(!Iu&&Pu){Iu=!0;do{for(var n=!1,l=Lu;null!==l;){if(0!==e){var r=l.pendingLanes;if(0===r)var a=0;else{var i=l.suspendedLanes,o=l.pingedLanes;a=(1<<31-ke(42|e)+1)-1,a=201326741&(a&=r&~(i&~o))?201326741&a|1:a?2|a:0}0!==a&&(n=!0,Wu(l,a))}else a=vc,!(3&(a=ze(l,l===fc?a:0,null!==l.cancelPendingCommit||-1!==l.timeoutHandle)))||Te(l,a)||(n=!0,Wu(l,a));l=l.next}}while(n);Iu=!1}}function ju(){Fu()}function Fu(){Pu=Mu=!1;var e=0;0!==Du&&function(){var e=window.event;if(e&&"popstate"===e.type)return e!==kd&&(kd=e,!0);return kd=null,!1}()&&(e=Du);for(var t=ue(),n=null,l=Lu;null!==l;){var r=l.next,a=Uu(l,t);0===a?(l.next=null,null===n?Lu=r:n.next=r,null===r&&(Au=n)):(n=l,(0!==e||3&a)&&(Pu=!0)),l=r}0!==jc&&5!==jc||Ru(e),0!==Du&&(Du=0)}function Uu(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,r=e.expirationTimes,a=-62914561&e.pendingLanes;0<a;){var i=31-ke(a),o=1<<i,s=r[i];-1===s?0!==(o&n)&&0===(o&l)||(r[i]=Le(o,t)):s<=t&&(e.expiredLanes|=o),a&=~o}if(n=vc,n=ze(e,e===(t=fc)?n:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle),l=e.callbackNode,0===n||e===t&&(2===yc||9===yc)||null!==e.cancelPendingCommit)return null!==l&&null!==l&&oe(l),e.callbackNode=null,e.callbackPriority=0;if(!(3&n)||Te(e,n)){if((t=n&-n)===e.callbackPriority)return t;switch(null!==l&&oe(l),je(n)){case 2:case 8:n=me;break;case 32:default:n=he;break;case 268435456:n=fe}return l=Bu.bind(null,e),n=ie(n,l),e.callbackPriority=t,e.callbackNode=n,t}return null!==l&&null!==l&&oe(l),e.callbackPriority=2,e.callbackNode=null,2}function Bu(e,t){if(0!==jc&&5!==jc)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(ku()&&e.callbackNode!==n)return null;var l=vc;return 0===(l=ze(e,e===fc?l:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle))?null:(Yc(e,l,t),Uu(e,ue()),null!=e.callbackNode&&e.callbackNode===n?Bu.bind(null,e):null)}function Wu(e,t){if(ku())return null;Yc(e,t,!0)}function qu(){if(0===Du){var e=Vr;0===e&&(e=Se,!(261888&(Se<<=1))&&(Se=256)),Du=e}return Du}function Vu(e){return null==e||"symbol"==typeof e||"boolean"==typeof e?null:"function"==typeof e?e:Mt(""+e)}function Hu(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}for(var Ku=0;Ku<El.length;Ku++){var Gu=El[Ku];$l(Gu.toLowerCase(),"on"+(Gu[0].toUpperCase()+Gu.slice(1)))}$l(vl,"onAnimationEnd"),$l(yl,"onAnimationIteration"),$l(wl,"onAnimationStart"),$l("dblclick","onDoubleClick"),$l("focusin","onFocus"),$l("focusout","onBlur"),$l(xl,"onTransitionRun"),$l(kl,"onTransitionStart"),$l(Cl,"onTransitionCancel"),$l(Nl,"onTransitionEnd"),it("onMouseEnter",["mouseout","mouseover"]),it("onMouseLeave",["mouseout","mouseover"]),it("onPointerEnter",["pointerout","pointerover"]),it("onPointerLeave",["pointerout","pointerover"]),at("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),at("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),at("onBeforeInput",["compositionend","keypress","textInput","paste"]),at("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),at("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),at("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Qu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Xu=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Qu));function Yu(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var l=e[n],r=l.event;l=l.listeners;e:{var a=void 0;if(t)for(var i=l.length-1;0<=i;i--){var o=l[i],s=o.instance,c=o.currentTarget;if(o=o.listener,s!==a&&r.isPropagationStopped())break e;a=o,r.currentTarget=c;try{a(r)}catch(u){_l(u)}r.currentTarget=null,a=s}else for(i=0;i<l.length;i++){if(s=(o=l[i]).instance,c=o.currentTarget,o=o.listener,s!==a&&r.isPropagationStopped())break e;a=o,r.currentTarget=c;try{a(r)}catch(u){_l(u)}r.currentTarget=null,a=s}}}}function Ju(e,t){var n=t[He];void 0===n&&(n=t[He]=/* @__PURE__ */new Set);var l=e+"__bubble";n.has(l)||(nd(t,e,2,!1),n.add(l))}function Zu(e,t,n){var l=0;t&&(l|=4),nd(n,e,l,t)}var ed="_reactListening"+Math.random().toString(36).slice(2);function td(e){if(!e[ed]){e[ed]=!0,lt.forEach(function(t){"selectionchange"!==t&&(Xu.has(t)||Zu(t,!1,e),Zu(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[ed]||(t[ed]=!0,Zu("selectionchange",!1,t))}}function nd(e,t,n,l){switch(_b(t)){case 2:var r=kb;break;case 8:r=Cb;break;default:r=Nb}n=r.bind(null,t,n,e),r=void 0,!qt||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(r=!0),l?void 0!==r?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):void 0!==r?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function ld(e,t,n,l,r){var a=l;if(!(1&t||2&t||null===l))e:for(;;){if(null===l)return;var o=l.tag;if(3===o||4===o){var s=l.stateNode.containerInfo;if(s===r)break;if(4===o)for(o=l.return;null!==o;){var c=o.tag;if((3===c||4===c)&&o.stateNode.containerInfo===r)return;o=o.return}for(;null!==s;){if(null===(o=Je(s)))return;if(5===(c=o.tag)||6===c||26===c||27===c){l=a=o;continue e}s=s.parentNode}}l=l.return}Ut(function(){var l=a,r=Dt(n),o=[];e:{var s=Sl.get(e);if(void 0!==s){var c=rn,u=e;switch(e){case"keypress":if(0===Xt(n))break e;case"keydown":case"keyup":c=wn;break;case"focusin":u="focus",c=dn;break;case"focusout":u="blur",c=dn;break;case"beforeblur":case"afterblur":c=dn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":c=cn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":c=un;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":c=kn;break;case vl:case yl:case wl:c=bn;break;case Nl:c=Cn;break;case"scroll":case"scrollend":c=on;break;case"wheel":c=Nn;break;case"copy":case"cut":case"paste":c=mn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":c=xn;break;case"toggle":case"beforetoggle":c=Sn}var d=!!(4&t),b=!d&&("scroll"===e||"scrollend"===e),m=d?null!==s?s+"Capture":null:s;d=[];for(var h,p=l;null!==p;){var f=p;if(h=f.stateNode,5!==(f=f.tag)&&26!==f&&27!==f||null===h||null===m||null!=(f=Bt(p,m))&&d.push(rd(p,f,h)),b)break;p=p.return}0<d.length&&(s=new c(s,u,null,n,r),o.push({event:s,listeners:d}))}}if(!(7&t)){if(c="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||n===It||!(u=n.relatedTarget||n.fromElement)||!Je(u)&&!u[Ve])&&(c||s)&&(s=r.window===r?r:(s=r.ownerDocument)?s.defaultView||s.parentWindow:window,c?(c=l,null!==(u=(u=n.relatedTarget||n.toElement)?Je(u):null)&&(b=i(u),d=u.tag,u!==b||5!==d&&27!==d&&6!==d)&&(u=null)):(c=null,u=l),c!==u)){if(d=cn,f="onMouseLeave",m="onMouseEnter",p="mouse","pointerout"!==e&&"pointerover"!==e||(d=xn,f="onPointerLeave",m="onPointerEnter",p="pointer"),b=null==c?s:et(c),h=null==u?s:et(u),(s=new d(f,p+"leave",c,n,r)).target=b,s.relatedTarget=h,f=null,Je(r)===l&&((d=new d(m,p+"enter",u,n,r)).target=h,d.relatedTarget=b,f=d),b=f,c&&u)e:{for(d=id,p=u,h=0,f=m=c;f;f=d(f))h++;f=0;for(var g=p;g;g=d(g))f++;for(;0<h-f;)m=d(m),h--;for(;0<f-h;)p=d(p),f--;for(;h--;){if(m===p||null!==p&&m===p.alternate){d=m;break e}m=d(m),p=d(p)}d=null}else d=null;null!==c&&od(o,s,c,d,!1),null!==u&&null!==b&&od(o,b,u,d,!0)}if("select"===(c=(s=l?et(l):window).nodeName&&s.nodeName.toLowerCase())||"input"===c&&"file"===s.type)var v=Wn;else if(On(s))if(qn)v=Zn;else{v=Yn;var y=Xn}else!(c=s.nodeName)||"input"!==c.toLowerCase()||"checkbox"!==s.type&&"radio"!==s.type?l&&Tt(l.elementType)&&(v=Wn):v=Jn;switch(v&&(v=v(e,l))?Rn(o,v,n,r):(y&&y(e,s,l),"focusout"===e&&l&&"number"===s.type&&null!=l.memoizedProps.value&&kt(s,"number",s.value)),y=l?et(l):window,e){case"focusin":(On(y)||"true"===y.contentEditable)&&(sl=y,cl=l,ul=null);break;case"focusout":ul=cl=sl=null;break;case"mousedown":dl=!0;break;case"contextmenu":case"mouseup":case"dragend":dl=!1,bl(o,n,r);break;case"selectionchange":if(ol)break;case"keydown":case"keyup":bl(o,n,r)}var w;if($n)e:{switch(e){case"compositionstart":var x="onCompositionStart";break e;case"compositionend":x="onCompositionEnd";break e;case"compositionupdate":x="onCompositionUpdate";break e}x=void 0}else In?Mn(e,n)&&(x="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(x="onCompositionStart");x&&(Tn&&"ko"!==n.locale&&(In||"onCompositionStart"!==x?"onCompositionEnd"===x&&In&&(w=Qt()):(Kt="value"in(Ht=r)?Ht.value:Ht.textContent,In=!0)),0<(y=ad(l,x)).length&&(x=new hn(x,e,null,n,r),o.push({event:x,listeners:y}),w?x.data=w:null!==(w=Pn(n))&&(x.data=w))),(w=zn?function(e,t){switch(e){case"compositionend":return Pn(t);case"keypress":return 32!==t.which?null:(An=!0,Ln);case"textInput":return(e=t.data)===Ln&&An?null:e;default:return null}}(e,n):function(e,t){if(In)return"compositionend"===e||!$n&&Mn(e,t)?(e=Qt(),Gt=Kt=Ht=null,In=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Tn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(x=ad(l,"onBeforeInput")).length&&(y=new hn("onBeforeInput","beforeinput",null,n,r),o.push({event:y,listeners:x}),y.data=w)),function(e,t,n,l,r){if("submit"===t&&n&&n.stateNode===r){var a=Vu((r[qe]||null).action),i=l.submitter;i&&null!==(t=(t=i[qe]||null)?Vu(t.formAction):i.getAttribute("formAction"))&&(a=t,i=null);var o=new rn("action","action",null,l,r);e.push({event:o,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(0!==Du){var e=i?Hu(r,i):new FormData(r);no(n,{pending:!0,data:e,method:r.method,action:a},null,e)}}else"function"==typeof a&&(o.preventDefault(),e=i?Hu(r,i):new FormData(r),no(n,{pending:!0,data:e,method:r.method,action:a},a,e))},currentTarget:r}]})}}(o,e,l,n,r)}Yu(o,t)})}function rd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ad(e,t){for(var n=t+"Capture",l=[];null!==e;){var r=e,a=r.stateNode;if(5!==(r=r.tag)&&26!==r&&27!==r||null===a||(null!=(r=Bt(e,n))&&l.unshift(rd(e,r,a)),null!=(r=Bt(e,t))&&l.push(rd(e,r,a))),3===e.tag)return l;e=e.return}return[]}function id(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag&&27!==e.tag);return e||null}function od(e,t,n,l,r){for(var a=t._reactName,i=[];null!==n&&n!==l;){var o=n,s=o.alternate,c=o.stateNode;if(o=o.tag,null!==s&&s===l)break;5!==o&&26!==o&&27!==o||null===c||(s=c,r?null!=(c=Bt(n,a))&&i.unshift(rd(n,c,s)):r||null!=(c=Bt(n,a))&&i.push(rd(n,c,s))),n=n.return}0!==i.length&&e.push({event:t,listeners:i})}var sd=/\r\n?/g,cd=/\u0000|\uFFFD/g;function ud(e){return("string"==typeof e?e:""+e).replace(sd,"\n").replace(cd,"")}function dd(e,t){return t=ud(t),ud(e)===t}function bd(e,t,n,l,a,i){switch(n){case"children":"string"==typeof l?"body"===t||"textarea"===t&&""===l||Et(e,l):("number"==typeof l||"bigint"==typeof l)&&"body"!==t&&Et(e,""+l);break;case"className":dt(e,"class",l);break;case"tabIndex":dt(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":dt(e,n,l);break;case"style":zt(e,l,i);break;case"data":if("object"!==t){dt(e,"data",l);break}case"src":case"href":if(""===l&&("a"!==t||"href"!==n)){e.removeAttribute(n);break}if(null==l||"function"==typeof l||"symbol"==typeof l||"boolean"==typeof l){e.removeAttribute(n);break}l=Mt(""+l),e.setAttribute(n,l);break;case"action":case"formAction":if("function"==typeof l){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}if("function"==typeof i&&("formAction"===n?("input"!==t&&bd(e,t,"name",a.name,a,null),bd(e,t,"formEncType",a.formEncType,a,null),bd(e,t,"formMethod",a.formMethod,a,null),bd(e,t,"formTarget",a.formTarget,a,null)):(bd(e,t,"encType",a.encType,a,null),bd(e,t,"method",a.method,a,null),bd(e,t,"target",a.target,a,null))),null==l||"symbol"==typeof l||"boolean"==typeof l){e.removeAttribute(n);break}l=Mt(""+l),e.setAttribute(n,l);break;case"onClick":null!=l&&(e.onclick=Pt);break;case"onScroll":null!=l&&Ju("scroll",e);break;case"onScrollEnd":null!=l&&Ju("scrollend",e);break;case"dangerouslySetInnerHTML":if(null!=l){if("object"!=typeof l||!("__html"in l))throw Error(r(61));if(null!=(n=l.__html)){if(null!=a.children)throw Error(r(60));e.innerHTML=n}}break;case"multiple":e.multiple=l&&"function"!=typeof l&&"symbol"!=typeof l;break;case"muted":e.muted=l&&"function"!=typeof l&&"symbol"!=typeof l;break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":case"autoFocus":break;case"xlinkHref":if(null==l||"function"==typeof l||"boolean"==typeof l||"symbol"==typeof l){e.removeAttribute("xlink:href");break}n=Mt(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":null!=l&&"function"!=typeof l&&"symbol"!=typeof l?e.setAttribute(n,""+l):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&"function"!=typeof l&&"symbol"!=typeof l?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":!0===l?e.setAttribute(n,""):!1!==l&&null!=l&&"function"!=typeof l&&"symbol"!=typeof l?e.setAttribute(n,l):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":null!=l&&"function"!=typeof l&&"symbol"!=typeof l&&!isNaN(l)&&1<=l?e.setAttribute(n,l):e.removeAttribute(n);break;case"rowSpan":case"start":null==l||"function"==typeof l||"symbol"==typeof l||isNaN(l)?e.removeAttribute(n):e.setAttribute(n,l);break;case"popover":Ju("beforetoggle",e),Ju("toggle",e),ut(e,"popover",l);break;case"xlinkActuate":bt(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":bt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":bt(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":bt(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":bt(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":bt(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":bt(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":bt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":bt(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":ut(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<n.length)||"o"!==n[0]&&"O"!==n[0]||"n"!==n[1]&&"N"!==n[1])&&ut(e,n=Lt.get(n)||n,l)}}function md(e,t,n,l,a,i){switch(n){case"style":zt(e,l,i);break;case"dangerouslySetInnerHTML":if(null!=l){if("object"!=typeof l||!("__html"in l))throw Error(r(61));if(null!=(n=l.__html)){if(null!=a.children)throw Error(r(60));e.innerHTML=n}}break;case"children":"string"==typeof l?Et(e,l):("number"==typeof l||"bigint"==typeof l)&&Et(e,""+l);break;case"onScroll":null!=l&&Ju("scroll",e);break;case"onScrollEnd":null!=l&&Ju("scrollend",e);break;case"onClick":null!=l&&(e.onclick=Pt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":case"innerText":case"textContent":break;default:rt.hasOwnProperty(n)||("o"!==n[0]||"n"!==n[1]||(a=n.endsWith("Capture"),t=n.slice(2,a?n.length-7:void 0),"function"==typeof(i=null!=(i=e[qe]||null)?i[n]:null)&&e.removeEventListener(t,i,a),"function"!=typeof l)?n in e?e[n]=l:!0===l?e.setAttribute(n,""):ut(e,n,l):("function"!=typeof i&&null!==i&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,a)))}}function hd(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ju("error",e),Ju("load",e);var l,a=!1,i=!1;for(l in n)if(n.hasOwnProperty(l)){var o=n[l];if(null!=o)switch(l){case"src":a=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:bd(e,t,l,o,n,null)}}return i&&bd(e,t,"srcSet",n.srcSet,n,null),void(a&&bd(e,t,"src",n.src,n,null));case"input":Ju("invalid",e);var s=l=o=i=null,c=null,u=null;for(a in n)if(n.hasOwnProperty(a)){var d=n[a];if(null!=d)switch(a){case"name":i=d;break;case"type":o=d;break;case"checked":c=d;break;case"defaultChecked":u=d;break;case"value":l=d;break;case"defaultValue":s=d;break;case"children":case"dangerouslySetInnerHTML":if(null!=d)throw Error(r(137,t));break;default:bd(e,t,a,d,n,null)}}return void xt(e,l,s,c,u,o,i,!1);case"select":for(i in Ju("invalid",e),a=o=l=null,n)if(n.hasOwnProperty(i)&&null!=(s=n[i]))switch(i){case"value":l=s;break;case"defaultValue":o=s;break;case"multiple":a=s;default:bd(e,t,i,s,n,null)}return t=l,n=o,e.multiple=!!a,void(null!=t?Ct(e,!!a,t,!1):null!=n&&Ct(e,!!a,n,!0));case"textarea":for(o in Ju("invalid",e),l=i=a=null,n)if(n.hasOwnProperty(o)&&null!=(s=n[o]))switch(o){case"value":a=s;break;case"defaultValue":i=s;break;case"children":l=s;break;case"dangerouslySetInnerHTML":if(null!=s)throw Error(r(91));break;default:bd(e,t,o,s,n,null)}return void St(e,a,i,l);case"option":for(c in n)if(n.hasOwnProperty(c)&&null!=(a=n[c]))if("selected"===c)e.selected=a&&"function"!=typeof a&&"symbol"!=typeof a;else bd(e,t,c,a,n,null);return;case"dialog":Ju("beforetoggle",e),Ju("toggle",e),Ju("cancel",e),Ju("close",e);break;case"iframe":case"object":Ju("load",e);break;case"video":case"audio":for(a=0;a<Qu.length;a++)Ju(Qu[a],e);break;case"image":Ju("error",e),Ju("load",e);break;case"details":Ju("toggle",e);break;case"embed":case"source":case"link":Ju("error",e),Ju("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in n)if(n.hasOwnProperty(u)&&null!=(a=n[u]))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:bd(e,t,u,a,n,null)}return;default:if(Tt(t)){for(d in n)n.hasOwnProperty(d)&&(void 0!==(a=n[d])&&md(e,t,d,a,n,void 0));return}}for(s in n)n.hasOwnProperty(s)&&(null!=(a=n[s])&&bd(e,t,s,a,n,null))}function pd(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}var fd=null,gd=null;function vd(e){return 9===e.nodeType?e:e.ownerDocument}function yd(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function wd(e,t){if(0===e)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return 1===e&&"foreignObject"===t?0:e}function xd(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"bigint"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var kd=null;var Cd="function"==typeof setTimeout?setTimeout:void 0,Nd="function"==typeof clearTimeout?clearTimeout:void 0,Sd="function"==typeof Promise?Promise:void 0,Ed="function"==typeof queueMicrotask?queueMicrotask:void 0!==Sd?function(e){return Sd.resolve(null).then(e).catch($d)}:Cd;function $d(e){setTimeout(function(){throw e})}function _d(e){return"head"===e}function zd(e,t){var n=t,l=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&8===r.nodeType)if("/$"===(n=r.data)||"/&"===n){if(0===l)return e.removeChild(r),void Hb(t);l--}else if("$"===n||"$?"===n||"$~"===n||"$!"===n||"&"===n)l++;else if("html"===n)Fd(e.ownerDocument.documentElement);else if("head"===n){Fd(n=e.ownerDocument.head);for(var a=n.firstChild;a;){var i=a.nextSibling,o=a.nodeName;a[Xe]||"SCRIPT"===o||"STYLE"===o||"LINK"===o&&"stylesheet"===a.rel.toLowerCase()||n.removeChild(a),a=i}}else"body"===n&&Fd(e.ownerDocument.body);n=r}while(n);Hb(t)}function Td(e,t){var n=e;e=0;do{var l=n.nextSibling;if(1===n.nodeType?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",""===n.getAttribute("style")&&n.removeAttribute("style")):3===n.nodeType&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),l&&8===l.nodeType)if("/$"===(n=l.data)){if(0===e)break;e--}else"$"!==n&&"$?"!==n&&"$~"!==n&&"$!"!==n||e++;n=l}while(n)}function Ld(e){var t=e.firstChild;for(t&&10===t.nodeType&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Ld(n),Ye(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if("stylesheet"===n.rel.toLowerCase())continue}e.removeChild(n)}}function Ad(e,t){for(;8!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!t)return null;if(null===(e=Id(e.nextSibling)))return null}return e}function Md(e){return"$?"===e.data||"$~"===e.data}function Pd(e){return"$!"===e.data||"$?"===e.data&&"loading"!==e.ownerDocument.readyState}function Id(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t||"$~"===t||"&"===t||"F!"===t||"F"===t)break;if("/$"===t||"/&"===t)return null}}return e}var Dd=null;function Od(e){e=e.nextSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n||"/&"===n){if(0===t)return Id(e.nextSibling);t--}else"$"!==n&&"$!"!==n&&"$?"!==n&&"$~"!==n&&"&"!==n||t++}e=e.nextSibling}return null}function Rd(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n||"$~"===n||"&"===n){if(0===t)return e;t--}else"/$"!==n&&"/&"!==n||t++}e=e.previousSibling}return null}function jd(e,t,n){switch(t=vd(n),e){case"html":if(!(e=t.documentElement))throw Error(r(452));return e;case"head":if(!(e=t.head))throw Error(r(453));return e;case"body":if(!(e=t.body))throw Error(r(454));return e;default:throw Error(r(451))}}function Fd(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ye(e)}var Ud=/* @__PURE__ */new Map,Bd=/* @__PURE__ */new Set;function Wd(e){return"function"==typeof e.getRootNode?e.getRootNode():9===e.nodeType?e:e.ownerDocument}var qd=O.d;O.d={f:function(){var e=qd.f(),t=tu();return e||t},r:function(e){var t=Ze(e);null!==t&&5===t.tag&&"form"===t.type?ro(t):qd.r(e)},D:function(e){qd.D(e),Hd("dns-prefetch",e,null)},C:function(e,t){qd.C(e,t),Hd("preconnect",e,t)},L:function(e,t,n){qd.L(e,t,n);var l=Vd;if(l&&e&&t){var r='link[rel="preload"][as="'+yt(t)+'"]';"image"===t&&n&&n.imageSrcSet?(r+='[imagesrcset="'+yt(n.imageSrcSet)+'"]',"string"==typeof n.imageSizes&&(r+='[imagesizes="'+yt(n.imageSizes)+'"]')):r+='[href="'+yt(e)+'"]';var a=r;switch(t){case"style":a=Gd(e);break;case"script":a=Yd(e)}Ud.has(a)||(e=b({rel:"preload",href:"image"===t&&n&&n.imageSrcSet?void 0:e,as:t},n),Ud.set(a,e),null!==l.querySelector(r)||"style"===t&&l.querySelector(Qd(a))||"script"===t&&l.querySelector(Jd(a))||(hd(t=l.createElement("link"),"link",e),nt(t),l.head.appendChild(t)))}},m:function(e,t){qd.m(e,t);var n=Vd;if(n&&e){var l=t&&"string"==typeof t.as?t.as:"script",r='link[rel="modulepreload"][as="'+yt(l)+'"][href="'+yt(e)+'"]',a=r;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=Yd(e)}if(!Ud.has(a)&&(e=b({rel:"modulepreload",href:e},t),Ud.set(a,e),null===n.querySelector(r))){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Jd(a)))return}hd(l=n.createElement("link"),"link",e),nt(l),n.head.appendChild(l)}}},X:function(e,t){qd.X(e,t);var n=Vd;if(n&&e){var l=tt(n).hoistableScripts,r=Yd(e),a=l.get(r);a||((a=n.querySelector(Jd(r)))||(e=b({src:e,async:!0},t),(t=Ud.get(r))&&nb(e,t),nt(a=n.createElement("script")),hd(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},l.set(r,a))}},S:function(e,t,n){qd.S(e,t,n);var l=Vd;if(l&&e){var r=tt(l).hoistableStyles,a=Gd(e);t=t||"default";var i=r.get(a);if(!i){var o={loading:0,preload:null};if(i=l.querySelector(Qd(a)))o.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Ud.get(a))&&tb(e,n);var s=i=l.createElement("link");nt(s),hd(s,"link",e),s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),s.addEventListener("load",function(){o.loading|=1}),s.addEventListener("error",function(){o.loading|=2}),o.loading|=4,eb(i,t,l)}i={type:"stylesheet",instance:i,count:1,state:o},r.set(a,i)}}},M:function(e,t){qd.M(e,t);var n=Vd;if(n&&e){var l=tt(n).hoistableScripts,r=Yd(e),a=l.get(r);a||((a=n.querySelector(Jd(r)))||(e=b({src:e,async:!0,type:"module"},t),(t=Ud.get(r))&&nb(e,t),nt(a=n.createElement("script")),hd(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},l.set(r,a))}}};var Vd="undefined"==typeof document?null:document;function Hd(e,t,n){var l=Vd;if(l&&"string"==typeof t&&t){var r=yt(t);r='link[rel="'+e+'"][href="'+r+'"]',"string"==typeof n&&(r+='[crossorigin="'+n+'"]'),Bd.has(r)||(Bd.add(r),e={rel:e,crossOrigin:n,href:t},null===l.querySelector(r)&&(hd(t=l.createElement("link"),"link",e),nt(t),l.head.appendChild(t)))}}function Kd(e,t,n,l){var a,i,o,s,c=(c=G.current)?Wd(c):null;if(!c)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return"string"==typeof n.precedence&&"string"==typeof n.href?(t=Gd(n.href),(l=(n=tt(c).hoistableStyles).get(t))||(l={type:"style",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if("stylesheet"===n.rel&&"string"==typeof n.href&&"string"==typeof n.precedence){e=Gd(n.href);var u=tt(c).hoistableStyles,d=u.get(e);if(d||(c=c.ownerDocument||c,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,d),(u=c.querySelector(Qd(e)))&&!u._p&&(d.instance=u,d.state.loading=5),Ud.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ud.set(e,n),u||(a=c,i=e,o=n,s=d.state,a.querySelector('link[rel="preload"][as="style"]['+i+"]")?s.loading=1:(i=a.createElement("link"),s.preload=i,i.addEventListener("load",function(){return s.loading|=1}),i.addEventListener("error",function(){return s.loading|=2}),hd(i,"link",o),nt(i),a.head.appendChild(i))))),t&&null===l)throw Error(r(528,""));return d}if(t&&null!==l)throw Error(r(529,""));return null;case"script":return t=n.async,"string"==typeof(n=n.src)&&t&&"function"!=typeof t&&"symbol"!=typeof t?(t=Yd(n),(l=(n=tt(c).hoistableScripts).get(t))||(l={type:"script",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function Gd(e){return'href="'+yt(e)+'"'}function Qd(e){return'link[rel="stylesheet"]['+e+"]"}function Xd(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function Yd(e){return'[src="'+yt(e)+'"]'}function Jd(e){return"script[async]"+e}function Zd(e,t,n){if(t.count++,null===t.instance)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+yt(n.href)+'"]');if(l)return t.instance=l,nt(l),l;var a=b({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return nt(l=(e.ownerDocument||e).createElement("style")),hd(l,"style",a),eb(l,n.precedence,e),t.instance=l;case"stylesheet":a=Gd(n.href);var i=e.querySelector(Qd(a));if(i)return t.state.loading|=4,t.instance=i,nt(i),i;l=Xd(n),(a=Ud.get(a))&&tb(l,a),nt(i=(e.ownerDocument||e).createElement("link"));var o=i;return o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),hd(i,"link",l),t.state.loading|=4,eb(i,n.precedence,e),t.instance=i;case"script":return i=Yd(n.src),(a=e.querySelector(Jd(i)))?(t.instance=a,nt(a),a):(l=n,(a=Ud.get(i))&&nb(l=b({},n),a),nt(a=(e=e.ownerDocument||e).createElement("script")),hd(a,"link",l),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(r(443,t.type))}else"stylesheet"===t.type&&!(4&t.state.loading)&&(l=t.instance,t.state.loading|=4,eb(l,n.precedence,e));return t.instance}function eb(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=l.length?l[l.length-1]:null,a=r,i=0;i<l.length;i++){var o=l[i];if(o.dataset.precedence===t)a=o;else if(a!==r)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=9===n.nodeType?n.head:n).insertBefore(e,t.firstChild)}function tb(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.title&&(e.title=t.title)}function nb(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.integrity&&(e.integrity=t.integrity)}var lb=null;function rb(e,t,n){if(null===lb){var l=/* @__PURE__ */new Map,r=lb=/* @__PURE__ */new Map;r.set(n,l)}else(l=(r=lb).get(n))||(l=/* @__PURE__ */new Map,r.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var a=n[r];if(!(a[Xe]||a[We]||"link"===e&&"stylesheet"===a.getAttribute("rel"))&&"http://www.w3.org/2000/svg"!==a.namespaceURI){var i=a.getAttribute(t)||"";i=e+i;var o=l.get(i);o?o.push(a):l.set(i,[a])}}return l}function ab(e,t,n){(e=e.ownerDocument||e).head.insertBefore(n,"title"===t?e.querySelector("head > title"):null)}function ib(e){return!!("stylesheet"!==e.type||3&e.state.loading)}var ob=0;function sb(){if(this.count--,0===this.count&&(0===this.imgCount||!this.waitingForImages))if(this.stylesheets)ub(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var cb=null;function ub(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,cb=/* @__PURE__ */new Map,t.forEach(db,e),cb=null,sb.call(e))}function db(e,t){if(!(4&t.state.loading)){var n=cb.get(e);if(n)var l=n.get(null);else{n=/* @__PURE__ */new Map,cb.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<r.length;a++){var i=r[a];"LINK"!==i.nodeName&&"not all"===i.getAttribute("media")||(n.set(i.dataset.precedence,i),l=i)}l&&n.set(null,l)}i=(r=t.instance).getAttribute("data-precedence"),(a=n.get(i)||l)===l&&n.set(null,r),n.set(i,r),this.count++,l=sb.bind(this),r.addEventListener("load",l),r.addEventListener("error",l),a?a.parentNode.insertBefore(r,a.nextSibling):(e=9===e.nodeType?e.head:e).insertBefore(r,e.firstChild),t.state.loading|=4}}var bb={$$typeof:w,Provider:null,Consumer:null,_currentValue:R,_currentValue2:R,_threadCount:0};function mb(e,t,n,l,r,a,i,o,s){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Me(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Me(0),this.hiddenUpdates=Me(null),this.identifierPrefix=l,this.onUncaughtError=r,this.onCaughtError=a,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=s,this.incompleteTransitions=/* @__PURE__ */new Map}function hb(e,t,n,l,r,a,i,o,s,c,u,d){return e=new mb(e,t,n,i,s,c,u,d,o),t=1,!0===a&&(t|=24),a=Fl(3,null,null,t),e.current=a,a.stateNode=e,(t=Ur()).refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:l,isDehydrated:n,cache:t},va(a),e}function pb(e){return e?e=Rl:Rl}function fb(e,t,n,l,r,a){r=pb(r),null===l.context?l.context=r:l.pendingContext=r,(l=wa(t)).payload={element:n},null!==(a=void 0===a?null:a)&&(l.callback=a),null!==(n=xa(e,l,t))&&(Xc(n,0,t),ka(n,e,t))}function gb(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function vb(e,t){gb(e,t),(e=e.alternate)&&gb(e,t)}function yb(e){if(13===e.tag||31===e.tag){var t=Il(e,67108864);null!==t&&Xc(t,0,67108864),vb(e,67108864)}}function wb(e){if(13===e.tag||31===e.tag){var t=Gc(),n=Il(e,t=Re(t));null!==n&&Xc(n,0,t),vb(e,t)}}var xb=!0;function kb(e,t,n,l){var r=D.T;D.T=null;var a=O.p;try{O.p=2,Nb(e,t,n,l)}finally{O.p=a,D.T=r}}function Cb(e,t,n,l){var r=D.T;D.T=null;var a=O.p;try{O.p=8,Nb(e,t,n,l)}finally{O.p=a,D.T=r}}function Nb(e,t,n,l){if(xb){var r=Sb(l);if(null===r)ld(e,t,l,Eb,n),Ob(e,l);else if(function(e,t,n,l,r){switch(t){case"focusin":return Tb=Rb(Tb,e,t,n,l,r),!0;case"dragenter":return Lb=Rb(Lb,e,t,n,l,r),!0;case"mouseover":return Ab=Rb(Ab,e,t,n,l,r),!0;case"pointerover":var a=r.pointerId;return Mb.set(a,Rb(Mb.get(a)||null,e,t,n,l,r)),!0;case"gotpointercapture":return a=r.pointerId,Pb.set(a,Rb(Pb.get(a)||null,e,t,n,l,r)),!0}return!1}(r,e,t,n,l))l.stopPropagation();else if(Ob(e,l),4&t&&-1<Db.indexOf(e)){for(;null!==r;){var a=Ze(r);if(null!==a)switch(a.tag){case 3:if((a=a.stateNode).current.memoizedState.isDehydrated){var i=_e(a.pendingLanes);if(0!==i){var o=a;for(o.pendingLanes|=2,o.entangledLanes|=2;i;){var s=1<<31-ke(i);o.entanglements[1]|=s,i&=~s}Ou(a),!(6&pc)&&(Dc=ue()+500,Ru(0))}}break;case 31:case 13:null!==(o=Il(a,2))&&Xc(o,0,2),tu(),vb(a,2)}if(null===(a=Sb(l))&&ld(e,t,l,Eb,n),a===r)break;r=a}null!==r&&l.stopPropagation()}else ld(e,t,l,null,n)}}function Sb(e){return $b(e=Dt(e))}var Eb=null;function $b(e){if(Eb=null,null!==(e=Je(e))){var t=i(e);if(null===t)e=null;else{var n=t.tag;if(13===n){if(null!==(e=s(t)))return e;e=null}else if(31===n){if(null!==(e=c(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Eb=e,null}function _b(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(de()){case be:return 2;case me:return 8;case he:case pe:return 32;case fe:return 268435456;default:return 32}default:return 32}}var zb=!1,Tb=null,Lb=null,Ab=null,Mb=/* @__PURE__ */new Map,Pb=/* @__PURE__ */new Map,Ib=[],Db="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Ob(e,t){switch(e){case"focusin":case"focusout":Tb=null;break;case"dragenter":case"dragleave":Lb=null;break;case"mouseover":case"mouseout":Ab=null;break;case"pointerover":case"pointerout":Mb.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pb.delete(t.pointerId)}}function Rb(e,t,n,l,r,a){return null===e||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:a,targetContainers:[r]},null!==t&&(null!==(t=Ze(t))&&yb(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,null!==r&&-1===t.indexOf(r)&&t.push(r),e)}function jb(e){var t=Je(e.target);if(null!==t){var n=i(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=s(n)))return e.blockedOn=t,void Ue(e.priority,function(){wb(n)})}else if(31===t){if(null!==(t=c(n)))return e.blockedOn=t,void Ue(e.priority,function(){wb(n)})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Fb(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Sb(e.nativeEvent);if(null!==n)return null!==(t=Ze(n))&&yb(t),e.blockedOn=n,!1;var l=new(n=e.nativeEvent).constructor(n.type,n);It=l,n.target.dispatchEvent(l),It=null,t.shift()}return!0}function Ub(e,t,n){Fb(e)&&n.delete(t)}function Bb(){zb=!1,null!==Tb&&Fb(Tb)&&(Tb=null),null!==Lb&&Fb(Lb)&&(Lb=null),null!==Ab&&Fb(Ab)&&(Ab=null),Mb.forEach(Ub),Pb.forEach(Ub)}function Wb(e,n){e.blockedOn===n&&(e.blockedOn=null,zb||(zb=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Bb)))}var qb=null;function Vb(e){qb!==e&&(qb=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){qb===e&&(qb=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],r=e[t+2];if("function"!=typeof l){if(null===$b(l||n))continue;break}var a=Ze(n);null!==a&&(e.splice(t,3),t-=3,no(a,{pending:!0,data:r,method:n.method,action:l},l,r))}}))}function Hb(e){function t(t){return Wb(t,e)}null!==Tb&&Wb(Tb,e),null!==Lb&&Wb(Lb,e),null!==Ab&&Wb(Ab,e),Mb.forEach(t),Pb.forEach(t);for(var n=0;n<Ib.length;n++){var l=Ib[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Ib.length&&null===(n=Ib[0]).blockedOn;)jb(n),null===n.blockedOn&&Ib.shift();if(null!=(n=(e.ownerDocument||e).$$reactFormReplay))for(l=0;l<n.length;l+=3){var r=n[l],a=n[l+1],i=r[qe]||null;if("function"==typeof a)i||Vb(n);else if(i){var o=null;if(a&&a.hasAttribute("formAction")){if(r=a,i=a[qe]||null)o=i.formAction;else if(null!==$b(r))continue}else o=i.action;"function"==typeof o?n[l+1]=o:(n.splice(l,3),l-=3),Vb(n)}}}function Kb(){function e(e){e.canIntercept&&"react-transition"===e.info&&e.intercept({handler:function(){return new Promise(function(e){return r=e})},focusReset:"manual",scroll:"manual"})}function t(){null!==r&&(r(),r=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var e=navigation.currentEntry;e&&null!=e.url&&navigation.navigate(e.url,{state:e.getState(),info:"react-transition",history:"replace"})}}if("object"==typeof navigation){var l=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),null!==r&&(r(),r=null)}}}function Gb(e){this._internalRoot=e}function Qb(e){this._internalRoot=e}Qb.prototype.render=Gb.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(r(409));fb(t.current,Gc(),e,t,null,null)},Qb.prototype.unmount=Gb.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;fb(e.current,2,null,e,null,null),tu(),t[Ve]=null}},Qb.prototype.unstable_scheduleHydration=function(e){if(e){var t=Fe();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ib.length&&0!==t&&t<Ib[n].priority;n++);Ib.splice(n,0,e),0===n&&jb(e)}};var Xb=n.version;if("19.2.3"!==Xb)throw Error(r(527,Xb,"19.2.3"));O.findDOMNode=function(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(r(188));throw e=Object.keys(e).join(","),Error(r(268,e))}return e=function(e){var t=e.alternate;if(!t){if(null===(t=i(e)))throw Error(r(188));return t!==e?null:e}for(var n=e,l=t;;){var a=n.return;if(null===a)break;var o=a.alternate;if(null===o){if(null!==(l=a.return)){n=l;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return u(a),e;if(o===l)return u(a),t;o=o.sibling}throw Error(r(188))}if(n.return!==l.return)n=a,l=o;else{for(var s=!1,c=a.child;c;){if(c===n){s=!0,n=a,l=o;break}if(c===l){s=!0,l=a,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,l=a;break}if(c===l){s=!0,l=o,n=a;break}c=c.sibling}if(!s)throw Error(r(189))}}if(n.alternate!==l)throw Error(r(190))}if(3!==n.tag)throw Error(r(188));return n.stateNode.current===n?e:t}(t),e=null===(e=null!==e?d(e):null)?null:e.stateNode};var Yb={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.3"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var Jb=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jb.isDisabled&&Jb.supportsFiber)try{ye=Jb.inject(Yb),we=Jb}catch(em){}}return E.createRoot=function(e,t){if(!a(e))throw Error(r(299));var n=!1,l="",i=Eo,o=$o,s=_o;return null!=t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(l=t.identifierPrefix),void 0!==t.onUncaughtError&&(i=t.onUncaughtError),void 0!==t.onCaughtError&&(o=t.onCaughtError),void 0!==t.onRecoverableError&&(s=t.onRecoverableError)),t=hb(e,1,!1,null,0,n,l,null,i,o,s,Kb),e[Ve]=t.current,td(e),new Gb(t)},E.hydrateRoot=function(e,t,n){if(!a(e))throw Error(r(299));var l=!1,i="",o=Eo,s=$o,c=_o,u=null;return null!=n&&(!0===n.unstable_strictMode&&(l=!0),void 0!==n.identifierPrefix&&(i=n.identifierPrefix),void 0!==n.onUncaughtError&&(o=n.onUncaughtError),void 0!==n.onCaughtError&&(s=n.onCaughtError),void 0!==n.onRecoverableError&&(c=n.onRecoverableError),void 0!==n.formState&&(u=n.formState)),(t=hb(e,1,!0,t,0,l,i,u,o,s,c,Kb)).context=pb(null),n=t.current,(i=wa(l=Re(l=Gc()))).callback=null,xa(n,i,l),n=l,t.current.lanes=n,Pe(t,n),Ou(t),e[Ve]=t.current,td(e),new Qb(t)},E.version="19.2.3",E}var L=(N||(N=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),S.exports=T()),S.exports);const A=new class{constructor(){this.supportsContainerQueries=this.detectContainerQueries(),this.init()}detectContainerQueries(){if("undefined"==typeof window)return!1;try{if("CSS"in window&&"supports"in window.CSS)return window.CSS.supports("container-type","inline-size");const e=document.createElement("div");return e.style.containerType="inline-size","inline-size"===e.style.containerType}catch{return!1}}init(){"undefined"!=typeof window&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>this.applyClasses()):this.applyClasses())}applyClasses(){document.querySelectorAll(".limbo-component-container-wrapper").forEach(e=>{this.supportsContainerQueries?(e.classList.add("container-queries-supported"),e.classList.remove("container-queries-fallback")):(e.classList.add("container-queries-fallback"),e.classList.remove("container-queries-supported"))}),this.supportsContainerQueries?(document.body.classList.add("container-queries-supported"),document.body.classList.remove("container-queries-fallback")):(document.body.classList.add("container-queries-fallback"),document.body.classList.remove("container-queries-supported"))}getContainerWidth(e){if(!e)return window.innerWidth;let t=e.closest(".limbo-component-container-wrapper");return t||(t=e.closest(".limbo-modal-content")),t||(t=e.closest(".limbo-modal")),t||(t=document.body),t.offsetWidth||t.clientWidth}shouldUseMobileStyles(e,t=768){return this.getContainerWidth(e)<=t}applyResponsiveClasses(e){if(this.supportsContainerQueries)return;const t=this.shouldUseMobileStyles(e),n=this.shouldUseMobileStyles(e,1024)&&!t;e.classList.toggle("limbo-mobile-fallback",t),e.classList.toggle("limbo-tablet-fallback",n),e.classList.toggle("limbo-desktop-fallback",!t&&!n)}observeResize(){if(!this.supportsContainerQueries)if("ResizeObserver"in window){const e=new ResizeObserver(e=>{e.forEach(e=>{this.applyResponsiveClasses(e.target)})});document.querySelectorAll(".limbo-component-container-wrapper").forEach(t=>{e.observe(t)})}else window.addEventListener("resize",()=>{document.querySelectorAll(".limbo-component-container-wrapper").forEach(e=>{this.applyResponsiveClasses(e)})})}};function M(e={}){const{useContainerQuery:l=!1,containerElement:r=null}=e,[a,i]=t(()=>{const e=l&&r?A.getContainerWidth(r):"undefined"!=typeof window?window.innerWidth:0,t="undefined"!=typeof window&&(e<=768||/Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)),n="undefined"!=typeof window&&("ontouchstart"in window||navigator.maxTouchPoints>0);return{isMobile:t,isTouch:n,isTablet:"undefined"!=typeof window&&(e>768&&e<=1024&&n),orientation:"undefined"!=typeof window?window.innerHeight>window.innerWidth?"portrait":"landscape":"portrait",viewport:{width:"undefined"!=typeof window?window.innerWidth:0,height:"undefined"!=typeof window?window.innerHeight:0},container:{width:e,supportsContainerQueries:A.supportsContainerQueries}}});n(()=>{if("undefined"==typeof window)return;const e=()=>{const e=window.innerWidth,t=window.innerHeight,n=l&&r?A.getContainerWidth(r):e,a=n<=768||/Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),o="ontouchstart"in window||navigator.maxTouchPoints>0;i({isMobile:a,isTouch:o,isTablet:n>768&&n<=1024&&o,orientation:t>e?"portrait":"landscape",viewport:{width:e,height:t},container:{width:n,supportsContainerQueries:A.supportsContainerQueries}})};let t;const n=()=>{clearTimeout(t),t=setTimeout(e,150)};return window.addEventListener("resize",n),window.addEventListener("orientationchange",()=>{setTimeout(e,100)}),()=>{clearTimeout(t),window.removeEventListener("resize",n),window.removeEventListener("orientationchange",e)}},[l,r]);const o="portrait"===a.orientation,s="landscape"===a.orientation,c=a.isMobile||a.isTablet&&o;return{...a,isPortrait:o,isLandscape:s,isCompactMode:c,isMobileSize:a.viewport.width<=640,isTabletSize:a.viewport.width>640&&a.viewport.width<=1024,isDesktopSize:a.viewport.width>1024,deviceClass:a.isMobile?"mobile":a.isTablet?"tablet":"desktop"}}function P({tabs:e,active:t,onChange:n}){const{isMobile:l,isTouch:r}=M(),a=["limbo-tabs","lb:flex","lb:gap-4","lb:border-b-2","lb:border-brand-blue-200","lb:mb-6",l&&"lb:overflow-x-auto lb:scrollbar-none"].filter(Boolean).join(" "),i=e=>{const t=["limbo-tab","lb:relative","lb:px-6","lb:py-2","lb:font-medium","lb:text-brand-blue-1000","lb:bg-transparent","lb:border-0","lb:border-b-2","lb:cursor-pointer","lb:transition-all","lb:duration-200","lb:hover:text-pink-1000","lb:focus:outline-none","lb:focus-visible:ring-2","lb:focus-visible:ring-brand-blue-400","lb:focus-visible:ring-offset-2"];return e?t.push("lb:border-b-brand-blue-1000","lb:font-semibold","limbo-active"):t.push("lb:border-b-transparent"),l&&t.push("lb:min-w-[120px]","lb:min-h-[44px]","lb:text-base","lb:shrink-0"),r&&t.push("lb:touch-manipulation"),t.join(" ")};/* @__PURE__ */
2
- return s("div",{className:a,role:"tablist","aria-label":"Opciones de navegación",style:l?{WebkitOverflowScrolling:"touch",scrollbarWidth:"none",msOverflowStyle:"none"}:void 0,children:e.map(l=>{const a=t===l.id;return!a&&l.hideNonActive?null:/* @__PURE__ */s("button",{"data-tab-id":l.id,onClick:()=>n(l.id),onKeyDown:t=>((t,l)=>{const r=e.findIndex(e=>e.id===l);let a=r;switch(t.key){case"ArrowLeft":case"ArrowUp":t.preventDefault(),a=r>0?r-1:e.length-1;break;case"ArrowRight":case"ArrowDown":t.preventDefault(),a=r<e.length-1?r+1:0;break;case"Home":t.preventDefault(),a=0;break;case"End":t.preventDefault(),a=e.length-1;break;case"Enter":case" ":return t.preventDefault(),void n(l);default:return}const i=e[a];i&&!i.hideNonActive&&(n(i.id),setTimeout(()=>{const e=document.querySelector(`[data-tab-id="${i.id}"]`);e&&e.focus()},0))})(t,l.id),className:i(a),role:"tab","aria-selected":a,"aria-controls":`tabpanel-${l.id}`,tabIndex:a?0:-1,id:`tab-${l.id}`,style:r?{WebkitTapHighlightColor:"transparent"}:void 0,children:l.label},l.id)})})}const I={DEV:"https://led-dev-limbo-dev.eu.els.local",PROD:"https://limbo.lefebvre.es"};function D(e,t=!1){if(!e)return"";if(e.startsWith("/files/")){return(t?I.PROD:I.DEV)+e}return e}function O(e){return"string"!=typeof e?e:e.replace(/&quot;/g,'"').replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&#39;/g,"'").replace(/&#x27;/g,"'")}function R(e){return!(!e||"string"!=typeof e)&&!e.startsWith("blob:")}function j(e,t={}){if(!e)return"";const{prefer:n="crop",isProd:l=!1}=t,r=O(e);try{const e=JSON.parse(r),t=()=>{if(e.images&&Array.isArray(e.images))for(const t of e.images)if(t&&R(t.url))return t.url;return null},a=e.original?.url,i=t();if("crop"===n){if(i)return D(i,l);if(R(a))return D(a,l)}else{if(R(a))return D(a,l);if(i)return D(i,l)}return R(e.url)?D(e.url,l):""}catch{if("string"==typeof r){if(r.startsWith("blob:"))return"";if(r.startsWith("/files/"))return D(r,l);if(r.startsWith("http")||r.startsWith("/"))return r}}return"string"==typeof e&&(e.startsWith("{")||e.startsWith("["))?"":e}function F(e,t={}){const{isProd:n=!1}=t;if(!e)return{original:null,images:[],url:""};try{const t=JSON.parse(O(e)),l=t.original?{...t.original,url:D(t.original.url,n)}:null,r=(t.images||[]).map(e=>({...e,url:D(e.url,n)}));return{original:l,images:r,url:r[0]?.url||l?.url||D(t.url,n)||""}}catch{return{original:null,images:[],url:D(e,n)}}}const U=[{regex:/^php/i,reason:'El nombre no puede empezar por "php"'},{regex:/\.(php\d?|phtml|phar)$/i,reason:"Extensión no permitida (.php)"},{regex:/\.(asp|aspx|ashx|asmx)$/i,reason:"Extensión no permitida (.asp)"},{regex:/\.(jsp|jspx|jspf)$/i,reason:"Extensión no permitida (.jsp)"},{regex:/\.(exe|bat|cmd|sh|ps1|vbs|cgi)$/i,reason:"Extensión ejecutable no permitida"},{regex:/<script/i,reason:"El nombre contiene código no permitido"},{regex:/\.\./,reason:"El nombre contiene rutas relativas no permitidas"}];function B(e){if(!e||"string"!=typeof e)return{valid:!1,error:"El nombre no puede estar vacío"};const t=e.trim();if(0===t.length)return{valid:!1,error:"El nombre no puede estar vacío"};if(t.length>255)return{valid:!1,error:"El nombre es demasiado largo (máx. 255 caracteres)"};for(const{regex:n,reason:l}of U)if(n.test(t))return{valid:!1,error:l};return{valid:!0}}function W(e,t={}){const{isProd:n=!1}=t;if(!e?.fields)return e;const l=e.fields.map(e=>{if("image"===e.type&&"string"==typeof e.example_value){const t=j(e.example_value,{isProd:n});return{...e,example_value:t||e.example_value}}return e});return{...e,fields:l}}const q=/* @__PURE__ */new Map,V=/* @__PURE__ */new Map,H=18e5,K=async e=>{if(!e)return Promise.reject(new Error("No URL provided"));const t=q.get(e);if(t&&Date.now()-t.timestamp<H)return t.blobUrl;if(V.has(e))return V.get(e);const n=(async()=>{try{let n,l,r=0;for(;r<2;)try{if(n=await fetch(e),!n.ok)throw new Error(`Failed to fetch image: ${n.status}`);break}catch(t){if(l=t,r+=1,r>=2)throw l}const a=await n.blob(),i=URL.createObjectURL(a);return q.set(e,{blobUrl:i,timestamp:Date.now(),size:a.size}),i}finally{V.delete(e)}})();return V.set(e,n),n},G=e=>{const t=q.get(e);return t&&Date.now()-t.timestamp<H?t.blobUrl:e},Q=e=>{const t=q.get(e);return t&&Date.now()-t.timestamp<H},X=async(e,t=4)=>{const n=/* @__PURE__ */new Map,l=e.filter(e=>!Q(e));if(0===l.length)return e.forEach(e=>{n.set(e,G(e))}),n;const r=[];for(let a=0;a<l.length;a+=t)r.push(l.slice(a,a+t));for(const a of r){(await Promise.allSettled(a.map(async e=>({url:e,blobUrl:await K(e)})))).forEach(e=>{"fulfilled"===e.status&&n.set(e.value.url,e.value.blobUrl)})}return n},Y="https://localhost",J="https://limbo.lefebvre.es";let Z={publicKey:null,token:null,authMode:null,tokenEndpoint:null,tokenProvider:null,prod:!1};function ee({prod:e=!1}={}){return e?J:Y}function te(){return{...Z}}async function ne({endpoint:e,method:t="GET",body:n=null,prod:l=!1,basePath:r="",customHeaders:a={},isFormData:i=!1,useJWT:o=!0}){try{const s=l||Z.prod,c=await async function({isFormData:e=!1,useJWT:t=!0,customHeaders:n={}}={}){const l={"Access-Control-Allow-Origin":`${window.location.hostname||"*"}`};e||(l["Content-Type"]="application/json");let r=Z.token;if(t){if("jwt"===Z.authMode&&Z.tokenProvider&&!r)try{console.log("🔑 Calling tokenProvider..."),r=await Z.tokenProvider(),console.log("✅ Token obtained from tokenProvider"),Z.token=r}catch(a){throw console.error("❌ tokenProvider failed:",a),new Error("Failed to obtain token from tokenProvider: "+a.message)}else if("session"===Z.authMode&&!r)try{const e=ee(Z),t=Z.tokenEndpoint||"/auth/token",n=await fetch(`${e}${t}`,{method:"POST",headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":`${window.location.hostname||"*"}`},body:JSON.stringify({public_key:Z.publicKey}),credentials:"include"});if(!n.ok)throw new Error(`Session auth failed: ${n.status}`);r=(await n.json()).token,Z.token=r}catch(a){throw console.error("❌ Session authentication failed:",a),new Error("Failed to authenticate with session. User must be logged in.")}r?l.Authorization=`Bearer ${r}`:console.warn("⚠️ No JWT token available:",{authMode:Z.authMode,hasPublicKey:!!Z.publicKey,hasTokenProvider:!!Z.tokenProvider})}return e&&delete l["Content-Type"],{...l,...n}}({isFormData:i,useJWT:o,customHeaders:a});"GET"===t&&!n&&c["Content-Type"]&&delete c["Content-Type"];const u=await fetch(`${ee({prod:s})}${r}${e}`,{method:t,headers:c,body:n?i?n:JSON.stringify(n):void 0,credentials:"include"});if(204===u.status)return{success:!0,data:null,message:"No content",httpCode:204,timestamp:/* @__PURE__ */(new Date).toISOString()};if(!u.ok){let e=`HTTP ${u.status}: ${u.statusText}`,t=null;try{const n=await u.json();t=n,n.error?e=`${n.error.code}: ${n.error.message}`:n.message&&(e=n.message)}catch{}throw 401===u.status&&t&&("token_expired"===t.error||t.message&&t.message.includes("expired")||t.message&&t.message.includes("caducado")||t.error&&t.error.includes("expired"))&&window.dispatchEvent(new CustomEvent("tokenExpiredError",{detail:{error:{response:{status:401,data:t}}}})),new Error(e)}return u.json()}catch(s){throw new Error(`API Error: ${s.message}`)}}function le(){const e=te();return e?.prod||!1?"https://limbo.lefebvre.es":"https://led-dev-limbo-dev.eu.els.local"}function re(e){if(!e?.id)return null;return`${le()}/api/assets/${e.id}/download`}function ae(e){if(!e)return null;if(e.startsWith("http://")||e.startsWith("https://"))return e;if(e.startsWith("/")){return`${le()}${e}`}return e}function ie(e){if(!e?.success||!e?.data)return{result:null};const t=e.data;return{result:{id:t.id,filename:t.filename||t.original_filename,mime_type:t.mime_type,file_size:t.file_size,width:t.width,height:t.height,upload_date:t.upload_date||t.created_at,processed_date:t.processed_date,processing_status:t.processing_status||t.status,url:ae(t.url)||re(t),url_webp:ae(t.url_webp),url_original:ae(t.url_original),format:t.format,format_original:t.format_original,permanent:t.permanent??!0,expires_at:t.expires_at,metadata:t.metadata||{},asset_type:t.asset_type||null,asset_subtype:t.asset_subtype||null,thumbnail_url:ae(t.thumbnail_url)||null,variants:oe(t.variants||[]),variants_count:t.variants_count||t.variants?.length||0}}}function oe(e){return Array.isArray(e)?e.map(e=>({id:e.id,name:e.name,width:e.width,height:e.height,format:e.format||e.output_format,file_size:e.file_size,crop_params:e.crop_params,url:ae(e.url),permanent:e.permanent??!0,expires_at:e.expires_at,created_at:e.created_at})):[]}function se(e){if(!e?.success||!e?.data)return{result:null};const t=e.data;if(t.id&&t.url&&t.name&&!t.processing_mode&&!t.variants)return console.log("[adaptVariantGenerationFromV2] Detectado formato de /variants/upload"),{result:{id:t.id,name:t.name,width:t.width,height:t.height,format:t.format,file_size:t.file_size,url:t.url,urlSigned:t.url,status:"completed",created_at:t.created_at||/* @__PURE__ */(new Date).toISOString()}};if("sync"===t.processing_mode&&t.variants&&t.variants.length>0){const e=t.variants[0];return{result:{id:e.id||null,name:e.name,width:parseInt(e.size?.split("x")[0])||e.width,height:parseInt(e.size?.split("x")[1])||e.height,format:e.format,file_size:e.file_size,url:e.url,urlSigned:e.url,status:e.status,asset_id:t.asset_id,created_at:e.created_at||/* @__PURE__ */(new Date).toISOString(),all_variants:t.variants}}}return{result:{job_id:t.job_id,asset_id:t.asset_id,variants_requested:t.variants_requested||[],processing_mode:t.processing_mode||"async",estimated_completion:t.estimated_completion,variant_statuses:(t.variant_statuses||t.variants||[]).map(e=>({name:e.name,status:e.status,size:e.expected_size||e.size,format:e.format}))}}}function ce(e){if(e.message&&!e.message.includes("API Error:"))return e;let t=e.message||"Unknown API error";return t.startsWith("API Error: ")&&(t=t.substring(11)),new Error(t)}const ue="/api";async function de(e={}){try{const t={url_expires:"0",...e},n=`/assets?${new URLSearchParams(t).toString()}`;return function(e){if(!e?.success||!Array.isArray(e?.data?.data))return{result:[]};const t={result:e.data.data.map(e=>({id:e.id,filename:e.filename||e.original_filename,mime_type:e.mime_type,file_size:e.file_size,width:e.width,height:e.height,upload_date:e.upload_date||e.created_at,processing_status:e.processing_status||e.status,variants:e.variants_count&&(oe(e.variants)||oe(e.image_variants))||[],url:ae(e.url)||re(e),url_webp:ae(e.url_webp),format:e.format,permanent:e.permanent??!0,expires_at:e.expires_at,folder:e.folder||null,asset_type:e.asset_type||null,asset_subtype:e.asset_subtype||null,thumbnail_url:ae(e.thumbnail_url)||null,metadata:e.metadata||{},variants_count:e.variants_count||0}))};return e.data.pagination&&(t.pagination={page:e.data.pagination.page,limit:e.data.pagination.limit,total:e.data.pagination.total,pages:e.data.pagination.pages}),t}(await ne({endpoint:n,method:"GET",basePath:ue,useJWT:!0}))}catch(t){throw ce(t)}}async function be(e,t=null,n=!1,l=null){try{const r=new FormData;r.append("file",e),t&&r.append("uploaded_by",t),n&&r.append("store_original",n.toString()),l&&r.append("folder",l);return function(e){if(!e?.success||!e?.data)return{result:null};const t=e.data;return{result:{id:t.id,filename:t.filename||t.original_filename,mime_type:t.mime_type,file_size:t.file_size,width:t.width,height:t.height,status:t.status,upload_date:t.created_at,url:ae(t.url),url_webp:ae(t.url_webp),url_original:ae(t.url_original),format:t.format,format_original:t.format_original,permanent:t.permanent??!0,folder:t.folder||null,processing:t.processing||{master_webp:"processing"===t.status?"queued":"completed",variants:"processing"===t.status?"queued":"completed"},asset_type:t.asset_type||null,asset_subtype:t.asset_subtype||null,thumbnail_url:ae(t.thumbnail_url)||null,checksum:t.checksum,storage_path:t.storage_path_base,metadata:t.metadata||{}}}}(await ne({endpoint:"/assets",method:"POST",body:r,basePath:ue,isFormData:!0,useJWT:!0}))}catch(r){throw ce(r)}}async function me(e,t){try{return ie(await ne({endpoint:`/assets/${e}`,method:"PATCH",body:t,basePath:ue,useJWT:!0}))}catch(n){throw ce(n)}}async function he(e,t=0){try{const l=new URLSearchParams({url_expires:t.toString()}),r=await ne({endpoint:`/assets/${e}/variants?${l}`,method:"GET",basePath:ue,useJWT:!0});return n=r,n?.success&&Array.isArray(n?.data?.variants)?{result:n.data.variants.map(e=>({id:e.id,name:e.filename||e.name||`Variante ${e.id}`,filename:e.filename,mime_type:e.mime_type,format:e.format||e.output_format||(e.mime_type?e.mime_type.split("/")[1]:"jpg"),file_size:e.file_size,width:e.width,height:e.height,upload_date:e.upload_date||e.created_at,processing_status:e.processing_status||e.status,url:ae(e.url)||re(e),permanent:e.permanent??!0,expires_at:e.expires_at,metadata:e.metadata||{},crop_data:e.crop_data||{},crop_params:e.crop_params||e.crop_data||{},parent_asset_id:e.parent_asset_id||n.data.asset_id,variant_type:e.variant_type||"crop"}))}:{result:[]}}catch(l){throw ce(l)}var n}function pe(){const[e,n]=t({}),[r,a]=t({}),[i,o]=t({}),s=l(async t=>{if(t&&!r[t]){if(e[t])return e[t];a(e=>({...e,[t]:!0})),o(e=>({...e,[t]:null}));try{const e=await he(t),l=e?.result||[];return n(e=>({...e,[t]:l})),l}catch(l){return console.error("Error loading variants:",l),o(e=>({...e,[t]:l.message})),[]}finally{a(e=>({...e,[t]:!1}))}}},[e,r]),c=l(t=>e[t]||[],[e]),u=l(e=>r[e]||!1,[r]),d=l(e=>i[e]||null,[i]),b=l(e=>{n(t=>{const n={...t};return delete n[e],n}),a(t=>{const n={...t};return delete n[e],n}),o(t=>{const n={...t};return delete n[e],n})},[]),m=l(async e=>(b(e),await s(e)),[b,s]),h=l(async(e,t)=>{try{return await async function(e,t){try{return await ne({endpoint:`/assets/${e}/variants/${t}`,method:"DELETE",basePath:ue,useJWT:!0})}catch(n){throw ce(n)}}(e,t),n(n=>{const l=n[e]||[];return{...n,[e]:l.filter(e=>e.id!==t)}}),{success:!0}}catch(l){return console.error("Error deleting variant:",l),{success:!1,error:l.message}}},[]);return{loadVariants:s,getVariants:c,isLoading:u,getError:d,clearVariants:b,refreshVariants:m,removeVariant:h}}function fe({isOpen:e=!1,onClose:t,title:a="",subtitle:i="",headerActions:o=null,footerHints:u=null,ariaLabel:d="Visor de archivo",children:b}){const m=r(null),h=l(e=>{"Escape"===e.key&&(e.preventDefault(),t?.())},[t]);return n(()=>{if(e)return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,h]),n(()=>(document.body.style.overflow=e?"hidden":"",()=>{document.body.style.overflow=""}),[e]),e?/* @__PURE__ */c("div",{className:"lb:fixed lb:inset-0 lb:bg-black/95 lb:z-[10000] lb:flex lb:flex-col",role:"dialog","aria-modal":"true","aria-label":d,children:[
2
+ return s("div",{className:a,role:"tablist","aria-label":"Opciones de navegación",style:l?{WebkitOverflowScrolling:"touch",scrollbarWidth:"none",msOverflowStyle:"none"}:void 0,children:e.map(l=>{const a=t===l.id;return!a&&l.hideNonActive?null:/* @__PURE__ */s("button",{"data-tab-id":l.id,onClick:()=>n(l.id),onKeyDown:t=>((t,l)=>{const r=e.findIndex(e=>e.id===l);let a=r;switch(t.key){case"ArrowLeft":case"ArrowUp":t.preventDefault(),a=r>0?r-1:e.length-1;break;case"ArrowRight":case"ArrowDown":t.preventDefault(),a=r<e.length-1?r+1:0;break;case"Home":t.preventDefault(),a=0;break;case"End":t.preventDefault(),a=e.length-1;break;case"Enter":case" ":return t.preventDefault(),void n(l);default:return}const i=e[a];i&&!i.hideNonActive&&(n(i.id),setTimeout(()=>{const e=document.querySelector(`[data-tab-id="${i.id}"]`);e&&e.focus()},0))})(t,l.id),className:i(a),role:"tab","aria-selected":a,"aria-controls":`tabpanel-${l.id}`,tabIndex:a?0:-1,id:`tab-${l.id}`,style:r?{WebkitTapHighlightColor:"transparent"}:void 0,children:l.label},l.id)})})}const I={DEV:"https://led-dev-limbo-dev.eu.els.local",PROD:"https://limbo.lefebvre.es"};function D(e,t=!1){if(!e)return"";if(e.startsWith("/files/")){return(t?I.PROD:I.DEV)+e}return e}function O(e){return"string"!=typeof e?e:e.replace(/&quot;/g,'"').replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&#39;/g,"'").replace(/&#x27;/g,"'")}function R(e){return!(!e||"string"!=typeof e)&&!e.startsWith("blob:")}function j(e,t={}){if(!e)return"";const{prefer:n="crop",isProd:l=!1}=t,r=O(e);try{const e=JSON.parse(r),t=()=>{if(e.images&&Array.isArray(e.images))for(const t of e.images)if(t&&R(t.url))return t.url;return null},a=e.original?.url,i=t();if("crop"===n){if(i)return D(i,l);if(R(a))return D(a,l)}else{if(R(a))return D(a,l);if(i)return D(i,l)}return R(e.url)?D(e.url,l):""}catch{if("string"==typeof r){if(r.startsWith("blob:"))return"";if(r.startsWith("/files/"))return D(r,l);if(r.startsWith("http")||r.startsWith("/"))return r}}return"string"==typeof e&&(e.startsWith("{")||e.startsWith("["))?"":e}function F(e,t={}){const{isProd:n=!1}=t;if(!e)return{original:null,images:[],url:""};try{const t=JSON.parse(O(e)),l=t.original?{...t.original,url:D(t.original.url,n)}:null,r=(t.images||[]).map(e=>({...e,url:D(e.url,n)}));return{original:l,images:r,url:r[0]?.url||l?.url||D(t.url,n)||""}}catch{return{original:null,images:[],url:D(e,n)}}}const U=[{regex:/^php/i,reason:'El nombre no puede empezar por "php"'},{regex:/\.(php\d?|phtml|phar)$/i,reason:"Extensión no permitida (.php)"},{regex:/\.(asp|aspx|ashx|asmx)$/i,reason:"Extensión no permitida (.asp)"},{regex:/\.(jsp|jspx|jspf)$/i,reason:"Extensión no permitida (.jsp)"},{regex:/\.(exe|bat|cmd|sh|ps1|vbs|cgi)$/i,reason:"Extensión ejecutable no permitida"},{regex:/<script/i,reason:"El nombre contiene código no permitido"},{regex:/\.\./,reason:"El nombre contiene rutas relativas no permitidas"}];function B(e){if(!e||"string"!=typeof e)return{valid:!1,error:"El nombre no puede estar vacío"};const t=e.trim();if(0===t.length)return{valid:!1,error:"El nombre no puede estar vacío"};if(t.length>255)return{valid:!1,error:"El nombre es demasiado largo (máx. 255 caracteres)"};for(const{regex:n,reason:l}of U)if(n.test(t))return{valid:!1,error:l};return{valid:!0}}function W(e,t={}){const{isProd:n=!1}=t;if(!e?.fields)return e;const l=e.fields.map(e=>{if("image"===e.type&&"string"==typeof e.example_value){const t=j(e.example_value,{isProd:n});return{...e,example_value:t||e.example_value}}return e});return{...e,fields:l}}const q=/* @__PURE__ */new Map,V=/* @__PURE__ */new Map,H=18e5,K=async e=>{if(!e)return Promise.reject(new Error("No URL provided"));const t=q.get(e);if(t&&Date.now()-t.timestamp<H)return t.blobUrl;if(V.has(e))return V.get(e);const n=(async()=>{try{let n,l,r=0;for(;r<2;)try{if(n=await fetch(e),!n.ok)throw new Error(`Failed to fetch image: ${n.status}`);break}catch(t){if(l=t,r+=1,r>=2)throw l}const a=await n.blob(),i=URL.createObjectURL(a);return q.set(e,{blobUrl:i,timestamp:Date.now(),size:a.size}),i}finally{V.delete(e)}})();return V.set(e,n),n},G=e=>{const t=q.get(e);return t&&Date.now()-t.timestamp<H?t.blobUrl:e},Q=e=>{const t=q.get(e);return t&&Date.now()-t.timestamp<H},X=async(e,t=4)=>{const n=/* @__PURE__ */new Map,l=e.filter(e=>!Q(e));if(0===l.length)return e.forEach(e=>{n.set(e,G(e))}),n;const r=[];for(let a=0;a<l.length;a+=t)r.push(l.slice(a,a+t));for(const a of r){(await Promise.allSettled(a.map(async e=>({url:e,blobUrl:await K(e)})))).forEach(e=>{"fulfilled"===e.status&&n.set(e.value.url,e.value.blobUrl)})}return n},Y="https://led-dev-limbo-dev.eu.els.local",J="https://limbo.lefebvre.es";let Z={publicKey:null,token:null,authMode:null,tokenEndpoint:null,tokenProvider:null,prod:!1};function ee({prod:e=!1}={}){return e?J:Y}function te(){return{...Z}}async function ne({endpoint:e,method:t="GET",body:n=null,prod:l=!1,basePath:r="",customHeaders:a={},isFormData:i=!1,useJWT:o=!0}){try{const s=l||Z.prod,c=await async function({isFormData:e=!1,useJWT:t=!0,customHeaders:n={}}={}){const l={"Access-Control-Allow-Origin":`${window.location.hostname||"*"}`};e||(l["Content-Type"]="application/json");let r=Z.token;if(t){if("jwt"===Z.authMode&&Z.tokenProvider&&!r)try{console.log("🔑 Calling tokenProvider..."),r=await Z.tokenProvider(),console.log("✅ Token obtained from tokenProvider"),Z.token=r}catch(a){throw console.error("❌ tokenProvider failed:",a),new Error("Failed to obtain token from tokenProvider: "+a.message)}else if("session"===Z.authMode&&!r)try{const e=ee(Z),t=Z.tokenEndpoint||"/auth/token",n=await fetch(`${e}${t}`,{method:"POST",headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":`${window.location.hostname||"*"}`},body:JSON.stringify({public_key:Z.publicKey}),credentials:"include"});if(!n.ok)throw new Error(`Session auth failed: ${n.status}`);r=(await n.json()).token,Z.token=r}catch(a){throw console.error("❌ Session authentication failed:",a),new Error("Failed to authenticate with session. User must be logged in.")}r?l.Authorization=`Bearer ${r}`:console.warn("⚠️ No JWT token available:",{authMode:Z.authMode,hasPublicKey:!!Z.publicKey,hasTokenProvider:!!Z.tokenProvider})}return e&&delete l["Content-Type"],{...l,...n}}({isFormData:i,useJWT:o,customHeaders:a});"GET"===t&&!n&&c["Content-Type"]&&delete c["Content-Type"];const u=await fetch(`${ee({prod:s})}${r}${e}`,{method:t,headers:c,body:n?i?n:JSON.stringify(n):void 0,credentials:"include"});if(204===u.status)return{success:!0,data:null,message:"No content",httpCode:204,timestamp:/* @__PURE__ */(new Date).toISOString()};if(!u.ok){let e=`HTTP ${u.status}: ${u.statusText}`,t=null;try{const n=await u.json();t=n,n.error?e=`${n.error.code}: ${n.error.message}`:n.message&&(e=n.message)}catch{}throw 401===u.status&&t&&("token_expired"===t.error||t.message&&t.message.includes("expired")||t.message&&t.message.includes("caducado")||t.error&&t.error.includes("expired"))&&window.dispatchEvent(new CustomEvent("tokenExpiredError",{detail:{error:{response:{status:401,data:t}}}})),new Error(e)}return u.json()}catch(s){throw new Error(`API Error: ${s.message}`)}}function le(){const e=te();return e?.prod||!1?"https://limbo.lefebvre.es":"https://led-dev-limbo-dev.eu.els.local"}function re(e){if(!e?.id)return null;return`${le()}/api/assets/${e.id}/download`}function ae(e){if(!e)return null;if(e.startsWith("http://")||e.startsWith("https://"))return e;if(e.startsWith("/")){return`${le()}${e}`}return e}function ie(e){if(!e?.success||!e?.data)return{result:null};const t=e.data;return{result:{id:t.id,filename:t.filename||t.original_filename,mime_type:t.mime_type,file_size:t.file_size,width:t.width,height:t.height,upload_date:t.upload_date||t.created_at,processed_date:t.processed_date,processing_status:t.processing_status||t.status,url:ae(t.url)||re(t),url_webp:ae(t.url_webp),url_original:ae(t.url_original),format:t.format,format_original:t.format_original,permanent:t.permanent??!0,expires_at:t.expires_at,metadata:t.metadata||{},asset_type:t.asset_type||null,asset_subtype:t.asset_subtype||null,thumbnail_url:ae(t.thumbnail_url)||null,variants:oe(t.variants||[]),variants_count:t.variants_count||t.variants?.length||0}}}function oe(e){return Array.isArray(e)?e.map(e=>({id:e.id,name:e.name,width:e.width,height:e.height,format:e.format||e.output_format,file_size:e.file_size,crop_params:e.crop_params,url:ae(e.url),permanent:e.permanent??!0,expires_at:e.expires_at,created_at:e.created_at})):[]}function se(e){if(!e?.success||!e?.data)return{result:null};const t=e.data;if(t.id&&t.url&&t.name&&!t.processing_mode&&!t.variants)return console.log("[adaptVariantGenerationFromV2] Detectado formato de /variants/upload"),{result:{id:t.id,name:t.name,width:t.width,height:t.height,format:t.format,file_size:t.file_size,url:t.url,urlSigned:t.url,status:"completed",created_at:t.created_at||/* @__PURE__ */(new Date).toISOString()}};if("sync"===t.processing_mode&&t.variants&&t.variants.length>0){const e=t.variants[0];return{result:{id:e.id||null,name:e.name,width:parseInt(e.size?.split("x")[0])||e.width,height:parseInt(e.size?.split("x")[1])||e.height,format:e.format,file_size:e.file_size,url:e.url,urlSigned:e.url,status:e.status,asset_id:t.asset_id,created_at:e.created_at||/* @__PURE__ */(new Date).toISOString(),all_variants:t.variants}}}return{result:{job_id:t.job_id,asset_id:t.asset_id,variants_requested:t.variants_requested||[],processing_mode:t.processing_mode||"async",estimated_completion:t.estimated_completion,variant_statuses:(t.variant_statuses||t.variants||[]).map(e=>({name:e.name,status:e.status,size:e.expected_size||e.size,format:e.format}))}}}function ce(e){if(e.message&&!e.message.includes("API Error:"))return e;let t=e.message||"Unknown API error";return t.startsWith("API Error: ")&&(t=t.substring(11)),new Error(t)}const ue="/api";async function de(e={}){try{const t={url_expires:"0",...e},n=`/assets?${new URLSearchParams(t).toString()}`;return function(e){if(!e?.success||!Array.isArray(e?.data?.data))return{result:[]};const t={result:e.data.data.map(e=>({id:e.id,filename:e.filename||e.original_filename,mime_type:e.mime_type,file_size:e.file_size,width:e.width,height:e.height,upload_date:e.upload_date||e.created_at,processing_status:e.processing_status||e.status,variants:e.variants_count&&(oe(e.variants)||oe(e.image_variants))||[],url:ae(e.url)||re(e),url_webp:ae(e.url_webp),format:e.format,permanent:e.permanent??!0,expires_at:e.expires_at,folder:e.folder||null,asset_type:e.asset_type||null,asset_subtype:e.asset_subtype||null,thumbnail_url:ae(e.thumbnail_url)||null,metadata:e.metadata||{},variants_count:e.variants_count||0}))};return e.data.pagination&&(t.pagination={page:e.data.pagination.page,limit:e.data.pagination.limit,total:e.data.pagination.total,pages:e.data.pagination.pages}),t}(await ne({endpoint:n,method:"GET",basePath:ue,useJWT:!0}))}catch(t){throw ce(t)}}async function be(e,t=null,n=!1,l=null){try{const r=new FormData;r.append("file",e),t&&r.append("uploaded_by",t),n&&r.append("store_original",n.toString()),l&&r.append("folder",l);return function(e){if(!e?.success||!e?.data)return{result:null};const t=e.data;return{result:{id:t.id,filename:t.filename||t.original_filename,mime_type:t.mime_type,file_size:t.file_size,width:t.width,height:t.height,status:t.status,upload_date:t.created_at,url:ae(t.url),url_webp:ae(t.url_webp),url_original:ae(t.url_original),format:t.format,format_original:t.format_original,permanent:t.permanent??!0,folder:t.folder||null,processing:t.processing||{master_webp:"processing"===t.status?"queued":"completed",variants:"processing"===t.status?"queued":"completed"},asset_type:t.asset_type||null,asset_subtype:t.asset_subtype||null,thumbnail_url:ae(t.thumbnail_url)||null,checksum:t.checksum,storage_path:t.storage_path_base,metadata:t.metadata||{}}}}(await ne({endpoint:"/assets",method:"POST",body:r,basePath:ue,isFormData:!0,useJWT:!0}))}catch(r){throw ce(r)}}async function me(e,t){try{return ie(await ne({endpoint:`/assets/${e}`,method:"PATCH",body:t,basePath:ue,useJWT:!0}))}catch(n){throw ce(n)}}async function he(e,t=0){try{const l=new URLSearchParams({url_expires:t.toString()}),r=await ne({endpoint:`/assets/${e}/variants?${l}`,method:"GET",basePath:ue,useJWT:!0});return n=r,n?.success&&Array.isArray(n?.data?.variants)?{result:n.data.variants.map(e=>({id:e.id,name:e.filename||e.name||`Variante ${e.id}`,filename:e.filename,mime_type:e.mime_type,format:e.format||e.output_format||(e.mime_type?e.mime_type.split("/")[1]:"jpg"),file_size:e.file_size,width:e.width,height:e.height,upload_date:e.upload_date||e.created_at,processing_status:e.processing_status||e.status,url:ae(e.url)||re(e),permanent:e.permanent??!0,expires_at:e.expires_at,metadata:e.metadata||{},crop_data:e.crop_data||{},crop_params:e.crop_params||e.crop_data||{},parent_asset_id:e.parent_asset_id||n.data.asset_id,variant_type:e.variant_type||"crop"}))}:{result:[]}}catch(l){throw ce(l)}var n}function pe(){const[e,n]=t({}),[r,a]=t({}),[i,o]=t({}),s=l(async t=>{if(t&&!r[t]){if(e[t])return e[t];a(e=>({...e,[t]:!0})),o(e=>({...e,[t]:null}));try{const e=await he(t),l=e?.result||[];return n(e=>({...e,[t]:l})),l}catch(l){return console.error("Error loading variants:",l),o(e=>({...e,[t]:l.message})),[]}finally{a(e=>({...e,[t]:!1}))}}},[e,r]),c=l(t=>e[t]||[],[e]),u=l(e=>r[e]||!1,[r]),d=l(e=>i[e]||null,[i]),b=l(e=>{n(t=>{const n={...t};return delete n[e],n}),a(t=>{const n={...t};return delete n[e],n}),o(t=>{const n={...t};return delete n[e],n})},[]),m=l(async e=>(b(e),await s(e)),[b,s]),h=l(async(e,t)=>{try{return await async function(e,t){try{return await ne({endpoint:`/assets/${e}/variants/${t}`,method:"DELETE",basePath:ue,useJWT:!0})}catch(n){throw ce(n)}}(e,t),n(n=>{const l=n[e]||[];return{...n,[e]:l.filter(e=>e.id!==t)}}),{success:!0}}catch(l){return console.error("Error deleting variant:",l),{success:!1,error:l.message}}},[]);return{loadVariants:s,getVariants:c,isLoading:u,getError:d,clearVariants:b,refreshVariants:m,removeVariant:h}}function fe({isOpen:e=!1,onClose:t,title:a="",subtitle:i="",headerActions:o=null,footerHints:u=null,ariaLabel:d="Visor de archivo",children:b}){const m=r(null),h=l(e=>{"Escape"===e.key&&(e.preventDefault(),t?.())},[t]);return n(()=>{if(e)return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,h]),n(()=>(document.body.style.overflow=e?"hidden":"",()=>{document.body.style.overflow=""}),[e]),e?/* @__PURE__ */c("div",{className:"lb:fixed lb:inset-0 lb:bg-black/95 lb:z-[10000] lb:flex lb:flex-col",role:"dialog","aria-modal":"true","aria-label":d,children:[
3
3
  /* @__PURE__ */c("div",{className:"lb:flex lb:items-center lb:justify-between lb:px-4 lb:py-3 lb:bg-black/50 lb:backdrop-blur-sm",children:[
4
4
  /* @__PURE__ */c("div",{className:"lb:flex-1 lb:min-w-0",children:[a&&/* @__PURE__ */s("h2",{className:"lb:text-white lb:font-medium lb:text-sm lb:truncate",children:a.includes(".")?a.split(".").slice(0,-1).join("."):a}),i&&/* @__PURE__ */s("p",{className:"lb:text-gray-400 lb:text-xs lb:mt-0.5 lb:truncate",children:i})]}),o&&/* @__PURE__ */s("div",{className:"lb:flex lb:items-center lb:gap-2 lb:mx-4",children:o}),
5
5
  /* @__PURE__ */s("button",{type:"button",onClick:t,className:"lb:w-10 lb:h-10 lb:flex lb:items-center lb:justify-center lb:rounded-lg lb:bg-white/10 lb:hover:bg-red-1000/80 lb:text-white lb:transition-colors","aria-label":"Cerrar visor (ESC)",title:"Cerrar (ESC)",children:/* @__PURE__ */s("svg",{className:"lb:w-6 lb:h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:/* @__PURE__ */s("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),
@@ -691,5 +691,5 @@ return c(u,{children:[m.showTabs&&"cropper"!=I&&/* @__PURE__ */s(P,{tabs:fe,acti
691
691
  /* @__PURE__ */s("div",{className:"lb:text-gray-400 lb:mb-4",children:/* @__PURE__ */s("svg",{className:"lb:w-16 lb:h-16 lb:mx-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:/* @__PURE__ */s("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),
692
692
  /* @__PURE__ */s("p",{className:"lb:text-gray-600 lb:mb-4",children:"Selecciona una imagen de la galería para comenzar a recortar."})]}),
693
693
  /* @__PURE__ */s(dl,{}),
694
- /* @__PURE__ */s(rl,{isOpen:q,onClose:V})]})}(()=>{try{const e=sessionStorage.getItem(sl);if(e){const t=JSON.parse(e),n=Date.now();Object.entries(t).forEach(([e,t])=>{t.timestamp&&n-t.timestamp<ol&&il.set(e,t)})}}catch{}})();class ml{constructor(e,t,n,l){this.id=e,this.config=t,this.eventManager=n,this.modalManager=l,this.root=null,this.container=null,this.modal=null,this.mounted=!1,this.destroyed=!1,this.button=null,this._validateConfig(),this._initialize()}_initialize(){"embed"===this.config.mode?this.mount():"button"===this.config.mode&&this._createButton(),this._emitDOMEvent("ready",{instance:this,config:this.config,timestamp:Date.now()})}mount(){if(this.mounted||this.destroyed)return this;if(this.container=this._resolveContainer(),!this.container)return this.eventManager.emit("error",{instanceId:this.id,error:"Container not found"}),this;try{this.root=L.createRoot(this.container),this.root.render(this._renderApp()),this.mounted=!0,this.eventManager.emit("ready",{instance:this})}catch(e){this.eventManager.emit("error",{instanceId:this.id,error:e.message})}return this}unmount(){return this.mounted?(this.root&&(this.root.unmount(),this.root=null),"button"===this.config.mode&&this.button,this.mounted=!1,this):this}open(){return"modal"!==this.config.mode&&"button"!==this.config.mode||(this.modal||this._createModal(),this.modal&&!this.modal.isOpened()&&(this.modal.open(),this.eventManager.emit("modal:open",{instance:this}))),this}close(){return this.modal&&this.modal.isOpened()&&(this.eventManager?.emit("modal:close",{instance:this}),this.modal.close()),this}updateConfig(e){return this.config={...this.config,...e},this.mounted&&this.root.render(this._renderApp()),this.eventManager.emit("config:updated",{instance:this,newConfig:e}),this}destroy(){this.destroyed||(this.unmount(),this.modal&&(this.modal.destroy(),this.modal=null),this.button&&this.button.parentNode&&(this.button.parentNode.removeChild(this.button),this.button=null),this.eventManager.emit("destroy",{instance:this}),this.container=null,this.config=null,this.eventManager=null,this.modalManager=null,this.destroyed=!0)}getId(){return this.id}getMode(){return this.config.mode}isMounted(){return this.mounted}isDestroyed(){return this.destroyed}getContainer(){return this.container}getConfig(){return{...this.config}}isContainerInDOM(){return this.container&&document.contains(this.container)}_createModal(){if(this.modalManager&&"modal"===this.config.mode&&(this.modal=this.modalManager.createModal({title:this.config.title||"Limbo Image Manager",size:this.config.modalSize||"large",onOpen:()=>{const e={instance:this,mode:"modal",timestamp:Date.now()};this._emitDOMEvent("modal:open",e),this.config.callbacks?.onOpen&&this.config.callbacks.onOpen(e)},onClose:()=>{const e={instance:this,mode:"modal",timestamp:Date.now()};this._emitDOMEvent("modal:close",e),this.config.callbacks?.onClose&&this.config.callbacks.onClose(e),this.config.autoDestroy&&this.destroy()},onDestroy:()=>{this.modal=null}}),this.modal)){const e=this.modal.getBodyContainer();this.root=L.createRoot(e),this.root.render(this._renderApp()),this.mounted=!0}}_createButton(){if(this.container||(this.container=this._resolveContainer()),!this.container)return void this.eventManager.emit("error",{instanceId:this.id,error:"Container not found for button mode"});const e=document.createElement("button");e.type="button",e.className="limbo-trigger-button",e.textContent=this.config.buttonText||"Abrir Limbo",e.style.cssText="\n background: #001978;\n color: white;\n border: none;\n padding: 10px 20px;\n border-radius: 6px;\n cursor: pointer;\n font-family: inherit;\n font-size: 14px;\n font-weight: 500;\n transition: all 0.2s ease;\n ",e.addEventListener("mouseenter",()=>{e.style.backgroundColor="#334793",e.style.transform="translateY(-1px)"}),e.addEventListener("mouseleave",()=>{e.style.backgroundColor="#001978",e.style.transform="translateY(0)"}),e.addEventListener("click",()=>{this.open()}),this.container.appendChild(e),this.button=e,this.mounted=!0}_resolveContainer(){const{container:e}=this.config;return e?"string"==typeof e?document.querySelector(e):e instanceof Element?e:null:null}_renderApp(){return e.createElement("div",{id:`limbo-component-container-${this.id}`,className:"limbo-scope limbo-instance limbo-component-container-wrapper lb:h-full lb:w-full lb:py-2 lb:pb-0 lb:bg-white","data-limbo-id":this.id,"data-limbo-mode":this.config.mode,"data-limbo-version":"3.7.0","data-limbo-isolated":"true","aria-label":"Limbo Image Manager",role:"region"},e.createElement(bl,{apiKey:this.config.apiKey||null,publicKey:this.config.publicKey||null,token:this.config.token||null,prod:this.config.prod||!1,url:this.config.url,features:this.config.features,modeUI:this.config.modeUI||"full",ui:this.config.ui,callbacks:this._createCallbacks(),instanceId:this.id,authMode:this.config.authMode||(this.config.publicKey?"session":"manual"),_externalImage:this.config._externalImage||null,cropperConfig:this.config.cropper||null,allowedCategories:this.config.validation?.allowedCategories||null,accept:this.config.validation?.accept||null,returnConfig:this.config.returnConfig||null,folderConfig:this.config.folders||{include:[],exclude:[],includeNoFolder:!0}}))}_createCallbacks(){return{onSelect:e=>{const t=this.config?.callbacks?.onSelect,n=this._createStandardPayload(e,"select");t&&Promise.resolve(t(n)).catch(e=>{console.error("[LimboInstance] Error en onSelect callback:",e)}),this.destroyed||this._emitDOMEvent("select",n)},onUpload:e=>{const t=this.config?.callbacks?.onUpload,n=this._createStandardPayload(e,"upload");t&&Promise.resolve(t(n)).catch(e=>{console.error("[LimboInstance] Error en onUpload callback:",e)}),this.destroyed||this._emitDOMEvent("upload",n)},onError:e=>{const t=this.config?.callbacks?.onError,n={instance:this,error:{message:e.message||"Unknown error",code:e.code||"UNKNOWN",timestamp:Date.now()}};t&&t(n.error),this.destroyed||this._emitDOMEvent("error",n)},onClose:()=>{const e=this.config?.callbacks?.onClose,t={instance:this,timestamp:Date.now()};e&&e(),this.destroyed||this._emitDOMEvent("close",t)},onCropsSaved:e=>{console.log("[LimboInstance] onCropsSaved recibido:",e),console.log("[LimboInstance] this.config?.callbacks:",this.config?.callbacks);const t=this.config?.callbacks?.onCropsSaved;console.log("[LimboInstance] userCallback existe:",!!t);const n={instance:this,eventType:"cropsSaved",timestamp:Date.now(),instanceId:this.id,...e};if(console.log("[LimboInstance] payload.crops:",n.crops),t){console.log("[LimboInstance] Llamando userCallback onCropsSaved");try{t(n),console.log("[LimboInstance] userCallback ejecutado correctamente")}catch(l){console.error("[LimboInstance] Error en userCallback:",l)}}else console.warn("[LimboInstance] ⚠️ userCallback onCropsSaved NO existe");this.destroyed||this._emitDOMEvent("cropsSaved",n)},onCropperComplete:e=>{console.log("[LimboInstance] onCropperComplete recibido:",e);const t=this.config?.callbacks?.onCropperComplete,n={instance:this,eventType:"cropperComplete",timestamp:Date.now(),instanceId:this.id,...e};t&&(console.log("[LimboInstance] Llamando userCallback onCropperComplete"),t(n)),this.destroyed||this._emitDOMEvent("cropperComplete",n)}}}_createStandardPayload(e,t){const n={instance:this,eventType:t,timestamp:Date.now(),instanceId:this.id,mode:this.config?.mode,features:this.config?.features};return e&&(e.assetId||e.id?(n.assetId=e.assetId||e.id,n.variants=e.variants||[],n.master=e.master||{urlSigned:e.url||e.urlSigned,width:e.width,height:e.height,mime:e.mime||e.mimeType},n.fileName=e.fileName||e.name,n.mime=e.mime||e.mimeType,n.width=e.width,n.height=e.height,n.fileBlob=e.fileBlob||e.file,n.metadata={uploadedBy:e.uploadedBy,uploadedAt:e.uploadedAt||e.timestamp,size:e.size,...e.metadata}):Object.assign(n,e)),n}_emitDOMEvent(e,t){if(this.destroyed)return;const n=new CustomEvent(`limbo:${e}`,{detail:t,bubbles:!0,cancelable:!0});(this.getContainer()||document).dispatchEvent(n),this.eventManager?.emit(e,t)}_validateConfig(){const e=te();if(!(this.config.auth?.apiKey||this.config.auth?.publicKey||this.config.auth?.token||this.config.apiKey||this.config.publicKey||this.config.token||this.config.tokenProvider||this.config.auth?.tokenProvider||e.token||e.publicKey||e.tokenProvider))throw new Error(`LimboInstance ${this.id}: Authentication is required. Provide either auth.publicKey (recommended), auth.apiKey (for server-side only), token, or tokenProvider`);if((this.config.auth?.apiKey||this.config.apiKey)&&"undefined"!=typeof window&&console.warn("⚠️ SECURITY WARNING: API Key detected in client-side code.\nThis is a security risk! Use publicKey instead for client applications.\nAPI Keys should only be used in server-side environments."),!["embed","modal","button"].includes(this.config.mode))throw new Error(`LimboInstance ${this.id}: invalid mode ${this.config.mode}`);if("embed"===this.config.mode&&!this.config.container)throw new Error(`LimboInstance ${this.id}: container is required for embed mode`);if("button"===this.config.mode&&!this.config.container)throw new Error(`LimboInstance ${this.id}: container is required for button mode`)}}class hl{constructor(){this.instances=/* @__PURE__ */new Map,this.counter=0}create(e,t,n){const l="limbo-"+ ++this.counter,r=new ml(l,e,t,n);return this.instances.set(l,r),r}get(e){return this.instances.get(e)}getAll(){return Array.from(this.instances.values())}getActive(){return this.getAll().filter(e=>e.isMounted())}destroy(e){const t=this.instances.get(e);return!!t&&(t.destroy(),this.instances.delete(e),!0)}destroyAll(){this.instances.forEach(e=>e.destroy()),this.instances.clear()}cleanupOrphans(){const e=[];return this.instances.forEach((t,n)=>{t.isContainerInDOM()||e.push(n)}),e.forEach(e=>this.destroy(e)),e.length}getStats(){const e=this.getAll();return{total:e.length,active:e.filter(e=>e.isMounted()).length,embed:e.filter(e=>"embed"===e.getMode()).length,modal:e.filter(e=>"modal"===e.getMode()).length,button:e.filter(e=>"button"===e.getMode()).length}}}class pl{constructor(){this.config=null,this.instances=/* @__PURE__ */new Map,this.observer=null,this.initialized=!1}configure(e,t,n){return this.config={selector:e.selector||null,dataset:e.dataset||"data-limbo-input-file",return:e.return||e.returnType||"json",mode:e.mode||"modal",features:e.features||["gallery","upload","cropper"],crop:e.crop||"free",quality:e.quality||.9,format:e.format||"webp",modeUI:e.modeUI||"full",modalSize:e.modalSize||"fullscreen",theme:e.theme||"light",compact:e.compact||!1,maxSize:e.maxSize||"10MB",formats:e.formats||["jpg","jpeg","png","webp"],minWidth:e.minWidth||null,minHeight:e.minHeight||null,maxWidth:e.maxWidth||null,maxHeight:e.maxHeight||null,buttonText:e.buttonText||"Seleccionar archivo",buttonClass:e.buttonClass||"limbo-auto-button",buttonStyle:e.buttonStyle||"primary",showPreview:!1!==e.showPreview,allowMultiple:e.allowMultiple||!1,autoAssign:!1!==e.autoAssign,localCropsOnly:e.localCropsOnly||!1,...e},this.configManager=t,this.eventManager=n,this._initialize(),this}cleanup(){this.observer&&(this.observer.disconnect(),this.observer=null),this.instances.forEach(({input:e,button:t})=>{this._restoreInput(e,t)}),this.instances.clear(),this.config=null,this.initialized=!1}getStats(){return{configured:null!==this.config,totalInputs:this.instances.size,dataset:this.config?.dataset,returnType:this.config?.return}}_initialize(){this.initialized||(this._scanExistingInputs(),this._setupObserver(),this.initialized=!0,this.eventManager.emit("autoInputs:initialized",{config:this.config,inputsFound:this.instances.size}))}_scanExistingInputs(){const e=this.config.selector||`input[${this.config.dataset}]`;document.querySelectorAll(e).forEach(e=>this._processInput(e))}_processInput(e){const t=this._getInputId(e);if(this.instances.has(t))return;if(!this._validateInput(e))return;const n=this._createButton(e);this._hideInput(e),this._insertButton(e,n),this.instances.set(t,{input:e,button:n,config:this._getInputConfig(e)}),this.eventManager.emit("autoInputs:processed",{inputId:t,input:e,button:n})}_createButton(e){const t=document.createElement("button"),n=this._getInputConfig(e);t.type="button",t.textContent=n.buttonText||this.config.buttonText;const l=[this.config.buttonClass];return n.buttonClass&&n.buttonClass!==this.config.buttonClass&&l.push(n.buttonClass),t.className=l.join(" "),this._styleButton(t,n),this._attachButtonEvents(t,e),t.setAttribute("aria-label",n.buttonText||this.config.buttonText),t.setAttribute("data-limbo-trigger","true"),t.setAttribute("data-limbo-input-id",n.inputId),n.disabled&&(t.disabled=!0),t}_styleButton(e,t){const n=t.buttonStyle||this.config.buttonStyle,l=t.theme||this.config.theme,r=t.compact||this.config.compact,a={border:"none",borderRadius:"8px",cursor:"pointer",fontFamily:"inherit",fontSize:r?"12px":"14px",fontWeight:"500",transition:"all 0.2s ease",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"8px",padding:r?"6px 12px":"8px 16px",textDecoration:"none",userSelect:"none"},i={primary:{backgroundColor:"dark"===l?"#3b82f6":"#001978",color:"white",hoverBg:"dark"===l?"#2563eb":"#334793"},secondary:{backgroundColor:"dark"===l?"#374151":"#f3f4f6",color:"dark"===l?"#f9fafb":"#374151",border:"1px solid "+("dark"===l?"#4b5563":"#d1d5db"),hoverBg:"dark"===l?"#4b5563":"#e5e7eb"},outline:{backgroundColor:"transparent",color:"dark"===l?"#3b82f6":"#001978",border:"2px solid "+("dark"===l?"#3b82f6":"#001978"),hoverBg:"dark"===l?"#3b82f6":"#001978",hoverColor:"white"},ghost:{backgroundColor:"transparent",color:"dark"===l?"#f9fafb":"#374151",hoverBg:"dark"===l?"#374151":"#f3f4f6"}},o=i[n]||i.primary;Object.assign(e.style,{...a,...o});const s=o.backgroundColor,c=o.color;e.addEventListener("mouseenter",()=>{e.style.backgroundColor=o.hoverBg||o.backgroundColor,o.hoverColor&&(e.style.color=o.hoverColor),e.style.transform="translateY(-1px)",e.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"}),e.addEventListener("mouseleave",()=>{e.style.backgroundColor=s,e.style.color=c,e.style.transform="translateY(0)",e.style.boxShadow="none"}),t.disabled&&(e.style.opacity="0.5",e.style.cursor="not-allowed")}_attachButtonEvents(e,t){e.addEventListener("click",e=>{e.preventDefault(),this._handleButtonClick(t)})}_handleButtonClick(e){const t=this._getInputConfig(e),n=this._createModalConfig(t);this.eventManager.emit("autoInputs:modalRequest",{input:e,config:n,callback:async t=>await this._handleImageSelection(e,t)})}async _handleImageSelection(e,t){const n=this._getInputConfig(e);let l=t;try{if(!t.original&&!t.images&&(t.id||t.assetId)){console.log("[AutoInputManager] 🔗 Selección directa detectada, obteniendo URL permanente...");const e=t.id||t.assetId;try{const n=await async function(e,t=!0,n=!0,l=0){try{const r=new URLSearchParams({include_variants:t.toString(),include_metadata:n.toString(),url_expires:l.toString()});return ie(await ne({endpoint:`/assets/${e}?${r}`,method:"GET",basePath:ue,useJWT:!0}))}catch(r){throw ce(r)}}(e,!1,!1,!0);n?.result?.url?(console.log("[AutoInputManager] ✅ URL permanente obtenida:",n.result.url),l={original:{url:n.result.url,width:n.result.width||t.width,height:n.result.height||t.height,assetId:e},images:[]}):(console.warn("[AutoInputManager] ⚠️ No se pudo obtener URL permanente, usando URL temporal"),l={original:{url:t.url||t.path,width:t.width,height:t.height,assetId:e},images:[]})}catch(r){console.error("[AutoInputManager] Error obteniendo URL permanente:",r),l={original:{url:t.url||t.path,width:t.width,height:t.height,assetId:e},images:[]}}}const a=await this._formatImageData(l,n);console.log("[AutoInputManager] Valor formateado:",a),console.log("[AutoInputManager] Tipo de valor:",typeof a),!1!==n.autoAssign&&(e.value=a,console.log("[AutoInputManager] Valor asignado al input:",e.value)),this._updateButtonFeedback(e,l),e.dispatchEvent(new Event("change",{bubbles:!0})),e.dispatchEvent(new CustomEvent("limbo:resultReady",{detail:{imageData:l,input:e,value:a,config:n,assignment:{format:n.return,smartAssign:!1!==n.smartAssign,autoAssign:!1!==n.autoAssign},legacy:{imageData:l,formatted:this._createFormattedResult(l,n)}},bubbles:!0})),e.dispatchEvent(new CustomEvent("limbo:imageSelected",{detail:{imageData:l,input:e,value:a,config:n,formatted:this._createFormattedResult(l,n)},bubbles:!0})),this.eventManager.emit("autoInputs:imageSelected",{input:e,imageData:l,value:a,config:n})}catch(a){console.error("Error handling image selection:",a),e.dispatchEvent(new CustomEvent("limbo:error",{detail:{error:a.message,input:e,imageData:l,config:n},bubbles:!0})),this._handleImageSelectionLegacy(e,t)}}_updateButtonFeedback(e,t){const n=this._getInputId(e),l=this.instances.get(n);if(!l||!l.button)return;const r=l.button,a=r.nextElementSibling;a&&a.classList.contains("limbo-button-feedback")&&a.remove();const i=document.createElement("span");i.className="limbo-button-feedback",i.style.cssText="\n display: inline-flex;\n align-items: center;\n gap: 6px;\n margin-left: 8px;\n padding: 4px 8px;\n background: #10b981;\n color: white;\n border-radius: 6px;\n font-size: 12px;\n font-weight: 500;\n animation: limbo-fade-in 0.3s ease-out;\n ";const o=t.images&&t.images.length>0,s=o?t.images.length:0;i.innerHTML=o?`\n <svg width="14" height="14" viewBox="0 0 20 20" fill="currentColor">\n <path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"/>\n </svg>\n <span>${s} recorte${1!==s?"s":""} configurado${1!==s?"s":""}</span>\n `:'\n <svg width="14" height="14" viewBox="0 0 20 20" fill="currentColor">\n <path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"/>\n </svg>\n <span>Archivo seleccionado</span>\n ',r.parentNode.insertBefore(i,r.nextSibling);let c=r.parentNode.querySelector(".limbo-powered-by");c||(c=document.createElement("div"),c.className="limbo-powered-by",c.innerHTML='<span style="display:block;margin-top:2px;font-size:10px;color:#aaa;text-align:left;font-family:inherit;opacity:0.7;">Powered by <b>Limbo</b></span>',r.parentNode.insertBefore(c,i.nextSibling)),r.style.backgroundColor="#10b981",r.textContent="Cambiar archivo"}async _handleImageSelectionLegacy(e,t){const n=this._getInputConfig(e),l=await this._formatImageData(t,n);!1!==n.autoAssign&&(e.value=l),e.dispatchEvent(new Event("change",{bubbles:!0})),e.dispatchEvent(new CustomEvent("limbo:imageSelected",{detail:{imageData:t,input:e,value:l,config:n,formatted:this._createFormattedResult(t,n)},bubbles:!0})),this.eventManager.emit("autoInputs:imageSelected",{input:e,imageData:t,value:l,config:n})}_createFormattedResult(e,t){return{url:e.url||e.path||"",base64:e.base64||e.dataUrl||"",assetId:e.assetId||e.id||"",fileName:e.fileName||e.filename||"",object:{url:e.url||e.path,assetId:e.assetId||e.id,fileName:e.fileName||e.filename,mime:e.mime||e.mime_type,width:e.width,height:e.height,size:e.size||e.file_size,created:e.created_at||e.created,metadata:e.metadata||{}},json:JSON.stringify({url:e.url||e.path,assetId:e.assetId||e.id,fileName:e.fileName||e.filename,mime:e.mime||e.mime_type,width:e.width,height:e.height,size:e.size||e.file_size}),metadata:{width:e.width,height:e.height,size:e.size||e.file_size,format:e.format||e.mime_type,quality:t.quality||this.config.quality,aspectRatio:e.width&&e.height?e.width/e.height:null}}}async _formatImageData(e,t=null){const n=(t||{}).return||this.config.return||"json",l=void 0!==e.original;switch(n){case"url":return l?e.images?.[0]?.url||e.original?.url||"":e.url||e.path||"";case"base64":return e.base64||e.dataUrl||"";case"assetId":return l?e.original?.assetId||"":e.assetId||e.id||"";case"fileName":return e.fileName||e.filename||"";default:try{if(l){const t={original:e.original?{url:e.original.url||e.original.urlSigned,width:e.original.width,height:e.original.height,assetId:e.original.assetId||e.original.id}:null,images:Array.isArray(e.images)?e.images.map(e=>{const t={url:e.url||e.urlSigned,width:e.width,height:e.height,name:e.name||e.filename||e.label};return e.cropState&&(t.cropState={selectorState:e.cropState.selectorState||null,imageTransform:e.cropState.imageTransform||null,flipState:e.cropState.flipState||null}),t}):[]};console.log("[AutoInputManager] Datos limpios para JSON:",t);const n=JSON.stringify(t);return console.log("[AutoInputManager] JSON generado:",n),n}const t={original:{url:e.url||e.path,width:e.width,height:e.height,assetId:e.assetId||e.id}};return console.log("[AutoInputManager] Datos legacy para JSON:",t),JSON.stringify(t)}catch(r){return console.error("[AutoInputManager] Error al serializar JSON:",r),console.error("[AutoInputManager] imageData problemático:",e),"{}"}}}_createModalConfig(e){return{mode:e.mode||this.config.mode||"modal",modeUI:e.modeUI||this.config.modeUI||"full",features:e.features||this.config.features,modalSize:e.modalSize||this.config.modalSize||"fullscreen",title:e.description||this.config.title||"Seleccionar archivo",cropper:this._getCropperConfig(e),ui:{showActions:this._getUIActions(e),hideActions:[],showTabs:this._shouldShowTabs(e),theme:e.theme||this.config.theme,compact:e.compact||this.config.compact,showPreview:void 0!==e.showPreview?e.showPreview:this.config.showPreview},validation:{accept:e.accept||null,maxSize:e.maxSize||this.config.maxSize,formats:e.formats||this.config.formats,minWidth:e.minWidth||this.config.minWidth,minHeight:e.minHeight||this.config.minHeight,maxWidth:e.maxWidth||this.config.maxWidth,maxHeight:e.maxHeight||this.config.maxHeight,required:e.required||!1},behavior:{allowMultiple:e.allowMultiple||this.config.allowMultiple,closeOnSelect:!0,autoAssign:void 0!==e.autoAssign?e.autoAssign:this.config.autoAssign,allowSelectNew:!1!==e.allowSelectNew},initialImageUrl:e.initialImageUrl||null,existingCrops:e.existingCrops||null,existingData:e.existingData||null,returnConfig:{format:e.return||this.config.return,quality:e.quality||this.config.quality,outputFormat:e.format||this.config.format},inputMeta:{inputId:e.inputId,inputName:e.inputName,inputType:e.inputType,placeholder:e.placeholder}}}_getCropperConfig(e){const t=e.crop||this.config.crop,n={quality:e.quality||this.config.quality,format:e.format||this.config.format,mandatoryCrops:e.mandatoryCrops||[],allowAdditionalCrops:!1!==e.allowAdditionalCrops,maxCrops:e.maxCrops||null,localCropsOnly:e.localCropsOnly??this.config.localCropsOnly??!1,existingCrops:e.existingCrops||null};if(e.mandatoryCrops&&e.mandatoryCrops.length>0)return{...n,aspectRatio:null};if(!t||"none"===t||"false"===t)return null;if("free"===t)return{...n,aspectRatio:null};const l={"1:1":1,"16:9":16/9,"4:3":4/3,"3:2":1.5,"2:1":2,square:1,landscape:16/9,portrait:3/4};if(l[t])return{...n,aspectRatio:l[t],minCropBoxWidth:e.minWidth||this.config.minWidth,minCropBoxHeight:e.minHeight||this.config.minHeight};if("string"==typeof t&&t.includes(":")){const[e,l]=t.split(":").map(Number);if(!isNaN(e)&&!isNaN(l)&&0!==l)return{...n,aspectRatio:e/l}}const r=parseFloat(t);return!isNaN(r)&&r>0?{...n,aspectRatio:r}:"object"==typeof t?{...n,...t}:null}_shouldShowTabs(e){const t=e.modeUI||this.config.modeUI||"full",n=e.features||this.config.features;return!["gallery-only","upload-only","crop-only","ia-only"].includes(t)&&(n&&n.length>1)}_getUIActions(e){const t=e.modeUI||this.config.modeUI||"full",n=e.features||this.config.features;let l=[];switch(t){case"gallery-only":case"upload-only":l=["select"];break;case"crop-only":l=["select","crop"];break;default:l=["select"],n.includes("cropper")&&l.push("crop"),n.includes("gallery")&&(l.push("download","copy","rename"),this.config.allowDelete&&l.push("delete"))}return l}_getInputId(e){if(e.id)return e.id;if(e.name)return e.name;let t=e.getAttribute("data-limbo-uid");return t||(t=`limbo-auto-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,e.setAttribute("data-limbo-uid",t)),t}_validateInput(e){return e instanceof HTMLInputElement}_getInputConfig(e){const t=e=>e?e.split(",").map(e=>e.trim()):null,n=e=>{if(!e)return null;const t=e.match(/^(\d+(?:\.\d+)?)(MB|KB|B)?$/i);if(!t)return null;const n=parseFloat(t[1]);switch((t[2]||"B").toUpperCase()){case"MB":return 1024*n*1024;case"KB":return 1024*n;default:return n}},l=(e,t=!1)=>null===e?t:"true"===e||"1"===e||""===e,r=e=>e?parseFloat(e):null,a=e=>{if(!e)return null;try{return JSON.parse(e)}catch(t){return console.warn("[Limbo AutoInputManager] Error parsing JSON attribute:",t),null}},i=a(e.dataset.mandatorycrops)||a(e.dataset.mandatoryCrops)||a(e.getAttribute("data-mandatory-crops"))||a(e.getAttribute("data-limbo-mandatory-crops"))||null;return{return:e.dataset.returntype||e.getAttribute("data-limbo-return")||this.config.return,mode:e.dataset.mode||e.getAttribute("data-limbo-mode")||this.config.mode,features:t(e.dataset.features)||t(e.getAttribute("data-limbo-features"))||this.config.features,crop:e.dataset.crop||e.getAttribute("data-limbo-crop")||this.config.crop,quality:r(e.dataset.quality)||r(e.getAttribute("data-limbo-quality"))||this.config.quality,format:e.dataset.format||e.getAttribute("data-limbo-format")||this.config.format,modeUI:e.dataset.modeui||e.dataset.modeUI||e.getAttribute("data-limbo-mode-ui")||this.config.modeUI,modalSize:e.dataset.modalsize||e.getAttribute("data-limbo-modal-size")||this.config.modalSize,theme:e.dataset.theme||e.getAttribute("data-limbo-theme")||this.config.theme,compact:l(e.dataset.compact,null)??l(e.getAttribute("data-limbo-compact"),this.config.compact),maxSize:n(e.getAttribute("data-limbo-max-size"))||n(this.config.maxSize),formats:t(e.getAttribute("data-limbo-formats"))||this.config.formats,minWidth:r(e.getAttribute("data-limbo-min-width"))||this.config.minWidth,minHeight:r(e.getAttribute("data-limbo-min-height"))||this.config.minHeight,maxWidth:r(e.getAttribute("data-limbo-max-width"))||this.config.maxWidth,maxHeight:r(e.getAttribute("data-limbo-max-height"))||this.config.maxHeight,buttonText:e.dataset.buttontext||e.getAttribute("data-limbo-button-text")||this.config.buttonText,buttonStyle:e.dataset.buttonstyle||e.getAttribute("data-limbo-button-style")||this.config.buttonStyle,buttonClass:e.dataset.buttonclass||e.getAttribute("data-limbo-button-class")||this.config.buttonClass,showPreview:l(e.getAttribute("data-limbo-show-preview"),this.config.showPreview),allowMultiple:l(e.getAttribute("data-limbo-allow-multiple"),this.config.allowMultiple),autoAssign:l(e.getAttribute("data-limbo-auto-assign"),this.config.autoAssign),placeholder:e.getAttribute("data-limbo-placeholder"),description:e.getAttribute("data-limbo-description"),required:l(e.getAttribute("data-limbo-required"),!1),disabled:l(e.getAttribute("data-limbo-disabled"),!1),inputId:this._getInputId(e),inputName:e.name,inputType:e.type,mandatoryCrops:i,allowAdditionalCrops:l(e.dataset.allowadditionalcrops,null)??l(e.getAttribute("data-limbo-allow-additional-crops"),!0),maxCrops:r(e.dataset.maxcrops)||r(e.getAttribute("data-limbo-max-crops"))||null,accept:e.dataset.accept||e.getAttribute("data-limbo-accept")||null,allowSelectNew:l(e.dataset.allowselectnew,null)??l(e.getAttribute("data-limbo-allow-select-new"),!0),...this._parseExistingInputValue(e.value)}}_parseExistingInputValue(e){if(!e||""===e.trim())return{initialImageUrl:null,existingCrops:null,existingData:null};try{const t=JSON.parse(e);return t.original&&t.original.url?(console.log("[AutoInputManager] Valor existente parseado:",t),{initialImageUrl:t.original.url,existingCrops:t.images||null,existingData:t}):t.url?{initialImageUrl:t.url,existingCrops:null,existingData:t}:{initialImageUrl:null,existingCrops:null,existingData:t}}catch(t){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?{initialImageUrl:e,existingCrops:null,existingData:null}:{initialImageUrl:null,existingCrops:null,existingData:null}}}_generateInputId(){return`limbo-auto-input-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}_hideInput(e){e.style.display="none"}_insertButton(e,t){e.parentNode.insertBefore(t,e.nextSibling)}_restoreInput(e,t){e.style.display="",t&&t.parentNode&&t.parentNode.removeChild(t)}_setupObserver(){this.observer=new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&this._scanNodeForInputs(e)})})}),this.observer.observe(document.body,{childList:!0,subtree:!0})}_scanNodeForInputs(e){const t=this.config.selector||`input[${this.config.dataset}]`;e.matches&&e.matches(t)&&this._processInput(e);const n=e.querySelectorAll&&e.querySelectorAll(t);n&&n.forEach(e=>this._processInput(e))}}class fl{constructor(){this.listeners=/* @__PURE__ */new Map}emit(e,t={}){this._emitDOMEvent(e,t),this._executeListeners(e,t)}on(e,t){return this.listeners.has(e)||this.listeners.set(e,[]),this.listeners.get(e).push(t),()=>this.off(e,t)}off(e,t){const n=this.listeners.get(e);if(n){const e=n.indexOf(t);e>-1&&n.splice(e,1)}}cleanup(){this.listeners.clear()}_emitDOMEvent(e,t){const n=new CustomEvent(`limbo:${e}`,{detail:{...t,timestamp:Date.now()},bubbles:!0,cancelable:!0});(t.instance?.getContainer()||document).dispatchEvent(n)}_executeListeners(e,t){const n=this.listeners.get(e);n&&n.forEach(n=>{try{n(t)}catch(l){console.error(`Error executing listener for ${e}:`,l)}})}getStats(){const e={};return this.listeners.forEach((t,n)=>{e[n]=t.length}),e}}class gl{constructor(){this.activeModals=/* @__PURE__ */new Set,this.zIndexBase=1e4,this.focusableSelectors=["button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"]):not([disabled])',"a[href]"].join(", "),this.initialized=!1,this._initGlobalListeners()}createModal(e){const t=new vl(this._generateModalId(),e,this);return this.activeModals.add(t),t}closeModal(e){const t=this._findModal(e);return!!t&&(t.close(),!0)}closeAllModals(){this.activeModals.forEach(e=>e.close()),this.activeModals.clear()}getActiveModal(){return Array.from(this.activeModals).pop()||null}getStats(){return{active:this.activeModals.size,nextZIndex:this._getNextZIndex()}}_generateModalId(){return`limbo-modal-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}_findModal(e){return Array.from(this.activeModals).find(t=>t.getId()===e)}_getNextZIndex(){return this.zIndexBase+10*this.activeModals.size}_removeModal(e){this.activeModals.delete(e),window.limboCore?.events&&window.limboCore.events.emit("modal:closed",{modalId:e.getId(),remainingModals:this.activeModals.size})}_handleGlobalKeydown(e){const t=this.getActiveModal();t&&("Escape"===e.key&&(e.preventDefault(),t.close()),"Tab"===e.key&&this._handleTabTrap(e,t))}_handleTabTrap(e,t){const n=t.getFocusableElements();if(0===n.length)return;const l=n[0],r=n[n.length-1];e.shiftKey?document.activeElement===l&&(e.preventDefault(),r.focus()):document.activeElement===r&&(e.preventDefault(),l.focus())}_initGlobalListeners(){this.initialized||(this.globalKeydownHandler=e=>this._handleGlobalKeydown(e),document.addEventListener("keydown",this.globalKeydownHandler),this.initialized=!0)}destroy(){this.closeAllModals(),this.initialized&&this.globalKeydownHandler&&(document.removeEventListener("keydown",this.globalKeydownHandler),this.initialized=!1,this.globalKeydownHandler=null)}}class vl{constructor(e,t,n){this.id=e,this.config={title:t.title||"Limbo",content:t.content||null,showCloseButton:!1!==t.showCloseButton,backdrop:!1!==t.backdrop,keyboard:!1!==t.keyboard,focus:!1!==t.focus,animation:!1!==t.animation,size:t.size||"large",onOpen:t.onOpen||null,onClose:t.onClose||null,onDestroy:t.onDestroy||null,...t},this.manager=n,this.element=null,this.backdrop=null,this.isOpen=!1,this.previousFocus=null,this._create()}_create(){this._createBackdrop(),this._createModal(),this._attachEvents()}_createBackdrop(){this.config.backdrop&&(this.backdrop=document.createElement("div"),this.backdrop.className="limbo-modal-backdrop",this.backdrop.style.cssText=`\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0.5);\n z-index: ${this.manager._getNextZIndex()};\n opacity: 0;\n transition: opacity 0.3s ease;\n `,this.backdrop.addEventListener("click",e=>{e.target===this.backdrop&&this.close()}))}_createModal(){this.element=document.createElement("div"),this.element.className=`limbo-scope limbo-modal limbo-modal--${this.config.size}`,this.element.id=this.id,this.element.role="dialog",this.element.setAttribute("aria-modal","true"),this.element.setAttribute("aria-labelledby",`${this.id}-title`),this.element.tabIndex=-1;const e=window.innerWidth<=768||/Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),t={small:e?"width: 100%; height: 100%;":"max-width: 500px; min-height: 400px;",medium:e?"width: 100%; height: 100%;":"max-width: 800px; min-height: 500px;",large:e?"width: 100%; height: 100%;":"max-width: 1400px; min-height: 700px;",xlarge:e?"width: 100%; height: 100%;":"max-width: 95dvw; min-height: 85vh;",fullscreen:"width: 100%; height: 100%; max-width: 100%; max-height: 100%; border-radius: 0;"},n="fullscreen"===this.config.size,l=e||n?`\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n transform: ${e?"translateY(100%)":"scale(0.95)"};\n width: 100%;\n height: 100%;\n max-width: none;\n max-height: none;\n border-radius: 0;\n background: white;\n z-index: ${this.manager._getNextZIndex()+1};\n opacity: ${e?"1":"0"};\n transition: ${e?"transform":"all"} 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n overflow: hidden;\n display: flex;\n flex-direction: column;\n padding-top: env(safe-area-inset-top);\n padding-left: env(safe-area-inset-left);\n padding-right: env(safe-area-inset-right);\n padding-bottom: env(safe-area-inset-bottom);\n `:`\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%) scale(0.8);\n ${t[this.config.size]}\n width: 90%;\n max-height: 90vh;\n background: white;\n border-radius: 16px;\n box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);\n z-index: ${this.manager._getNextZIndex()+1};\n opacity: 0;\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n overflow: hidden;\n display: flex;\n flex-direction: column;\n `;this.element.style.cssText=l,this._createHeader(),this._createBody(),document.body.appendChild(this.backdrop),document.body.appendChild(this.element)}_createHeader(){const e=document.createElement("div");e.className="limbo-modal-header";const t=window.innerWidth<=768||/Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);e.style.cssText=`\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: ${t?"16px 20px":"20px 24px"};\n border-bottom: 1px solid #e9ecef;\n background: #f8f9fa;\n ${t?"position: sticky; top: 0; z-index: 10;":""}\n min-height: ${t?"60px":"auto"};\n `;const n=document.createElement("h2");if(n.id=`${this.id}-title`,n.className="limbo-modal-title",n.textContent=this.config.title,n.style.cssText="\n margin: 0;\n font-size: 18px;\n font-weight: 600;\n color: #001978;\n flex: 1;\n margin-right: 16px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n ",e.appendChild(n),this.config.showCloseButton){const n=document.createElement("button");n.type="button",n.className="limbo-modal-close",n.innerHTML="✕",n.setAttribute("aria-label","Cerrar modal"),n.style.cssText=`\n background: none;\n border: none;\n font-size: ${t?"28px":"24px"};\n color: #6c757d;\n cursor: pointer;\n padding: ${t?"8px":"4px"};\n border-radius: 4px;\n transition: all 0.2s ease;\n min-width: ${t?"44px":"auto"};\n min-height: ${t?"44px":"auto"};\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n `,n.addEventListener("mouseenter",()=>{n.style.backgroundColor="#f8f9fa",n.style.color="#001978"}),n.addEventListener("mouseleave",()=>{n.style.backgroundColor="transparent",n.style.color="#6c757d"}),n.addEventListener("click",()=>this.close()),e.appendChild(n)}this.element.appendChild(e)}_createBody(){const e=window.innerWidth<=768||/Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),t=document.createElement("div");t.className="limbo-modal-body",t.id=`${this.id}-body`,t.style.cssText=`\n flex: 1;\n overflow-y: auto;\n padding: 0;\n -webkit-overflow-scrolling: touch;\n ${e?"height: 100%; overscroll-behavior: contain;":""}\n `,this.config.content&&("string"==typeof this.config.content?t.innerHTML=this.config.content:this.config.content instanceof Element&&t.appendChild(this.config.content)),this.element.appendChild(t)}_attachEvents(){this._originalBodyOverflow=document.body.style.overflow}open(){if(this.isOpen)return this;window.limbo&&window.limbo.core&&window.limbo.core.keyboard?(window.limbo.core.keyboard.pushFocus(document.activeElement),window.limbo.core.keyboard.setActiveModal(this.element)):this.previousFocus=document.activeElement,document.body.style.overflow="hidden";const e=window.innerWidth<=768||/Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),t="fullscreen"===this.config.size;return requestAnimationFrame(()=>{this.backdrop&&(this.backdrop.style.opacity="1"),this.element.style.opacity="1",this.element.style.transform=e?"translateY(0%)":t?"scale(1)":"translate(-50%, -50%) scale(1)"}),this.isOpen=!0,this.config.focus&&setTimeout(()=>{if(window.limbo&&window.limbo.core&&window.limbo.core.keyboard)window.limbo.core.keyboard.focusFirst(this.element);else{const e=this.getFocusableElements()[0];e&&e.focus()}},300),this.config.onOpen&&this.config.onOpen(this),this}close(){if(!this.isOpen)return this;const e=window.innerWidth<=768||/Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),t="fullscreen"===this.config.size;return this.backdrop&&(this.backdrop.style.opacity="0"),this.element.style.opacity="0",this.element.style.transform=e?"translateY(100%)":t?"scale(0.95)":"translate(-50%, -50%) scale(0.8)",setTimeout(()=>{this._cleanup()},300),this.isOpen=!1,window.limbo&&window.limbo.core&&window.limbo.core.keyboard&&(window.limbo.core.keyboard.setActiveModal(null),window.limbo.core.keyboard.releaseFocus()),this.config.onClose&&this.config.onClose(this),this}destroy(){this.close(),this.manager._removeModal(this),this.config.onDestroy&&this.config.onDestroy(this)}getBodyContainer(){return this.element.querySelector(".limbo-modal-body")}getFocusableElements(){return Array.from(this.element.querySelectorAll(this.manager.focusableSelectors))}getId(){return this.id}isOpened(){return this.isOpen}getConfig(){return{...this.config}}_cleanup(){document.body.style.overflow=this._originalBodyOverflow||"",this.previousFocus&&"function"==typeof this.previousFocus.focus&&this.previousFocus.focus(),this.backdrop&&this.backdrop.parentNode&&this.backdrop.parentNode.removeChild(this.backdrop),this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}}class yl{constructor(){this.currentTheme=null,this.customThemes=/* @__PURE__ */new Map,this.config=this._getDefaultConfig(),this.isInitialized=!1,this.isCompactMode=!1,this.compactBreakpoint=null,this.compactObserver=null,this.mediaQueryObserver=null,this.mutationObserver=null,this.storageListener=null,this.themeCache=/* @__PURE__ */new Map,this.appliedStyles=/* @__PURE__ */new Set,this.changeCallbacks=/* @__PURE__ */new Set}_getDefaultConfig(){return{theme:{auto:!0,storage:!0,inherit:!0,smooth:!0,detectSystem:!0},compact:{enabled:!1,auto:!0,breakpoint:768,forceOnMobile:!0,persistPreference:!0},presets:{light:{name:"light",displayName:"Claro",variables:{"--limbo-primary":"#3b82f6","--limbo-primary-hover":"#2563eb","--limbo-primary-light":"#dbeafe","--limbo-primary-dark":"#1e40af","--limbo-bg-primary":"#ffffff","--limbo-bg-secondary":"#f8fafc","--limbo-bg-tertiary":"#f1f5f9","--limbo-bg-overlay":"rgba(0, 0, 0, 0.5)","--limbo-bg-card":"#ffffff","--limbo-bg-input":"#ffffff","--limbo-text-primary":"#0f172a","--limbo-text-secondary":"#475569","--limbo-text-tertiary":"#64748b","--limbo-text-inverse":"#ffffff","--limbo-text-muted":"#94a3b8","--limbo-border-light":"#e2e8f0","--limbo-border-medium":"#cbd5e1","--limbo-border-strong":"#94a3b8","--limbo-border-focus":"#3b82f6","--limbo-success":"#10b981","--limbo-success-light":"#d1fae5","--limbo-error":"#ef4444","--limbo-error-light":"#fee2e2","--limbo-warning":"#f59e0b","--limbo-warning-light":"#fef3c7","--limbo-info":"#3b82f6","--limbo-info-light":"#dbeafe","--limbo-shadow-sm":"0 1px 2px 0 rgba(0, 0, 0, 0.05)","--limbo-shadow-md":"0 4px 6px -1px rgba(0, 0, 0, 0.1)","--limbo-shadow-lg":"0 10px 15px -3px rgba(0, 0, 0, 0.1)","--limbo-shadow-xl":"0 20px 25px -5px rgba(0, 0, 0, 0.1)","--limbo-radius-sm":"4px","--limbo-radius-md":"6px","--limbo-radius-lg":"8px","--limbo-radius-xl":"12px","--limbo-font-family":"system-ui, -apple-system, sans-serif","--limbo-font-size-xs":"12px","--limbo-font-size-sm":"14px","--limbo-font-size-md":"16px","--limbo-font-size-lg":"18px","--limbo-font-size-xl":"20px","--limbo-z-dropdown":"1000","--limbo-z-sticky":"1020","--limbo-z-fixed":"1030","--limbo-z-modal":"1050","--limbo-z-tooltip":"1070","--limbo-transition-fast":"150ms cubic-bezier(0.4, 0, 0.2, 1)","--limbo-transition-normal":"300ms cubic-bezier(0.4, 0, 0.2, 1)","--limbo-transition-slow":"500ms cubic-bezier(0.4, 0, 0.2, 1)","--limbo-spacing-compact":"0.5rem","--limbo-spacing-compact-sm":"0.25rem","--limbo-spacing-compact-lg":"0.75rem","--limbo-font-size-compact-xs":"11px","--limbo-font-size-compact-sm":"12px","--limbo-font-size-compact-md":"14px","--limbo-font-size-compact-lg":"16px","--limbo-radius-compact":"4px","--limbo-radius-compact-sm":"3px","--limbo-radius-compact-lg":"6px","--limbo-button-height-compact":"32px","--limbo-input-height-compact":"36px","--limbo-modal-padding-compact":"12px","--limbo-card-padding-compact":"12px","--limbo-gap-compact":"8px","--limbo-gap-compact-sm":"4px","--limbo-gap-compact-lg":"12px"}},dark:{name:"dark",displayName:"Oscuro",variables:{"--limbo-primary":"#60a5fa","--limbo-primary-hover":"#3b82f6","--limbo-primary-light":"#1e293b","--limbo-primary-dark":"#93c5fd","--limbo-bg-primary":"#0f172a","--limbo-bg-secondary":"#1e293b","--limbo-bg-tertiary":"#334155","--limbo-bg-overlay":"rgba(0, 0, 0, 0.8)","--limbo-bg-card":"#1e293b","--limbo-bg-input":"#334155","--limbo-text-primary":"#f8fafc","--limbo-text-secondary":"#cbd5e1","--limbo-text-tertiary":"#94a3b8","--limbo-text-inverse":"#0f172a","--limbo-text-muted":"#64748b","--limbo-border-light":"#334155","--limbo-border-medium":"#475569","--limbo-border-strong":"#64748b","--limbo-border-focus":"#60a5fa","--limbo-success":"#34d399","--limbo-success-light":"#064e3b","--limbo-error":"#f87171","--limbo-error-light":"#7f1d1d","--limbo-warning":"#fbbf24","--limbo-warning-light":"#78350f","--limbo-info":"#60a5fa","--limbo-info-light":"#1e3a8a","--limbo-shadow-sm":"0 1px 2px 0 rgba(0, 0, 0, 0.2)","--limbo-shadow-md":"0 4px 6px -1px rgba(0, 0, 0, 0.3)","--limbo-shadow-lg":"0 10px 15px -3px rgba(0, 0, 0, 0.4)","--limbo-shadow-xl":"0 20px 25px -5px rgba(0, 0, 0, 0.5)","--limbo-radius-sm":"4px","--limbo-radius-md":"6px","--limbo-radius-lg":"8px","--limbo-radius-xl":"12px","--limbo-font-family":"system-ui, -apple-system, sans-serif","--limbo-font-size-xs":"12px","--limbo-font-size-sm":"14px","--limbo-font-size-md":"16px","--limbo-font-size-lg":"18px","--limbo-font-size-xl":"20px","--limbo-z-dropdown":"1000","--limbo-z-sticky":"1020","--limbo-z-fixed":"1030","--limbo-z-modal":"1050","--limbo-z-tooltip":"1070","--limbo-transition-fast":"150ms cubic-bezier(0.4, 0, 0.2, 1)","--limbo-transition-normal":"300ms cubic-bezier(0.4, 0, 0.2, 1)","--limbo-transition-slow":"500ms cubic-bezier(0.4, 0, 0.2, 1)","--limbo-spacing-compact":"0.5rem","--limbo-spacing-compact-sm":"0.25rem","--limbo-spacing-compact-lg":"0.75rem","--limbo-font-size-compact-xs":"11px","--limbo-font-size-compact-sm":"12px","--limbo-font-size-compact-md":"14px","--limbo-font-size-compact-lg":"16px","--limbo-radius-compact":"4px","--limbo-radius-compact-sm":"3px","--limbo-radius-compact-lg":"6px","--limbo-button-height-compact":"32px","--limbo-input-height-compact":"36px","--limbo-modal-padding-compact":"12px","--limbo-card-padding-compact":"12px","--limbo-gap-compact":"8px","--limbo-gap-compact-sm":"4px","--limbo-gap-compact-lg":"12px"}},auto:{name:"auto",displayName:"Automático",variables:{}}},inheritance:{portalSelectors:["body","[data-theme]",".theme-light",".theme-dark",".light-theme",".dark-theme"],variablePrefix:"--",fallbackTheme:"light"},transitions:{duration:"300ms",easing:"cubic-bezier(0.4, 0, 0.2, 1)",properties:["background-color","border-color","color","fill","stroke","box-shadow"]}}}initialize(e={}){this.isInitialized?console.warn("ThemeManager already initialized"):(this.config=this._deepMerge(this.config,e),this._loadCustomThemes(),this.config.theme.inherit&&this._inheritPortalTheme(),this._applyInitialTheme(),this._applyInitialCompactMode(),this._setupObservers(),this._injectBaseStyles(),this.isInitialized=!0)}_injectBaseStyles(){if(document.getElementById("limbo-theme-styles"))return;const e=`\n :root {\n /* Variables de transición para cambios de tema */\n color-scheme: light dark;\n }\n \n [data-limbo-theme] {\n transition: ${this.config.transitions.properties.map(e=>`${e} ${this.config.transitions.duration} ${this.config.transitions.easing}`).join(", ")};\n }\n \n /* Clases de utilidad para temas */\n .limbo-theme-light {\n color-scheme: light;\n }\n \n .limbo-theme-dark {\n color-scheme: dark;\n }\n \n .limbo-theme-auto {\n color-scheme: light dark;\n }\n \n /* Estilos para elementos del componente con variables CSS */\n .limbo-component {\n background-color: var(--limbo-bg-primary);\n color: var(--limbo-text-primary);\n border-color: var(--limbo-border-light);\n border-radius: var(--limbo-radius-md);\n font-family: var(--limbo-font-family);\n font-size: var(--limbo-font-size-md);\n transition: var(--limbo-transition-normal);\n }\n \n .limbo-card {\n background-color: var(--limbo-bg-card);\n border: 1px solid var(--limbo-border-light);\n border-radius: var(--limbo-radius-lg);\n box-shadow: var(--limbo-shadow-md);\n color: var(--limbo-text-primary);\n }\n \n .limbo-input {\n background-color: var(--limbo-bg-input);\n border: 1px solid var(--limbo-border-medium);\n border-radius: var(--limbo-radius-md);\n color: var(--limbo-text-primary);\n font-family: var(--limbo-font-family);\n font-size: var(--limbo-font-size-md);\n transition: var(--limbo-transition-fast);\n }\n \n .limbo-input:focus {\n border-color: var(--limbo-border-focus);\n box-shadow: 0 0 0 3px var(--limbo-primary-light);\n outline: none;\n }\n \n .limbo-button {\n background-color: var(--limbo-primary);\n border: 1px solid var(--limbo-primary);\n border-radius: var(--limbo-radius-md);\n color: var(--limbo-text-inverse);\n font-family: var(--limbo-font-family);\n font-size: var(--limbo-font-size-md);\n transition: var(--limbo-transition-fast);\n cursor: pointer;\n }\n \n .limbo-button:hover {\n background-color: var(--limbo-primary-hover);\n border-color: var(--limbo-primary-hover);\n }\n \n .limbo-button.secondary {\n background-color: var(--limbo-bg-secondary);\n border-color: var(--limbo-border-medium);\n color: var(--limbo-text-primary);\n }\n \n .limbo-button.secondary:hover {\n background-color: var(--limbo-bg-tertiary);\n }\n \n /* Estados de feedback con variables */\n .limbo-state-success {\n background-color: var(--limbo-success-light);\n border-color: var(--limbo-success);\n color: var(--limbo-success);\n }\n \n .limbo-state-error {\n background-color: var(--limbo-error-light);\n border-color: var(--limbo-error);\n color: var(--limbo-error);\n }\n \n .limbo-state-warning {\n background-color: var(--limbo-warning-light);\n border-color: var(--limbo-warning);\n color: var(--limbo-warning);\n }\n \n .limbo-state-info {\n background-color: var(--limbo-info-light);\n border-color: var(--limbo-info);\n color: var(--limbo-info);\n }\n \n /* Overlay y modal con variables */\n .limbo-overlay {\n background-color: var(--limbo-bg-overlay);\n backdrop-filter: blur(4px);\n }\n \n .limbo-modal {\n background-color: var(--limbo-bg-card);\n border-radius: var(--limbo-radius-xl);\n box-shadow: var(--limbo-shadow-xl);\n color: var(--limbo-text-primary);\n }\n \n /* Responsive design con variables */\n @media (max-width: 640px) {\n .limbo-component {\n font-size: var(--limbo-font-size-sm);\n }\n }\n \n /* Modo reducido de movimiento */\n @media (prefers-reduced-motion: reduce) {\n [data-limbo-theme] {\n transition: none;\n }\n \n .limbo-component,\n .limbo-input,\n .limbo-button {\n transition: none;\n }\n }\n \n /* Esquemas de color automático */\n @media (prefers-color-scheme: dark) {\n :root:not([data-limbo-theme]) {\n color-scheme: dark;\n }\n }\n \n @media (prefers-color-scheme: light) {\n :root:not([data-limbo-theme]) {\n color-scheme: light;\n }\n }\n \n /* ===================================\n MODO COMPACTO - ESTILOS ESPECÍFICOS \n =================================== */\n \n /* Activación del modo compacto por atributo o clase */\n [data-limbo-compact="true"],\n .limbo-compact-mode {\n /* Componentes base más pequeños */\n --limbo-font-size-md: var(--limbo-font-size-compact-md);\n --limbo-font-size-sm: var(--limbo-font-size-compact-sm);\n --limbo-font-size-lg: var(--limbo-font-size-compact-lg);\n --limbo-spacing: var(--limbo-spacing-compact);\n --limbo-radius-md: var(--limbo-radius-compact);\n --limbo-gap: var(--limbo-gap-compact);\n }\n \n /* Botones compactos */\n [data-limbo-compact="true"] .limbo-button,\n .limbo-compact-mode .limbo-button {\n height: var(--limbo-button-height-compact);\n padding: var(--limbo-spacing-compact-sm) var(--limbo-spacing-compact);\n font-size: var(--limbo-font-size-compact-sm);\n border-radius: var(--limbo-radius-compact);\n min-width: auto;\n }\n \n /* Inputs compactos */\n [data-limbo-compact="true"] .limbo-input,\n .limbo-compact-mode .limbo-input {\n height: var(--limbo-input-height-compact);\n padding: var(--limbo-spacing-compact-sm) var(--limbo-spacing-compact);\n font-size: var(--limbo-font-size-compact-md);\n border-radius: var(--limbo-radius-compact);\n }\n \n /* Cards compactas */\n [data-limbo-compact="true"] .limbo-card,\n .limbo-compact-mode .limbo-card {\n padding: var(--limbo-card-padding-compact);\n border-radius: var(--limbo-radius-compact-lg);\n }\n \n /* Modales compactos */\n [data-limbo-compact="true"] .limbo-modal,\n .limbo-compact-mode .limbo-modal {\n padding: var(--limbo-modal-padding-compact);\n border-radius: var(--limbo-radius-compact-lg);\n max-width: 90vw;\n max-height: 90vh;\n }\n \n /* Tabs compactas */\n [data-limbo-compact="true"] .limbo-tabs,\n .limbo-compact-mode .limbo-tabs {\n gap: var(--limbo-gap-compact-sm);\n }\n \n [data-limbo-compact="true"] .limbo-tab,\n .limbo-compact-mode .limbo-tab {\n padding: var(--limbo-spacing-compact-sm) var(--limbo-spacing-compact);\n font-size: var(--limbo-font-size-compact-sm);\n border-radius: var(--limbo-radius-compact-sm);\n }\n \n /* Gallery compacta */\n [data-limbo-compact="true"] .limbo-gallery,\n .limbo-compact-mode .limbo-gallery {\n gap: var(--limbo-gap-compact-sm);\n }\n \n [data-limbo-compact="true"] .limbo-gallery-item,\n .limbo-compact-mode .limbo-gallery-item {\n border-radius: var(--limbo-radius-compact);\n min-height: 120px; /* Más pequeño para móviles */\n }\n \n /* Notificaciones compactas */\n [data-limbo-compact="true"] .limbo-notification,\n .limbo-compact-mode .limbo-notification {\n padding: var(--limbo-spacing-compact-sm) var(--limbo-spacing-compact);\n font-size: var(--limbo-font-size-compact-sm);\n border-radius: var(--limbo-radius-compact);\n }\n \n /* Progress indicators compactos */\n [data-limbo-compact="true"] .limbo-progress,\n .limbo-compact-mode .limbo-progress {\n height: 3px; /* Más delgado */\n }\n \n [data-limbo-compact="true"] .limbo-progress-circular,\n .limbo-compact-mode .limbo-progress-circular {\n width: 20px;\n height: 20px;\n }\n \n /* Auto-activación en pantallas pequeñas */\n @media (max-width: 768px) {\n :root[data-limbo-compact="auto"],\n .limbo-component[data-limbo-compact="auto"] {\n /* Aplicar automáticamente estilos compactos */\n --limbo-font-size-md: var(--limbo-font-size-compact-md);\n --limbo-font-size-sm: var(--limbo-font-size-compact-sm);\n --limbo-spacing: var(--limbo-spacing-compact);\n --limbo-radius-md: var(--limbo-radius-compact);\n --limbo-gap: var(--limbo-gap-compact);\n }\n \n /* Modal full-screen en móvil cuando es compacto */\n [data-limbo-compact="auto"] .limbo-modal,\n [data-limbo-compact="true"] .limbo-modal {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n width: 100vw;\n height: 100vh;\n max-width: 100vw;\n max-height: 100vh;\n border-radius: 0;\n margin: 0;\n }\n \n /* Tabs en accordion en móvil */\n [data-limbo-compact="auto"] .limbo-tabs,\n [data-limbo-compact="true"] .limbo-tabs {\n flex-direction: column;\n width: 100%;\n }\n \n /* Gallery de 2 columnas en móvil */\n [data-limbo-compact="auto"] .limbo-gallery,\n [data-limbo-compact="true"] .limbo-gallery {\n grid-template-columns: 1fr 1fr;\n gap: var(--limbo-gap-compact);\n }\n }\n \n /* Touch targets más grandes en móviles */\n @media (max-width: 768px) and (pointer: coarse) {\n [data-limbo-compact="auto"] .limbo-button,\n [data-limbo-compact="true"] .limbo-button {\n min-height: 44px; /* Tamaño mínimo de toque recomendado */\n padding: var(--limbo-spacing-compact) var(--limbo-spacing-compact-lg);\n }\n \n [data-limbo-compact="auto"] .limbo-tab,\n [data-limbo-compact="true"] .limbo-tab {\n min-height: 44px;\n }\n }\n `,t=document.createElement("style");t.id="limbo-theme-styles",t.textContent=e,document.head.appendChild(t)}applyTheme(e,t={}){const n=this._getTheme(e);if(!n)return console.warn(`Theme '${e}' not found`),!1;const l=this.currentTheme;return this._applyThemeVariables(n,t.scope),this._updateThemeAttributes(n.name),this.config.theme.storage&&!t.temporary&&this._saveThemePreference(n.name),this.currentTheme=n.name,this._triggerChangeCallbacks(n.name,l),!0}toggleTheme(e="light",t="dark"){const n=this.currentTheme===e?t:e;return this.applyTheme(n)}applyAutoTheme(){const e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return this.applyTheme(e)}registerTheme(e,t){const n={name:e,displayName:t.displayName||e,variables:t.variables||{},extends:t.extends||null,...t};if(n.extends){const e=this._getTheme(n.extends);e&&(n.variables={...e.variables,...n.variables})}return this.customThemes.set(e,n),this}removeTheme(e){if(this.config.presets[e])return console.warn(`Cannot remove predefined theme: ${e}`),!1;const t=this.customThemes.delete(e);return t&&this.currentTheme===e&&this.applyTheme(this.config.inheritance.fallbackTheme),t}getAvailableThemes(){const e=Object.keys(this.config.presets),t=Array.from(this.customThemes.keys());return{presets:e,custom:t,all:[...e,...t]}}getCurrentTheme(){return{name:this.currentTheme,theme:this._getTheme(this.currentTheme),isCustom:this.customThemes.has(this.currentTheme),variables:this._getCurrentVariables()}}enableCompactMode(e={}){const t={element:document.documentElement,persist:!0,...e};return t.element.setAttribute("data-limbo-compact","true"),t.element.classList.add("limbo-compact-mode"),this.isCompactMode=!0,t.persist&&this.config.compact.persistPreference&&this._saveCompactPreference(!0),this._triggerCompactChange(!0),this}disableCompactMode(e={}){const t={element:document.documentElement,persist:!0,...e};return t.element.setAttribute("data-limbo-compact","false"),t.element.classList.remove("limbo-compact-mode"),this.isCompactMode=!1,t.persist&&this.config.compact.persistPreference&&this._saveCompactPreference(!1),this._triggerCompactChange(!1),this}toggleCompactMode(e={}){return this.isCompactMode?this.disableCompactMode(e):this.enableCompactMode(e)}applyAutoCompactMode(){const e=this._shouldUseCompactMode();return e&&!this.isCompactMode?this.enableCompactMode({persist:!1}):!e&&this.isCompactMode&&this.disableCompactMode({persist:!1}),this}getCompactState(){return{isEnabled:this.isCompactMode,isAuto:this.config.compact.auto,breakpoint:this.config.compact.breakpoint,currentViewport:window.innerWidth,shouldBeCompact:this._shouldUseCompactMode()}}_shouldUseCompactMode(){if(!this.config.compact.auto)return this.config.compact.enabled;const e=window.innerWidth<=this.config.compact.breakpoint,t=/Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),n="ontouchstart"in window||navigator.maxTouchPoints>0;return!(!this.config.compact.forceOnMobile||!t&&!n)||e}_saveCompactPreference(e){try{localStorage.setItem("limbo-compact-preference",e.toString())}catch(t){console.warn("Could not save compact preference:",t)}}_loadCompactPreference(){try{return"true"===localStorage.getItem("limbo-compact-preference")}catch(e){return console.warn("Could not load compact preference:",e),null}}_triggerCompactChange(e){this.changeCallbacks.forEach(t=>{try{t({type:"compact",isCompact:e,viewport:window.innerWidth,timestamp:Date.now()})}catch(n){console.error("Error in compact mode change callback:",n)}})}_inheritPortalTheme(){const e=this._detectPortalTheme();return e?(this.registerTheme("portal-inherited",e),"portal-inherited"):null}_detectPortalTheme(){const e={name:"portal-detected",displayName:"Tema del Portal",variables:{}};for(const t of this.config.inheritance.portalSelectors){const n=document.querySelector(t);if(n){const t=this._extractCSSVariables(n);Object.keys(t).length>0&&(e.variables={...e.variables,...t});const l=n.getAttribute("data-theme")||n.getAttribute("class")?.match(/theme-(\w+)/)||n.getAttribute("class")?.match(/(\w+)-theme/);l&&(e.detectedName=Array.isArray(l)?l[1]:l)}}return Object.keys(e.variables).length>0?e:null}_extractCSSVariables(e){const t={},n=getComputedStyle(e);["primary","primary-hover","primary-light","primary-dark","bg-primary","bg-secondary","bg-tertiary","bg-card","bg-input","text-primary","text-secondary","text-tertiary","text-inverse","border-light","border-medium","border-strong","border-focus","success","error","warning","info","shadow-sm","shadow-md","shadow-lg","shadow-xl","radius-sm","radius-md","radius-lg","radius-xl"].forEach(e=>{const l=`--limbo-${e}`,r=n.getPropertyValue(l).trim();r&&(t[l]=r)});return["--primary-color","--background-color","--text-color","--border-color","--accent-color","--surface-color"].forEach(e=>{const l=n.getPropertyValue(e).trim();if(l){const n=this._mapGenericToLimbo(e,l);n&&Object.assign(t,n)}}),t}_mapGenericToLimbo(e,t){return{"--primary-color":{"--limbo-primary":t},"--background-color":{"--limbo-bg-primary":t},"--text-color":{"--limbo-text-primary":t},"--border-color":{"--limbo-border-light":t},"--accent-color":{"--limbo-primary":t},"--surface-color":{"--limbo-bg-card":t}}[e]||null}_applyInitialTheme(){let e=this.config.inheritance.fallbackTheme;if(this.config.theme.storage){const t=this._loadThemePreference();t&&this._getTheme(t)&&(e=t)}const t=document.documentElement.getAttribute("data-limbo-theme");t&&this._getTheme(t)&&(e=t);const n=this._inheritPortalTheme();n&&(e=n),this.config.theme.auto&&"auto"===e&&(e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),this.applyTheme(e,{temporary:!1})}_applyInitialCompactMode(){let e=!1;if(this.config.compact.persistPreference){const t=this._loadCompactPreference();null!==t&&(e=t)}const t=document.documentElement.getAttribute("data-limbo-compact");"true"===t?e=!0:"false"===t&&(e=!1),("auto"===t||this.config.compact.auto)&&(e=this._shouldUseCompactMode()),e?this.enableCompactMode({persist:!1}):this.disableCompactMode({persist:!1})}_applyThemeVariables(e,t=document.documentElement){const n="string"==typeof t?document.querySelector(t):t;n?(Object.entries(e.variables).forEach(([e,t])=>{n.style.setProperty(e,t),this.appliedStyles.add(`${n.tagName}:${e}`)}),this.themeCache.set(e.name,{theme:e,appliedAt:Date.now(),scope:n})):console.warn("Theme scope element not found")}_updateThemeAttributes(e){document.documentElement.setAttribute("data-limbo-theme",e),document.documentElement.classList.remove("limbo-theme-light","limbo-theme-dark","limbo-theme-auto"),document.documentElement.classList.add(`limbo-theme-${e}`),this._updateMetaThemeColor(e)}_updateMetaThemeColor(e){const t=this._getTheme(e);if(!t)return;const n=t.variables["--limbo-primary"]||"#3b82f6";let l=document.querySelector('meta[name="theme-color"]');l||(l=document.createElement("meta"),l.name="theme-color",document.head.appendChild(l)),l.content=n}_getTheme(e){return this.config.presets[e]?this.config.presets[e]:this.customThemes.has(e)?this.customThemes.get(e):null}_getCurrentVariables(){const e=this._getTheme(this.currentTheme);if(!e)return{};const t=getComputedStyle(document.documentElement),n={};return Object.keys(e.variables).forEach(e=>{n[e]=t.getPropertyValue(e).trim()}),n}_saveThemePreference(e){try{localStorage.setItem("limbo-theme-preference",e)}catch(t){console.warn("Could not save theme preference:",t)}}_loadThemePreference(){try{return localStorage.getItem("limbo-theme-preference")}catch(e){return console.warn("Could not load theme preference:",e),null}}_loadCustomThemes(){try{const e=localStorage.getItem("limbo-custom-themes");if(e){const t=JSON.parse(e);Object.entries(t).forEach(([e,t])=>{this.customThemes.set(e,t)})}}catch(e){console.warn("Could not load custom themes:",e)}}_saveCustomThemes(){try{const e=Object.fromEntries(this.customThemes);localStorage.setItem("limbo-custom-themes",JSON.stringify(e))}catch(e){console.warn("Could not save custom themes:",e)}}_setupObservers(){this.config.theme.detectSystem&&this._setupSystemObserver(),this.config.theme.storage&&this._setupStorageObserver(),this._setupMutationObserver(),this.config.compact.auto&&this._setupViewportObserver()}_setupSystemObserver(){const e=window.matchMedia("(prefers-color-scheme: dark)");e.addEventListener("change",e=>{if("auto"===this.currentTheme||this.config.theme.auto){const t=e.matches?"dark":"light";this.applyTheme(t,{temporary:!0})}}),this.mediaQueryObserver=e}_setupStorageObserver(){const e=e=>{"limbo-theme-preference"===e.key&&e.newValue!==this.currentTheme&&this._getTheme(e.newValue)&&this.applyTheme(e.newValue)};window.addEventListener("storage",e),this.storageListener=e}_setupMutationObserver(){const e=new MutationObserver(e=>{e.forEach(e=>{if("attributes"===e.type&&"data-limbo-theme"===e.attributeName){const t=e.target.getAttribute("data-limbo-theme");t&&t!==this.currentTheme&&this._getTheme(t)&&this.applyTheme(t)}})});e.observe(document.documentElement,{attributes:!0,attributeFilter:["data-limbo-theme"]}),this.mutationObserver=e}_setupViewportObserver(){const e=`(max-width: ${this.config.compact.breakpoint}px)`,t=window.matchMedia(e);t.addEventListener("change",()=>{("auto"===document.documentElement.getAttribute("data-limbo-compact")||this.config.compact.auto)&&this.applyAutoCompactMode()}),this.compactObserver=t,window.addEventListener("orientationchange",()=>{setTimeout(()=>{("auto"===document.documentElement.getAttribute("data-limbo-compact")||this.config.compact.auto)&&this.applyAutoCompactMode()},100)})}onThemeChange(e){return this.changeCallbacks.add(e),()=>this.changeCallbacks.delete(e)}_triggerChangeCallbacks(e,t){this.changeCallbacks.forEach(n=>{try{n({theme:e,previousTheme:t,themeData:this._getTheme(e),variables:this._getCurrentVariables()})}catch(l){console.error("Error in theme change callback:",l)}})}generateThemeFromColors(e,t){const n={name:e,displayName:e,variables:{}};t.primary&&(n.variables["--limbo-primary"]=t.primary,n.variables["--limbo-primary-hover"]=this._darkenColor(t.primary,10),n.variables["--limbo-primary-light"]=this._lightenColor(t.primary,40),n.variables["--limbo-primary-dark"]=this._darkenColor(t.primary,20)),t.background&&(n.variables["--limbo-bg-primary"]=t.background,n.variables["--limbo-bg-secondary"]=this._lightenColor(t.background,5),n.variables["--limbo-bg-tertiary"]=this._lightenColor(t.background,10),n.variables["--limbo-bg-card"]=t.background),t.text&&(n.variables["--limbo-text-primary"]=t.text,n.variables["--limbo-text-secondary"]=this._lightenColor(t.text,20),n.variables["--limbo-text-tertiary"]=this._lightenColor(t.text,40));const l=this._getTheme(this.config.inheritance.fallbackTheme);return l&&(n.variables={...l.variables,...n.variables}),this.registerTheme(e,n),n}_darkenColor(e,t){const n=parseInt(e.replace("#",""),16),l=Math.round(2.55*t),r=(n>>16)-l,a=(n>>8&255)-l,i=(255&n)-l;return"#"+(16777216+65536*(r<255?r<1?0:r:255)+256*(a<255?a<1?0:a:255)+(i<255?i<1?0:i:255)).toString(16).slice(1)}_lightenColor(e,t){const n=parseInt(e.replace("#",""),16),l=Math.round(2.55*t),r=(n>>16)+l,a=(n>>8&255)+l,i=(255&n)+l;return"#"+(16777216+65536*(r<255?r<1?0:r:255)+256*(a<255?a<1?0:a:255)+(i<255?i<1?0:i:255)).toString(16).slice(1)}_deepMerge(e,t){const n={...e};return Object.keys(t).forEach(l=>{t[l]&&"object"==typeof t[l]&&!Array.isArray(t[l])?n[l]=this._deepMerge(e[l]||{},t[l]):n[l]=t[l]}),n}getThemeInfo(){return{current:this.getCurrentTheme(),available:this.getAvailableThemes(),compact:this.getCompactState(),config:this.config,isInitialized:this.isInitialized,cache:{themes:this.themeCache.size,applied:this.appliedStyles.size},observers:{system:!!this.mediaQueryObserver,storage:!!this.storageListener,mutation:!!this.mutationObserver,viewport:!!this.compactObserver}}}debug(){return console.table(this.getThemeInfo()),this.getThemeInfo()}destroy(){this.mediaQueryObserver&&this.mediaQueryObserver.removeEventListener("change",this._setupSystemObserver),this.storageListener&&window.removeEventListener("storage",this.storageListener),this.mutationObserver&&this.mutationObserver.disconnect(),this.compactObserver&&this.compactObserver.removeEventListener("change",this._setupViewportObserver),this.changeCallbacks.clear(),this.themeCache.clear(),this.appliedStyles.clear(),this._saveCustomThemes();const e=document.getElementById("limbo-theme-styles");e&&e.remove(),this.isInitialized=!1}}const wl=new class{constructor(){this.config=new w,this.instances=new hl,this.autoInputs=new pl,this.events=new fl,this.modals=new gl,this.theme=new yl,this.containerQueryDetector=A,this._setupInternalListeners(),this._initializeContainerQueries()}configure(e){var t;return this.config.setGlobal(e),t={publicKey:e.publicKey,apiKey:e.apiKey,token:e.token,authMode:e.authMode||"manual",tokenProvider:e.tokenProvider,prod:Boolean(e.prod)||!1,mode:e.mode||"embed",callbacks:e.callbacks||null},Z={...Z,...t},Z.authMode||(Z.token?Z.authMode="manual":Z.authMode="session"),this.config}setToken(e){return function(e){Z.token=e}(e),this.config.setGlobal({token:e}),this}create(e){const t=this.config.merge(e);return this.instances.create(t,this.events,this.modals)}configureAutoInputs(e){return this.autoInputs.configure(e,this.config,this.events)}setTheme(e){return e&&(this.config.set("theme",e),this.theme.setTheme(e),this.events.emit("theme:changed",{theme:e})),this}getTheme(){return this.theme.getCurrentTheme()}scanAndActivate(e=null){const t=this.autoInputs.config?.dataset||"data-limbo-input-file",n=e||`[${t}]`,l=document.querySelectorAll(n);if(0===l.length)return{found:0,processed:0,skipped:0};let r=0,a=0;return l.forEach(e=>{try{this.autoInputs._processInput(e),r++}catch(t){console.warn(`⚠️ Limbo: Error procesando input ${e.id||e.name}:`,t),a++}}),this.events.emit("limbo:scanCompleted",{found:l.length,processed:r,skipped:a,inputs:Array.from(l)}),{found:l.length,processed:r,skipped:a}}_initializeContainerQueries(){this.containerQueryDetector.observeResize(),setTimeout(()=>{document.querySelectorAll(".limbo-component-container-wrapper").forEach(e=>{this.containerQueryDetector.applyResponsiveClasses(e)})},100)}rescan(e=document){const t=this.autoInputs.config?.dataset||"data-limbo-input-file",n=e.querySelectorAll(`[${t}]`);let l=0;return n.forEach(e=>{if(!this.autoInputs.instances.has(this.autoInputs._getInputId(e)))try{this.autoInputs._processInput(e),l++}catch(t){console.warn("⚠️ Limbo: Error procesando nuevo input:",t)}}),l}init(e){const t=this._mapLegacyOptions(e);return this.create(t)}getInstances(){return this.instances.getAll()}destroy(){this.instances.destroyAll(),this.autoInputs.cleanup(),this.events.cleanup(),this.theme.removeTheme()}_mapLegacyOptions(e){return{container:e.container||"#image-manager",mode:"embed",features:["gallery","upload","cropper"],apiKey:e.apiKey,prod:e.prod||!1,url:void 0===e.url||e.url}}_setupInternalListeners(){this.events.on("autoInputs:modalRequest",({config:e,callback:t,input:n})=>{this._handleAutoInputModalRequest({config:e,callback:t,input:n})})}_handleAutoInputModalRequest({config:e,callback:t,input:n}){const l=n,r=async n=>{let r={};if(n.crops&&n.crops.length>0){const e=n.asset||n.original;r.original={url:e?.url||e?.urlSigned||n.originalUrl,width:e?.width||n.originalWidth,height:e?.height||n.originalHeight,assetId:e?.id||n.assetId},r.images=n.crops.map(e=>({url:e.url||e.urlSigned,width:e.width,height:e.height,name:e.name||e.filename}))}else n.asset?r.original={url:n.asset.url||n.asset.urlSigned,width:n.asset.width,height:n.asset.height,assetId:n.asset.id}:n.master?.urlSigned||n.master?.url?r.original={url:n.master.urlSigned||n.master.url,width:n.master.width||n.width,height:n.master.height||n.height,assetId:n.assetId}:n.url||n.urlSigned?r.original={url:n.url||n.urlSigned,width:n.width,height:n.height,assetId:n.assetId||n.id}:(console.warn("[Limbo] handleResult: formato de datos no reconocido",n),r=n);if(l){var a=e?.returnConfig?.format||"json",i="";i="url"===a?r.images?.[0]?.url||r.original?.url||"":"assetId"===a?r.original?.assetId||"":JSON.stringify(r),l.value=i,l.dispatchEvent(new Event("change",{bubbles:!0})),console.log("[Limbo] ✅ Valor asignado al input:",l.value?.substring(0,80))}try{await t(r)}catch(o){}c.close()},a={...e,mode:"modal",autoDestroy:!0,interaction:{allowSelection:!0,allowCropping:!0,...e.interaction},callbacks:{onSelect:e=>{r(e)},onCropsSaved:e=>{r(e)},onCropperComplete:e=>{r(e)},onUpload:t=>{"upload-only"!==e.modeUI||e.features?.includes("cropper")||r(t)},onClose:()=>{}}},i=e.validation?.accept||null,o=i?f(i):null,s=!o||o.isAllTypes||o.includesImages;if(e.initialImageUrl&&s){const t=this._extractAssetIdFromUrl(e.initialImageUrl)||e.existingData?.original?.assetId||null;t&&(a._externalImage={url:e.initialImageUrl,filename:e.initialImageUrl.split("/").pop()?.split("?")[0]||"image.jpg",width:1920,height:1080,mime_type:"image/jpeg",id:t})}e.cropper&&(a.cropper=e.cropper),this.config.setGlobal({interaction:{allowSelection:!0,allowCropping:!0,...e.interaction}});const c=this.create(a);c.open()}_extractAssetIdFromUrl(e){if(!e)return null;try{const t=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi,n=e.match(t);return n&&n.length>=2?n[1]:n&&1===n.length?n[0]:null}catch(t){return console.warn("Error extracting asset ID from URL:",t),null}}openGallery(e={}){const t=this.create({mode:"modal",modeUI:"gallery-only",features:["gallery"],autoDestroy:!0,modal:{title:e.title||"Seleccionar Imagen",size:e.size||"large"},validation:{accept:e.accept||null},callbacks:{onSelect:n=>{e.onSelect?.(n),!1!==e.autoClose&&t.close()}},...e});return t.open(),t}openUploader(e={}){const t=!1!==e.redirectToGallery?["upload","gallery"]:["upload"],n=this.create({mode:"modal",modeUI:!1!==e.redirectToGallery?"full":"upload-only",features:t,autoDestroy:!0,modal:{title:e.title||"Subir Imagen",size:e.size||"medium"},validation:{accept:e.accept||null},callbacks:{onUpload:t=>{e.onUpload?.(t),!1===e.autoClose||e.redirectToGallery||n.close()}},...e});return n.open(),n}openCropper(e,t={}){if(!e)throw new Error("Limbo.openCropper: imageUrl es requerido");const n={url:e,filename:t.filename||"image.jpg",width:t.width||1920,height:t.height||1080,mime_type:t.mimeType||"image/jpeg",id:t.assetId||`external-${Date.now()}`},l=this.create({mode:"modal",modeUI:"crop-only",features:["cropper"],autoDestroy:!0,modal:{title:t.title||"Recortar Imagen",size:"xlarge"},cropper:{mandatoryCrops:t.mandatoryCrops||[],allowCustomCrops:!1!==t.allowCustomCrops,enforceRequiredCrops:!1!==t.enforceRequiredCrops},callbacks:{onCropperComplete:e=>{t.onComplete?.(e),!1!==t.autoClose&&l.close()},onCropperCancelled:e=>{t.onCancelled?.(e),!1!==t.autoClose&&l.close()},onCropperError:e=>{t.onError?.(e)}},_externalImage:n,...t});return l.open(),l}createInlineGallery(e,t={}){return this.create({container:e,mode:"embed",modeUI:"gallery-only",features:["gallery"],validation:{accept:t.accept||null},callbacks:{onSelect:t.onSelect,onDelete:t.onDelete},...t})}createInlineUploader(e,t={}){return this.create({container:e,mode:"embed",modeUI:"upload-only",features:["upload"],validation:{accept:t.accept||null},callbacks:{onUpload:t.onUpload},...t})}createStandaloneCropper(e,t,n={}){if(!e)throw new Error("Limbo.createStandaloneCropper: container es requerido");if(!t)throw new Error("Limbo.createStandaloneCropper: imageUrl es requerido");const l={url:t,filename:n.filename||"image.jpg",width:n.width||1920,height:n.height||1080,mime_type:n.mimeType||"image/jpeg",id:n.assetId||`external-${Date.now()}`};return this.create({container:e,mode:"embed",modeUI:"crop-only",features:["cropper"],autoHideOnComplete:!1!==n.autoHideOnComplete,cropper:{mandatoryCrops:n.mandatoryCrops||[],allowCustomCrops:!1!==n.allowCustomCrops,enforceRequiredCrops:!1!==n.enforceRequiredCrops},callbacks:{onCropperComplete:n.onComplete,onCropperCancelled:n.onCancelled,onCropperError:n.onError},_externalImage:l,...n})}createFullSelector(e,t={}){return this.create({container:e,mode:t.mode||"embed",modeUI:"full",features:["gallery","upload","cropper"],validation:{accept:t.accept||null},callbacks:{onSelect:t.onSelect,onUpload:t.onUpload,onDelete:t.onDelete,onCropsSaved:t.onCropsSaved},...t})}};"undefined"!=typeof window&&(window.Limbo=wl,window.limboCore=wl);"undefined"!=typeof window&&document.querySelector("#root")&&(wl.configure({prod:!1,publicKey:"pk_4d29236d6e80d31c3cb69fc201cc9720",authMode:"session"}),wl.create({container:"#root",mode:"embed",modeUI:"full",features:["gallery","upload","cropper"],title:"Limbo Image Manager - Development",url:!0}),wl.configureAutoInputs({dataset:"data-limbo-input-file",return:"json",features:["gallery","upload","cropper"],modeUI:"full",modalSize:"large",title:"Seleccionar archivo",crops:"free",allowDelete:!1}));export{I as LIMBO_BASE_URL,O as decodeHtmlEntities,wl as default,j as extractImageUrl,R as isValidImageUrl,F as parseImageData,W as prepareImageFieldsForPreview,D as resolveUrl};
694
+ /* @__PURE__ */s(rl,{isOpen:q,onClose:V})]})}(()=>{try{const e=sessionStorage.getItem(sl);if(e){const t=JSON.parse(e),n=Date.now();Object.entries(t).forEach(([e,t])=>{t.timestamp&&n-t.timestamp<ol&&il.set(e,t)})}}catch{}})();class ml{constructor(e,t,n,l){this.id=e,this.config=t,this.eventManager=n,this.modalManager=l,this.root=null,this.container=null,this.modal=null,this.mounted=!1,this.destroyed=!1,this.button=null,this._validateConfig(),this._initialize()}_initialize(){"embed"===this.config.mode?this.mount():"button"===this.config.mode&&this._createButton(),this._emitDOMEvent("ready",{instance:this,config:this.config,timestamp:Date.now()})}mount(){if(this.mounted||this.destroyed)return this;if(this.container=this._resolveContainer(),!this.container)return this.eventManager.emit("error",{instanceId:this.id,error:"Container not found"}),this;try{this.root=L.createRoot(this.container),this.root.render(this._renderApp()),this.mounted=!0,this.eventManager.emit("ready",{instance:this})}catch(e){this.eventManager.emit("error",{instanceId:this.id,error:e.message})}return this}unmount(){return this.mounted?(this.root&&(this.root.unmount(),this.root=null),"button"===this.config.mode&&this.button,this.mounted=!1,this):this}open(){return"modal"!==this.config.mode&&"button"!==this.config.mode||(this.modal||this._createModal(),this.modal&&!this.modal.isOpened()&&(this.modal.open(),this.eventManager.emit("modal:open",{instance:this}))),this}close(){return this.modal&&this.modal.isOpened()&&(this.eventManager?.emit("modal:close",{instance:this}),this.modal.close()),this}updateConfig(e){return this.config={...this.config,...e},this.mounted&&this.root.render(this._renderApp()),this.eventManager.emit("config:updated",{instance:this,newConfig:e}),this}destroy(){this.destroyed||(this.unmount(),this.modal&&(this.modal.destroy(),this.modal=null),this.button&&this.button.parentNode&&(this.button.parentNode.removeChild(this.button),this.button=null),this.eventManager.emit("destroy",{instance:this}),this.container=null,this.config=null,this.eventManager=null,this.modalManager=null,this.destroyed=!0)}getId(){return this.id}getMode(){return this.config.mode}isMounted(){return this.mounted}isDestroyed(){return this.destroyed}getContainer(){return this.container}getConfig(){return{...this.config}}isContainerInDOM(){return this.container&&document.contains(this.container)}_createModal(){if(this.modalManager&&"modal"===this.config.mode&&(this.modal=this.modalManager.createModal({title:this.config.title||"Limbo Image Manager",size:this.config.modalSize||"large",onOpen:()=>{const e={instance:this,mode:"modal",timestamp:Date.now()};this._emitDOMEvent("modal:open",e),this.config.callbacks?.onOpen&&this.config.callbacks.onOpen(e)},onClose:()=>{const e={instance:this,mode:"modal",timestamp:Date.now()};this._emitDOMEvent("modal:close",e),this.config.callbacks?.onClose&&this.config.callbacks.onClose(e),this.config.autoDestroy&&this.destroy()},onDestroy:()=>{this.modal=null}}),this.modal)){const e=this.modal.getBodyContainer();this.root=L.createRoot(e),this.root.render(this._renderApp()),this.mounted=!0}}_createButton(){if(this.container||(this.container=this._resolveContainer()),!this.container)return void this.eventManager.emit("error",{instanceId:this.id,error:"Container not found for button mode"});const e=document.createElement("button");e.type="button",e.className="limbo-trigger-button",e.textContent=this.config.buttonText||"Abrir Limbo",e.style.cssText="\n background: #001978;\n color: white;\n border: none;\n padding: 10px 20px;\n border-radius: 6px;\n cursor: pointer;\n font-family: inherit;\n font-size: 14px;\n font-weight: 500;\n transition: all 0.2s ease;\n ",e.addEventListener("mouseenter",()=>{e.style.backgroundColor="#334793",e.style.transform="translateY(-1px)"}),e.addEventListener("mouseleave",()=>{e.style.backgroundColor="#001978",e.style.transform="translateY(0)"}),e.addEventListener("click",()=>{this.open()}),this.container.appendChild(e),this.button=e,this.mounted=!0}_resolveContainer(){const{container:e}=this.config;return e?"string"==typeof e?document.querySelector(e):e instanceof Element?e:null:null}_renderApp(){return e.createElement("div",{id:`limbo-component-container-${this.id}`,className:"limbo-scope limbo-instance limbo-component-container-wrapper lb:h-full lb:w-full lb:py-2 lb:pb-0 lb:bg-white","data-limbo-id":this.id,"data-limbo-mode":this.config.mode,"data-limbo-version":"3.7.0","data-limbo-isolated":"true","aria-label":"Limbo Image Manager",role:"region"},e.createElement(bl,{apiKey:this.config.apiKey||null,publicKey:this.config.publicKey||null,token:this.config.token||null,prod:this.config.prod||!1,url:this.config.url,features:this.config.features,modeUI:this.config.modeUI||"full",ui:this.config.ui,callbacks:this._createCallbacks(),instanceId:this.id,authMode:this.config.authMode||(this.config.publicKey?"session":"manual"),_externalImage:this.config._externalImage||null,cropperConfig:this.config.cropper||null,allowedCategories:this.config.validation?.allowedCategories||null,accept:this.config.validation?.accept||null,returnConfig:this.config.returnConfig||null,folderConfig:this.config.folders||{include:[],exclude:[],includeNoFolder:!0}}))}_createCallbacks(){return{onSelect:e=>{const t=this.config?.callbacks?.onSelect,n=this._createStandardPayload(e,"select");t&&Promise.resolve(t(n)).catch(e=>{console.error("[LimboInstance] Error en onSelect callback:",e)}),this.destroyed||this._emitDOMEvent("select",n)},onUpload:e=>{const t=this.config?.callbacks?.onUpload,n=this._createStandardPayload(e,"upload");t&&Promise.resolve(t(n)).catch(e=>{console.error("[LimboInstance] Error en onUpload callback:",e)}),this.destroyed||this._emitDOMEvent("upload",n)},onError:e=>{const t=this.config?.callbacks?.onError,n={instance:this,error:{message:e.message||"Unknown error",code:e.code||"UNKNOWN",timestamp:Date.now()}};t&&t(n.error),this.destroyed||this._emitDOMEvent("error",n)},onClose:()=>{const e=this.config?.callbacks?.onClose,t={instance:this,timestamp:Date.now()};e&&e(),this.destroyed||this._emitDOMEvent("close",t)},onCropsSaved:e=>{console.log("[LimboInstance] onCropsSaved recibido:",e),console.log("[LimboInstance] this.config?.callbacks:",this.config?.callbacks);const t=this.config?.callbacks?.onCropsSaved;console.log("[LimboInstance] userCallback existe:",!!t);const n={instance:this,eventType:"cropsSaved",timestamp:Date.now(),instanceId:this.id,...e};if(console.log("[LimboInstance] payload.crops:",n.crops),t){console.log("[LimboInstance] Llamando userCallback onCropsSaved");try{t(n),console.log("[LimboInstance] userCallback ejecutado correctamente")}catch(l){console.error("[LimboInstance] Error en userCallback:",l)}}else console.warn("[LimboInstance] ⚠️ userCallback onCropsSaved NO existe");this.destroyed||this._emitDOMEvent("cropsSaved",n)},onCropperComplete:e=>{console.log("[LimboInstance] onCropperComplete recibido:",e);const t=this.config?.callbacks?.onCropperComplete,n={instance:this,eventType:"cropperComplete",timestamp:Date.now(),instanceId:this.id,...e};t&&(console.log("[LimboInstance] Llamando userCallback onCropperComplete"),t(n)),this.destroyed||this._emitDOMEvent("cropperComplete",n)}}}_createStandardPayload(e,t){const n={instance:this,eventType:t,timestamp:Date.now(),instanceId:this.id,mode:this.config?.mode,features:this.config?.features};return e&&(e.assetId||e.id?(n.assetId=e.assetId||e.id,n.variants=e.variants||[],n.master=e.master||{urlSigned:e.url||e.urlSigned,width:e.width,height:e.height,mime:e.mime||e.mimeType},n.fileName=e.fileName||e.name,n.mime=e.mime||e.mimeType,n.width=e.width,n.height=e.height,n.fileBlob=e.fileBlob||e.file,n.metadata={uploadedBy:e.uploadedBy,uploadedAt:e.uploadedAt||e.timestamp,size:e.size,...e.metadata}):Object.assign(n,e)),n}_emitDOMEvent(e,t){if(this.destroyed)return;const n=new CustomEvent(`limbo:${e}`,{detail:t,bubbles:!0,cancelable:!0});(this.getContainer()||document).dispatchEvent(n),this.eventManager?.emit(e,t)}_validateConfig(){const e=te();if(!(this.config.auth?.apiKey||this.config.auth?.publicKey||this.config.auth?.token||this.config.apiKey||this.config.publicKey||this.config.token||this.config.tokenProvider||this.config.auth?.tokenProvider||e.token||e.publicKey||e.tokenProvider))throw new Error(`LimboInstance ${this.id}: Authentication is required. Provide either auth.publicKey (recommended), auth.apiKey (for server-side only), token, or tokenProvider`);if((this.config.auth?.apiKey||this.config.apiKey)&&"undefined"!=typeof window&&console.warn("⚠️ SECURITY WARNING: API Key detected in client-side code.\nThis is a security risk! Use publicKey instead for client applications.\nAPI Keys should only be used in server-side environments."),!["embed","modal","button"].includes(this.config.mode))throw new Error(`LimboInstance ${this.id}: invalid mode ${this.config.mode}`);if("embed"===this.config.mode&&!this.config.container)throw new Error(`LimboInstance ${this.id}: container is required for embed mode`);if("button"===this.config.mode&&!this.config.container)throw new Error(`LimboInstance ${this.id}: container is required for button mode`)}}class hl{constructor(){this.instances=/* @__PURE__ */new Map,this.counter=0}create(e,t,n){const l="limbo-"+ ++this.counter,r=new ml(l,e,t,n);return this.instances.set(l,r),r}get(e){return this.instances.get(e)}getAll(){return Array.from(this.instances.values())}getActive(){return this.getAll().filter(e=>e.isMounted())}destroy(e){const t=this.instances.get(e);return!!t&&(t.destroy(),this.instances.delete(e),!0)}destroyAll(){this.instances.forEach(e=>e.destroy()),this.instances.clear()}cleanupOrphans(){const e=[];return this.instances.forEach((t,n)=>{t.isContainerInDOM()||e.push(n)}),e.forEach(e=>this.destroy(e)),e.length}getStats(){const e=this.getAll();return{total:e.length,active:e.filter(e=>e.isMounted()).length,embed:e.filter(e=>"embed"===e.getMode()).length,modal:e.filter(e=>"modal"===e.getMode()).length,button:e.filter(e=>"button"===e.getMode()).length}}}class pl{constructor(){this.config=null,this.instances=/* @__PURE__ */new Map,this.observer=null,this.initialized=!1}configure(e,t,n){return this.config={selector:e.selector||null,dataset:e.dataset||"data-limbo-input-file",return:e.return||e.returnType||"json",mode:e.mode||"modal",features:e.features||["gallery","upload","cropper"],crop:e.crop||"free",quality:e.quality||.9,format:e.format||"webp",modeUI:e.modeUI||"full",modalSize:e.modalSize||"fullscreen",theme:e.theme||"light",compact:e.compact||!1,maxSize:e.maxSize||"10MB",formats:e.formats||["jpg","jpeg","png","webp"],minWidth:e.minWidth||null,minHeight:e.minHeight||null,maxWidth:e.maxWidth||null,maxHeight:e.maxHeight||null,buttonText:e.buttonText||"Seleccionar archivo",buttonClass:e.buttonClass||"limbo-auto-button",buttonStyle:e.buttonStyle||"primary",showPreview:!1!==e.showPreview,allowMultiple:e.allowMultiple||!1,autoAssign:!1!==e.autoAssign,localCropsOnly:e.localCropsOnly||!1,...e},this.configManager=t,this.eventManager=n,this._initialize(),this}cleanup(){this.observer&&(this.observer.disconnect(),this.observer=null),this.instances.forEach(({input:e,button:t})=>{this._restoreInput(e,t)}),this.instances.clear(),this.config=null,this.initialized=!1}getStats(){return{configured:null!==this.config,totalInputs:this.instances.size,dataset:this.config?.dataset,returnType:this.config?.return}}_initialize(){this.initialized||(this._scanExistingInputs(),this._setupObserver(),this.initialized=!0,this.eventManager.emit("autoInputs:initialized",{config:this.config,inputsFound:this.instances.size}))}_scanExistingInputs(){const e=this.config.selector||`input[${this.config.dataset}]`;document.querySelectorAll(e).forEach(e=>this._processInput(e))}_processInput(e){const t=this._getInputId(e);if(this.instances.has(t))return;if(!this._validateInput(e))return;const n=this._createButton(e);this._hideInput(e),this._insertButton(e,n),this.instances.set(t,{input:e,button:n,config:this._getInputConfig(e)}),this.eventManager.emit("autoInputs:processed",{inputId:t,input:e,button:n})}_createButton(e){const t=document.createElement("button"),n=this._getInputConfig(e);t.type="button",t.textContent=n.buttonText||this.config.buttonText;const l=[this.config.buttonClass];return n.buttonClass&&n.buttonClass!==this.config.buttonClass&&l.push(n.buttonClass),t.className=l.join(" "),this._styleButton(t,n),this._attachButtonEvents(t,e),t.setAttribute("aria-label",n.buttonText||this.config.buttonText),t.setAttribute("data-limbo-trigger","true"),t.setAttribute("data-limbo-input-id",n.inputId),n.disabled&&(t.disabled=!0),t}_styleButton(e,t){const n=t.buttonStyle||this.config.buttonStyle,l=t.theme||this.config.theme,r=t.compact||this.config.compact,a={border:"none",borderRadius:"8px",cursor:"pointer",fontFamily:"inherit",fontSize:r?"12px":"14px",fontWeight:"500",transition:"all 0.2s ease",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"8px",padding:r?"6px 12px":"8px 16px",textDecoration:"none",userSelect:"none"},i={primary:{backgroundColor:"dark"===l?"#3b82f6":"#001978",color:"white",hoverBg:"dark"===l?"#2563eb":"#334793"},secondary:{backgroundColor:"dark"===l?"#374151":"#f3f4f6",color:"dark"===l?"#f9fafb":"#374151",border:"1px solid "+("dark"===l?"#4b5563":"#d1d5db"),hoverBg:"dark"===l?"#4b5563":"#e5e7eb"},outline:{backgroundColor:"transparent",color:"dark"===l?"#3b82f6":"#001978",border:"2px solid "+("dark"===l?"#3b82f6":"#001978"),hoverBg:"dark"===l?"#3b82f6":"#001978",hoverColor:"white"},ghost:{backgroundColor:"transparent",color:"dark"===l?"#f9fafb":"#374151",hoverBg:"dark"===l?"#374151":"#f3f4f6"}},o=i[n]||i.primary;Object.assign(e.style,{...a,...o});const s=o.backgroundColor,c=o.color;e.addEventListener("mouseenter",()=>{e.style.backgroundColor=o.hoverBg||o.backgroundColor,o.hoverColor&&(e.style.color=o.hoverColor),e.style.transform="translateY(-1px)",e.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"}),e.addEventListener("mouseleave",()=>{e.style.backgroundColor=s,e.style.color=c,e.style.transform="translateY(0)",e.style.boxShadow="none"}),t.disabled&&(e.style.opacity="0.5",e.style.cursor="not-allowed")}_attachButtonEvents(e,t){e.addEventListener("click",e=>{e.preventDefault(),this._handleButtonClick(t)})}_handleButtonClick(e){const t=this._getInputConfig(e),n=this._createModalConfig(t);this.eventManager.emit("autoInputs:modalRequest",{input:e,config:n,callback:async t=>await this._handleImageSelection(e,t)})}async _handleImageSelection(e,t){const n=this._getInputConfig(e);let l=t;try{if(!t.original&&!t.images&&(t.id||t.assetId)){console.log("[AutoInputManager] 🔗 Selección directa detectada, obteniendo URL permanente...");const e=t.id||t.assetId;try{const n=await async function(e,t=!0,n=!0,l=0){try{const r=new URLSearchParams({include_variants:t.toString(),include_metadata:n.toString(),url_expires:l.toString()});return ie(await ne({endpoint:`/assets/${e}?${r}`,method:"GET",basePath:ue,useJWT:!0}))}catch(r){throw ce(r)}}(e,!1,!1,!0);n?.result?.url?(console.log("[AutoInputManager] ✅ URL permanente obtenida:",n.result.url),l={original:{url:n.result.url,width:n.result.width||t.width,height:n.result.height||t.height,assetId:e},images:[]}):(console.warn("[AutoInputManager] ⚠️ No se pudo obtener URL permanente, usando URL temporal"),l={original:{url:t.url||t.path,width:t.width,height:t.height,assetId:e},images:[]})}catch(r){console.error("[AutoInputManager] Error obteniendo URL permanente:",r),l={original:{url:t.url||t.path,width:t.width,height:t.height,assetId:e},images:[]}}}const a=await this._formatImageData(l,n);console.log("[AutoInputManager] Valor formateado:",a),console.log("[AutoInputManager] Tipo de valor:",typeof a),!1!==n.autoAssign&&(e.value=a,console.log("[AutoInputManager] Valor asignado al input:",e.value)),this._updateButtonFeedback(e,l),e.dispatchEvent(new Event("change",{bubbles:!0})),e.dispatchEvent(new CustomEvent("limbo:resultReady",{detail:{imageData:l,input:e,value:a,config:n,assignment:{format:n.return,smartAssign:!1!==n.smartAssign,autoAssign:!1!==n.autoAssign},legacy:{imageData:l,formatted:this._createFormattedResult(l,n)}},bubbles:!0})),e.dispatchEvent(new CustomEvent("limbo:imageSelected",{detail:{imageData:l,input:e,value:a,config:n,formatted:this._createFormattedResult(l,n)},bubbles:!0})),this.eventManager.emit("autoInputs:imageSelected",{input:e,imageData:l,value:a,config:n})}catch(a){console.error("Error handling image selection:",a),e.dispatchEvent(new CustomEvent("limbo:error",{detail:{error:a.message,input:e,imageData:l,config:n},bubbles:!0})),this._handleImageSelectionLegacy(e,t)}}_updateButtonFeedback(e,t){const n=this._getInputId(e),l=this.instances.get(n);if(!l||!l.button)return;const r=l.button,a=r.nextElementSibling;a&&a.classList.contains("limbo-button-feedback")&&a.remove();const i=document.createElement("span");i.className="limbo-button-feedback",i.style.cssText="\n display: inline-flex;\n align-items: center;\n gap: 6px;\n margin-left: 8px;\n padding: 4px 8px;\n background: #10b981;\n color: white;\n border-radius: 6px;\n font-size: 12px;\n font-weight: 500;\n animation: limbo-fade-in 0.3s ease-out;\n ";const o=t.images&&t.images.length>0,s=o?t.images.length:0;i.innerHTML=o?`\n <svg width="14" height="14" viewBox="0 0 20 20" fill="currentColor">\n <path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"/>\n </svg>\n <span>${s} recorte${1!==s?"s":""} configurado${1!==s?"s":""}</span>\n `:'\n <svg width="14" height="14" viewBox="0 0 20 20" fill="currentColor">\n <path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"/>\n </svg>\n <span>Archivo seleccionado</span>\n ',r.parentNode.insertBefore(i,r.nextSibling);let c=r.parentNode.querySelector(".limbo-powered-by");c||(c=document.createElement("div"),c.className="limbo-powered-by",c.innerHTML='<span style="display:block;margin-top:2px;font-size:10px;color:#aaa;text-align:left;font-family:inherit;opacity:0.7;">Powered by <b>Limbo</b></span>',r.parentNode.insertBefore(c,i.nextSibling)),r.style.backgroundColor="#10b981",r.textContent="Cambiar archivo"}async _handleImageSelectionLegacy(e,t){const n=this._getInputConfig(e),l=await this._formatImageData(t,n);!1!==n.autoAssign&&(e.value=l),e.dispatchEvent(new Event("change",{bubbles:!0})),e.dispatchEvent(new CustomEvent("limbo:imageSelected",{detail:{imageData:t,input:e,value:l,config:n,formatted:this._createFormattedResult(t,n)},bubbles:!0})),this.eventManager.emit("autoInputs:imageSelected",{input:e,imageData:t,value:l,config:n})}_createFormattedResult(e,t){return{url:e.url||e.path||"",base64:e.base64||e.dataUrl||"",assetId:e.assetId||e.id||"",fileName:e.fileName||e.filename||"",object:{url:e.url||e.path,assetId:e.assetId||e.id,fileName:e.fileName||e.filename,mime:e.mime||e.mime_type,width:e.width,height:e.height,size:e.size||e.file_size,created:e.created_at||e.created,metadata:e.metadata||{}},json:JSON.stringify({url:e.url||e.path,assetId:e.assetId||e.id,fileName:e.fileName||e.filename,mime:e.mime||e.mime_type,width:e.width,height:e.height,size:e.size||e.file_size}),metadata:{width:e.width,height:e.height,size:e.size||e.file_size,format:e.format||e.mime_type,quality:t.quality||this.config.quality,aspectRatio:e.width&&e.height?e.width/e.height:null}}}async _formatImageData(e,t=null){const n=(t||{}).return||this.config.return||"json",l=void 0!==e.original;switch(n){case"url":return l?e.images?.[0]?.url||e.original?.url||"":e.url||e.path||"";case"base64":return e.base64||e.dataUrl||"";case"assetId":return l?e.original?.assetId||"":e.assetId||e.id||"";case"fileName":return e.fileName||e.filename||"";default:try{if(l){const t={original:e.original?{url:e.original.url||e.original.urlSigned,width:e.original.width,height:e.original.height,assetId:e.original.assetId||e.original.id}:null,images:Array.isArray(e.images)?e.images.map(e=>{const t={url:e.url||e.urlSigned,width:e.width,height:e.height,name:e.name||e.filename||e.label};return e.cropState&&(t.cropState={selectorState:e.cropState.selectorState||null,imageTransform:e.cropState.imageTransform||null,flipState:e.cropState.flipState||null}),t}):[]};console.log("[AutoInputManager] Datos limpios para JSON:",t);const n=JSON.stringify(t);return console.log("[AutoInputManager] JSON generado:",n),n}const t={original:{url:e.url||e.path,width:e.width,height:e.height,assetId:e.assetId||e.id}};return console.log("[AutoInputManager] Datos legacy para JSON:",t),JSON.stringify(t)}catch(r){return console.error("[AutoInputManager] Error al serializar JSON:",r),console.error("[AutoInputManager] imageData problemático:",e),"{}"}}}_createModalConfig(e){return{mode:e.mode||this.config.mode||"modal",modeUI:e.modeUI||this.config.modeUI||"full",features:e.features||this.config.features,modalSize:e.modalSize||this.config.modalSize||"fullscreen",title:e.description||this.config.title||"Seleccionar archivo",cropper:this._getCropperConfig(e),ui:{showActions:this._getUIActions(e),hideActions:[],showTabs:this._shouldShowTabs(e),theme:e.theme||this.config.theme,compact:e.compact||this.config.compact,showPreview:void 0!==e.showPreview?e.showPreview:this.config.showPreview},validation:{accept:e.accept||null,maxSize:e.maxSize||this.config.maxSize,formats:e.formats||this.config.formats,minWidth:e.minWidth||this.config.minWidth,minHeight:e.minHeight||this.config.minHeight,maxWidth:e.maxWidth||this.config.maxWidth,maxHeight:e.maxHeight||this.config.maxHeight,required:e.required||!1},behavior:{allowMultiple:e.allowMultiple||this.config.allowMultiple,closeOnSelect:!0,autoAssign:void 0!==e.autoAssign?e.autoAssign:this.config.autoAssign,allowSelectNew:!1!==e.allowSelectNew},initialImageUrl:e.initialImageUrl||null,existingCrops:e.existingCrops||null,existingData:e.existingData||null,returnConfig:{format:e.return||this.config.return,quality:e.quality||this.config.quality,outputFormat:e.format||this.config.format},inputMeta:{inputId:e.inputId,inputName:e.inputName,inputType:e.inputType,placeholder:e.placeholder}}}_getCropperConfig(e){const t=e.crop||this.config.crop,n={quality:e.quality||this.config.quality,format:e.format||this.config.format,mandatoryCrops:e.mandatoryCrops||[],allowAdditionalCrops:!1!==e.allowAdditionalCrops,maxCrops:e.maxCrops||null,localCropsOnly:e.localCropsOnly??this.config.localCropsOnly??!1,existingCrops:e.existingCrops||null};if(e.mandatoryCrops&&e.mandatoryCrops.length>0)return{...n,aspectRatio:null};if(!t||"none"===t||"false"===t)return null;if("free"===t)return{...n,aspectRatio:null};const l={"1:1":1,"16:9":16/9,"4:3":4/3,"3:2":1.5,"2:1":2,square:1,landscape:16/9,portrait:3/4};if(l[t])return{...n,aspectRatio:l[t],minCropBoxWidth:e.minWidth||this.config.minWidth,minCropBoxHeight:e.minHeight||this.config.minHeight};if("string"==typeof t&&t.includes(":")){const[e,l]=t.split(":").map(Number);if(!isNaN(e)&&!isNaN(l)&&0!==l)return{...n,aspectRatio:e/l}}const r=parseFloat(t);return!isNaN(r)&&r>0?{...n,aspectRatio:r}:"object"==typeof t?{...n,...t}:null}_shouldShowTabs(e){const t=e.modeUI||this.config.modeUI||"full",n=e.features||this.config.features;return!["gallery-only","upload-only","crop-only","ia-only"].includes(t)&&(n&&n.length>1)}_getUIActions(e){const t=e.modeUI||this.config.modeUI||"full",n=e.features||this.config.features;let l=[];switch(t){case"gallery-only":case"upload-only":l=["select"];break;case"crop-only":l=["select","crop"];break;default:l=["select"],n.includes("cropper")&&l.push("crop"),n.includes("gallery")&&(l.push("download","copy","rename"),this.config.allowDelete&&l.push("delete"))}return l}_getInputId(e){if(e.id)return e.id;if(e.name)return e.name;let t=e.getAttribute("data-limbo-uid");return t||(t=`limbo-auto-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,e.setAttribute("data-limbo-uid",t)),t}_validateInput(e){return e instanceof HTMLInputElement}_getInputConfig(e){const t=e=>e?e.split(",").map(e=>e.trim()):null,n=e=>{if(!e)return null;const t=e.match(/^(\d+(?:\.\d+)?)(MB|KB|B)?$/i);if(!t)return null;const n=parseFloat(t[1]);switch((t[2]||"B").toUpperCase()){case"MB":return 1024*n*1024;case"KB":return 1024*n;default:return n}},l=(e,t=!1)=>null===e?t:"true"===e||"1"===e||""===e,r=e=>e?parseFloat(e):null,a=e=>{if(!e)return null;try{return JSON.parse(e)}catch(t){return console.warn("[Limbo AutoInputManager] Error parsing JSON attribute:",t),null}},i=a(e.dataset.mandatorycrops)||a(e.dataset.mandatoryCrops)||a(e.getAttribute("data-mandatory-crops"))||a(e.getAttribute("data-limbo-mandatory-crops"))||null;return{return:e.dataset.returntype||e.getAttribute("data-limbo-return")||this.config.return,mode:e.dataset.mode||e.getAttribute("data-limbo-mode")||this.config.mode,features:t(e.dataset.features)||t(e.getAttribute("data-limbo-features"))||this.config.features,crop:e.dataset.crop||e.getAttribute("data-limbo-crop")||this.config.crop,quality:r(e.dataset.quality)||r(e.getAttribute("data-limbo-quality"))||this.config.quality,format:e.dataset.format||e.getAttribute("data-limbo-format")||this.config.format,modeUI:e.dataset.modeui||e.dataset.modeUI||e.getAttribute("data-limbo-mode-ui")||this.config.modeUI,modalSize:e.dataset.modalsize||e.getAttribute("data-limbo-modal-size")||this.config.modalSize,theme:e.dataset.theme||e.getAttribute("data-limbo-theme")||this.config.theme,compact:l(e.dataset.compact,null)??l(e.getAttribute("data-limbo-compact"),this.config.compact),maxSize:n(e.getAttribute("data-limbo-max-size"))||n(this.config.maxSize),formats:t(e.getAttribute("data-limbo-formats"))||this.config.formats,minWidth:r(e.getAttribute("data-limbo-min-width"))||this.config.minWidth,minHeight:r(e.getAttribute("data-limbo-min-height"))||this.config.minHeight,maxWidth:r(e.getAttribute("data-limbo-max-width"))||this.config.maxWidth,maxHeight:r(e.getAttribute("data-limbo-max-height"))||this.config.maxHeight,buttonText:e.dataset.buttontext||e.getAttribute("data-limbo-button-text")||this.config.buttonText,buttonStyle:e.dataset.buttonstyle||e.getAttribute("data-limbo-button-style")||this.config.buttonStyle,buttonClass:e.dataset.buttonclass||e.getAttribute("data-limbo-button-class")||this.config.buttonClass,showPreview:l(e.getAttribute("data-limbo-show-preview"),this.config.showPreview),allowMultiple:l(e.getAttribute("data-limbo-allow-multiple"),this.config.allowMultiple),autoAssign:l(e.getAttribute("data-limbo-auto-assign"),this.config.autoAssign),placeholder:e.getAttribute("data-limbo-placeholder"),description:e.getAttribute("data-limbo-description"),required:l(e.getAttribute("data-limbo-required"),!1),disabled:l(e.getAttribute("data-limbo-disabled"),!1),inputId:this._getInputId(e),inputName:e.name,inputType:e.type,mandatoryCrops:i,allowAdditionalCrops:l(e.dataset.allowadditionalcrops,null)??l(e.getAttribute("data-limbo-allow-additional-crops"),!0),maxCrops:r(e.dataset.maxcrops)||r(e.getAttribute("data-limbo-max-crops"))||null,accept:e.dataset.accept||e.getAttribute("data-limbo-accept")||null,allowSelectNew:l(e.dataset.allowselectnew,null)??l(e.getAttribute("data-limbo-allow-select-new"),!0),...this._parseExistingInputValue(e.value)}}_parseExistingInputValue(e){if(!e||""===e.trim())return{initialImageUrl:null,existingCrops:null,existingData:null};try{const t=JSON.parse(e);return t.original&&t.original.url?(console.log("[AutoInputManager] Valor existente parseado:",t),{initialImageUrl:t.original.url,existingCrops:t.images||null,existingData:t}):t.url?{initialImageUrl:t.url,existingCrops:null,existingData:t}:{initialImageUrl:null,existingCrops:null,existingData:t}}catch(t){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?{initialImageUrl:e,existingCrops:null,existingData:null}:{initialImageUrl:null,existingCrops:null,existingData:null}}}_generateInputId(){return`limbo-auto-input-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}_hideInput(e){e.style.display="none"}_insertButton(e,t){e.parentNode.insertBefore(t,e.nextSibling)}_restoreInput(e,t){e.style.display="",t&&t.parentNode&&t.parentNode.removeChild(t)}_setupObserver(){this.observer=new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&this._scanNodeForInputs(e)})})}),this.observer.observe(document.body,{childList:!0,subtree:!0})}_scanNodeForInputs(e){const t=this.config.selector||`input[${this.config.dataset}]`;e.matches&&e.matches(t)&&this._processInput(e);const n=e.querySelectorAll&&e.querySelectorAll(t);n&&n.forEach(e=>this._processInput(e))}}class fl{constructor(){this.listeners=/* @__PURE__ */new Map}emit(e,t={}){this._emitDOMEvent(e,t),this._executeListeners(e,t)}on(e,t){return this.listeners.has(e)||this.listeners.set(e,[]),this.listeners.get(e).push(t),()=>this.off(e,t)}off(e,t){const n=this.listeners.get(e);if(n){const e=n.indexOf(t);e>-1&&n.splice(e,1)}}cleanup(){this.listeners.clear()}_emitDOMEvent(e,t){const n=new CustomEvent(`limbo:${e}`,{detail:{...t,timestamp:Date.now()},bubbles:!0,cancelable:!0});(t.instance?.getContainer()||document).dispatchEvent(n)}_executeListeners(e,t){const n=this.listeners.get(e);n&&n.forEach(n=>{try{n(t)}catch(l){console.error(`Error executing listener for ${e}:`,l)}})}getStats(){const e={};return this.listeners.forEach((t,n)=>{e[n]=t.length}),e}}class gl{constructor(){this.activeModals=/* @__PURE__ */new Set,this.zIndexBase=1e4,this.focusableSelectors=["button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"]):not([disabled])',"a[href]"].join(", "),this.initialized=!1,this._initGlobalListeners()}createModal(e){const t=new vl(this._generateModalId(),e,this);return this.activeModals.add(t),t}closeModal(e){const t=this._findModal(e);return!!t&&(t.close(),!0)}closeAllModals(){this.activeModals.forEach(e=>e.close()),this.activeModals.clear()}getActiveModal(){return Array.from(this.activeModals).pop()||null}getStats(){return{active:this.activeModals.size,nextZIndex:this._getNextZIndex()}}_generateModalId(){return`limbo-modal-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}_findModal(e){return Array.from(this.activeModals).find(t=>t.getId()===e)}_getNextZIndex(){return this.zIndexBase+10*this.activeModals.size}_removeModal(e){this.activeModals.delete(e),window.limboCore?.events&&window.limboCore.events.emit("modal:closed",{modalId:e.getId(),remainingModals:this.activeModals.size})}_handleGlobalKeydown(e){const t=this.getActiveModal();t&&("Escape"===e.key&&(e.preventDefault(),t.close()),"Tab"===e.key&&this._handleTabTrap(e,t))}_handleTabTrap(e,t){const n=t.getFocusableElements();if(0===n.length)return;const l=n[0],r=n[n.length-1];e.shiftKey?document.activeElement===l&&(e.preventDefault(),r.focus()):document.activeElement===r&&(e.preventDefault(),l.focus())}_initGlobalListeners(){this.initialized||(this.globalKeydownHandler=e=>this._handleGlobalKeydown(e),document.addEventListener("keydown",this.globalKeydownHandler),this.initialized=!0)}destroy(){this.closeAllModals(),this.initialized&&this.globalKeydownHandler&&(document.removeEventListener("keydown",this.globalKeydownHandler),this.initialized=!1,this.globalKeydownHandler=null)}}class vl{constructor(e,t,n){this.id=e,this.config={title:t.title||"Limbo",content:t.content||null,showCloseButton:!1!==t.showCloseButton,backdrop:!1!==t.backdrop,keyboard:!1!==t.keyboard,focus:!1!==t.focus,animation:!1!==t.animation,size:t.size||"large",onOpen:t.onOpen||null,onClose:t.onClose||null,onDestroy:t.onDestroy||null,...t},this.manager=n,this.element=null,this.backdrop=null,this.isOpen=!1,this.previousFocus=null,this._create()}_create(){this._createBackdrop(),this._createModal(),this._attachEvents()}_createBackdrop(){this.config.backdrop&&(this.backdrop=document.createElement("div"),this.backdrop.className="limbo-modal-backdrop",this.backdrop.style.cssText=`\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0.5);\n z-index: ${this.manager._getNextZIndex()};\n opacity: 0;\n transition: opacity 0.3s ease;\n `,this.backdrop.addEventListener("click",e=>{e.target===this.backdrop&&this.close()}))}_createModal(){this.element=document.createElement("div"),this.element.className=`limbo-scope limbo-modal limbo-modal--${this.config.size}`,this.element.id=this.id,this.element.role="dialog",this.element.setAttribute("aria-modal","true"),this.element.setAttribute("aria-labelledby",`${this.id}-title`),this.element.tabIndex=-1;const e=window.innerWidth<=768||/Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),t={small:e?"width: 100%; height: 100%;":"max-width: 500px; min-height: 400px;",medium:e?"width: 100%; height: 100%;":"max-width: 800px; min-height: 500px;",large:e?"width: 100%; height: 100%;":"max-width: 1400px; min-height: 700px;",xlarge:e?"width: 100%; height: 100%;":"max-width: 95dvw; min-height: 85vh;",fullscreen:"width: 100%; height: 100%; max-width: 100%; max-height: 100%; border-radius: 0;"},n="fullscreen"===this.config.size,l=e||n?`\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n transform: ${e?"translateY(100%)":"scale(0.95)"};\n width: 100%;\n height: 100%;\n max-width: none;\n max-height: none;\n border-radius: 0;\n background: white;\n z-index: ${this.manager._getNextZIndex()+1};\n opacity: ${e?"1":"0"};\n transition: ${e?"transform":"all"} 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n overflow: hidden;\n display: flex;\n flex-direction: column;\n padding-top: env(safe-area-inset-top);\n padding-left: env(safe-area-inset-left);\n padding-right: env(safe-area-inset-right);\n padding-bottom: env(safe-area-inset-bottom);\n `:`\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%) scale(0.8);\n ${t[this.config.size]}\n width: 90%;\n max-height: 90vh;\n background: white;\n border-radius: 16px;\n box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);\n z-index: ${this.manager._getNextZIndex()+1};\n opacity: 0;\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n overflow: hidden;\n display: flex;\n flex-direction: column;\n `;this.element.style.cssText=l,this._createHeader(),this._createBody(),document.body.appendChild(this.backdrop),document.body.appendChild(this.element)}_createHeader(){const e=document.createElement("div");e.className="limbo-modal-header";const t=window.innerWidth<=768||/Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);e.style.cssText=`\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: ${t?"16px 20px":"20px 24px"};\n border-bottom: 1px solid #e9ecef;\n background: #f8f9fa;\n ${t?"position: sticky; top: 0; z-index: 10;":""}\n min-height: ${t?"60px":"auto"};\n `;const n=document.createElement("h2");if(n.id=`${this.id}-title`,n.className="limbo-modal-title",n.textContent=this.config.title,n.style.cssText="\n margin: 0;\n font-size: 18px;\n font-weight: 600;\n color: #001978;\n flex: 1;\n margin-right: 16px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n ",e.appendChild(n),this.config.showCloseButton){const n=document.createElement("button");n.type="button",n.className="limbo-modal-close",n.innerHTML="✕",n.setAttribute("aria-label","Cerrar modal"),n.style.cssText=`\n background: none;\n border: none;\n font-size: ${t?"28px":"24px"};\n color: #6c757d;\n cursor: pointer;\n padding: ${t?"8px":"4px"};\n border-radius: 4px;\n transition: all 0.2s ease;\n min-width: ${t?"44px":"auto"};\n min-height: ${t?"44px":"auto"};\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n `,n.addEventListener("mouseenter",()=>{n.style.backgroundColor="#f8f9fa",n.style.color="#001978"}),n.addEventListener("mouseleave",()=>{n.style.backgroundColor="transparent",n.style.color="#6c757d"}),n.addEventListener("click",()=>this.close()),e.appendChild(n)}this.element.appendChild(e)}_createBody(){const e=window.innerWidth<=768||/Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),t=document.createElement("div");t.className="limbo-modal-body",t.id=`${this.id}-body`,t.style.cssText=`\n flex: 1;\n overflow-y: auto;\n padding: 0;\n -webkit-overflow-scrolling: touch;\n ${e?"height: 100%; overscroll-behavior: contain;":""}\n `,this.config.content&&("string"==typeof this.config.content?t.innerHTML=this.config.content:this.config.content instanceof Element&&t.appendChild(this.config.content)),this.element.appendChild(t)}_attachEvents(){this._originalBodyOverflow=document.body.style.overflow}open(){if(this.isOpen)return this;window.limbo&&window.limbo.core&&window.limbo.core.keyboard?(window.limbo.core.keyboard.pushFocus(document.activeElement),window.limbo.core.keyboard.setActiveModal(this.element)):this.previousFocus=document.activeElement,document.body.style.overflow="hidden";const e=window.innerWidth<=768||/Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),t="fullscreen"===this.config.size;return requestAnimationFrame(()=>{this.backdrop&&(this.backdrop.style.opacity="1"),this.element.style.opacity="1",this.element.style.transform=e?"translateY(0%)":t?"scale(1)":"translate(-50%, -50%) scale(1)"}),this.isOpen=!0,this.config.focus&&setTimeout(()=>{if(window.limbo&&window.limbo.core&&window.limbo.core.keyboard)window.limbo.core.keyboard.focusFirst(this.element);else{const e=this.getFocusableElements()[0];e&&e.focus()}},300),this.config.onOpen&&this.config.onOpen(this),this}close(){if(!this.isOpen)return this;const e=window.innerWidth<=768||/Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),t="fullscreen"===this.config.size;return this.backdrop&&(this.backdrop.style.opacity="0"),this.element.style.opacity="0",this.element.style.transform=e?"translateY(100%)":t?"scale(0.95)":"translate(-50%, -50%) scale(0.8)",setTimeout(()=>{this._cleanup()},300),this.isOpen=!1,window.limbo&&window.limbo.core&&window.limbo.core.keyboard&&(window.limbo.core.keyboard.setActiveModal(null),window.limbo.core.keyboard.releaseFocus()),this.config.onClose&&this.config.onClose(this),this}destroy(){this.close(),this.manager._removeModal(this),this.config.onDestroy&&this.config.onDestroy(this)}getBodyContainer(){return this.element.querySelector(".limbo-modal-body")}getFocusableElements(){return Array.from(this.element.querySelectorAll(this.manager.focusableSelectors))}getId(){return this.id}isOpened(){return this.isOpen}getConfig(){return{...this.config}}_cleanup(){document.body.style.overflow=this._originalBodyOverflow||"",this.previousFocus&&"function"==typeof this.previousFocus.focus&&this.previousFocus.focus(),this.backdrop&&this.backdrop.parentNode&&this.backdrop.parentNode.removeChild(this.backdrop),this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}}class yl{constructor(){this.currentTheme=null,this.customThemes=/* @__PURE__ */new Map,this.config=this._getDefaultConfig(),this.isInitialized=!1,this.isCompactMode=!1,this.compactBreakpoint=null,this.compactObserver=null,this.mediaQueryObserver=null,this.mutationObserver=null,this.storageListener=null,this.themeCache=/* @__PURE__ */new Map,this.appliedStyles=/* @__PURE__ */new Set,this.changeCallbacks=/* @__PURE__ */new Set}_getDefaultConfig(){return{theme:{auto:!0,storage:!0,inherit:!0,smooth:!0,detectSystem:!0},compact:{enabled:!1,auto:!0,breakpoint:768,forceOnMobile:!0,persistPreference:!0},presets:{light:{name:"light",displayName:"Claro",variables:{"--limbo-primary":"#3b82f6","--limbo-primary-hover":"#2563eb","--limbo-primary-light":"#dbeafe","--limbo-primary-dark":"#1e40af","--limbo-bg-primary":"#ffffff","--limbo-bg-secondary":"#f8fafc","--limbo-bg-tertiary":"#f1f5f9","--limbo-bg-overlay":"rgba(0, 0, 0, 0.5)","--limbo-bg-card":"#ffffff","--limbo-bg-input":"#ffffff","--limbo-text-primary":"#0f172a","--limbo-text-secondary":"#475569","--limbo-text-tertiary":"#64748b","--limbo-text-inverse":"#ffffff","--limbo-text-muted":"#94a3b8","--limbo-border-light":"#e2e8f0","--limbo-border-medium":"#cbd5e1","--limbo-border-strong":"#94a3b8","--limbo-border-focus":"#3b82f6","--limbo-success":"#10b981","--limbo-success-light":"#d1fae5","--limbo-error":"#ef4444","--limbo-error-light":"#fee2e2","--limbo-warning":"#f59e0b","--limbo-warning-light":"#fef3c7","--limbo-info":"#3b82f6","--limbo-info-light":"#dbeafe","--limbo-shadow-sm":"0 1px 2px 0 rgba(0, 0, 0, 0.05)","--limbo-shadow-md":"0 4px 6px -1px rgba(0, 0, 0, 0.1)","--limbo-shadow-lg":"0 10px 15px -3px rgba(0, 0, 0, 0.1)","--limbo-shadow-xl":"0 20px 25px -5px rgba(0, 0, 0, 0.1)","--limbo-radius-sm":"4px","--limbo-radius-md":"6px","--limbo-radius-lg":"8px","--limbo-radius-xl":"12px","--limbo-font-family":"system-ui, -apple-system, sans-serif","--limbo-font-size-xs":"12px","--limbo-font-size-sm":"14px","--limbo-font-size-md":"16px","--limbo-font-size-lg":"18px","--limbo-font-size-xl":"20px","--limbo-z-dropdown":"1000","--limbo-z-sticky":"1020","--limbo-z-fixed":"1030","--limbo-z-modal":"1050","--limbo-z-tooltip":"1070","--limbo-transition-fast":"150ms cubic-bezier(0.4, 0, 0.2, 1)","--limbo-transition-normal":"300ms cubic-bezier(0.4, 0, 0.2, 1)","--limbo-transition-slow":"500ms cubic-bezier(0.4, 0, 0.2, 1)","--limbo-spacing-compact":"0.5rem","--limbo-spacing-compact-sm":"0.25rem","--limbo-spacing-compact-lg":"0.75rem","--limbo-font-size-compact-xs":"11px","--limbo-font-size-compact-sm":"12px","--limbo-font-size-compact-md":"14px","--limbo-font-size-compact-lg":"16px","--limbo-radius-compact":"4px","--limbo-radius-compact-sm":"3px","--limbo-radius-compact-lg":"6px","--limbo-button-height-compact":"32px","--limbo-input-height-compact":"36px","--limbo-modal-padding-compact":"12px","--limbo-card-padding-compact":"12px","--limbo-gap-compact":"8px","--limbo-gap-compact-sm":"4px","--limbo-gap-compact-lg":"12px"}},dark:{name:"dark",displayName:"Oscuro",variables:{"--limbo-primary":"#60a5fa","--limbo-primary-hover":"#3b82f6","--limbo-primary-light":"#1e293b","--limbo-primary-dark":"#93c5fd","--limbo-bg-primary":"#0f172a","--limbo-bg-secondary":"#1e293b","--limbo-bg-tertiary":"#334155","--limbo-bg-overlay":"rgba(0, 0, 0, 0.8)","--limbo-bg-card":"#1e293b","--limbo-bg-input":"#334155","--limbo-text-primary":"#f8fafc","--limbo-text-secondary":"#cbd5e1","--limbo-text-tertiary":"#94a3b8","--limbo-text-inverse":"#0f172a","--limbo-text-muted":"#64748b","--limbo-border-light":"#334155","--limbo-border-medium":"#475569","--limbo-border-strong":"#64748b","--limbo-border-focus":"#60a5fa","--limbo-success":"#34d399","--limbo-success-light":"#064e3b","--limbo-error":"#f87171","--limbo-error-light":"#7f1d1d","--limbo-warning":"#fbbf24","--limbo-warning-light":"#78350f","--limbo-info":"#60a5fa","--limbo-info-light":"#1e3a8a","--limbo-shadow-sm":"0 1px 2px 0 rgba(0, 0, 0, 0.2)","--limbo-shadow-md":"0 4px 6px -1px rgba(0, 0, 0, 0.3)","--limbo-shadow-lg":"0 10px 15px -3px rgba(0, 0, 0, 0.4)","--limbo-shadow-xl":"0 20px 25px -5px rgba(0, 0, 0, 0.5)","--limbo-radius-sm":"4px","--limbo-radius-md":"6px","--limbo-radius-lg":"8px","--limbo-radius-xl":"12px","--limbo-font-family":"system-ui, -apple-system, sans-serif","--limbo-font-size-xs":"12px","--limbo-font-size-sm":"14px","--limbo-font-size-md":"16px","--limbo-font-size-lg":"18px","--limbo-font-size-xl":"20px","--limbo-z-dropdown":"1000","--limbo-z-sticky":"1020","--limbo-z-fixed":"1030","--limbo-z-modal":"1050","--limbo-z-tooltip":"1070","--limbo-transition-fast":"150ms cubic-bezier(0.4, 0, 0.2, 1)","--limbo-transition-normal":"300ms cubic-bezier(0.4, 0, 0.2, 1)","--limbo-transition-slow":"500ms cubic-bezier(0.4, 0, 0.2, 1)","--limbo-spacing-compact":"0.5rem","--limbo-spacing-compact-sm":"0.25rem","--limbo-spacing-compact-lg":"0.75rem","--limbo-font-size-compact-xs":"11px","--limbo-font-size-compact-sm":"12px","--limbo-font-size-compact-md":"14px","--limbo-font-size-compact-lg":"16px","--limbo-radius-compact":"4px","--limbo-radius-compact-sm":"3px","--limbo-radius-compact-lg":"6px","--limbo-button-height-compact":"32px","--limbo-input-height-compact":"36px","--limbo-modal-padding-compact":"12px","--limbo-card-padding-compact":"12px","--limbo-gap-compact":"8px","--limbo-gap-compact-sm":"4px","--limbo-gap-compact-lg":"12px"}},auto:{name:"auto",displayName:"Automático",variables:{}}},inheritance:{portalSelectors:["body","[data-theme]",".theme-light",".theme-dark",".light-theme",".dark-theme"],variablePrefix:"--",fallbackTheme:"light"},transitions:{duration:"300ms",easing:"cubic-bezier(0.4, 0, 0.2, 1)",properties:["background-color","border-color","color","fill","stroke","box-shadow"]}}}initialize(e={}){this.isInitialized?console.warn("ThemeManager already initialized"):(this.config=this._deepMerge(this.config,e),this._loadCustomThemes(),this.config.theme.inherit&&this._inheritPortalTheme(),this._applyInitialTheme(),this._applyInitialCompactMode(),this._setupObservers(),this._injectBaseStyles(),this.isInitialized=!0)}_injectBaseStyles(){if(document.getElementById("limbo-theme-styles"))return;const e=`\n :root {\n /* Variables de transición para cambios de tema */\n color-scheme: light dark;\n }\n \n [data-limbo-theme] {\n transition: ${this.config.transitions.properties.map(e=>`${e} ${this.config.transitions.duration} ${this.config.transitions.easing}`).join(", ")};\n }\n \n /* Clases de utilidad para temas */\n .limbo-theme-light {\n color-scheme: light;\n }\n \n .limbo-theme-dark {\n color-scheme: dark;\n }\n \n .limbo-theme-auto {\n color-scheme: light dark;\n }\n \n /* Estilos para elementos del componente con variables CSS */\n .limbo-component {\n background-color: var(--limbo-bg-primary);\n color: var(--limbo-text-primary);\n border-color: var(--limbo-border-light);\n border-radius: var(--limbo-radius-md);\n font-family: var(--limbo-font-family);\n font-size: var(--limbo-font-size-md);\n transition: var(--limbo-transition-normal);\n }\n \n .limbo-card {\n background-color: var(--limbo-bg-card);\n border: 1px solid var(--limbo-border-light);\n border-radius: var(--limbo-radius-lg);\n box-shadow: var(--limbo-shadow-md);\n color: var(--limbo-text-primary);\n }\n \n .limbo-input {\n background-color: var(--limbo-bg-input);\n border: 1px solid var(--limbo-border-medium);\n border-radius: var(--limbo-radius-md);\n color: var(--limbo-text-primary);\n font-family: var(--limbo-font-family);\n font-size: var(--limbo-font-size-md);\n transition: var(--limbo-transition-fast);\n }\n \n .limbo-input:focus {\n border-color: var(--limbo-border-focus);\n box-shadow: 0 0 0 3px var(--limbo-primary-light);\n outline: none;\n }\n \n .limbo-button {\n background-color: var(--limbo-primary);\n border: 1px solid var(--limbo-primary);\n border-radius: var(--limbo-radius-md);\n color: var(--limbo-text-inverse);\n font-family: var(--limbo-font-family);\n font-size: var(--limbo-font-size-md);\n transition: var(--limbo-transition-fast);\n cursor: pointer;\n }\n \n .limbo-button:hover {\n background-color: var(--limbo-primary-hover);\n border-color: var(--limbo-primary-hover);\n }\n \n .limbo-button.secondary {\n background-color: var(--limbo-bg-secondary);\n border-color: var(--limbo-border-medium);\n color: var(--limbo-text-primary);\n }\n \n .limbo-button.secondary:hover {\n background-color: var(--limbo-bg-tertiary);\n }\n \n /* Estados de feedback con variables */\n .limbo-state-success {\n background-color: var(--limbo-success-light);\n border-color: var(--limbo-success);\n color: var(--limbo-success);\n }\n \n .limbo-state-error {\n background-color: var(--limbo-error-light);\n border-color: var(--limbo-error);\n color: var(--limbo-error);\n }\n \n .limbo-state-warning {\n background-color: var(--limbo-warning-light);\n border-color: var(--limbo-warning);\n color: var(--limbo-warning);\n }\n \n .limbo-state-info {\n background-color: var(--limbo-info-light);\n border-color: var(--limbo-info);\n color: var(--limbo-info);\n }\n \n /* Overlay y modal con variables */\n .limbo-overlay {\n background-color: var(--limbo-bg-overlay);\n backdrop-filter: blur(4px);\n }\n \n .limbo-modal {\n background-color: var(--limbo-bg-card);\n border-radius: var(--limbo-radius-xl);\n box-shadow: var(--limbo-shadow-xl);\n color: var(--limbo-text-primary);\n }\n \n /* Responsive design con variables */\n @media (max-width: 640px) {\n .limbo-component {\n font-size: var(--limbo-font-size-sm);\n }\n }\n \n /* Modo reducido de movimiento */\n @media (prefers-reduced-motion: reduce) {\n [data-limbo-theme] {\n transition: none;\n }\n \n .limbo-component,\n .limbo-input,\n .limbo-button {\n transition: none;\n }\n }\n \n /* Esquemas de color automático */\n @media (prefers-color-scheme: dark) {\n :root:not([data-limbo-theme]) {\n color-scheme: dark;\n }\n }\n \n @media (prefers-color-scheme: light) {\n :root:not([data-limbo-theme]) {\n color-scheme: light;\n }\n }\n \n /* ===================================\n MODO COMPACTO - ESTILOS ESPECÍFICOS \n =================================== */\n \n /* Activación del modo compacto por atributo o clase */\n [data-limbo-compact="true"],\n .limbo-compact-mode {\n /* Componentes base más pequeños */\n --limbo-font-size-md: var(--limbo-font-size-compact-md);\n --limbo-font-size-sm: var(--limbo-font-size-compact-sm);\n --limbo-font-size-lg: var(--limbo-font-size-compact-lg);\n --limbo-spacing: var(--limbo-spacing-compact);\n --limbo-radius-md: var(--limbo-radius-compact);\n --limbo-gap: var(--limbo-gap-compact);\n }\n \n /* Botones compactos */\n [data-limbo-compact="true"] .limbo-button,\n .limbo-compact-mode .limbo-button {\n height: var(--limbo-button-height-compact);\n padding: var(--limbo-spacing-compact-sm) var(--limbo-spacing-compact);\n font-size: var(--limbo-font-size-compact-sm);\n border-radius: var(--limbo-radius-compact);\n min-width: auto;\n }\n \n /* Inputs compactos */\n [data-limbo-compact="true"] .limbo-input,\n .limbo-compact-mode .limbo-input {\n height: var(--limbo-input-height-compact);\n padding: var(--limbo-spacing-compact-sm) var(--limbo-spacing-compact);\n font-size: var(--limbo-font-size-compact-md);\n border-radius: var(--limbo-radius-compact);\n }\n \n /* Cards compactas */\n [data-limbo-compact="true"] .limbo-card,\n .limbo-compact-mode .limbo-card {\n padding: var(--limbo-card-padding-compact);\n border-radius: var(--limbo-radius-compact-lg);\n }\n \n /* Modales compactos */\n [data-limbo-compact="true"] .limbo-modal,\n .limbo-compact-mode .limbo-modal {\n padding: var(--limbo-modal-padding-compact);\n border-radius: var(--limbo-radius-compact-lg);\n max-width: 90vw;\n max-height: 90vh;\n }\n \n /* Tabs compactas */\n [data-limbo-compact="true"] .limbo-tabs,\n .limbo-compact-mode .limbo-tabs {\n gap: var(--limbo-gap-compact-sm);\n }\n \n [data-limbo-compact="true"] .limbo-tab,\n .limbo-compact-mode .limbo-tab {\n padding: var(--limbo-spacing-compact-sm) var(--limbo-spacing-compact);\n font-size: var(--limbo-font-size-compact-sm);\n border-radius: var(--limbo-radius-compact-sm);\n }\n \n /* Gallery compacta */\n [data-limbo-compact="true"] .limbo-gallery,\n .limbo-compact-mode .limbo-gallery {\n gap: var(--limbo-gap-compact-sm);\n }\n \n [data-limbo-compact="true"] .limbo-gallery-item,\n .limbo-compact-mode .limbo-gallery-item {\n border-radius: var(--limbo-radius-compact);\n min-height: 120px; /* Más pequeño para móviles */\n }\n \n /* Notificaciones compactas */\n [data-limbo-compact="true"] .limbo-notification,\n .limbo-compact-mode .limbo-notification {\n padding: var(--limbo-spacing-compact-sm) var(--limbo-spacing-compact);\n font-size: var(--limbo-font-size-compact-sm);\n border-radius: var(--limbo-radius-compact);\n }\n \n /* Progress indicators compactos */\n [data-limbo-compact="true"] .limbo-progress,\n .limbo-compact-mode .limbo-progress {\n height: 3px; /* Más delgado */\n }\n \n [data-limbo-compact="true"] .limbo-progress-circular,\n .limbo-compact-mode .limbo-progress-circular {\n width: 20px;\n height: 20px;\n }\n \n /* Auto-activación en pantallas pequeñas */\n @media (max-width: 768px) {\n :root[data-limbo-compact="auto"],\n .limbo-component[data-limbo-compact="auto"] {\n /* Aplicar automáticamente estilos compactos */\n --limbo-font-size-md: var(--limbo-font-size-compact-md);\n --limbo-font-size-sm: var(--limbo-font-size-compact-sm);\n --limbo-spacing: var(--limbo-spacing-compact);\n --limbo-radius-md: var(--limbo-radius-compact);\n --limbo-gap: var(--limbo-gap-compact);\n }\n \n /* Modal full-screen en móvil cuando es compacto */\n [data-limbo-compact="auto"] .limbo-modal,\n [data-limbo-compact="true"] .limbo-modal {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n width: 100vw;\n height: 100vh;\n max-width: 100vw;\n max-height: 100vh;\n border-radius: 0;\n margin: 0;\n }\n \n /* Tabs en accordion en móvil */\n [data-limbo-compact="auto"] .limbo-tabs,\n [data-limbo-compact="true"] .limbo-tabs {\n flex-direction: column;\n width: 100%;\n }\n \n /* Gallery de 2 columnas en móvil */\n [data-limbo-compact="auto"] .limbo-gallery,\n [data-limbo-compact="true"] .limbo-gallery {\n grid-template-columns: 1fr 1fr;\n gap: var(--limbo-gap-compact);\n }\n }\n \n /* Touch targets más grandes en móviles */\n @media (max-width: 768px) and (pointer: coarse) {\n [data-limbo-compact="auto"] .limbo-button,\n [data-limbo-compact="true"] .limbo-button {\n min-height: 44px; /* Tamaño mínimo de toque recomendado */\n padding: var(--limbo-spacing-compact) var(--limbo-spacing-compact-lg);\n }\n \n [data-limbo-compact="auto"] .limbo-tab,\n [data-limbo-compact="true"] .limbo-tab {\n min-height: 44px;\n }\n }\n `,t=document.createElement("style");t.id="limbo-theme-styles",t.textContent=e,document.head.appendChild(t)}applyTheme(e,t={}){const n=this._getTheme(e);if(!n)return console.warn(`Theme '${e}' not found`),!1;const l=this.currentTheme;return this._applyThemeVariables(n,t.scope),this._updateThemeAttributes(n.name),this.config.theme.storage&&!t.temporary&&this._saveThemePreference(n.name),this.currentTheme=n.name,this._triggerChangeCallbacks(n.name,l),!0}toggleTheme(e="light",t="dark"){const n=this.currentTheme===e?t:e;return this.applyTheme(n)}applyAutoTheme(){const e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return this.applyTheme(e)}registerTheme(e,t){const n={name:e,displayName:t.displayName||e,variables:t.variables||{},extends:t.extends||null,...t};if(n.extends){const e=this._getTheme(n.extends);e&&(n.variables={...e.variables,...n.variables})}return this.customThemes.set(e,n),this}removeTheme(e){if(this.config.presets[e])return console.warn(`Cannot remove predefined theme: ${e}`),!1;const t=this.customThemes.delete(e);return t&&this.currentTheme===e&&this.applyTheme(this.config.inheritance.fallbackTheme),t}getAvailableThemes(){const e=Object.keys(this.config.presets),t=Array.from(this.customThemes.keys());return{presets:e,custom:t,all:[...e,...t]}}getCurrentTheme(){return{name:this.currentTheme,theme:this._getTheme(this.currentTheme),isCustom:this.customThemes.has(this.currentTheme),variables:this._getCurrentVariables()}}enableCompactMode(e={}){const t={element:document.documentElement,persist:!0,...e};return t.element.setAttribute("data-limbo-compact","true"),t.element.classList.add("limbo-compact-mode"),this.isCompactMode=!0,t.persist&&this.config.compact.persistPreference&&this._saveCompactPreference(!0),this._triggerCompactChange(!0),this}disableCompactMode(e={}){const t={element:document.documentElement,persist:!0,...e};return t.element.setAttribute("data-limbo-compact","false"),t.element.classList.remove("limbo-compact-mode"),this.isCompactMode=!1,t.persist&&this.config.compact.persistPreference&&this._saveCompactPreference(!1),this._triggerCompactChange(!1),this}toggleCompactMode(e={}){return this.isCompactMode?this.disableCompactMode(e):this.enableCompactMode(e)}applyAutoCompactMode(){const e=this._shouldUseCompactMode();return e&&!this.isCompactMode?this.enableCompactMode({persist:!1}):!e&&this.isCompactMode&&this.disableCompactMode({persist:!1}),this}getCompactState(){return{isEnabled:this.isCompactMode,isAuto:this.config.compact.auto,breakpoint:this.config.compact.breakpoint,currentViewport:window.innerWidth,shouldBeCompact:this._shouldUseCompactMode()}}_shouldUseCompactMode(){if(!this.config.compact.auto)return this.config.compact.enabled;const e=window.innerWidth<=this.config.compact.breakpoint,t=/Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),n="ontouchstart"in window||navigator.maxTouchPoints>0;return!(!this.config.compact.forceOnMobile||!t&&!n)||e}_saveCompactPreference(e){try{localStorage.setItem("limbo-compact-preference",e.toString())}catch(t){console.warn("Could not save compact preference:",t)}}_loadCompactPreference(){try{return"true"===localStorage.getItem("limbo-compact-preference")}catch(e){return console.warn("Could not load compact preference:",e),null}}_triggerCompactChange(e){this.changeCallbacks.forEach(t=>{try{t({type:"compact",isCompact:e,viewport:window.innerWidth,timestamp:Date.now()})}catch(n){console.error("Error in compact mode change callback:",n)}})}_inheritPortalTheme(){const e=this._detectPortalTheme();return e?(this.registerTheme("portal-inherited",e),"portal-inherited"):null}_detectPortalTheme(){const e={name:"portal-detected",displayName:"Tema del Portal",variables:{}};for(const t of this.config.inheritance.portalSelectors){const n=document.querySelector(t);if(n){const t=this._extractCSSVariables(n);Object.keys(t).length>0&&(e.variables={...e.variables,...t});const l=n.getAttribute("data-theme")||n.getAttribute("class")?.match(/theme-(\w+)/)||n.getAttribute("class")?.match(/(\w+)-theme/);l&&(e.detectedName=Array.isArray(l)?l[1]:l)}}return Object.keys(e.variables).length>0?e:null}_extractCSSVariables(e){const t={},n=getComputedStyle(e);["primary","primary-hover","primary-light","primary-dark","bg-primary","bg-secondary","bg-tertiary","bg-card","bg-input","text-primary","text-secondary","text-tertiary","text-inverse","border-light","border-medium","border-strong","border-focus","success","error","warning","info","shadow-sm","shadow-md","shadow-lg","shadow-xl","radius-sm","radius-md","radius-lg","radius-xl"].forEach(e=>{const l=`--limbo-${e}`,r=n.getPropertyValue(l).trim();r&&(t[l]=r)});return["--primary-color","--background-color","--text-color","--border-color","--accent-color","--surface-color"].forEach(e=>{const l=n.getPropertyValue(e).trim();if(l){const n=this._mapGenericToLimbo(e,l);n&&Object.assign(t,n)}}),t}_mapGenericToLimbo(e,t){return{"--primary-color":{"--limbo-primary":t},"--background-color":{"--limbo-bg-primary":t},"--text-color":{"--limbo-text-primary":t},"--border-color":{"--limbo-border-light":t},"--accent-color":{"--limbo-primary":t},"--surface-color":{"--limbo-bg-card":t}}[e]||null}_applyInitialTheme(){let e=this.config.inheritance.fallbackTheme;if(this.config.theme.storage){const t=this._loadThemePreference();t&&this._getTheme(t)&&(e=t)}const t=document.documentElement.getAttribute("data-limbo-theme");t&&this._getTheme(t)&&(e=t);const n=this._inheritPortalTheme();n&&(e=n),this.config.theme.auto&&"auto"===e&&(e=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),this.applyTheme(e,{temporary:!1})}_applyInitialCompactMode(){let e=!1;if(this.config.compact.persistPreference){const t=this._loadCompactPreference();null!==t&&(e=t)}const t=document.documentElement.getAttribute("data-limbo-compact");"true"===t?e=!0:"false"===t&&(e=!1),("auto"===t||this.config.compact.auto)&&(e=this._shouldUseCompactMode()),e?this.enableCompactMode({persist:!1}):this.disableCompactMode({persist:!1})}_applyThemeVariables(e,t=document.documentElement){const n="string"==typeof t?document.querySelector(t):t;n?(Object.entries(e.variables).forEach(([e,t])=>{n.style.setProperty(e,t),this.appliedStyles.add(`${n.tagName}:${e}`)}),this.themeCache.set(e.name,{theme:e,appliedAt:Date.now(),scope:n})):console.warn("Theme scope element not found")}_updateThemeAttributes(e){document.documentElement.setAttribute("data-limbo-theme",e),document.documentElement.classList.remove("limbo-theme-light","limbo-theme-dark","limbo-theme-auto"),document.documentElement.classList.add(`limbo-theme-${e}`),this._updateMetaThemeColor(e)}_updateMetaThemeColor(e){const t=this._getTheme(e);if(!t)return;const n=t.variables["--limbo-primary"]||"#3b82f6";let l=document.querySelector('meta[name="theme-color"]');l||(l=document.createElement("meta"),l.name="theme-color",document.head.appendChild(l)),l.content=n}_getTheme(e){return this.config.presets[e]?this.config.presets[e]:this.customThemes.has(e)?this.customThemes.get(e):null}_getCurrentVariables(){const e=this._getTheme(this.currentTheme);if(!e)return{};const t=getComputedStyle(document.documentElement),n={};return Object.keys(e.variables).forEach(e=>{n[e]=t.getPropertyValue(e).trim()}),n}_saveThemePreference(e){try{localStorage.setItem("limbo-theme-preference",e)}catch(t){console.warn("Could not save theme preference:",t)}}_loadThemePreference(){try{return localStorage.getItem("limbo-theme-preference")}catch(e){return console.warn("Could not load theme preference:",e),null}}_loadCustomThemes(){try{const e=localStorage.getItem("limbo-custom-themes");if(e){const t=JSON.parse(e);Object.entries(t).forEach(([e,t])=>{this.customThemes.set(e,t)})}}catch(e){console.warn("Could not load custom themes:",e)}}_saveCustomThemes(){try{const e=Object.fromEntries(this.customThemes);localStorage.setItem("limbo-custom-themes",JSON.stringify(e))}catch(e){console.warn("Could not save custom themes:",e)}}_setupObservers(){this.config.theme.detectSystem&&this._setupSystemObserver(),this.config.theme.storage&&this._setupStorageObserver(),this._setupMutationObserver(),this.config.compact.auto&&this._setupViewportObserver()}_setupSystemObserver(){const e=window.matchMedia("(prefers-color-scheme: dark)");e.addEventListener("change",e=>{if("auto"===this.currentTheme||this.config.theme.auto){const t=e.matches?"dark":"light";this.applyTheme(t,{temporary:!0})}}),this.mediaQueryObserver=e}_setupStorageObserver(){const e=e=>{"limbo-theme-preference"===e.key&&e.newValue!==this.currentTheme&&this._getTheme(e.newValue)&&this.applyTheme(e.newValue)};window.addEventListener("storage",e),this.storageListener=e}_setupMutationObserver(){const e=new MutationObserver(e=>{e.forEach(e=>{if("attributes"===e.type&&"data-limbo-theme"===e.attributeName){const t=e.target.getAttribute("data-limbo-theme");t&&t!==this.currentTheme&&this._getTheme(t)&&this.applyTheme(t)}})});e.observe(document.documentElement,{attributes:!0,attributeFilter:["data-limbo-theme"]}),this.mutationObserver=e}_setupViewportObserver(){const e=`(max-width: ${this.config.compact.breakpoint}px)`,t=window.matchMedia(e);t.addEventListener("change",()=>{("auto"===document.documentElement.getAttribute("data-limbo-compact")||this.config.compact.auto)&&this.applyAutoCompactMode()}),this.compactObserver=t,window.addEventListener("orientationchange",()=>{setTimeout(()=>{("auto"===document.documentElement.getAttribute("data-limbo-compact")||this.config.compact.auto)&&this.applyAutoCompactMode()},100)})}onThemeChange(e){return this.changeCallbacks.add(e),()=>this.changeCallbacks.delete(e)}_triggerChangeCallbacks(e,t){this.changeCallbacks.forEach(n=>{try{n({theme:e,previousTheme:t,themeData:this._getTheme(e),variables:this._getCurrentVariables()})}catch(l){console.error("Error in theme change callback:",l)}})}generateThemeFromColors(e,t){const n={name:e,displayName:e,variables:{}};t.primary&&(n.variables["--limbo-primary"]=t.primary,n.variables["--limbo-primary-hover"]=this._darkenColor(t.primary,10),n.variables["--limbo-primary-light"]=this._lightenColor(t.primary,40),n.variables["--limbo-primary-dark"]=this._darkenColor(t.primary,20)),t.background&&(n.variables["--limbo-bg-primary"]=t.background,n.variables["--limbo-bg-secondary"]=this._lightenColor(t.background,5),n.variables["--limbo-bg-tertiary"]=this._lightenColor(t.background,10),n.variables["--limbo-bg-card"]=t.background),t.text&&(n.variables["--limbo-text-primary"]=t.text,n.variables["--limbo-text-secondary"]=this._lightenColor(t.text,20),n.variables["--limbo-text-tertiary"]=this._lightenColor(t.text,40));const l=this._getTheme(this.config.inheritance.fallbackTheme);return l&&(n.variables={...l.variables,...n.variables}),this.registerTheme(e,n),n}_darkenColor(e,t){const n=parseInt(e.replace("#",""),16),l=Math.round(2.55*t),r=(n>>16)-l,a=(n>>8&255)-l,i=(255&n)-l;return"#"+(16777216+65536*(r<255?r<1?0:r:255)+256*(a<255?a<1?0:a:255)+(i<255?i<1?0:i:255)).toString(16).slice(1)}_lightenColor(e,t){const n=parseInt(e.replace("#",""),16),l=Math.round(2.55*t),r=(n>>16)+l,a=(n>>8&255)+l,i=(255&n)+l;return"#"+(16777216+65536*(r<255?r<1?0:r:255)+256*(a<255?a<1?0:a:255)+(i<255?i<1?0:i:255)).toString(16).slice(1)}_deepMerge(e,t){const n={...e};return Object.keys(t).forEach(l=>{t[l]&&"object"==typeof t[l]&&!Array.isArray(t[l])?n[l]=this._deepMerge(e[l]||{},t[l]):n[l]=t[l]}),n}getThemeInfo(){return{current:this.getCurrentTheme(),available:this.getAvailableThemes(),compact:this.getCompactState(),config:this.config,isInitialized:this.isInitialized,cache:{themes:this.themeCache.size,applied:this.appliedStyles.size},observers:{system:!!this.mediaQueryObserver,storage:!!this.storageListener,mutation:!!this.mutationObserver,viewport:!!this.compactObserver}}}debug(){return console.table(this.getThemeInfo()),this.getThemeInfo()}destroy(){this.mediaQueryObserver&&this.mediaQueryObserver.removeEventListener("change",this._setupSystemObserver),this.storageListener&&window.removeEventListener("storage",this.storageListener),this.mutationObserver&&this.mutationObserver.disconnect(),this.compactObserver&&this.compactObserver.removeEventListener("change",this._setupViewportObserver),this.changeCallbacks.clear(),this.themeCache.clear(),this.appliedStyles.clear(),this._saveCustomThemes();const e=document.getElementById("limbo-theme-styles");e&&e.remove(),this.isInitialized=!1}}const wl=new class{constructor(){this.config=new w,this.instances=new hl,this.autoInputs=new pl,this.events=new fl,this.modals=new gl,this.theme=new yl,this.containerQueryDetector=A,this._setupInternalListeners(),this._initializeContainerQueries()}configure(e){var t;return this.config.setGlobal(e),t={publicKey:e.publicKey,apiKey:e.apiKey,token:e.token,authMode:e.authMode||"manual",tokenProvider:e.tokenProvider,prod:Boolean(e.prod)||!1,mode:e.mode||"embed",callbacks:e.callbacks||null},Z={...Z,...t},Z.authMode||(Z.token?Z.authMode="manual":Z.authMode="session"),this.config}setToken(e){return function(e){Z.token=e}(e),this.config.setGlobal({token:e}),this}create(e){const t=this.config.merge(e);return this.instances.create(t,this.events,this.modals)}configureAutoInputs(e){return this.autoInputs.configure(e,this.config,this.events)}setTheme(e){return e&&(this.config.set("theme",e),this.theme.setTheme(e),this.events.emit("theme:changed",{theme:e})),this}getTheme(){return this.theme.getCurrentTheme()}scanAndActivate(e=null){const t=this.autoInputs.config?.dataset||"data-limbo-input-file",n=e||`[${t}]`,l=document.querySelectorAll(n);if(0===l.length)return{found:0,processed:0,skipped:0};let r=0,a=0;return l.forEach(e=>{try{this.autoInputs._processInput(e),r++}catch(t){console.warn(`⚠️ Limbo: Error procesando input ${e.id||e.name}:`,t),a++}}),this.events.emit("limbo:scanCompleted",{found:l.length,processed:r,skipped:a,inputs:Array.from(l)}),{found:l.length,processed:r,skipped:a}}_initializeContainerQueries(){this.containerQueryDetector.observeResize(),setTimeout(()=>{document.querySelectorAll(".limbo-component-container-wrapper").forEach(e=>{this.containerQueryDetector.applyResponsiveClasses(e)})},100)}rescan(e=document){const t=this.autoInputs.config?.dataset||"data-limbo-input-file",n=e.querySelectorAll(`[${t}]`);let l=0;return n.forEach(e=>{if(!this.autoInputs.instances.has(this.autoInputs._getInputId(e)))try{this.autoInputs._processInput(e),l++}catch(t){console.warn("⚠️ Limbo: Error procesando nuevo input:",t)}}),l}init(e){const t=this._mapLegacyOptions(e);return this.create(t)}getInstances(){return this.instances.getAll()}destroy(){this.instances.destroyAll(),this.autoInputs.cleanup(),this.events.cleanup(),this.theme.removeTheme()}_mapLegacyOptions(e){return{container:e.container||"#image-manager",mode:"embed",features:["gallery","upload","cropper"],apiKey:e.apiKey,prod:e.prod||!1,url:void 0===e.url||e.url}}_setupInternalListeners(){this.events.on("autoInputs:modalRequest",({config:e,callback:t,input:n})=>{this._handleAutoInputModalRequest({config:e,callback:t,input:n})})}_handleAutoInputModalRequest({config:e,callback:t,input:n}){const l=n,r=async n=>{let r={};if(n.crops&&n.crops.length>0){const e=n.asset||n.original;r.original={url:e?.url||e?.urlSigned||n.originalUrl,width:e?.width||n.originalWidth,height:e?.height||n.originalHeight,assetId:e?.id||n.assetId},r.images=n.crops.map(e=>({url:e.url||e.urlSigned,width:e.width,height:e.height,name:e.name||e.filename}))}else n.asset?r.original={url:n.asset.url||n.asset.urlSigned,width:n.asset.width,height:n.asset.height,assetId:n.asset.id}:n.master?.urlSigned||n.master?.url?r.original={url:n.master.urlSigned||n.master.url,width:n.master.width||n.width,height:n.master.height||n.height,assetId:n.assetId}:n.url||n.urlSigned?r.original={url:n.url||n.urlSigned,width:n.width,height:n.height,assetId:n.assetId||n.id}:(console.warn("[Limbo] handleResult: formato de datos no reconocido",n),r=n);if(l){var a=e?.returnConfig?.format||"json",i="";i="url"===a?r.images?.[0]?.url||r.original?.url||"":"assetId"===a?r.original?.assetId||"":JSON.stringify(r),l.value=i,l.dispatchEvent(new Event("change",{bubbles:!0})),console.log("[Limbo] ✅ Valor asignado al input:",l.value?.substring(0,80))}try{await t(r)}catch(o){}c.close()},a={...e,mode:"modal",autoDestroy:!0,interaction:{allowSelection:!0,allowCropping:!0,...e.interaction},callbacks:{onSelect:e=>{r(e)},onCropsSaved:e=>{r(e)},onCropperComplete:e=>{r(e)},onUpload:t=>{"upload-only"!==e.modeUI||e.features?.includes("cropper")||r(t)},onClose:()=>{}}},i=e.validation?.accept||null,o=i?f(i):null,s=!o||o.isAllTypes||o.includesImages;if(e.initialImageUrl&&s){const t=this._extractAssetIdFromUrl(e.initialImageUrl)||e.existingData?.original?.assetId||null;t&&(a._externalImage={url:e.initialImageUrl,filename:e.initialImageUrl.split("/").pop()?.split("?")[0]||"image.jpg",width:1920,height:1080,mime_type:"image/jpeg",id:t})}e.cropper&&(a.cropper=e.cropper),this.config.setGlobal({interaction:{allowSelection:!0,allowCropping:!0,...e.interaction}});const c=this.create(a);c.open()}_extractAssetIdFromUrl(e){if(!e)return null;try{const t=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi,n=e.match(t);return n&&n.length>=2?n[1]:n&&1===n.length?n[0]:null}catch(t){return console.warn("Error extracting asset ID from URL:",t),null}}openGallery(e={}){const t=this.create({mode:"modal",modeUI:"gallery-only",features:["gallery"],autoDestroy:!0,modal:{title:e.title||"Seleccionar Imagen",size:e.size||"large"},validation:{accept:e.accept||null},callbacks:{onSelect:n=>{e.onSelect?.(n),!1!==e.autoClose&&t.close()}},...e});return t.open(),t}openUploader(e={}){const t=!1!==e.redirectToGallery?["upload","gallery"]:["upload"],n=this.create({mode:"modal",modeUI:!1!==e.redirectToGallery?"full":"upload-only",features:t,autoDestroy:!0,modal:{title:e.title||"Subir Imagen",size:e.size||"medium"},validation:{accept:e.accept||null},callbacks:{onUpload:t=>{e.onUpload?.(t),!1===e.autoClose||e.redirectToGallery||n.close()}},...e});return n.open(),n}openCropper(e,t={}){if(!e)throw new Error("Limbo.openCropper: imageUrl es requerido");const n={url:e,filename:t.filename||"image.jpg",width:t.width||1920,height:t.height||1080,mime_type:t.mimeType||"image/jpeg",id:t.assetId||`external-${Date.now()}`},l=this.create({mode:"modal",modeUI:"crop-only",features:["cropper"],autoDestroy:!0,modal:{title:t.title||"Recortar Imagen",size:"xlarge"},cropper:{mandatoryCrops:t.mandatoryCrops||[],allowCustomCrops:!1!==t.allowCustomCrops,enforceRequiredCrops:!1!==t.enforceRequiredCrops},callbacks:{onCropperComplete:e=>{t.onComplete?.(e),!1!==t.autoClose&&l.close()},onCropperCancelled:e=>{t.onCancelled?.(e),!1!==t.autoClose&&l.close()},onCropperError:e=>{t.onError?.(e)}},_externalImage:n,...t});return l.open(),l}createInlineGallery(e,t={}){return this.create({container:e,mode:"embed",modeUI:"gallery-only",features:["gallery"],validation:{accept:t.accept||null},callbacks:{onSelect:t.onSelect,onDelete:t.onDelete},...t})}createInlineUploader(e,t={}){return this.create({container:e,mode:"embed",modeUI:"upload-only",features:["upload"],validation:{accept:t.accept||null},callbacks:{onUpload:t.onUpload},...t})}createStandaloneCropper(e,t,n={}){if(!e)throw new Error("Limbo.createStandaloneCropper: container es requerido");if(!t)throw new Error("Limbo.createStandaloneCropper: imageUrl es requerido");const l={url:t,filename:n.filename||"image.jpg",width:n.width||1920,height:n.height||1080,mime_type:n.mimeType||"image/jpeg",id:n.assetId||`external-${Date.now()}`};return this.create({container:e,mode:"embed",modeUI:"crop-only",features:["cropper"],autoHideOnComplete:!1!==n.autoHideOnComplete,cropper:{mandatoryCrops:n.mandatoryCrops||[],allowCustomCrops:!1!==n.allowCustomCrops,enforceRequiredCrops:!1!==n.enforceRequiredCrops},callbacks:{onCropperComplete:n.onComplete,onCropperCancelled:n.onCancelled,onCropperError:n.onError},_externalImage:l,...n})}createFullSelector(e,t={}){return this.create({container:e,mode:t.mode||"embed",modeUI:"full",features:["gallery","upload","cropper"],validation:{accept:t.accept||null},callbacks:{onSelect:t.onSelect,onUpload:t.onUpload,onDelete:t.onDelete,onCropsSaved:t.onCropsSaved},...t})}};"undefined"!=typeof window&&(window.Limbo=wl,window.limboCore=wl);"undefined"!=typeof window&&document.querySelector("#root")&&(wl.configure({prod:!1,publicKey:"pk_e464fd744106b7a8d63d453c4bd02582",authMode:"session"}),wl.create({container:"#root",mode:"embed",modeUI:"full",features:["gallery","upload","cropper"],title:"Limbo Image Manager - Development",url:!0}),wl.configureAutoInputs({dataset:"data-limbo-input-file",return:"json",features:["gallery","upload","cropper"],modeUI:"full",modalSize:"large",title:"Seleccionar archivo",crops:"free",allowDelete:!1}));export{I as LIMBO_BASE_URL,O as decodeHtmlEntities,wl as default,j as extractImageUrl,R as isValidImageUrl,F as parseImageData,W as prepareImageFieldsForPreview,D as resolveUrl};
695
695
  //# sourceMappingURL=limbo.es.map