Spaces:
Running
Running
db pooling
Browse files- py_backend/app/crud.py +13 -2
- py_backend/app/database.py +9 -1
- py_backend/app/routers/images_listing.py +4 -2
- py_backend/app/utils/image_utils.py +11 -5
- py_backend/static/assets/AdminPage-CKOHTtPR.js +0 -35
- py_backend/static/assets/ExportModal-DYxnGjiT.js +0 -1
- py_backend/static/assets/index-CUpOp1T1.js +0 -2
- py_backend/static/assets/index-DHoU8ejU.js +0 -2
- py_backend/static/assets/index-DnPgbq1Q.js +0 -0
- py_backend/static/assets/index-DvKkI06h.js +0 -1
- py_backend/static/assets/jszip.min-DJ3yWU3V.js +0 -12
- py_backend/static/assets/useAdmin-qpJv9-Qq.js +0 -1
- py_backend/static/index.html +3 -4
py_backend/app/crud.py
CHANGED
|
@@ -222,12 +222,23 @@ def get_captions_with_images_filtered(
|
|
| 222 |
base_query = base_query.having(effective_count > 1)
|
| 223 |
|
| 224 |
if needs_grouping:
|
| 225 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 226 |
elif needs_image_join:
|
| 227 |
count_query = base_query.with_entities(func.count(distinct(models.Captions.caption_id)))
|
|
|
|
| 228 |
else:
|
| 229 |
count_query = base_query.with_entities(func.count(models.Captions.caption_id))
|
| 230 |
-
|
| 231 |
|
| 232 |
query = base_query.order_by(models.Captions.created_at.desc())
|
| 233 |
|
|
|
|
| 222 |
base_query = base_query.having(effective_count > 1)
|
| 223 |
|
| 224 |
if needs_grouping:
|
| 225 |
+
total_count = count_captions_with_images_filtered(
|
| 226 |
+
db=db,
|
| 227 |
+
search=search,
|
| 228 |
+
source=source,
|
| 229 |
+
event_type=event_type,
|
| 230 |
+
region=region,
|
| 231 |
+
country=country,
|
| 232 |
+
image_type=image_type,
|
| 233 |
+
upload_type=upload_type,
|
| 234 |
+
starred_only=starred_only
|
| 235 |
+
)
|
| 236 |
elif needs_image_join:
|
| 237 |
count_query = base_query.with_entities(func.count(distinct(models.Captions.caption_id)))
|
| 238 |
+
total_count = count_query.scalar()
|
| 239 |
else:
|
| 240 |
count_query = base_query.with_entities(func.count(models.Captions.caption_id))
|
| 241 |
+
total_count = count_query.scalar()
|
| 242 |
|
| 243 |
query = base_query.order_by(models.Captions.created_at.desc())
|
| 244 |
|
py_backend/app/database.py
CHANGED
|
@@ -22,10 +22,18 @@ if "sslmode=" not in raw_db_url and "localhost" not in raw_db_url and "127.0.0.1
|
|
| 22 |
|
| 23 |
logger.debug(f"database url: {raw_db_url}")
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
engine = create_engine(
|
| 26 |
raw_db_url,
|
| 27 |
pool_pre_ping=True,
|
| 28 |
-
pool_recycle=300,
|
|
|
|
|
|
|
| 29 |
)
|
| 30 |
|
| 31 |
SessionLocal = sessionmaker(
|
|
|
|
| 22 |
|
| 23 |
logger.debug(f"database url: {raw_db_url}")
|
| 24 |
|
| 25 |
+
# Connection pool configuration:
|
| 26 |
+
# - pool_size: number of persistent connections to keep (default: 5)
|
| 27 |
+
# - max_overflow: additional connections beyond pool_size (default: 10)
|
| 28 |
+
# Total max connections = pool_size + max_overflow = 20
|
| 29 |
+
# - pool_pre_ping: test connections before use to handle stale connections
|
| 30 |
+
# - pool_recycle: recycle connections after 300 seconds to prevent stale connections
|
| 31 |
engine = create_engine(
|
| 32 |
raw_db_url,
|
| 33 |
pool_pre_ping=True,
|
| 34 |
+
pool_recycle=300,
|
| 35 |
+
pool_size=10,
|
| 36 |
+
max_overflow=10,
|
| 37 |
)
|
| 38 |
|
| 39 |
SessionLocal = sessionmaker(
|
py_backend/app/routers/images_listing.py
CHANGED
|
@@ -25,9 +25,10 @@ def list_images(db: Session = Depends(get_db)):
|
|
| 25 |
"""Get all images with their caption data"""
|
| 26 |
logger.debug("Listing all images")
|
| 27 |
images = crud.get_images(db)
|
|
|
|
| 28 |
result = []
|
| 29 |
for img in images:
|
| 30 |
-
img_dict = convert_image_to_dict(img, f"/api/images/{img.image_id}/file")
|
| 31 |
result.append(schemas.ImageOut(**img_dict))
|
| 32 |
|
| 33 |
logger.info(f"Returned {len(result)} images")
|
|
@@ -73,9 +74,10 @@ def list_images_grouped(
|
|
| 73 |
**filters
|
| 74 |
)
|
| 75 |
|
|
|
|
| 76 |
result = []
|
| 77 |
for img in images:
|
| 78 |
-
img_dict = convert_image_to_dict(img, f"/api/images/{img.image_id}/file")
|
| 79 |
result.append(schemas.ImageOut(**img_dict))
|
| 80 |
|
| 81 |
logger.info(f"Returned {len(result)} images for page {page}")
|
|
|
|
| 25 |
"""Get all images with their caption data"""
|
| 26 |
logger.debug("Listing all images")
|
| 27 |
images = crud.get_images(db)
|
| 28 |
+
url_cache: dict[str, str] = {}
|
| 29 |
result = []
|
| 30 |
for img in images:
|
| 31 |
+
img_dict = convert_image_to_dict(img, f"/api/images/{img.image_id}/file", url_cache=url_cache)
|
| 32 |
result.append(schemas.ImageOut(**img_dict))
|
| 33 |
|
| 34 |
logger.info(f"Returned {len(result)} images")
|
|
|
|
| 74 |
**filters
|
| 75 |
)
|
| 76 |
|
| 77 |
+
url_cache: dict[str, str] = {}
|
| 78 |
result = []
|
| 79 |
for img in images:
|
| 80 |
+
img_dict = convert_image_to_dict(img, f"/api/images/{img.image_id}/file", url_cache=url_cache)
|
| 81 |
result.append(schemas.ImageOut(**img_dict))
|
| 82 |
|
| 83 |
logger.info(f"Returned {len(result)} images for page {page}")
|
py_backend/app/utils/image_utils.py
CHANGED
|
@@ -2,14 +2,20 @@
|
|
| 2 |
Shared utilities for image operations
|
| 3 |
"""
|
| 4 |
import logging
|
| 5 |
-
from typing import Dict, Any
|
| 6 |
from sqlalchemy.orm import Session
|
| 7 |
from .. import crud, storage
|
| 8 |
|
| 9 |
logger = logging.getLogger(__name__)
|
| 10 |
|
| 11 |
-
def convert_image_to_dict(img, image_url: str) -> Dict[str, Any]:
|
| 12 |
-
"""Helper function to convert SQLAlchemy image model to dict for Pydantic
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
countries_list = []
|
| 14 |
if hasattr(img, 'countries') and img.countries is not None:
|
| 15 |
try:
|
|
@@ -62,13 +68,13 @@ def convert_image_to_dict(img, image_url: str) -> Dict[str, Any]:
|
|
| 62 |
|
| 63 |
if hasattr(img, 'thumbnail_key') and img.thumbnail_key:
|
| 64 |
try:
|
| 65 |
-
thumbnail_url = storage.get_object_url(img.thumbnail_key)
|
| 66 |
except Exception as e:
|
| 67 |
logger.warning(f"Error generating thumbnail URL for image {img.image_id}: {e}")
|
| 68 |
|
| 69 |
if hasattr(img, 'detail_key') and img.detail_key:
|
| 70 |
try:
|
| 71 |
-
detail_url = storage.get_object_url(img.detail_key)
|
| 72 |
except Exception as e:
|
| 73 |
logger.warning(f"Error generating detail URL for image {img.image_id}: {e}")
|
| 74 |
|
|
|
|
| 2 |
Shared utilities for image operations
|
| 3 |
"""
|
| 4 |
import logging
|
| 5 |
+
from typing import Dict, Any, Optional
|
| 6 |
from sqlalchemy.orm import Session
|
| 7 |
from .. import crud, storage
|
| 8 |
|
| 9 |
logger = logging.getLogger(__name__)
|
| 10 |
|
| 11 |
+
def convert_image_to_dict(img, image_url: str, url_cache: Optional[Dict[str, str]] = None) -> Dict[str, Any]:
|
| 12 |
+
"""Helper function to convert SQLAlchemy image model to dict for Pydantic
|
| 13 |
+
|
| 14 |
+
Args:
|
| 15 |
+
img: SQLAlchemy image model instance
|
| 16 |
+
image_url: URL for the main image file
|
| 17 |
+
url_cache: Optional dict to cache generated URLs by key, avoiding duplicate presigned URL generation
|
| 18 |
+
"""
|
| 19 |
countries_list = []
|
| 20 |
if hasattr(img, 'countries') and img.countries is not None:
|
| 21 |
try:
|
|
|
|
| 68 |
|
| 69 |
if hasattr(img, 'thumbnail_key') and img.thumbnail_key:
|
| 70 |
try:
|
| 71 |
+
thumbnail_url = storage.get_object_url(img.thumbnail_key, cache=url_cache)
|
| 72 |
except Exception as e:
|
| 73 |
logger.warning(f"Error generating thumbnail URL for image {img.image_id}: {e}")
|
| 74 |
|
| 75 |
if hasattr(img, 'detail_key') and img.detail_key:
|
| 76 |
try:
|
| 77 |
+
detail_url = storage.get_object_url(img.detail_key, cache=url_cache)
|
| 78 |
except Exception as e:
|
| 79 |
logger.warning(f"Error generating detail URL for image {img.image_id}: {e}")
|
| 80 |
|
py_backend/static/assets/AdminPage-CKOHTtPR.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
| 1 |
-
import{r as t,j as a,N as K,H as Je,O as m,z as j,I as re,_ as Ge,n as i,J as b}from"./index-DnPgbq1Q.js";import{u as Ve}from"./useAdmin-qpJv9-Qq.js";const We="_adminContainer_j11pf_5",qe="_adminHeader_j11pf_13",Ke="_adminSection_j11pf_20",Ye="_modelSelectionArea_j11pf_29",Qe="_modelSelectionRow_j11pf_36",Xe="_modelsTable_j11pf_89",Ze="_promptSubsection_j11pf_97",ea="_promptSubsectionTitle_j11pf_109",aa="_modelCode_j11pf_152",la="_modelId_j11pf_157",sa="_modelActions_j11pf_163",oa="_addModelButtonContainer_j11pf_169",ta="_addModelForm_j11pf_177",ia="_addModelFormTitle_j11pf_185",da="_addModelFormGrid_j11pf_193",na="_addModelFormField_j11pf_206",ra="_addModelFormCheckbox_j11pf_250",ca="_addModelFormActions_j11pf_268",ma="_modalOverlay_j11pf_277",ha="_modalContent_j11pf_291",pa="_modalBody_j11pf_302",xa="_modalTitle_j11pf_312",ua="_modalText_j11pf_320",ja="_modalTextLeft_j11pf_332",_a="_modalButtons_j11pf_355",va="_modalForm_j11pf_363",ga="_formField_j11pf_372",fa="_formLabel_j11pf_376",ba="_formInput_j11pf_385",ya="_textarea_j11pf_407",l={adminContainer:We,adminHeader:qe,adminSection:Ke,modelSelectionArea:Ye,modelSelectionRow:Qe,modelsTable:Xe,promptSubsection:Ze,promptSubsectionTitle:ea,modelCode:aa,modelId:la,modelActions:sa,addModelButtonContainer:oa,addModelForm:ta,addModelFormTitle:ia,addModelFormGrid:da,addModelFormField:na,addModelFormCheckbox:ra,addModelFormActions:ca,modalOverlay:ma,modalContent:ha,modalBody:pa,modalTitle:xa,modalText:ua,modalTextLeft:ja,modalButtons:_a,modalForm:va,formField:ga,formLabel:fa,formInput:ba,textarea:ya},A="selectedVlmModel";function Sa(){const{isAuthenticated:_,isLoading:ce,login:me,logout:he,verifyToken:Y}=Ve(),[$,Q]=t.useState(""),[X,v]=t.useState(""),[Z,ee]=t.useState(!1),[I,y]=t.useState([]),[pe,N]=t.useState(""),[xe,C]=t.useState(""),[ae,P]=t.useState([]),[ue,E]=t.useState([]),[je,L]=t.useState([]),[_e,S]=t.useState(!1),[B,O]=t.useState(null),[D,g]=t.useState({schema_id:"",title:"",version:"",schema:{}}),[ve,k]=t.useState(!1),[ge,w]=t.useState(!1),[fe,U]=t.useState(null),[M,z]=t.useState(null),[n,r]=t.useState({p_code:"",label:"",metadata_instructions:"",image_type:"crisis_map",is_active:!1}),[le,R]=t.useState(!1),[be,H]=t.useState(!1),[J,G]=t.useState(null),[o,c]=t.useState({m_code:"",label:"",model_type:"custom",provider:"huggingface",model_id:"",is_available:!1,is_fallback:!1}),[ye,T]=t.useState(!1),[Ne,V]=t.useState(!1),[Ce,p]=t.useState(!1),[se,oe]=t.useState(""),[Se,ke]=t.useState(""),[we,x]=t.useState(""),[Me,F]=t.useState(""),u=t.useCallback(()=>{fetch("/api/models").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}: ${e.statusText}`);return e.json()}).then(e=>{if(console.log("Models data received:",e),e&&Array.isArray(e.models)){y(e.models);const s=localStorage.getItem(A);if(e.models.length>0)if(s==="random")N("random");else if(s&&e.models.find(d=>d.m_code===s&&d.is_available))N(s);else{const d=e.models.find(h=>h.is_available)||e.models[0];N(d.m_code),localStorage.setItem(A,d.m_code)}}else console.error("Expected models object but got:",e),y([])}).catch(e=>{console.error("Error fetching models:",e),y([])}),fetch("/api/admin/fallback-model",{headers:{Authorization:`Bearer ${localStorage.getItem("adminToken")}`}}).then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}: ${e.statusText}`);return e.json()}).then(e=>{console.log("Fallback model data received:",e),e.fallback_model?C(e.fallback_model.m_code):C("")}).catch(e=>{console.error("Error fetching fallback model:",e),C("")})},[]),f=t.useCallback(()=>{console.log("=== fetchPrompts called ==="),fetch("/api/prompts").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}: ${e.statusText}`);return e.json()}).then(e=>{console.log("Prompts data received:",e),Array.isArray(e)?P(e):(console.error("Expected array but got:",e),P([])),console.log("State update triggered with:",e||[])}).catch(e=>{console.error("Error fetching prompts:",e),P([])})},[]),te=t.useCallback(()=>{fetch("/api/image-types").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}: ${e.statusText}`);return e.json()}).then(e=>{console.log("Image types data received:",e),Array.isArray(e)?E(e):(console.error("Expected array but got:",e),E([]))}).catch(e=>{console.error("Error fetching image types:",e),E([])})},[]),W=t.useCallback(()=>{console.log("=== fetchSchemas called ==="),fetch("/api/schemas",{headers:{Authorization:`Bearer ${localStorage.getItem("adminToken")}`}}).then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}: ${e.statusText}`);return e.json()}).then(e=>{console.log("Schemas data received:",e),Array.isArray(e)?L(e):(console.error("Expected array but got:",e),L([]))}).catch(e=>{console.error("Error fetching schemas:",e),L([])})},[]);t.useEffect(()=>{_&&(u(),f(),te(),W())},[_,u,f,te,W]),t.useEffect(()=>{_&&Y()},[_,Y]);const ie=e=>{z(e),r({p_code:e.p_code,label:e.label||"",metadata_instructions:e.metadata_instructions||"",image_type:e.image_type||"crisis_map",is_active:e.is_active||!1}),k(!0)},Te=async()=>{try{if(!M){alert("No prompt selected for editing");return}const e=await fetch(`/api/prompts/${M.p_code}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({label:n.label,metadata_instructions:n.metadata_instructions,image_type:n.image_type,is_active:n.is_active})});if(e.ok)f(),k(!1),z(null),r({p_code:"",label:"",metadata_instructions:"",image_type:"crisis_map",is_active:!1});else{const s=await e.json();alert(`Failed to update prompt: ${s.error||"Unknown error"}`)}}catch{alert("Error updating prompt")}},de=async(e,s)=>{try{const d=await fetch(`/api/prompts/${e}/toggle-active?image_type=${s}`,{method:"POST",headers:{"Content-Type":"application/json"}});if(d.ok)f();else{const h=await d.json();alert(`Failed to toggle prompt active status: ${h.detail||"Unknown error"}`)}}catch{alert("Error toggling prompt active status")}},ne=e=>{U(e),r({p_code:"",label:"",metadata_instructions:"",image_type:e,is_active:!1}),w(!0)},Fe=async()=>{try{const e=await fetch("/api/prompts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(e.ok)f(),w(!1),U(null),r({p_code:"",label:"",metadata_instructions:"",image_type:"crisis_map",is_active:!1});else{const s=await e.json();alert(`Failed to create prompt: ${s.detail||"Unknown error"}`)}}catch{alert("Error creating prompt")}},Ae=e=>{O(e),g({schema_id:e.schema_id,title:e.title,version:e.version,schema:e.schema}),S(!0)},$e=async()=>{try{if(!B){alert("No schema selected for editing");return}const e=await fetch(`/api/schemas/${B.schema_id}`,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("adminToken")}`},body:JSON.stringify(D)});if(e.ok)W(),S(!1),O(null),g({schema_id:"",title:"",version:"",schema:{}});else{const s=await e.json();alert(`Failed to save schema: ${s.detail||"Unknown error"}`)}}catch(e){console.error("Error saving schema:",e),alert("Error saving schema")}},Ie=()=>{S(!1),O(null),g({schema_id:"",title:"",version:"",schema:{}})},Pe=async(e,s)=>{try{const d=await fetch(`/api/models/${e}/toggle`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({is_available:!s})});if(d.ok)y(h=>(h||[]).map(q=>q.m_code===e?{...q,is_available:!s}:q));else{const h=await d.json();alert(`Failed to toggle model availability: ${h.error||"Unknown error"}`)}}catch{alert("Error toggling model availability")}},Ee=e=>{N(e),e==="random"?localStorage.setItem(A,"random"):localStorage.setItem(A,e)},Le=async e=>{try{const s=await fetch(`/api/admin/models/${e}`,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("adminToken")}`},body:JSON.stringify({is_fallback:!0})});if(s.ok)C(e),u();else{const d=await s.json();alert(`Failed to set fallback model: ${d.detail||"Unknown error"}`)}}catch{alert("Error setting fallback model")}},Be=async()=>{try{const e=await fetch("/api/admin/models",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("adminToken")}`},body:JSON.stringify(o)});if(e.ok){const s=`
|
| 2 |
-
Model "${o.label}" added successfully!
|
| 3 |
-
|
| 4 |
-
⚠️ IMPORTANT: Model will NOT work until you complete these steps:
|
| 5 |
-
|
| 6 |
-
1. 🔑 Ensure API key is set and valid.
|
| 7 |
-
|
| 8 |
-
2. 📝 Verify model_id format.
|
| 9 |
-
|
| 10 |
-
3. 📚 Check model specific documentation for details.
|
| 11 |
-
`;ke(s),V(!0),R(!1),c({m_code:"",label:"",model_type:"custom",provider:"huggingface",model_id:"",is_available:!1,is_fallback:!1}),u()}else{const s=await e.json();alert(`Failed to add model: ${s.detail||"Unknown error"}`)}}catch{alert("Error adding model")}},Oe=e=>{G(e),c({m_code:e.m_code,label:e.label,model_type:e.model_type||"custom",provider:e.provider||e.config?.provider||"huggingface",model_id:e.model_id||e.config?.model_id||e.m_code,is_available:e.is_available,is_fallback:e.is_fallback}),H(!0)},De=async()=>{try{console.log("Updating model with data:",o);const e={label:o.label,model_type:o.model_type,provider:o.provider,model_id:o.model_id,is_available:o.is_available};if(console.log("Update payload:",e),!J){alert("No model selected for editing");return}const s=await fetch(`/api/admin/models/${J.m_code}`,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("adminToken")}`},body:JSON.stringify(e)});if(console.log("Update response status:",s.status),s.ok){const d=await s.json();console.log("Update successful:",d),H(!1),G(null),c({m_code:"",label:"",model_type:"custom",provider:"huggingface",model_id:"",is_available:!1,is_fallback:!1}),console.log("Refreshing models..."),u()}else{const d=await s.json();console.error("Update failed:",d),alert(`Failed to update model: ${d.detail||"Unknown error"}`)}}catch(e){console.error("Update error:",e),alert("Error updating model")}},Ue=async e=>{oe(e),T(!0)},ze=async()=>{try{const e=await fetch(`/api/admin/models/${se}`,{method:"DELETE",headers:{Authorization:`Bearer ${localStorage.getItem("adminToken")}`}});if(e.ok)T(!1),oe(""),u();else{const s=await e.json();alert(`Failed to delete model: ${s.detail||"Unknown error"}`)}}catch{alert("Error deleting model")}},Re=async e=>{if(e.preventDefault(),!$.trim()){v("Please enter a password");return}ee(!0),v("");try{await me($)||v("Invalid password")}catch{v("Login failed. Please try again.")}finally{ee(!1)}},He=()=>{he(),Q(""),v("")};return ce?a.jsx(K,{children:a.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-ifrcRed mx-auto mb-4"}),a.jsx("p",{className:"text-gray-600",children:"Loading..."})]})})}):_?a.jsxs(K,{children:[a.jsxs("div",{className:l.adminContainer,children:[a.jsx("div",{className:l.adminHeader,children:a.jsx(i,{name:"logout",variant:"secondary",onClick:He,children:"Logout"})}),a.jsxs("div",{className:l.adminSection,children:[a.jsx(j,{heading:"VLM Model Selection",headingLevel:2,withHeaderBorder:!0,withInternalPadding:!0,children:a.jsxs("div",{className:l.modelSelectionArea,children:[a.jsx("p",{className:"text-gray-700",children:"Select which Vision Language Model to use for caption generation."}),a.jsxs("div",{className:l.modelSelectionRow,children:[a.jsx(b,{label:"Model",name:"selected-model",value:pe,onChange:e=>Ee(e||""),options:[{value:"random",label:"Random"},...(I||[]).filter(e=>e.is_available).map(e=>({value:e.m_code,label:e.label}))],keySelector:e=>e.value,labelSelector:e=>e.label}),a.jsx(b,{label:"Fallback",name:"fallback-model",value:xe,onChange:e=>Le(e||""),options:[{value:"",label:"No fallback (use STUB_MODEL)"},...(I||[]).filter(e=>e.is_available).map(e=>({value:e.m_code,label:e.label}))],keySelector:e=>e.value,labelSelector:e=>e.label})]})]})}),a.jsx(j,{heading:"Model Management",headingLevel:2,withHeaderBorder:!0,withInternalPadding:!0,children:a.jsxs("div",{className:l.modelManagementArea,children:[a.jsx("div",{className:l.modelsTable,children:a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Code"}),a.jsx("th",{children:"Label"}),a.jsx("th",{children:"Provider"}),a.jsx("th",{children:"Model ID"}),a.jsx("th",{children:"Available"}),a.jsx("th",{children:"Actions"})]})}),a.jsx("tbody",{children:(I||[]).map(e=>a.jsxs("tr",{children:[a.jsx("td",{className:l.modelCode,children:e.m_code}),a.jsx("td",{children:e.label}),a.jsx("td",{children:e.provider||e.config?.provider||"huggingface"}),a.jsx("td",{className:l.modelId,children:e.model_id||e.config?.model_id||e.m_code||"N/A"}),a.jsx("td",{children:a.jsx(i,{name:`toggle-${e.m_code}`,variant:e.is_available?"primary":"secondary",size:1,onClick:()=>Pe(e.m_code,e.is_available),children:e.is_available?"Enabled":"Disabled"})}),a.jsx("td",{children:a.jsxs("div",{className:l.modelActions,children:[a.jsx(i,{name:`edit-${e.m_code}`,variant:"secondary",size:1,onClick:()=>Oe(e),children:"Edit"}),a.jsx(i,{name:`delete-${e.m_code}`,variant:"secondary",size:1,onClick:()=>Ue(e.m_code),children:"Delete"})]})})]},e.m_code))})]})}),!le&&a.jsx("div",{className:l.addModelButtonContainer,children:a.jsx(i,{name:"show-add-form",variant:"primary",onClick:()=>R(!0),children:"Add New Model"})}),le&&a.jsxs("div",{className:l.addModelForm,children:[a.jsx("h4",{className:l.addModelFormTitle,children:"Add New Model"}),a.jsxs("div",{className:l.addModelFormGrid,children:[a.jsx("div",{className:l.addModelFormField,children:a.jsx(m,{label:"Model Code",name:"model-code",value:o.m_code,onChange:e=>c({...o,m_code:e||""}),placeholder:"e.g., NEW_MODEL_123"})}),a.jsx("div",{className:l.addModelFormField,children:a.jsx(m,{label:"Label",name:"model-label",value:o.label,onChange:e=>c({...o,label:e||""}),placeholder:"e.g., New Model Name"})}),a.jsx("div",{className:l.addModelFormField,children:a.jsx(b,{label:"Provider",name:"model-provider",value:o.provider,onChange:e=>c({...o,provider:e||"huggingface"}),options:[{value:"huggingface",label:"HuggingFace"},{value:"openai",label:"OpenAI"},{value:"google",label:"Google"}],keySelector:e=>e.value,labelSelector:e=>e.label})}),a.jsx("div",{className:l.addModelFormField,children:a.jsx(m,{label:"Model ID",name:"model-id",value:o.model_id,onChange:e=>c({...o,model_id:e||""}),placeholder:"e.g., org/model-name"})}),a.jsx("div",{className:l.addModelFormField,children:a.jsxs("div",{className:l.addModelFormCheckbox,children:[a.jsx("input",{type:"checkbox",checked:o.is_available,onChange:e=>c({...o,is_available:e.target.checked})}),a.jsx("span",{children:"Available for use"})]})})]}),a.jsxs("div",{className:l.addModelFormActions,children:[a.jsx(i,{name:"save-model",variant:"primary",onClick:Be,disabled:!o.m_code||!o.label||!o.model_id,children:"Save Model"}),a.jsx(i,{name:"cancel-add",variant:"secondary",onClick:()=>R(!1),children:"Cancel"})]})]}),be&&a.jsxs("div",{className:l.addModelForm,children:[a.jsxs("h4",{className:l.addModelFormTitle,children:["Edit Model: ",J?.label]}),a.jsxs("div",{className:l.addModelFormGrid,children:[a.jsx("div",{className:l.addModelFormField,children:a.jsx(m,{label:"Model Code",name:"model-code",value:o.m_code,onChange:e=>c({...o,m_code:e||""}),placeholder:"e.g., NEW_MODEL_123",disabled:!0})}),a.jsx("div",{className:l.addModelFormField,children:a.jsx(m,{label:"Label",name:"model-label",value:o.label,onChange:e=>c({...o,label:e||""}),placeholder:"e.g., New Model Name"})}),a.jsx("div",{className:l.addModelFormField,children:a.jsx(b,{label:"Provider",name:"model-provider",value:o.provider,onChange:e=>c({...o,provider:e||"huggingface"}),options:[{value:"huggingface",label:"HuggingFace"},{value:"openai",label:"OpenAI"},{value:"google",label:"Google"}],keySelector:e=>e.value,labelSelector:e=>e.label})}),a.jsx("div",{className:l.addModelFormField,children:a.jsx(m,{label:"Model ID",name:"model-id",value:o.model_id,onChange:e=>c({...o,model_id:e||""}),placeholder:"e.g., org/model-name"})}),a.jsx("div",{className:l.addModelFormField,children:a.jsxs("div",{className:l.addModelFormCheckbox,children:[a.jsx("input",{type:"checkbox",checked:o.is_available,onChange:e=>c({...o,is_available:e.target.checked})}),a.jsx("span",{children:"Available for use"})]})})]}),a.jsxs("div",{className:l.addModelFormActions,children:[a.jsx(i,{name:"update-model",variant:"primary",onClick:De,disabled:!o.m_code||!o.label||!o.model_id,children:"Update Model"}),a.jsx(i,{name:"cancel-edit",variant:"secondary",onClick:()=>{H(!1),G(null),c({m_code:"",label:"",model_type:"custom",provider:"huggingface",model_id:"",is_available:!1,is_fallback:!1})},children:"Cancel"})]})]})]})}),a.jsx(j,{heading:"Prompt Management",headingLevel:2,withHeaderBorder:!0,withInternalPadding:!0,children:a.jsxs("div",{className:l.modelManagementArea,children:[a.jsxs("div",{className:l.promptSubsection,children:[a.jsx("h4",{className:l.promptSubsectionTitle,children:"Crisis Maps"}),a.jsx("div",{className:l.modelsTable,children:a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Code"}),a.jsx("th",{children:"Label"}),a.jsx("th",{children:"Status"}),a.jsx("th",{children:"Actions"})]})}),a.jsx("tbody",{children:(ae||[]).filter(e=>e.image_type==="crisis_map").sort((e,s)=>e.p_code.localeCompare(s.p_code)).map(e=>a.jsxs("tr",{children:[a.jsx("td",{className:l.modelCode,children:e.p_code}),a.jsx("td",{className:l.promptLabel,children:e.label||"No label"}),a.jsx("td",{children:a.jsx(i,{name:`toggle-crisis-${e.p_code}`,variant:e.is_active?"primary":"secondary",size:1,onClick:()=>de(e.p_code,"crisis_map"),children:e.is_active?"Active":"Inactive"})}),a.jsx("td",{children:a.jsxs("div",{className:l.modelActions,children:[a.jsx(i,{name:`view-${e.p_code}`,variant:"secondary",size:1,onClick:()=>{x(`=== Prompt Details ===
|
| 12 |
-
Code: ${e.p_code}
|
| 13 |
-
Label: ${e.label}
|
| 14 |
-
Image Type: ${e.image_type}
|
| 15 |
-
Active: ${e.is_active}
|
| 16 |
-
|
| 17 |
-
Metadata Instructions:
|
| 18 |
-
${e.metadata_instructions||"No instructions available"}`),F(`Prompt: ${e.p_code}`),p(!0)},children:"View"}),a.jsx(i,{name:`edit-${e.p_code}`,variant:"secondary",size:1,onClick:()=>ie(e),children:"Edit"})]})})]},e.p_code))})]})}),a.jsx("div",{className:l.addModelButtonContainer,children:a.jsx(i,{name:"add-crisis-prompt",variant:"primary",onClick:()=>ne("crisis_map"),children:"Add New Crisis Map Prompt"})})]}),a.jsxs("div",{className:l.promptSubsection,children:[a.jsx("h4",{className:l.promptSubsectionTitle,children:"Drone Images"}),a.jsx("div",{className:l.modelsTable,children:a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Code"}),a.jsx("th",{children:"Label"}),a.jsx("th",{children:"Status"}),a.jsx("th",{children:"Actions"})]})}),a.jsx("tbody",{children:(ae||[]).filter(e=>e.image_type==="drone_image").sort((e,s)=>e.p_code.localeCompare(s.p_code)).map(e=>a.jsxs("tr",{children:[a.jsx("td",{className:l.modelCode,children:e.p_code}),a.jsx("td",{className:l.promptLabel,children:e.label||"No label"}),a.jsx("td",{children:a.jsx(i,{name:`toggle-drone-${e.p_code}`,variant:e.is_active?"primary":"secondary",size:1,onClick:()=>de(e.p_code,"drone_image"),children:e.is_active?"Active":"Inactive"})}),a.jsx("td",{children:a.jsxs("div",{className:l.modelActions,children:[a.jsx(i,{name:`view-${e.p_code}`,variant:"secondary",size:1,onClick:()=>{x(`=== Prompt Details ===
|
| 19 |
-
Code: ${e.p_code}
|
| 20 |
-
Label: ${e.label}
|
| 21 |
-
Image Type: ${e.image_type}
|
| 22 |
-
Active: ${e.is_active}
|
| 23 |
-
|
| 24 |
-
Metadata Instructions:
|
| 25 |
-
${e.metadata_instructions||"No instructions available"}`),F(`Prompt: ${e.p_code}`),p(!0)},children:"View"}),a.jsx(i,{name:`edit-${e.p_code}`,variant:"secondary",size:1,onClick:()=>ie(e),children:"Edit"})]})})]},e.p_code))})]})}),a.jsx("div",{className:l.addModelButtonContainer,children:a.jsx(i,{name:"add-drone-prompt",variant:"primary",onClick:()=>ne("drone_image"),children:"Add New Drone Image Prompt"})})]})]})}),a.jsx(j,{heading:"Schema Management",headingLevel:2,withHeaderBorder:!0,withInternalPadding:!0,children:a.jsx("div",{className:l.modelManagementArea,children:a.jsx("div",{className:l.modelsTable,children:a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Schema ID"}),a.jsx("th",{children:"Schema Content"}),a.jsx("th",{children:"Actions"})]})}),a.jsx("tbody",{children:(je||[]).sort((e,s)=>e.schema_id.localeCompare(s.schema_id)).map(e=>a.jsxs("tr",{children:[a.jsx("td",{className:l.modelCode,children:e.schema_id}),a.jsx("td",{className:l.promptLabel,style:{maxWidth:"400px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:JSON.stringify(e.schema)}),a.jsx("td",{children:a.jsxs("div",{className:l.modelActions,children:[a.jsx(i,{name:`view-schema-${e.schema_id}`,variant:"secondary",size:1,onClick:()=>{x(`=== Schema Details ===
|
| 26 |
-
Schema ID: ${e.schema_id}
|
| 27 |
-
|
| 28 |
-
Schema Definition:
|
| 29 |
-
${JSON.stringify(e.schema,null,2)}`),F(`Schema: ${e.schema_id}`),p(!0)},children:"View"}),a.jsx(i,{name:`edit-schema-${e.schema_id}`,variant:"secondary",size:1,onClick:()=>Ae(e),children:"Edit"})]})})]},e.schema_id))})]})})})}),a.jsx(j,{heading:"Utilities",headingLevel:2,withHeaderBorder:!0,withInternalPadding:!0,children:a.jsx("div",{className:"flex flex-wrap gap-4",children:a.jsx(i,{name:"test-connection",variant:"secondary",onClick:async()=>{x("Testing API connection..."),F("Connection Test Results");try{const e=await fetch("/api/models");if(e.ok){const s=await e.json(),d=`✅ API connection successful!
|
| 30 |
-
|
| 31 |
-
Found ${s.models?.length||0} models in database.
|
| 32 |
-
|
| 33 |
-
Available models:
|
| 34 |
-
${(s.models||[]).filter(h=>h.is_available).map(h=>`- ${h.label} (${h.m_code})`).join(`
|
| 35 |
-
`)||"None"}`;x(d)}else{const s=`❌ API connection failed: HTTP ${e.status}`;x(s)}p(!0)}catch(e){const s=`❌ Connection error: ${e}`;x(s),p(!0)}},children:"Test Connection"})})})]})]}),ye&&a.jsx("div",{className:l.modalOverlay,onClick:()=>T(!1),children:a.jsx("div",{className:l.modalContent,onClick:e=>e.stopPropagation(),children:a.jsxs("div",{className:l.modalBody,children:[a.jsx("h3",{className:l.modalTitle,children:"Delete Model"}),a.jsxs("p",{className:l.modalText,children:["Are you sure you want to delete model ",a.jsx("span",{className:l.modelCode,children:se}),"? This action cannot be undone."]}),a.jsxs("div",{className:l.modalButtons,children:[a.jsx(i,{name:"cancel-delete",variant:"tertiary",onClick:()=>T(!1),children:"Cancel"}),a.jsx(i,{name:"confirm-delete",variant:"secondary",onClick:ze,children:"Delete"})]})]})})}),Ne&&a.jsx("div",{className:l.modalOverlay,onClick:()=>V(!1),children:a.jsx("div",{className:l.modalContent,onClick:e=>e.stopPropagation(),children:a.jsxs("div",{className:l.modalBody,children:[a.jsx("h3",{className:l.modalTitle,children:"Model Added Successfully!"}),a.jsx("div",{className:`${l.modalText} ${l.modalTextLeft}`,children:Se}),a.jsx("div",{className:l.modalButtons,children:a.jsx(i,{name:"close-setup-instructions",variant:"secondary",onClick:()=>V(!1),children:"Got it!"})})]})})}),Ce&&a.jsx("div",{className:l.modalOverlay,onClick:()=>p(!1),children:a.jsx("div",{className:l.modalContent,onClick:e=>e.stopPropagation(),children:a.jsxs("div",{className:l.modalBody,children:[a.jsx("h3",{className:l.modalTitle,children:Me}),a.jsx("div",{className:`${l.modalText} ${l.modalTextLeft}`,children:a.jsx("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:we})}),a.jsx("div",{className:l.modalButtons,children:a.jsx(i,{name:"close-test-results",variant:"secondary",onClick:()=>p(!1),children:"Close"})})]})})}),ve&&a.jsx("div",{className:l.modalOverlay,onClick:()=>k(!1),children:a.jsx("div",{className:l.modalContent,onClick:e=>e.stopPropagation(),children:a.jsxs("div",{className:l.modalBody,children:[a.jsxs("h3",{className:l.modalTitle,children:["Edit Prompt: ",M?.p_code]}),a.jsxs("div",{className:l.modalForm,children:[a.jsxs("div",{className:l.formField,children:[a.jsx("label",{className:l.formLabel,children:"Code:"}),a.jsx(m,{name:"prompt-code",value:M?.p_code,onChange:()=>{},disabled:!0,className:l.formInput})]}),a.jsxs("div",{className:l.formField,children:[a.jsx("label",{className:l.formLabel,children:"Label:"}),a.jsx(m,{name:"prompt-label",value:n.label,onChange:e=>r(s=>({...s,label:e||""})),className:l.formInput})]}),a.jsxs("div",{className:l.formField,children:[a.jsx("label",{className:l.formLabel,children:"Image Type:"}),a.jsx(b,{name:"prompt-image-type",value:n.image_type,onChange:e=>r(s=>({...s,image_type:e||"crisis_map"})),options:ue||[],keySelector:e=>e.image_type,labelSelector:e=>e.label})]}),a.jsxs("div",{className:l.formField,children:[a.jsx("label",{className:l.formLabel,children:"Active Status:"}),a.jsxs("div",{className:l.addModelFormCheckbox,children:[a.jsx("input",{type:"checkbox",checked:n.is_active,onChange:e=>r(s=>({...s,is_active:e.target.checked}))}),a.jsx("span",{children:"Active for this image type"})]})]}),a.jsxs("div",{className:l.formField,children:[a.jsx("label",{className:l.formLabel,children:"Metadata Instructions:"}),a.jsx("textarea",{name:"prompt-instructions",value:n.metadata_instructions,onChange:e=>r(s=>({...s,metadata_instructions:e.target.value})),className:`${l.formInput} ${l.textarea}`,rows:8})]})]}),a.jsxs("div",{className:l.modalButtons,children:[a.jsx(i,{name:"cancel-edit-prompt",variant:"tertiary",onClick:()=>{k(!1),z(null),r({p_code:"",label:"",metadata_instructions:"",image_type:"crisis_map",is_active:!1})},children:"Cancel"}),a.jsx(i,{name:"save-prompt",variant:"primary",onClick:Te,children:"Save Changes"})]})]})})}),ge&&a.jsx("div",{className:l.modalOverlay,onClick:()=>w(!1),children:a.jsx("div",{className:l.modalContent,onClick:e=>e.stopPropagation(),children:a.jsxs("div",{className:l.modalBody,children:[a.jsxs("h3",{className:l.modalTitle,children:["Add New ",fe==="crisis_map"?"Crisis Map":"Drone Image"," Prompt"]}),a.jsxs("div",{className:l.modalForm,children:[a.jsxs("div",{className:l.formField,children:[a.jsx("label",{className:l.formLabel,children:"Code:"}),a.jsx(m,{name:"prompt-code",value:n.p_code,onChange:e=>r(s=>({...s,p_code:e||""})),placeholder:"e.g., CUSTOM_CRISIS_MAP_001",className:l.formInput})]}),a.jsxs("div",{className:l.formField,children:[a.jsx("label",{className:l.formLabel,children:"Label:"}),a.jsx(m,{name:"prompt-label",value:n.label,onChange:e=>r(s=>({...s,label:e||""})),placeholder:"Enter prompt description...",className:l.formInput})]}),a.jsxs("div",{className:l.formField,children:[a.jsx("label",{className:l.formLabel,children:"Image Type:"}),a.jsx(m,{name:"prompt-image-type",value:n.image_type,onChange:()=>{},disabled:!0,className:l.formInput})]}),a.jsxs("div",{className:l.formField,children:[a.jsx("label",{className:l.formLabel,children:"Active Status:"}),a.jsxs("div",{className:l.addModelFormCheckbox,children:[a.jsx("input",{type:"checkbox",checked:n.is_active,onChange:e=>r(s=>({...s,is_active:e.target.checked}))}),a.jsx("span",{children:"Active for this image type"})]})]}),a.jsxs("div",{className:l.formField,children:[a.jsx("label",{className:l.formLabel,children:"Metadata Instructions:"}),a.jsx("textarea",{name:"prompt-instructions",value:n.metadata_instructions,onChange:e=>r(s=>({...s,metadata_instructions:e.target.value})),placeholder:"Enter metadata extraction instructions...",className:`${l.formInput} ${l.textarea}`,rows:8})]})]}),a.jsxs("div",{className:l.modalButtons,children:[a.jsx(i,{name:"cancel-add-prompt",variant:"tertiary",onClick:()=>{w(!1),U(null),r({p_code:"",label:"",metadata_instructions:"",image_type:"crisis_map",is_active:!1})},children:"Cancel"}),a.jsx(i,{name:"save-new-prompt",variant:"primary",onClick:Fe,disabled:!n.p_code||!n.label,children:"Create Prompt"})]})]})})}),_e&&a.jsx("div",{className:l.modalOverlay,onClick:()=>S(!1),children:a.jsx("div",{className:l.modalContent,onClick:e=>e.stopPropagation(),children:a.jsxs("div",{className:l.modalBody,children:[a.jsxs("h3",{className:l.modalTitle,children:["Edit Schema: ",B?.schema_id]}),a.jsxs("div",{className:l.modalForm,children:[a.jsxs("div",{className:l.formField,children:[a.jsx("label",{className:l.formLabel,children:"Schema ID:"}),a.jsx(m,{name:"schema-id",value:D.schema_id,onChange:e=>g(s=>({...s,schema_id:e||""})),className:l.formInput,disabled:!0})]}),a.jsxs("div",{className:l.formField,children:[a.jsx("label",{className:l.formLabel,children:"Schema Definition (JSON):"}),a.jsx("textarea",{name:"schema-definition",value:JSON.stringify(D.schema,null,2),onChange:e=>{try{const s=JSON.parse(e.target.value);g(d=>({...d,schema:s}))}catch{}},className:`${l.formInput} ${l.textarea}`,rows:20,style:{fontFamily:"monospace"}})]})]}),a.jsxs("div",{className:l.modalButtons,children:[a.jsx(i,{name:"cancel-edit-schema",variant:"tertiary",onClick:Ie,children:"Cancel"}),a.jsx(i,{name:"save-schema",variant:"primary",onClick:$e,children:"Save Changes"})]})]})})})]}):a.jsx(K,{children:a.jsxs("div",{className:"mx-auto max-w-md px-4 sm:px-6 lg:px-8 py-6 sm:py-10",children:[a.jsx("div",{className:"text-center mb-8",children:a.jsx(Je,{level:2,children:"Admin Login"})}),a.jsxs("form",{onSubmit:Re,className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700 mb-2",children:"Password"}),a.jsx(m,{id:"password",name:"password",type:"password",value:$,onChange:e=>Q(e||""),placeholder:"Enter admin password",required:!0,className:"w-full",disabled:Z})]}),X&&a.jsx("div",{children:a.jsx("p",{className:"text-sm text-ifrcRed font-medium",children:X})}),a.jsx("div",{className:"flex justify-center",children:a.jsx(j,{withInternalPadding:!0,className:"p-2",children:Z?a.jsxs("div",{className:re.loadingContainer,children:[a.jsx(Ge,{className:"text-ifrcRed"}),a.jsx("p",{className:re.loadingText,children:"Logging in..."})]}):a.jsx(i,{name:"login",type:"submit",variant:"primary",size:2,children:"Login"})})})]})]})})}export{Sa as default};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
py_backend/static/assets/ExportModal-DYxnGjiT.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{r as n,j as e,P,S as W,o as F,T as V,D as A,z as g,n as b,O as H,J as M,V as q,_ as O,L as D}from"./index-DnPgbq1Q.js";const G=({title:c,titleId:i,...r})=>n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 24 24",fill:"currentColor",width:"1em",height:"1em","aria-labelledby":i},r),c?n.createElement("title",{id:i},c):null,n.createElement("g",{clipPath:"url(#checkbox-indeterminate-line_svg__a)"},n.createElement("path",{d:"M4 3h16a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Zm1 2v14h14V5H5Zm2 6h10v2H7v-2Z"})),n.createElement("defs",null,n.createElement("clipPath",{id:"checkbox-indeterminate-line_svg__a"},n.createElement("path",{d:"M0 0h24v24H0z"})))),$=({title:c,titleId:i,...r})=>n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 24 24",fill:"currentColor",width:"1em",height:"1em","aria-labelledby":i},r),c?n.createElement("title",{id:i},c):null,n.createElement("g",{clipPath:"url(#filter-line_svg__a)"},n.createElement("path",{d:"M9 13.5 4 6H3V4h18v2h-1l-5 7.5V22H9v-8.5ZM6.404 6 11 12.894V20h2v-7.106L17.596 6H6.404Z"})),n.createElement("defs",null,n.createElement("clipPath",{id:"filter-line_svg__a"},n.createElement("path",{d:"M0 0h24v24H0z"}))));function R(c){const{className:i,indeterminate:r,value:v}=c;return e.jsxs(e.Fragment,{children:[r&&e.jsx(G,{className:i}),v&&!r&&e.jsx(P,{className:i}),!v&&!r&&e.jsx(W,{className:i})]})}const U="_checkbox_12g7n_1",Z="_with-background_12g7n_7",Y="_checkmark-container_12g7n_12",J="_input_12g7n_18",K="_content_12g7n_33",Q="_description_12g7n_40",X="_checked_12g7n_45",L="_checkmark_12g7n_12",ee="_disabled-checkbox_12g7n_58",m={checkbox:U,withBackground:Z,checkmarkContainer:Y,input:J,content:K,description:Q,checked:X,checkmark:L,disabledCheckbox:ee};function B(c){const{className:i,checkmark:r=R,checkmarkClassName:v,checkmarkContainerClassName:T,disabled:s,error:h,indeterminate:y,inputClassName:w,invertedLogic:d=!1,label:j,labelContainerClassName:_,name:I,onChange:f,readOnly:x,tooltip:k,value:C,description:u,withBackground:E,...S}=c,z=n.useCallback(t=>{const o=t.currentTarget.checked;f(d?!o:o,I)},[I,f,d]),N=d?!C:C,p=F(m.checkbox,i,!y&&N&&m.checked,E&&m.withBackground,s&&m.disabledCheckbox,x&&m.readOnly);return e.jsxs("label",{className:p,title:k,children:[e.jsxs("div",{className:F(m.checkmarkContainer,T),children:[e.jsx("input",{onChange:z,className:F(m.input,w),type:"checkbox",checked:N??!1,disabled:s||x,readOnly:x,...S}),e.jsx(r,{className:F(m.checkmark,v),value:N??!1,indeterminate:y,"aria-hidden":"true"})]}),(j||u)&&e.jsxs("div",{className:m.content,children:[j&&e.jsx("div",{className:_,children:j}),u&&e.jsx("div",{className:m.description,children:u})]}),h&&e.jsx(V,{children:h})]})}function _e({sources:c,types:i,regions:r,countries:v,imageTypes:T,isLoadingFilters:s=!1}){const[h,y]=n.useState(!1),[w,d]=n.useState(""),{search:j,setSearch:_,srcFilter:I,setSrcFilter:f,catFilter:x,setCatFilter:k,regionFilter:C,setRegionFilter:u,countryFilter:E,setCountryFilter:S,imageTypeFilter:z,setImageTypeFilter:N,uploadTypeFilter:p,setUploadTypeFilter:t,clearAllFilters:o}=A();return n.useEffect(()=>{d(j)},[j]),e.jsxs("div",{className:"mb-6 space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[e.jsx(g,{withInternalPadding:!0,className:"bg-white/20 backdrop-blur-sm rounded-md p-2",children:e.jsx(b,{name:"toggle-filters",variant:"secondary",onClick:()=>y(!h),className:"whitespace-nowrap",title:h?"Hide Filters":"Show Filters",children:e.jsx($,{className:"w-4 h-4"})})}),e.jsx(g,{withInternalPadding:!0,className:"bg-white/20 backdrop-blur-sm rounded-md p-2 flex-1 min-w-[300px]",children:e.jsx(H,{name:"search",placeholder:"Search",value:w,onChange:a=>d(a||""),onKeyDown:a=>{a.key==="Enter"&&_(w)}})}),e.jsx(g,{withInternalPadding:!0,className:"bg-white/20 backdrop-blur-sm rounded-md p-2",children:e.jsx(b,{name:"clear-filters",variant:"secondary",onClick:o,children:"Clear Filters"})})]}),h&&e.jsx("div",{className:"bg-white/20 backdrop-blur-sm rounded-md p-4",children:e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4",children:[e.jsx(g,{withInternalPadding:!0,className:"p-2",children:e.jsx(M,{name:"source",placeholder:s?"Loading...":"All Sources",options:c,value:I||null,onChange:a=>f(a||""),keySelector:a=>a.s_code,labelSelector:a=>a.label,required:!1,disabled:s})}),e.jsx(g,{withInternalPadding:!0,className:"p-2",children:e.jsx(M,{name:"category",placeholder:s?"Loading...":"All Categories",options:i,value:x||null,onChange:a=>k(a||""),keySelector:a=>a.t_code,labelSelector:a=>a.label,required:!1,disabled:s})}),e.jsx(g,{withInternalPadding:!0,className:"p-2",children:e.jsx(M,{name:"region",placeholder:s?"Loading...":"All Regions",options:r,value:C||null,onChange:a=>u(a||""),keySelector:a=>a.r_code,labelSelector:a=>a.label,required:!1,disabled:s})}),e.jsx(g,{withInternalPadding:!0,className:"p-2",children:e.jsx(q,{name:"country",placeholder:s?"Loading...":"All Countries",options:v,value:E?[E]:[],onChange:a=>S(a[0]||""),keySelector:a=>a.c_code,labelSelector:a=>a.label,disabled:s})}),e.jsx(g,{withInternalPadding:!0,className:"p-2",children:e.jsx(M,{name:"imageType",placeholder:s?"Loading...":"All Image Types",options:T,value:z||null,onChange:a=>N(a||""),keySelector:a=>a.image_type,labelSelector:a=>a.label,required:!1,disabled:s})}),e.jsx(g,{withInternalPadding:!0,className:"p-2",children:e.jsx(M,{name:"uploadType",placeholder:"All Upload Types",options:[{key:"single",label:"Single Upload"},{key:"multiple",label:"Multiple Upload"}],value:p||null,onChange:a=>t(a||""),keySelector:a=>a.key,labelSelector:a=>a.label,required:!1,disabled:!1})})]})})]})}const ae="_fullSizeModalOverlay_cyz3b_1",le="_fullSizeModalContent_cyz3b_29",te="_ratingWarningContent_cyz3b_53",se="_ratingWarningTitle_cyz3b_65",ne="_exportModeSection_cyz3b_133",ie="_splitConfigSection_cyz3b_143",re="_splitConfigTitle_cyz3b_153",ce="_splitInputsContainer_cyz3b_167",oe="_splitInputGroup_cyz3b_183",de="_splitInputLabel_cyz3b_197",pe="_splitInput_cyz3b_167",me="_splitTotal_cyz3b_247",he="_splitTotalError_cyz3b_261",xe="_checkboxesContainer_cyz3b_271",ue="_ratingWarningButtons_cyz3b_289",ge="_singleExportMessage_cyz3b_309",be="_navigateButtonContainer_cyz3b_333",ve="_loadingOverlay_cyz3b_349",l={fullSizeModalOverlay:ae,fullSizeModalContent:le,ratingWarningContent:te,ratingWarningTitle:se,exportModeSection:ne,splitConfigSection:ie,splitConfigTitle:re,splitInputsContainer:ce,splitInputGroup:oe,splitInputLabel:de,splitInput:pe,splitTotal:me,splitTotalError:he,checkboxesContainer:xe,ratingWarningButtons:ue,singleExportMessage:ge,navigateButtonContainer:be,loadingOverlay:ve};function fe({isOpen:c,onClose:i,onExport:r,crisisMapsCount:v,droneImagesCount:T,isLoading:s=!1,exportSuccess:h=!1,variant:y="bulk",onNavigateAndExport:w}){const[d,j]=n.useState("standard"),[_,I]=n.useState(80),[f,x]=n.useState(10),[k,C]=n.useState(10),[u,E]=n.useState(!0),[S,z]=n.useState(!0),N=()=>{if(y==="single"){r(d,["crisis_map","drone_image"]);return}if(!u&&!S){alert("Please select at least one image type to export.");return}const t=[];u&&t.push("crisis_map"),S&&t.push("drone_image"),r(d,t)},p=()=>{i()};return c?y==="single"?e.jsx("div",{className:l.fullSizeModalOverlay,onClick:p,children:e.jsxs("div",{className:l.fullSizeModalContent,onClick:t=>t.stopPropagation(),children:[s&&e.jsx("div",{className:l.loadingOverlay,children:e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsx(O,{className:"text-ifrcRed"}),e.jsx("div",{className:"text-lg font-medium",children:"Exporting..."}),e.jsx("div",{className:"text-sm text-gray-600",children:"This might take a few seconds"})]})}),h&&e.jsx("div",{className:l.loadingOverlay,children:e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsx("div",{className:"text-lg font-medium",children:"Export Successful!"}),e.jsx("div",{className:"text-sm text-gray-600",children:"Your dataset has been downloaded"}),e.jsx(b,{name:"close-export-success",onClick:p,className:"mt-4",children:"Close"})]})}),e.jsxs("div",{className:l.ratingWarningContent,children:[e.jsx("h3",{className:l.ratingWarningTitle,children:"Export Single Item"}),e.jsxs("div",{className:l.singleExportMessage,children:[e.jsx("p",{children:"This only exports the 1 item currently on display."}),e.jsx("p",{children:'You may export the entire dataset from the "list view" here:'})]}),e.jsx("div",{className:l.navigateButtonContainer,children:e.jsx(b,{name:"navigate-to-list",variant:"secondary",onClick:w,children:"Navigate to List View"})}),e.jsxs("div",{className:l.ratingWarningButtons,children:[e.jsx(b,{name:"continue-export",onClick:N,disabled:s,children:s?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(O,{className:"text-white"}),"Exporting..."]}):"Continue"}),e.jsx(b,{name:"cancel-export",variant:"tertiary",onClick:p,disabled:s,children:"Cancel"})]})]})]})}):e.jsx("div",{className:l.fullSizeModalOverlay,onClick:p,children:e.jsxs("div",{className:l.fullSizeModalContent,onClick:t=>t.stopPropagation(),children:[s&&e.jsx("div",{className:l.loadingOverlay,children:e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsx(O,{className:"text-ifrcRed"}),e.jsx("div",{className:"text-lg font-medium",children:"Exporting..."}),e.jsx("div",{className:"text-sm text-gray-600",children:"This might take a few seconds"})]})}),h&&e.jsx("div",{className:l.loadingOverlay,children:e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsx("div",{className:"text-lg font-medium",children:"Export Successful!"}),e.jsx("div",{className:"text-sm text-gray-600",children:"Your dataset has been downloaded"}),e.jsx(b,{name:"close-export-success",onClick:p,className:"mt-4",children:"Close"})]})}),e.jsxs("div",{className:l.ratingWarningContent,children:[e.jsx("h3",{className:l.ratingWarningTitle,children:"Export Dataset"}),e.jsx("div",{className:l.exportModeSection,children:e.jsx(D,{name:"export-mode",value:d,onChange:t=>{(t==="standard"||t==="fine-tuning")&&j(t)},options:[{key:"standard",label:"Standard"},{key:"fine-tuning",label:"Fine-tuning"}],keySelector:t=>t.key,labelSelector:t=>t.label,disabled:s})}),d==="fine-tuning"&&e.jsxs("div",{className:l.splitConfigSection,children:[e.jsx("div",{className:l.splitConfigTitle,children:"Dataset Split Configuration"}),e.jsxs("div",{className:l.splitInputsContainer,children:[e.jsxs("div",{className:l.splitInputGroup,children:[e.jsx("label",{htmlFor:"train-split",className:l.splitInputLabel,children:"Train (%)"}),e.jsx("input",{id:"train-split",type:"number",min:"0",max:"100",value:_,onChange:t=>{const o=parseInt(t.target.value)||0,a=100-o;a>=0&&(I(o),f+k>a&&(x(Math.floor(a/2)),C(a-Math.floor(a/2))))},className:l.splitInput,disabled:s})]}),e.jsxs("div",{className:l.splitInputGroup,children:[e.jsx("label",{htmlFor:"test-split",className:l.splitInputLabel,children:"Test (%)"}),e.jsx("input",{id:"test-split",type:"number",min:"0",max:"100",value:f,onChange:t=>{const o=parseInt(t.target.value)||0,a=100-_-o;a>=0&&(x(o),C(a))},className:l.splitInput,disabled:s})]}),e.jsxs("div",{className:l.splitInputGroup,children:[e.jsx("label",{htmlFor:"val-split",className:l.splitInputLabel,children:"Val (%)"}),e.jsx("input",{id:"val-split",type:"number",min:"0",max:"100",value:k,onChange:t=>{const o=parseInt(t.target.value)||0,a=100-_-o;a>=0&&(C(o),x(a))},className:l.splitInput,disabled:s})]})]}),_+f+k!==100&&e.jsx("div",{className:l.splitTotal,children:e.jsx("span",{className:l.splitTotalError,children:"Must equal 100%"})})]}),e.jsxs("div",{className:l.checkboxesContainer,children:[e.jsx("div",{className:"flex items-center gap-3",children:e.jsx(B,{name:"crisis-maps",label:`Crisis Maps (${v} images)`,value:u,onChange:t=>E(t),disabled:s})}),e.jsx("div",{className:"flex items-center gap-3",children:e.jsx(B,{name:"drone-images",label:`Drone Images (${T} images)`,value:S,onChange:t=>z(t),disabled:s})})]}),e.jsxs("div",{className:l.ratingWarningButtons,children:[e.jsx(b,{name:"confirm-export",onClick:N,disabled:s,children:s?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(O,{className:"text-white"}),"Exporting..."]}):"Export Selected"}),e.jsx(b,{name:"cancel-export",variant:"tertiary",onClick:p,disabled:s,children:"Cancel"})]})]})]})}):null}export{fe as E,_e as F};
|
|
|
|
|
|
py_backend/static/assets/index-CUpOp1T1.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jszip.min-DJ3yWU3V.js","assets/index-DnPgbq1Q.js","assets/index-cCOeofBN.css"])))=>i.map(i=>d[i]);
|
| 2 |
-
import{K as ea,x as aa,r as d,D as ta,j as a,N as ee,n as M,_ as we,L as sa,z as E,v as ne,w as oe,F as ia,M as na,G as oa}from"./index-DnPgbq1Q.js";import{u as ra}from"./useAdmin-qpJv9-Qq.js";import{F as la,E as ca}from"./ExportModal-DYxnGjiT.js";const da="_tabSelector_usssr_1",ga="_imageContainer_usssr_12",ma="_imagePlaceholder_usssr_33",ua="_metadataTags_usssr_45",pa="_metadataTag_usssr_45",fa="_captionContainer_usssr_67",_a="_captionText_usssr_74",ha="_gridLayout_usssr_131",xa="_detailsSection_usssr_155",ya="_loadingContainer_usssr_161",va="_errorContainer_usssr_171",ja="_fullSizeModalOverlay_usssr_205",wa="_fullSizeModalContent_usssr_219",Ia="_ratingWarningContent_usssr_230",Na="_ratingWarningTitle_usssr_236",Ca="_ratingWarningText_usssr_243",ba="_ratingWarningButtons_usssr_250",Sa="_carouselContainer_usssr_365",ka="_carouselImageWrapper_usssr_370",Da="_carouselImage_usssr_370",La="_carouselNavigation_usssr_393",Ma="_carouselButton_usssr_405",Fa="_carouselIndicators_usssr_429",Ta="_carouselIndicator_usssr_429",Ea="_carouselIndicatorActive_usssr_458",$a="_singleImageContainer_usssr_488",Pa="_viewImageButtonContainer_usssr_494",g={tabSelector:da,imageContainer:ga,imagePlaceholder:ma,metadataTags:ua,metadataTag:pa,captionContainer:fa,captionText:_a,gridLayout:ha,detailsSection:xa,loadingContainer:ya,errorContainer:va,fullSizeModalOverlay:ja,fullSizeModalContent:wa,ratingWarningContent:Ia,ratingWarningTitle:Na,ratingWarningText:Ca,ratingWarningButtons:ba,carouselContainer:Sa,carouselImageWrapper:ka,carouselImage:Da,carouselNavigation:La,carouselButton:Ma,carouselIndicators:Fa,carouselIndicator:Ta,carouselIndicatorActive:Ea,singleImageContainer:$a,viewImageButtonContainer:Pa};function st(){const{mapId:u}=ea(),x=aa(),{isAuthenticated:re}=ra(),[le,Ie]=d.useState("mapDetails"),[e,ae]=d.useState(null),[z,R]=d.useState(!0),[ce,O]=d.useState(null),[de,Ne]=d.useState([]),[ge,Ce]=d.useState([]),[me,be]=d.useState([]),[ue,Se]=d.useState([]),[ke,De]=d.useState([]),[Le,Me]=d.useState(!1),[Fe,Te]=d.useState(!1),[W,q]=d.useState(!1),[Ee,K]=d.useState(!1),[pe,Z]=d.useState(!1),[$e,te]=d.useState(!1),[Pe,se]=d.useState(!1),[Ra,Aa]=d.useState("standard"),[$,za]=d.useState(80),[J,Oa]=d.useState(10),[Ua,Ba]=d.useState(10),[Wa,Ja]=d.useState(!0),[Va,Ga]=d.useState(!0),[U,Q]=d.useState(!1),[Re,fe]=d.useState(!1),[Ae,_e]=d.useState(null),[ze,V]=d.useState(!1),[h,G]=d.useState([]),[k,A]=d.useState(0),[H,he]=d.useState(!1),{search:p,setSearch:Ha,srcFilter:y,setSrcFilter:qa,catFilter:v,setCatFilter:Ka,regionFilter:j,setRegionFilter:Za,countryFilter:w,setCountryFilter:Qa,imageTypeFilter:I,setImageTypeFilter:Xa,uploadTypeFilter:N,setUploadTypeFilter:Ya,showReferenceExamples:b,setShowReferenceExamples:Oe,clearAllFilters:Ue}=ta(),Be=[{key:"explore",label:"List"},{key:"mapDetails",label:"Carousel"}],X=d.useCallback(async t=>{if(!(!t||t==="undefined"||t==="null"||t.trim()===""))try{const s=new URLSearchParams;p&&s.append("search",p),y&&s.append("source",y),v&&s.append("event_type",v),j&&s.append("region",j),w&&s.append("country",w),I&&s.append("image_type",I),N&&s.append("upload_type",N),b&&s.append("starred_only","true");const l=await fetch(`/api/images/grouped?${s.toString()}`);if(l.ok){const i=await l.json();console.log("Server response for upload_type=multiple:",{url:`/api/images/grouped?${s.toString()}`,count:i.length,images:i.map(r=>({image_id:r.image_id,image_count:r.image_count,all_image_ids:r.all_image_ids,all_image_ids_length:r.all_image_ids?.length}))});const n=i.findIndex(r=>r.image_id===t);console.log("Navigation availability check (server-side):",{filteredImagesCount:i.length,currentIndex:n,currentId:t,uploadTypeFilter:N,hasPrevious:i.length>1&&n>0,hasNext:i.length>1&&n<i.length-1,filteredImages:i.map(r=>({image_id:r.image_id,image_count:r.image_count,all_image_ids:r.all_image_ids,image_type:r.image_type}))}),Me(i.length>1&&n>0),Te(i.length>1&&n<i.length-1)}}catch(s){console.error("Failed to check navigation availability:",s)}},[p,y,v,j,w,I,N,b]),ie=d.useCallback(async t=>{console.log("fetchAllImages called with imageIds:",t),he(!0);try{const s=t.map(async i=>{const n=await fetch(`/api/images/${i}`);if(!n.ok)throw new Error(`Failed to fetch image ${i}`);return n.json()}),l=await Promise.all(s);G(l),A(0),console.log("fetchAllImages: Loaded",l.length,"images")}catch(s){console.error("fetchAllImages error:",s),O(s instanceof Error?s.message:"Failed to load all images")}finally{he(!1)}},[]),xe=d.useCallback(async t=>{if(console.log("fetchMapData called with id:",t),console.log("fetchMapData id type:",typeof t),!t||t==="undefined"||t==="null"||t.trim()===""){console.log("fetchMapData: Invalid ID detected:",t),O("Invalid Map ID"),R(!1);return}if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t)){console.log("fetchMapData: Invalid UUID format:",t),O("Invalid Map ID format"),R(!1);return}console.log("fetchMapData: Making API call for id:",t),q(!0),R(!0);try{const l=await fetch(`/api/images/${t}`);if(!l.ok)throw new Error("Map not found");const i=await l.json();if(ae(i),i.all_image_ids&&i.all_image_ids.length>1)await ie(i.all_image_ids);else if(i.image_count&&i.image_count>1){console.log("Multi-upload detected but no all_image_ids, trying grouped endpoint");try{const n=await fetch("/api/images/grouped");if(n.ok){const o=(await n.json()).find(m=>m.all_image_ids&&m.all_image_ids.includes(i.image_id));o&&o.all_image_ids?await ie(o.all_image_ids):(G([i]),A(0))}else G([i]),A(0)}catch(n){console.error("Failed to fetch from grouped endpoint:",n),G([i]),A(0)}}else G([i]),A(0);await X(t)}catch(l){O(l instanceof Error?l.message:"Unknown error occurred")}finally{R(!1),q(!1)}},[X,ie]),We=d.useCallback(()=>{h.length>1&&A(t=>t>0?t-1:h.length-1)},[h.length]),Je=d.useCallback(()=>{h.length>1&&A(t=>t<h.length-1?t+1:0)},[h.length]),Ve=d.useCallback(t=>{t>=0&&t<h.length&&A(t)},[h.length]),ye=d.useCallback(async t=>{const s=t||(h.length>0?h[k]:e);if(s){V(!0),_e(s),fe(!0);try{const l=new Image;l.onload=()=>{V(!1)},l.onerror=()=>{V(!1)},l.src=s.image_url}catch(l){console.error("Error preloading full-size image:",l),V(!1)}}},[h,k,e]),Ge=d.useCallback(()=>{fe(!1),_e(null),V(!1)},[]);d.useEffect(()=>{if(console.log("MapDetailsPage: mapId from useParams:",u),console.log("MapDetailsPage: mapId type:",typeof u),console.log("MapDetailsPage: mapId value:",u),!u||u==="undefined"||u==="null"||u.trim()===""||u===void 0||u===null){console.log("MapDetailsPage: Invalid mapId, setting error"),O("Map ID is required"),R(!1);return}if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(u)){console.log("MapDetailsPage: Invalid UUID format:",u),O("Invalid Map ID format"),R(!1);return}console.log("MapDetailsPage: Fetching data for mapId:",u),xe(u)},[u,xe]),d.useEffect(()=>{if(!e||z||U)return;if(!u||u==="undefined"||u==="null"||u.trim()===""){console.log("Auto-navigation skipped: Invalid mapId");return}if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(u)){console.log("Auto-navigation skipped: Invalid mapId format");return}(()=>{const l=!p||e.title?.toLowerCase().includes(p.toLowerCase())||e.generated?.toLowerCase().includes(p.toLowerCase())||e.source?.toLowerCase().includes(p.toLowerCase())||e.event_type?.toLowerCase().includes(p.toLowerCase()),i=!y||e.source===y,n=!v||e.event_type===v,r=!j||e.countries.some(P=>P.r_code===j),o=!w||e.countries.some(P=>P.c_code===w),m=!I||e.image_type===I,_=!b||e.starred===!0,D=l&&i&&n&&r&&o&&m&&_;return console.log("Auto-navigation check:",{mapId:u,search:p,srcFilter:y,catFilter:v,regionFilter:j,countryFilter:w,imageTypeFilter:I,showReferenceExamples:b,matchesSearch:l,matchesSource:i,matchesCategory:n,matchesRegion:r,matchesCountry:o,matchesImageType:m,matchesReferenceExamples:_,matches:D}),D})()||(console.log("Current map does not match filters, looking for first matching item"),fetch("/api/images").then(l=>l.json()).then(l=>{console.log("Auto-navigation: Received images from API:",l.length),console.log("Auto-navigation: First few images:",l.slice(0,3).map(n=>({image_id:n.image_id,title:n.title})));const i=l.find(n=>{const r=!p||n.title?.toLowerCase().includes(p.toLowerCase())||n.generated?.toLowerCase().includes(p.toLowerCase())||n.source?.toLowerCase().includes(p.toLowerCase())||n.event_type?.toLowerCase().includes(p.toLowerCase()),o=!y||n.source===y,m=!v||n.event_type===v,_=!j||n.countries?.some(f=>f.r_code===j),D=!w||n.countries?.some(f=>f.c_code===w),P=!I||n.image_type===I,F=!b||n.starred===!0;return r&&o&&m&&_&&D&&P&&F});console.log("Auto-navigation: Found first matching image:",i?{image_id:i.image_id,title:i.title,source:i.source}:"No matching image found"),i&&i.image_id&&i.image_id!=="undefined"&&i.image_id!=="null"&&i.image_id.trim()!==""&&i.image_id!==u&&(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(i.image_id)?(console.log("Auto-navigating to:",i.image_id),x(`/map/${i.image_id}`)):console.error("Auto-navigation blocked: Invalid image_id format:",i.image_id))}).catch(console.error))},[e,p,y,v,j,w,I,b,u,x,z,U]);const ve=async t=>{if(!W){q(!0);try{const s=new URLSearchParams;p&&s.append("search",p),y&&s.append("source",y),v&&s.append("event_type",v),j&&s.append("region",j),w&&s.append("country",w),I&&s.append("image_type",I),N&&s.append("upload_type",N),b&&s.append("starred_only","true");const l=await fetch(`/api/images/grouped?${s.toString()}`);if(l.ok){const i=await l.json(),n=i.findIndex(m=>m.image_id===u);if(n===-1){console.error("Current image not found in filtered list");return}let r;t==="previous"?r=n>0?n-1:i.length-1:r=n<i.length-1?n+1:0;const o=i[r];o&&o.image_id&&o.image_id!=="undefined"&&o.image_id!=="null"&&o.image_id.trim()!==""&&(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(o.image_id)?(console.log("Carousel navigating to:",o.image_id),x(`/map/${o.image_id}`)):console.error("Carousel navigation blocked: Invalid image_id format:",o.image_id))}}catch(s){console.error("Failed to navigate to item:",s)}finally{q(!1)}}};d.useEffect(()=>{console.log("=== NAVIGATION USEEFFECT TRIGGERED ==="),console.log("Navigation useEffect triggered:",{map:!!e,mapId:u,loading:z,isDeleting:U,uploadTypeFilter:N,allFilters:{search:p,srcFilter:y,catFilter:v,regionFilter:j,countryFilter:w,imageTypeFilter:I,uploadTypeFilter:N,showReferenceExamples:b}}),e&&u&&!z&&!U?(console.log("Calling checkNavigationAvailability with:",u),X(u)):console.log("NOT calling checkNavigationAvailability because:",{map:!!e,mapId:!!u,loading:z,isDeleting:U})},[e,u,p,y,v,j,w,I,N,b,z,U,X]),d.useEffect(()=>{Promise.all([fetch("/api/sources").then(t=>t.json()),fetch("/api/types").then(t=>t.json()),fetch("/api/image-types").then(t=>t.json()),fetch("/api/regions").then(t=>t.json()),fetch("/api/countries").then(t=>t.json())]).then(([t,s,l,i,n])=>{Ne(t),Ce(s),be(l),Se(i),De(n)}).catch(console.error)},[]);const He=async()=>{e&&K(!0)},qe=async()=>{if(e)try{(await fetch(`/api/images/${e.image_id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({starred:!e.starred})})).ok?ae(s=>s?{...s,starred:!s.starred}:null):console.error("Failed to toggle starred status")}catch(t){console.error("Error toggling starred status:",t)}},Ke=async()=>{if(e){Q(!0);try{if(console.log("Deleting image with ID:",e.image_id),(await fetch(`/api/images/${e.image_id}`,{method:"DELETE"})).ok){ae(s=>s?{...s,starred:!s.starred}:null),K(!1);try{const s=await fetch("/api/images/grouped");if(s.ok){const i=(await s.json()).filter(r=>{const o=!p||r.title?.toLowerCase().includes(p.toLowerCase())||r.generated?.toLowerCase().includes(p.toLowerCase())||r.source?.toLowerCase().includes(p.toLowerCase())||r.event_type?.toLowerCase().includes(p.toLowerCase()),m=!y||r.source===y,_=!v||r.event_type===v,D=!j||r.countries?.some(C=>C.r_code===j),P=!w||r.countries?.some(C=>C.c_code===w),F=!I||r.image_type===I,f=!N||N==="single"&&(!r.image_count||r.image_count<=1)||N==="multiple"&&r.image_count&&r.image_count>1,L=!b||r.starred===!0;return o&&m&&_&&D&&P&&F&&f&&L}),n=i.filter(r=>r.image_id!==e.image_id);if(n.length>0){const r=i.findIndex(m=>m.image_id===e.image_id);let o;if(r===i.length-1?o=r-1:o=r,console.log("Navigation target:",{currentIndex:r,targetIndex:o,targetId:n[o]?.image_id}),o>=0&&o<n.length){const m=n[o];m&&m.image_id&&m.image_id!=="undefined"&&m.image_id!=="null"&&m.image_id.trim()!==""?/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(m.image_id)?(console.log("Navigating to:",m.image_id),x(`/map/${m.image_id}`)):(console.error("Navigation blocked: Invalid image_id format:",m.image_id),x("/explore")):(console.error("Navigation blocked: Invalid image_id:",m?.image_id),x("/explore"))}else n[0]&&n[0].image_id&&n[0].image_id!=="undefined"&&n[0].image_id!=="null"&&n[0].image_id.trim()!==""?/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(n[0].image_id)?(console.log("Fallback navigation to first item:",n[0].image_id),x(`/map/${n[0].image_id}`)):(console.error("Fallback navigation blocked: Invalid image_id format:",n[0].image_id),x("/explore")):(console.log("No valid remaining items, going to explore page"),x("/explore"))}else console.log("No remaining items, going to explore page"),x("/explore")}else x("/explore")}catch(s){console.error("Failed to navigate to next item:",s),x("/explore")}finally{Q(!1)}}else console.error("Delete failed"),Q(!1)}catch(t){console.error("Delete failed:",t),Q(!1)}}},je=d.useCallback(async()=>{R(!0);try{const t=new URLSearchParams;p&&t.append("search",p),y&&t.append("source",y),v&&t.append("event_type",v),j&&t.append("region",j),w&&t.append("country",w),I&&t.append("image_type",I),N&&t.append("upload_type",N),b&&t.append("starred_only","true");const s=await fetch(`/api/images/grouped?${t.toString()}`);if(s.ok){const l=await s.json();if(l.length>0){const i=l[0];i&&i.image_id&&x(`/map/${i.image_id}`)}else x("/explore")}}catch(t){console.error("Failed to navigate to matching image:",t),x("/explore")}finally{R(!1)}},[p,y,v,j,w,I,N,b,x]),c=d.useMemo(()=>{if(!e)return null;if(!p&&!y&&!v&&!j&&!w&&!I&&!N&&!b)return e;const t=!p||e.title?.toLowerCase().includes(p.toLowerCase())||e.generated?.toLowerCase().includes(p.toLowerCase())||e.source?.toLowerCase().includes(p.toLowerCase())||e.event_type?.toLowerCase().includes(p.toLowerCase()),s=!y||e.source===y,l=!v||e.event_type===v,i=!j||e.countries.some(D=>D.r_code===j),n=!w||e.countries.some(D=>D.c_code===w),r=!I||e.image_type===I,o=!N||N==="single"&&(!e.image_count||e.image_count<=1)&&(!e.all_image_ids||e.all_image_ids.length<=1)||N==="multiple"&&(e.image_count&&e.image_count>1||e.all_image_ids&&e.all_image_ids.length>1),m=!b||e.starred===!0,_=t&&s&&l&&i&&n&&r&&o&&m;return!_&&(p||y||v||j||w||I||N||b)?(setTimeout(()=>{je()},100),e):_?e:null},[e,p,y,v,j,w,I,N,b,je]),Ze=()=>{if(!e)return;if(!e.all_image_ids||e.all_image_ids.length<=1){const i=`/upload?step=1&contribute=true&imageIds=${[e.image_id].join(",")}`;x(i);return}const s=`/upload?step=1&contribute=true&imageIds=${e.all_image_ids.join(",")}`;x(s)},T=(t,s)=>({image:`images/${s}`,caption:t.edited||t.generated||"",metadata:{image_id:t.image_count&&t.image_count>1?t.all_image_ids||[t.image_id]:t.image_id,title:t.title,source:t.source,event_type:t.event_type,image_type:t.image_type,countries:t.countries,starred:t.starred,image_count:t.image_count||1}}),Qe=async t=>{if(e){te(!0),se(!1);try{const s=(await oa(async()=>{const{default:o}=await import("./jszip.min-DJ3yWU3V.js").then(m=>m.j);return{default:o}},__vite__mapDeps([0,1,2]))).default,l=new s;if(e.image_type==="crisis_map"){const o=l.folder("crisis_maps_dataset"),m=o?.folder("images");if(m)try{const _=e.image_count&&e.image_count>1?e.all_image_ids||[e.image_id]:[e.image_id],D=_.map(async(f,L)=>{try{const C=await fetch(`/api/images/${f}/file`);if(!C.ok)throw new Error(`Failed to fetch image ${f}`);const S=await C.blob(),Y=e.file_key.split(".").pop()||"jpg",B=`0001_${String(L+1).padStart(2,"0")}.${Y}`;return m.file(B,S),{success:!0,fileName:B,imageId:f}}catch(C){return console.error(`Failed to process image ${f}:`,C),{success:!1,fileName:"",imageId:f}}}),F=(await Promise.all(D)).filter(f=>f.success);if(F.length===0)throw new Error("No images could be processed");if(t==="fine-tuning"){const f=[],L=[],C=[],S=F.map(Ye=>`images/${Ye.fileName}`),Y=Math.random(),B={image:S.length===1?S[0]:S,caption:e.edited||e.generated||"",metadata:{image_id:_,title:e.title,source:e.source,event_type:e.event_type,image_type:e.image_type,countries:e.countries,starred:e.starred,image_count:e.image_count||1}};Y<$/100?f.push(B):Y<($+J)/100?L.push(B):C.push(B),o&&(o.file("train.jsonl",JSON.stringify(f,null,2)),o.file("test.jsonl",JSON.stringify(L,null,2)),o.file("val.jsonl",JSON.stringify(C,null,2)))}else{const f=F.map(C=>`images/${C.fileName}`),L={image:f.length===1?f[0]:f,caption:e.edited||e.generated||"",metadata:{image_id:_,title:e.title,source:e.source,event_type:e.event_type,image_type:e.image_type,countries:e.countries,starred:e.starred,image_count:e.image_count||1}};o&&o.file("0001.json",JSON.stringify(L,null,2))}}catch(_){throw console.error(`Failed to process image ${e.image_id}:`,_),_}}else if(e.image_type==="drone_image"){const o=l.folder("drone_images_dataset"),m=o?.folder("images");if(m)try{const _=await fetch(`/api/images/${e.image_id}/file`);if(!_.ok)throw new Error(`Failed to fetch image ${e.image_id}`);const D=await _.blob(),F=`0001.${e.file_key.split(".").pop()||"jpg"}`;if(m.file(F,D),t==="fine-tuning"){const f=[],L=[],C=[];if(String(e?.image_type)==="crisis_map"){const S=Math.random();S<$/100?f.push(T(e,"0001")):S<($+J)/100?L.push(T(e,"0001")):C.push(T(e,"0001"))}else if(String(e?.image_type)==="drone_image"){const S=Math.random();S<$/100?f.push(T(e,"0001")):S<($+J)/100?L.push(T(e,"0001")):C.push(T(e,"0001"))}o&&(o.file("train.jsonl",JSON.stringify(f,null,2)),o.file("test.jsonl",JSON.stringify(L,null,2)),o.file("val.jsonl",JSON.stringify(C,null,2)))}else{const f={image:`images/${F}`,caption:e.edited||e.generated||"",metadata:{image_id:e.image_count&&e.image_count>1?e.all_image_ids||[e.image_id]:e.image_id,title:e.title,source:e.source,event_type:e.event_type,image_type:e.image_type,countries:e.countries,starred:e.starred,image_count:e.image_count||1}};o&&o.file("0001.json",JSON.stringify(f,null,2))}}catch(_){throw console.error(`Failed to process image ${e.image_id}:`,_),_}}else{const o=l.folder("generic_dataset"),m=o?.folder("images");if(m)try{const _=await fetch(`/api/images/${e.image_id}/file`);if(!_.ok)throw new Error(`Failed to fetch image ${e.image_id}`);const D=await _.blob(),F=`0001.${e.file_key.split(".").pop()||"jpg"}`;if(m.file(F,D),t==="fine-tuning"){const f=[],L=[],C=[];if(String(e?.image_type)==="crisis_map"){const S=Math.random();S<$/100?f.push(T(e,"0001")):S<($+J)/100?L.push(T(e,"0001")):C.push(T(e,"0001"))}else if(String(e?.image_type)==="drone_image"){const S=Math.random();S<$/100?f.push(T(e,"0001")):S<($+J)/100?L.push(T(e,"0001")):C.push(T(e,"0001"))}o&&(o.file("train.jsonl",JSON.stringify(f,null,2)),o.file("test.jsonl",JSON.stringify(L,null,2)),o.file("val.jsonl",JSON.stringify(C,null,2)))}else{const f={image:`images/${F}`,caption:e.edited||e.generated||"",metadata:{image_id:e.image_count&&e.image_count>1?e.all_image_ids||[e.image_id]:e.image_id,title:e.title,source:e.source,event_type:e.event_type,image_type:e.image_type,countries:e.countries,starred:e.starred,image_count:e.image_count||1}};o&&o.file("0001.json",JSON.stringify(f,null,2))}}catch(_){throw console.error(`Failed to process image ${e.image_id}:`,_),_}}const i=await l.generateAsync({type:"blob"}),n=URL.createObjectURL(i),r=document.createElement("a");r.href=n,r.download=`dataset_${e.image_type}_${e.image_id}_${t}_${new Date().toISOString().split("T")[0]}.zip`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n),console.log(`Exported ${e.image_type} dataset with 1 image in ${t} mode`),se(!0)}catch(s){console.error("Export failed:",s),alert("Failed to export dataset. Please try again.")}finally{te(!1)}}},Xe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;return!u||u==="undefined"||u==="null"||u.trim()===""||!Xe.test(u)?a.jsx(ee,{children:a.jsxs("div",{className:"flex flex-col items-center gap-4 text-center py-12",children:[a.jsx("div",{className:"text-4xl",children:"⚠️"}),a.jsx("div",{className:"text-xl font-semibold",children:"Invalid Map ID"}),a.jsx("div",{children:"The map ID provided is not valid."}),a.jsxs("div",{className:"text-sm text-gray-500 mt-2",children:['Debug Info: mapId = "',u,'" (type: ',typeof u,")"]}),a.jsx(M,{name:"back-to-explore",variant:"secondary",onClick:()=>x("/explore"),children:"Return to Explore"})]})}):z?a.jsx(ee,{children:a.jsx("div",{className:g.loadingContainer,children:a.jsxs("div",{className:"flex flex-col items-center gap-4",children:[a.jsx(we,{className:"text-ifrcRed"}),a.jsx("div",{children:"Loading map details..."})]})})}):ce||!e?a.jsx(ee,{children:a.jsx("div",{className:g.errorContainer,children:a.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[a.jsx("div",{className:"text-4xl",children:"⚠️"}),a.jsx("div",{className:"text-xl font-semibold",children:"Unable to load map"}),a.jsx("div",{children:ce||"Map not found"}),a.jsx(M,{name:"back-to-explore",variant:"secondary",onClick:()=>x("/explore"),children:"Return to Explore"})]})})}):a.jsxs(ee,{children:[a.jsxs("div",{className:"max-w-7xl mx-auto",children:[a.jsxs("div",{className:g.tabSelector,children:[a.jsx(sa,{name:"map-details-view",value:le,onChange:t=>{(t==="mapDetails"||t==="explore")&&(Ie(t),t==="explore"&&x("/explore"))},options:Be,keySelector:t=>t.key,labelSelector:t=>t.label}),a.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[a.jsx(E,{withInternalPadding:!0,className:"bg-white/20 backdrop-blur-sm rounded-md p-2",children:a.jsxs(M,{name:"reference-examples",variant:b?"primary":"secondary",onClick:()=>Oe(!b),className:"whitespace-nowrap",children:[a.jsx("span",{className:"mr-2",children:b?a.jsx("span",{className:"text-yellow-400",children:"★"}):a.jsx("span",{className:"text-yellow-400",children:"☆"})}),"Reference Examples"]})}),a.jsx(M,{name:"export-dataset",variant:"secondary",onClick:()=>Z(!0),children:"Export"})]})]}),a.jsx(la,{sources:de,types:ge,regions:ue,countries:ke,imageTypes:me,isLoadingFilters:!1}),le==="mapDetails"?a.jsx("div",{className:"relative",children:c?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:g.gridLayout,children:[a.jsxs(E,{heading:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{children:c.title||"Map Image"}),c.starred&&a.jsx("span",{className:"text-red-500 text-xl",title:"Starred image",children:"★"})]}),headingLevel:2,withHeaderBorder:!0,withInternalPadding:!0,spacing:"comfortable",children:[a.jsx("div",{className:g.imageContainer,children:e?.image_count&&e.image_count>1||h.length>1?a.jsxs("div",{className:g.carouselContainer,children:[a.jsx("div",{className:g.carouselImageWrapper,children:H?a.jsxs("div",{className:g.imagePlaceholder,children:[a.jsx(we,{className:"text-ifrcRed"}),a.jsx("div",{children:"Loading images..."})]}):h[k]?.detail_url?a.jsx("img",{src:h[k].detail_url,alt:h[k].file_key,className:g.carouselImage,onError:t=>{console.log("MapDetailsPage: Detail image failed to load, falling back to original:",h[k].detail_url);const s=t.target;h[k].image_url&&(s.src=h[k].image_url)},onLoad:()=>console.log("MapDetailsPage: Detail image loaded successfully:",h[k].detail_url)}):h[k]?.image_url?a.jsx("img",{src:h[k].image_url,alt:h[k].file_key,className:g.carouselImage,onLoad:()=>console.log("MapDetailsPage: Original image loaded successfully:",h[k].image_url)}):a.jsx("div",{className:g.imagePlaceholder,children:"No image available"})}),a.jsxs("div",{className:g.carouselNavigation,children:[a.jsx(M,{name:"previous-image",variant:"tertiary",size:1,onClick:We,disabled:H,className:g.carouselButton,children:a.jsx(ne,{className:"w-4 h-4"})}),a.jsx("div",{className:g.carouselIndicators,children:h.map((t,s)=>a.jsx("button",{onClick:()=>Ve(s),className:`${g.carouselIndicator} ${s===k?g.carouselIndicatorActive:""}`,disabled:H,children:s+1},s))}),a.jsx(M,{name:"next-image",variant:"tertiary",size:1,onClick:Je,disabled:H,className:g.carouselButton,children:a.jsx(oe,{className:"w-4 h-4"})})]}),a.jsx("div",{className:g.viewImageButtonContainer,children:a.jsx(M,{name:"view-full-size-carousel",variant:"secondary",size:1,onClick:()=>ye(h[k]),disabled:H||!h[k]?.image_url,children:"View Image"})})]}):a.jsxs("div",{className:g.singleImageContainer,children:[c.detail_url?a.jsx("img",{src:c.detail_url,alt:c.file_key,onError:t=>{console.log("MapDetailsPage: Detail image failed to load, falling back to original:",c.detail_url);const s=t.target;c.image_url&&(s.src=c.image_url)},onLoad:()=>console.log("MapDetailsPage: Detail image loaded successfully:",c.detail_url)}):c.image_url?a.jsx("img",{src:c.image_url,alt:c.file_key,onLoad:()=>console.log("MapDetailsPage: Original image loaded successfully:",c.image_url)}):a.jsx("div",{className:g.imagePlaceholder,children:"No image available"}),a.jsx("div",{className:g.viewImageButtonContainer,children:a.jsx(M,{name:"view-full-size-single",variant:"secondary",size:1,onClick:()=>ye(c),disabled:!c.image_url,children:"View Image"})})]})}),a.jsx(E,{withInternalPadding:!0,className:"bg-white/20 backdrop-blur-sm rounded-md p-2",children:a.jsxs("div",{className:g.metadataTags,children:[c.image_type!=="drone_image"&&a.jsx("span",{className:g.metadataTag,children:de.find(t=>t.s_code===c.source)?.label||c.source}),a.jsx("span",{className:g.metadataTag,children:ge.find(t=>t.t_code===c.event_type)?.label||c.event_type}),a.jsx("span",{className:g.metadataTag,children:me.find(t=>t.image_type===c.image_type)?.label||c.image_type}),c.countries&&c.countries.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:g.metadataTag,children:ue.find(t=>t.r_code===c.countries[0].r_code)?.label||"Unknown Region"}),a.jsx("span",{className:g.metadataTag,children:c.countries.map(t=>t.label).join(", ")})]}),c.image_count&&c.image_count>1&&a.jsxs("span",{className:g.metadataTag,title:`Multi-upload with ${c.image_count} images`,children:["📷 ",c.image_count]}),(!c.image_count||c.image_count<=1)&&a.jsx("span",{className:g.metadataTag,title:"Single Upload",children:"Single"})]})})]}),a.jsx("div",{className:g.detailsSection,children:c.edited&&c.edited.includes("Description:")||c.generated&&c.generated.includes("Description:")?a.jsx(E,{heading:"AI Generated Content",headingLevel:3,withHeaderBorder:!0,withInternalPadding:!0,spacing:"comfortable",children:a.jsx("div",{className:g.captionContainer,children:a.jsx("div",{className:g.captionText,children:(c.edited||c.generated||"").split(/(Description:|Analysis:|Recommended Actions:)/).map((l,i)=>l.trim()===""?null:l==="Description:"||l==="Analysis:"||l==="Recommended Actions:"?a.jsx("h4",{className:"font-semibold text-gray-800 mt-4 mb-2",children:l},i):a.jsx("p",{className:"mb-2",children:l.trim()},i))})})}):a.jsx(E,{heading:"Description",headingLevel:3,withHeaderBorder:!0,withInternalPadding:!0,spacing:"comfortable",children:a.jsx("div",{className:g.captionContainer,children:c.generated||c.edited?a.jsx("div",{className:g.captionText,children:a.jsx("p",{children:c.edited||c.generated})}):a.jsx("p",{children:"— no caption yet —"})})})})]}),a.jsx("div",{className:"flex items-center justify-center mt-8",children:a.jsx(E,{withInternalPadding:!0,className:"bg-white/20 backdrop-blur-sm rounded-lg p-4",children:a.jsxs("div",{className:"flex items-center gap-4",children:[Le&&a.jsx(E,{withInternalPadding:!0,className:"rounded-md p-2",children:a.jsx(M,{name:"previous-item",variant:"tertiary",size:1,className:`bg-white/90 hover:bg-white shadow-lg border border-gray-200 ${W?"opacity-50 cursor-not-allowed":"hover:scale-110"}`,onClick:()=>ve("previous"),disabled:W,children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsxs("div",{className:"flex -space-x-1",children:[a.jsx(ne,{className:"w-4 h-4"}),a.jsx(ne,{className:"w-4 h-4"})]}),a.jsx("span",{className:"font-semibold",children:"Previous"})]})})}),re&&a.jsx(E,{withInternalPadding:!0,className:"rounded-md p-2",children:a.jsx(M,{name:"delete",variant:"tertiary",size:1,className:"bg-red-50 hover:bg-red-100 text-red-700 border border-red-200 hover:border-red-300",onClick:He,title:"Delete","aria-label":"Delete saved image",children:a.jsx(ia,{className:"w-4 h-4"})})}),a.jsx(E,{withInternalPadding:!0,className:"rounded-md p-2",children:a.jsx(M,{name:"contribute",onClick:Ze,children:"Contribute"})}),re&&a.jsx(E,{withInternalPadding:!0,className:"rounded-md p-2",children:a.jsx(M,{name:"toggle-star",variant:"tertiary",size:1,className:`${e?.starred?"bg-red-100 hover:bg-red-200 text-red-800 border-2 border-red-400":"bg-gray-100 hover:bg-gray-200 text-gray-600 border-2 border-gray-300"} w-16 h-8 rounded-full transition-all duration-200 flex items-center justify-center`,onClick:qe,title:e?.starred?"Unstar image":"Star image","aria-label":e?.starred?"Unstar image":"Star image",children:a.jsx("span",{className:`text-lg transition-all duration-200 ${e?.starred?"text-red-600":"text-gray-500"}`,children:e?.starred?"★":"☆"})})}),Fe&&a.jsx(E,{withInternalPadding:!0,className:"rounded-md p-2",children:a.jsx(M,{name:"next-item",variant:"tertiary",size:1,className:`bg-white/90 hover:bg-white shadow-lg border border-gray-200 ${W?"opacity-50 cursor-not-allowed":"hover:scale-110"}`,onClick:()=>ve("next"),disabled:W,children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("span",{className:"font-semibold",children:"Next"}),a.jsxs("div",{className:"flex -space-x-1",children:[a.jsx(oe,{className:"w-4 h-4"}),a.jsx(oe,{className:"w-4 h-4"})]})]})})})]})})})]}):a.jsxs("div",{className:"text-center py-12",children:[a.jsx("div",{className:"text-xl font-semibold text-gray-600 mb-4",children:"No matches found"}),a.jsx("div",{className:"mt-4",children:a.jsx(M,{name:"clear-filters",variant:"secondary",onClick:Ue,children:"Clear Filters"})})]})}):null]}),Ee&&a.jsx("div",{className:g.fullSizeModalOverlay,onClick:()=>K(!1),children:a.jsx("div",{className:g.fullSizeModalContent,onClick:t=>t.stopPropagation(),children:a.jsxs("div",{className:g.ratingWarningContent,children:[a.jsx("h3",{className:g.ratingWarningTitle,children:"Delete Image?"}),a.jsx("p",{className:g.ratingWarningText,children:"This action cannot be undone. Are you sure you want to delete this saved image and all related data?"}),a.jsxs("div",{className:g.ratingWarningButtons,children:[a.jsx(M,{name:"confirm-delete",variant:"secondary",onClick:Ke,children:"Delete"}),a.jsx(M,{name:"cancel-delete",variant:"tertiary",onClick:()=>K(!1),children:"Cancel"})]})]})})}),pe&&a.jsx(ca,{isOpen:pe,onClose:()=>{Z(!1),se(!1),te(!1)},onExport:(t,s)=>{s.includes(e.image_type)&&Qe(t)},filteredCount:1,totalCount:1,hasFilters:!1,crisisMapsCount:e.image_type==="crisis_map"?1:0,droneImagesCount:e.image_type==="drone_image"?1:0,isLoading:$e,exportSuccess:Pe,variant:"single",onNavigateToList:()=>{Z(!1),x("/explore")},onNavigateAndExport:()=>{Z(!1),x("/explore?export=true")}}),a.jsx(na,{isOpen:Re,imageUrl:Ae?.image_url||null,preview:null,selectedImageData:null,onClose:Ge,isLoading:ze})]})}export{st as default};
|
|
|
|
|
|
|
|
|
py_backend/static/assets/index-DHoU8ejU.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jszip.min-DJ3yWU3V.js","assets/index-DnPgbq1Q.js","assets/index-cCOeofBN.css"])))=>i.map(i=>d[i]);
|
| 2 |
-
import{j as t,z as j,n as N,v as De,w as Oe,x as Le,B as Me,r,D as Re,N as Je,_ as ge,L as ze,F as We,G as Ue}from"./index-DnPgbq1Q.js";import{u as Be}from"./useAdmin-qpJv9-Qq.js";import{F as Ae,E as He}from"./ExportModal-DYxnGjiT.js";const Ve="_paginatorContainer_1l5ti_1",Ge="_paginationControls_1l5ti_19",pe={paginatorContainer:Ve,paginationControls:Ge};function Ze({currentPage:_,totalPages:p,onPageChange:T,className:z=""}){if(p<=1)return null;const u=(()=>{const f=[];if(p<=5)for(let h=1;h<=p;h++)f.push(h);else{let h=Math.max(1,_-2);const v=Math.min(p,h+5-1);v===p&&(h=Math.max(1,v-5+1));for(let b=h;b<=v;b++)f.push(b)}return f})();return t.jsx("div",{className:`${pe.paginatorContainer} ${z}`,children:t.jsxs("div",{className:pe.paginationControls,children:[t.jsx(j,{withInternalPadding:!0,className:"bg-white/20 backdrop-blur-sm rounded-md p-2",children:t.jsxs(N,{name:"prev-page",variant:"tertiary",size:1,onClick:()=>T(Math.max(1,_-1)),disabled:_===1,title:"Previous page",children:[t.jsx(De,{className:"w-4 h-4"}),t.jsx("span",{className:"hidden sm:inline",children:"Previous"})]})}),t.jsxs("div",{className:"flex items-center gap-1",children:[u[0]>1&&t.jsxs(t.Fragment,{children:[t.jsx(j,{withInternalPadding:!0,className:"bg-white/20 backdrop-blur-sm rounded-md p-2",children:t.jsx(N,{name:"page-1",variant:"tertiary",size:1,onClick:()=>T(1),children:"1"})}),u[0]>2&&t.jsx(j,{withInternalPadding:!0,className:"bg-white/20 backdrop-blur-sm rounded-md p-2",children:t.jsx("span",{className:"px-2 text-gray-500",children:"..."})})]}),u.map(f=>t.jsx(j,{withInternalPadding:!0,className:"bg-white/20 backdrop-blur-sm rounded-md p-2",children:t.jsx(N,{name:`page-${f}`,variant:_===f?"primary":"tertiary",size:1,onClick:()=>T(f),children:f})},f)),u[u.length-1]<p&&t.jsxs(t.Fragment,{children:[u[u.length-1]<p-1&&t.jsx(j,{withInternalPadding:!0,className:"bg-white/20 backdrop-blur-sm rounded-md p-2",children:t.jsx("span",{className:"px-2 text-gray-500",children:"..."})}),t.jsx(j,{withInternalPadding:!0,className:"bg-white/20 backdrop-blur-sm rounded-md p-2",children:t.jsx(N,{name:`page-${p}`,variant:"tertiary",size:1,onClick:()=>T(p),children:p})})]})]}),t.jsx(j,{withInternalPadding:!0,className:"bg-white/20 backdrop-blur-sm rounded-md p-2",children:t.jsxs(N,{name:"next-page",variant:"tertiary",size:1,onClick:()=>T(Math.min(p,_+1)),disabled:_===p,title:"Next page",children:[t.jsx("span",{className:"hidden sm:inline",children:"Next"}),t.jsx(Oe,{className:"w-4 h-4"})]})})]})})}const qe="_tabSelector_o9y1f_1",Ke="_metadataTags_o9y1f_8",Qe="_metadataTag_o9y1f_8",Xe="_metadataTagSource_o9y1f_32",Ye="_metadataTagType_o9y1f_43",et="_mapItem_o9y1f_54",tt="_mapItemImage_o9y1f_72",at="_mapItemContent_o9y1f_92",st="_mapItemTitle_o9y1f_97",it="_mapItemMetadata_o9y1f_105",nt="_fullSizeModalOverlay_o9y1f_134",lt="_fullSizeModalContent_o9y1f_148",rt="_ratingWarningContent_o9y1f_159",ot="_ratingWarningTitle_o9y1f_165",ct="_ratingWarningText_o9y1f_172",dt="_ratingWarningButtons_o9y1f_179",m={tabSelector:qe,metadataTags:Ke,metadataTag:Qe,metadataTagSource:Xe,metadataTagType:Ye,mapItem:et,mapItemImage:tt,mapItemContent:at,mapItemTitle:st,mapItemMetadata:it,fullSizeModalOverlay:nt,fullSizeModalContent:lt,ratingWarningContent:rt,ratingWarningTitle:ot,ratingWarningText:ct,ratingWarningButtons:dt};function ut(){const _=Le(),p=Me(),{isAuthenticated:T}=Be(),[z,te]=r.useState("explore"),[u,f]=r.useState([]),{search:I,srcFilter:h,catFilter:v,regionFilter:b,countryFilter:P,imageTypeFilter:D,uploadTypeFilter:O,showReferenceExamples:w,setShowReferenceExamples:ue}=Re(),[A,fe]=r.useState([]),[H,he]=r.useState([]),[ae,xe]=r.useState([]),[_e,ye]=r.useState([]),[se,je]=r.useState([]),[Ne,ie]=r.useState(!0),[L,ne]=r.useState(!0),[ve,V]=r.useState(!1),[be,G]=r.useState(!1),[we,Z]=r.useState(!1),[q,K]=r.useState(null),[Se,W]=r.useState(!1),[U,le]=r.useState(""),[Q,re]=r.useState(!1),[X,oe]=r.useState(1),[B]=r.useState(10),[Y,ce]=r.useState(0),[Te,de]=r.useState(0),Ie=[{key:"explore",label:"List"},{key:"mapDetails",label:"Carousel"}],M=r.useCallback(()=>{ne(!0),K(null);const e=new URLSearchParams({page:X.toString(),limit:B.toString(),include_count:"true"});I&&e.append("search",I),h&&e.append("source",h),v&&e.append("event_type",v),b&&e.append("region",b),P&&e.append("country",P),D&&e.append("image_type",D),O&&e.append("upload_type",O),w&&e.append("starred_only","true"),fetch(`/api/images/grouped?${e.toString()}`).then(s=>{if(!s.ok)throw new Error(`Failed to fetch images: ${s.status} ${s.statusText}`);return s.json()}).then(s=>{if(console.log("ExplorePage: Fetched captions:",s),s.items&&typeof s.total_count=="number")f(s.items),ce(s.total_count),de(Math.ceil(s.total_count/B));else if(Array.isArray(s))f(s);else throw new Error("Unexpected response format");K(null)}).catch(s=>{console.error("ExplorePage: Error fetching captions:",s),K(s instanceof Error?s.message:"Failed to load images. Please try again later."),f([]),ce(0),de(0)}).finally(()=>{ne(!1)})},[X,I,h,v,b,P,D,O,w,B]);r.useEffect(()=>{M()},[M]),r.useEffect(()=>{oe(1)},[I,h,v,b,P,D,O,w]),r.useEffect(()=>{const e=()=>{document.hidden||M()};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[M]),r.useEffect(()=>{new URLSearchParams(p.search).get("export")==="true"&&(V(!0),_("/explore",{replace:!0}))},[p.search,_,I,h,v,b,P,D,w]),r.useEffect(()=>{ie(!0),Promise.all([fetch("/api/sources").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}: ${e.statusText}`);return e.json()}),fetch("/api/types").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}: ${e.statusText}`);return e.json()}),fetch("/api/regions").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}: ${e.statusText}`);return e.json()}),fetch("/api/countries").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}: ${e.statusText}`);return e.json()}),fetch("/api/image-types").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}: ${e.statusText}`);return e.json()})]).then(([e,s,d,E,C])=>{fe(e),he(s),xe(d),ye(E),je(C)}).catch(()=>{}).finally(()=>{ie(!1)})},[]);const S=u,Ee=async(e,s="fine-tuning")=>{if(e.length===0){alert("No images to export");return}G(!0),Z(!1);try{const d=(await Ue(async()=>{const{default:i}=await import("./jszip.min-DJ3yWU3V.js").then($=>$.j);return{default:i}},__vite__mapDeps([0,1,2]))).default,E=new d,C=e.filter(i=>i.image_type==="crisis_map"),R=e.filter(i=>i.image_type==="drone_image");if(C.length>0){const i=E.folder("crisis_maps_dataset"),$=i?.folder("images");if($){let F=1;for(const a of C)try{const y=a.image_count&&a.image_count>1?a.all_image_ids||[a.image_id]:[a.image_id],ee=y.map(async(n,x)=>{try{const l=await fetch(`/api/images/${n}/file`);if(!l.ok)throw new Error(`Failed to fetch image ${n}`);const o=await l.blob(),c=a.file_key.split(".").pop()||"jpg",g=`${String(F).padStart(4,"0")}_${String(x+1).padStart(2,"0")}.${c}`;return $.file(g,o),{success:!0,fileName:g,imageId:n}}catch(l){return console.error(`Failed to process image ${n}:`,l),{success:!1,fileName:"",imageId:n}}}),k=(await Promise.all(ee)).filter(n=>n.success);if(k.length>0){if(s==="fine-tuning"){const n=k.map(o=>`images/${o.fileName}`),x=Math.random(),l={image:n.length===1?n[0]:n,caption:a.edited||a.generated||"",metadata:{image_id:y,title:a.title,source:a.source,event_type:a.event_type,image_type:a.image_type,countries:a.countries,starred:a.starred,image_count:a.image_count||1}};if(!i)continue;if(x<.8){const o=i.file("train.jsonl");if(o){const c=await o.async("string").then(g=>JSON.parse(g||"[]")).catch(()=>[]);c.push(l),i.file("train.jsonl",JSON.stringify(c,null,2))}else i.file("train.jsonl",JSON.stringify([l],null,2))}else if(x<.9){const o=i.file("test.jsonl");if(o){const c=await o.async("string").then(g=>JSON.parse(g||"[]")).catch(()=>[]);c.push(l),i.file("test.jsonl",JSON.stringify(c,null,2))}else i.file("test.jsonl",JSON.stringify([l],null,2))}else{const o=i.file("val.jsonl");if(o){const c=await o.async("string").then(g=>JSON.parse(g||"[]")).catch(()=>[]);c.push(l),i.file("val.jsonl",JSON.stringify(c,null,2))}else i.file("val.jsonl",JSON.stringify([l],null,2))}}else{const n=k.map(l=>`images/${l.fileName}`),x={image:n.length===1?n[0]:n,caption:a.edited||a.generated||"",metadata:{image_id:y,title:a.title,source:a.source,event_type:a.event_type,image_type:a.image_type,countries:a.countries,starred:a.starred,image_count:a.image_count||1}};i&&i.file(`${String(F).padStart(4,"0")}.json`,JSON.stringify(x,null,2))}F++}}catch(y){console.error(`Failed to process caption ${a.image_id}:`,y)}}}if(R.length>0){const i=E.folder("drone_images_dataset"),$=i?.folder("images");if($){let F=1;for(const a of R)try{const y=a.image_count&&a.image_count>1?a.all_image_ids||[a.image_id]:[a.image_id],ee=y.map(async(n,x)=>{try{const l=await fetch(`/api/images/${n}/file`);if(!l.ok)throw new Error(`Failed to fetch image ${n}`);const o=await l.blob(),c=a.file_key.split(".").pop()||"jpg",g=`${String(F).padStart(4,"0")}_${String(x+1).padStart(2,"0")}.${c}`;return $.file(g,o),{success:!0,fileName:g,imageId:n}}catch(l){return console.error(`Failed to process image ${n}:`,l),{success:!1,fileName:"",imageId:n}}}),k=(await Promise.all(ee)).filter(n=>n.success);if(k.length>0){if(s==="fine-tuning"){const n=k.map(o=>`images/${o.fileName}`),x=Math.random(),l={image:n.length===1?n[0]:n,caption:a.edited||a.generated||"",metadata:{image_id:y,title:a.title,source:a.source,event_type:a.event_type,image_type:a.image_type,countries:a.countries,starred:a.starred,image_count:a.image_count||1}};if(!i)continue;if(x<.8){const o=i.file("train.jsonl");if(o){const c=await o.async("string").then(g=>JSON.parse(g||"[]")).catch(()=>[]);c.push(l),i.file("train.jsonl",JSON.stringify(c,null,2))}else i.file("train.jsonl",JSON.stringify([l],null,2))}else if(x<.9){const o=i.file("test.jsonl");if(o){const c=await o.async("string").then(g=>JSON.parse(g||"[]")).catch(()=>[]);c.push(l),i.file("test.jsonl",JSON.stringify(c,null,2))}else i.file("test.jsonl",JSON.stringify([l],null,2))}else{const o=i.file("val.jsonl");if(o){const c=await o.async("string").then(g=>JSON.parse(g||"[]")).catch(()=>[]);c.push(l),i.file("val.jsonl",JSON.stringify(c,null,2))}else i.file("val.jsonl",JSON.stringify([l],null,2))}}else{const n=k.map(l=>`images/${l.fileName}`),x={image:n.length===1?n[0]:n,caption:a.edited||a.generated||"",metadata:{image_id:y,title:a.title,source:a.source,event_type:a.event_type,image_type:a.image_type,countries:a.countries,starred:a.starred,image_count:a.image_count||1}};i&&i.file(`${String(F).padStart(4,"0")}.json`,JSON.stringify(x,null,2))}F++}}catch(y){console.error(`Failed to process caption ${a.image_id}:`,y)}}}const Fe=await E.generateAsync({type:"blob"}),me=URL.createObjectURL(Fe),J=document.createElement("a");J.href=me,J.download=`datasets_${s}_${new Date().toISOString().split("T")[0]}.zip`,document.body.appendChild(J),J.click(),document.body.removeChild(J),URL.revokeObjectURL(me);const ke=(C.length||0)+(R.length||0);console.log(`Exported ${s} datasets with ${ke} total images:`),C.length>0&&console.log(`- Crisis maps: ${C.length} images`),R.length>0&&console.log(`- Drone images: ${R.length} images`),Z(!0)}catch(d){console.error("Export failed:",d),alert("Failed to export dataset. Please try again.")}finally{G(!1)}},Ce=e=>{le(e),W(!0)},$e=async()=>{if(U){re(!0);try{console.log("Deleting image with ID:",U),(await fetch(`/api/images/${U}`,{method:"DELETE"})).ok?(f(s=>s.filter(d=>d.image_id!==U)),W(!1),le("")):(console.error("Delete failed"),alert("Failed to delete image. Please try again."))}catch(e){console.error("Delete failed:",e),alert("Failed to delete image. Please try again.")}finally{re(!1)}}};return t.jsxs(Je,{children:[L?t.jsx("div",{className:"flex flex-col items-center justify-center min-h-[60vh]",children:t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[t.jsx(ge,{className:"text-ifrcRed"}),t.jsx("div",{children:"Loading examples..."})]})}):t.jsxs("div",{className:"max-w-7xl mx-auto",children:[t.jsxs("div",{className:m.tabSelector,children:[t.jsx(ze,{name:"explore-view",value:z,onChange:e=>{(e==="explore"||e==="mapDetails")&&(te(e),e==="mapDetails"&&u.length>0&&(u[0]?.image_id&&u[0].image_id!=="undefined"&&u[0].image_id!=="null"?_(`/map/${u[0].image_id}`):console.error("Invalid image_id for navigation:",u[0]?.image_id)))},options:Ie,keySelector:e=>e.key,labelSelector:e=>e.label}),t.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[t.jsx(j,{withInternalPadding:!0,className:"bg-white/20 backdrop-blur-sm rounded-md p-2",children:t.jsxs(N,{name:"reference-examples",variant:w?"primary":"secondary",onClick:()=>ue(!w),className:"whitespace-nowrap",children:[t.jsx("span",{className:"mr-2",children:w?t.jsx("span",{className:"text-yellow-400",children:"★"}):t.jsx("span",{className:"text-yellow-400",children:"☆"})}),"Reference Examples"]})}),t.jsx(N,{name:"export-dataset",variant:"secondary",onClick:()=>V(!0),children:"Export"})]})]}),z==="explore"?t.jsxs("div",{className:"space-y-6",children:[t.jsx("div",{className:"mb-6 space-y-4",children:t.jsx("div",{className:"flex flex-wrap items-center gap-4",children:t.jsx(j,{withInternalPadding:!0,className:"bg-white/20 backdrop-blur-sm rounded-md p-2 flex-1 min-w-[300px]",children:t.jsx(Ae,{sources:A,types:H,regions:ae,countries:_e,imageTypes:se,isLoadingFilters:Ne})})})}),t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"flex justify-between items-center",children:t.jsxs("p",{className:"text-sm text-gray-600",children:[S.length," of ",Y," examples"]})}),L&&t.jsx("div",{className:"text-center py-12",children:t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[t.jsx(ge,{className:"text-ifrcRed"}),t.jsx("div",{children:"Loading examples..."})]})}),!L&&q&&t.jsx("div",{className:"text-center py-12",children:t.jsx(j,{withInternalPadding:!0,className:"bg-red-50 border border-red-200 rounded-md max-w-2xl mx-auto",children:t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[t.jsx("div",{className:"text-red-800 font-semibold text-lg",children:"Failed to Load Images"}),t.jsx("div",{className:"text-red-700",children:q}),t.jsx(N,{name:"retry-fetch",variant:"primary",onClick:()=>M(),children:"Retry"})]})})}),!L&&!q&&t.jsxs("div",{className:"space-y-4",children:[S.map(e=>t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("div",{className:`${m.mapItem} flex-1`,onClick:()=>{console.log("ExplorePage: Clicking on image with ID:",e.image_id),console.log("ExplorePage: Image data:",e),e.image_id&&e.image_id!=="undefined"&&e.image_id!=="null"?(console.log("ExplorePage: Navigating to:",`/map/${e.image_id}`),console.log("ExplorePage: Full navigation URL:",`/#/map/${e.image_id}`),_(`/map/${e.image_id}`)):(console.error("Invalid image_id for navigation:",e.image_id),console.error("Full item data:",JSON.stringify(e,null,2)),alert(`Cannot navigate: Invalid image ID (${e.image_id})`))},children:[t.jsx("div",{className:m.mapItemImage,style:{width:"120px",height:"80px"},children:e.thumbnail_url?t.jsxs(t.Fragment,{children:[console.log("ExplorePage: Using thumbnail for fast loading:",e.thumbnail_url),t.jsx("img",{src:e.thumbnail_url,alt:e.file_key,onError:s=>{console.error("ExplorePage: Thumbnail failed to load, falling back to original:",e.thumbnail_url);const d=s.target;e.image_url?d.src=e.image_url:(d.style.display="none",d.parentElement.innerHTML="Img")},onLoad:()=>console.log("ExplorePage: Thumbnail loaded successfully:",e.thumbnail_url)})]}):e.image_url?t.jsxs(t.Fragment,{children:[console.log("ExplorePage: No thumbnail available, using original image:",e.image_url),t.jsx("img",{src:e.image_url,alt:e.file_key,onError:s=>{console.error("ExplorePage: Original image failed to load:",e.image_url);const d=s.target;d.style.display="none",d.parentElement.innerHTML="Img"},onLoad:()=>console.log("ExplorePage: Original image loaded successfully:",e.image_url)})]}):t.jsxs(t.Fragment,{children:[console.log("ExplorePage: No image_url or thumbnail provided for item:",e),"'Img'"]})}),t.jsxs("div",{className:m.mapItemContent,children:[t.jsx("h3",{className:m.mapItemTitle,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{children:e.title||"Untitled"}),e.starred&&t.jsx("span",{className:"text-red-500 text-lg",title:"Starred image",children:"★"})]})}),t.jsx("div",{className:m.mapItemMetadata,children:t.jsxs("div",{className:m.metadataTags,children:[e.image_type!=="drone_image"&&t.jsx("span",{className:m.metadataTagSource,children:e.source&&e.source.includes(", ")?e.source.split(", ").map(s=>A.find(d=>d.s_code===s.trim())?.label||s.trim()).join(", "):A.find(s=>s.s_code===e.source)?.label||e.source}),t.jsx("span",{className:m.metadataTagType,children:e.event_type&&e.event_type.includes(", ")?e.event_type.split(", ").map(s=>H.find(d=>d.t_code===s.trim())?.label||s.trim()).join(", "):H.find(s=>s.t_code===e.event_type)?.label||e.event_type}),t.jsx("span",{className:m.metadataTag,children:se.find(s=>s.image_type===e.image_type)?.label||e.image_type}),e.image_count&&e.image_count>1&&t.jsxs("span",{className:m.metadataTag,title:`Multi-upload with ${e.image_count} images`,children:["📷 ",e.image_count]}),(!e.image_count||e.image_count<=1)&&t.jsx("span",{className:m.metadataTag,title:"Single Upload",children:"Single"}),e.countries&&e.countries.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:m.metadataTag,children:ae.find(s=>s.r_code===e.countries[0].r_code)?.label||"Unknown Region"}),t.jsx("span",{className:m.metadataTag,children:e.countries.map(s=>s.label).join(", ")})]})]})})]})]}),T&&t.jsx(j,{withInternalPadding:!0,className:"bg-white/20 backdrop-blur-sm rounded-md p-2",children:t.jsx(N,{name:`delete-${e.image_id}`,variant:"tertiary",size:1,className:"bg-red-50 hover:bg-red-100 text-red-700 border border-red-200 hover:border-red-300",onClick:()=>Ce(e.image_id),title:"Delete","aria-label":"Delete saved image",children:t.jsx(We,{className:"w-4 h-4"})})})]},e.image_id)),!S.length&&t.jsx("div",{className:"text-center py-12",children:t.jsx("p",{className:"text-gray-500",children:"No examples found."})}),!L&&S.length>0&&t.jsx(Ze,{currentPage:X,totalPages:Te,totalItems:Y,itemsPerPage:B,onPageChange:oe})]})]})]}):t.jsx("div",{className:"space-y-6",children:t.jsxs("div",{className:"text-center py-12",children:[t.jsx("p",{className:"text-gray-500",children:"Map Details view coming soon..."}),t.jsx("p",{className:"text-sm text-gray-400 mt-2",children:"This will show detailed information about individual maps"})]})})]}),Se&&t.jsx("div",{className:m.fullSizeModalOverlay,onClick:()=>W(!1),children:t.jsx("div",{className:m.fullSizeModalContent,onClick:e=>e.stopPropagation(),children:t.jsxs("div",{className:m.ratingWarningContent,children:[t.jsx("h3",{className:m.ratingWarningTitle,children:"Delete Image?"}),t.jsx("p",{className:m.ratingWarningText,children:"This action cannot be undone. Are you sure you want to delete this saved image and all related data?"}),t.jsxs("div",{className:m.ratingWarningButtons,children:[t.jsx(N,{name:"confirm-delete",variant:"secondary",onClick:$e,disabled:Q,children:Q?"Deleting...":"Delete"}),t.jsx(N,{name:"cancel-delete",variant:"tertiary",onClick:()=>W(!1),disabled:Q,children:"Cancel"})]})]})})}),t.jsx(He,{isOpen:ve,onClose:()=>{V(!1),Z(!1),G(!1)},onExport:(e,s)=>{const d=S.filter(E=>s.includes(E.image_type));Ee(d,e)},filteredCount:S.length,totalCount:Y,hasFilters:!!(I||h||v||b||P||D||O||w),crisisMapsCount:S.filter(e=>e.image_type==="crisis_map").length,droneImagesCount:S.filter(e=>e.image_type==="drone_image").length,isLoading:be,exportSuccess:we})]})}export{ut as default};
|
|
|
|
|
|
|
|
|
py_backend/static/assets/index-DnPgbq1Q.js
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
py_backend/static/assets/index-DvKkI06h.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{r as s,y as nt,t as ht,a as q,c as gt,j as e,o as N,b as re,R as st,z,g as rt,d as ft,m as vt,e as pt,n as Z,A as xt,f as _t,h as Ct,i as yt,k as he,l as bt,p as ye,q as jt,s as Nt,E as wt,C as St,U as Mt,Q as It,u as Dt,N as je,_ as Et,L as Tt}from"./index-DnPgbq1Q.js";const kt=({title:m,titleId:a,...h})=>s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 24 24",fill:"currentColor",width:"1em",height:"1em","aria-labelledby":a},h),m?s.createElement("title",{id:a},m):null,s.createElement("g",{clipPath:"url(#arrow-drop-down-line_svg__a)"},s.createElement("path",{d:"m12 15-4.243-4.243 1.415-1.414L12 12.172l2.828-2.83 1.415 1.415L12 15Z"})),s.createElement("defs",null,s.createElement("clipPath",{id:"arrow-drop-down-line_svg__a"},s.createElement("path",{d:"M0 0h24v24H0z"})))),Lt=({title:m,titleId:a,...h})=>s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 24 24",fill:"currentColor",width:"1em",height:"1em","aria-labelledby":a},h),m?s.createElement("title",{id:a},m):null,s.createElement("g",{clipPath:"url(#arrow-drop-up-line_svg__a)"},s.createElement("path",{d:"m12 11.828-2.828 2.829-1.415-1.414L12 9l4.243 4.243-1.415 1.414L12 11.828Z"})),s.createElement("defs",null,s.createElement("clipPath",{id:"arrow-drop-up-line_svg__a"},s.createElement("path",{d:"M0 0h24v24H0z"})))),Pt=({title:m,titleId:a,...h})=>s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 24 24",fill:"currentColor",width:"1em",height:"1em","aria-labelledby":a},h),m?s.createElement("title",{id:a},m):null,s.createElement("g",{clipPath:"url(#information-line_svg__a)"},s.createElement("path",{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10Zm0-2a8 8 0 1 0 0-16.001A8 8 0 0 0 12 20ZM11 7h2v2h-2V7Zm0 4h2v6h-2v-6Z"})),s.createElement("defs",null,s.createElement("clipPath",{id:"information-line_svg__a"},s.createElement("path",{d:"M0 0h24v24H0z"})))),Rt=({title:m,titleId:a,...h})=>s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 24 24",fill:"currentColor",width:"1em",height:"1em","aria-labelledby":a},h),m?s.createElement("title",{id:a},m):null,s.createElement("path",{fillRule:"evenodd",d:"m15.063 12 .937.938-4 4-4-4L8.938 12 12 15.063 15.063 12Z",clipRule:"evenodd"}),s.createElement("mask",{id:"table-sorting-line_svg__a",width:8,height:5,x:8,y:12,maskUnits:"userSpaceOnUse",style:{maskType:"luminance"}},s.createElement("path",{fillRule:"evenodd",d:"m15.063 12 .937.938-4 4-4-4L8.938 12 12 15.063 15.063 12Z",clipRule:"evenodd"})),s.createElement("g",{mask:"url(#table-sorting-line_svg__a)"},s.createElement("path",{d:"M-24-22h72v72h-72z"})),s.createElement("path",{fillRule:"evenodd",d:"M8.938 11 8 10.062l4-4 4 4-.938.938L12 7.937 8.937 11Z",clipRule:"evenodd"}),s.createElement("mask",{id:"table-sorting-line_svg__b",width:8,height:5,x:8,y:6,maskUnits:"userSpaceOnUse",style:{maskType:"luminance"}},s.createElement("path",{fillRule:"evenodd",d:"M8.938 11 8 10.062l4-4 4 4-.938.938L12 7.937 8.937 11Z",clipRule:"evenodd"})),s.createElement("g",{mask:"url(#table-sorting-line_svg__b)"},s.createElement("path",{d:"M48 45h-72v-72h72z"}))),$t="_number-output_1blvi_1",Bt={numberOutput:$t};function we(m){const{className:a,invalidText:h=nt,separatorHidden:r,compact:f,currency:g,value:b,tooltip:_,unit:y,prefix:x,suffix:w,maximumFractionDigits:C=1}=m,{currentLanguage:j}=s.useContext(ht),v=s.useMemo(()=>{if(q(b))return h;const S=gt(b,{currency:g,compact:f,separatorHidden:r,maximumFractionDigits:C,unit:y,language:j});return e.jsxs(e.Fragment,{children:[x,S,w]})},[h,b,f,r,g,y,C,x,j,w]);return e.jsx("div",{className:N(Bt.numberOutput,a),title:re(_)?String(_):void 0,children:v})}const At="_tooltip-dummy_rbf3f_1",Ft="_tooltip-content_rbf3f_7",Ot="_pointer_rbf3f_14",Ne={tooltipDummy:At,tooltipContent:Ft,pointer:Ot};function Ht(m){const{className:a,title:h,description:r,preferredWidth:f}=m,[g,b]=s.useState(!1),[_,y]=s.useState(!1),x=s.useRef(),w=s.useRef(null);return s.useEffect(()=>{const C=()=>{y(!0)},j=()=>{y(!1)};if(q(w.current))return;const{current:{parentNode:v}}=w;if(!q(v))return x.current=v,v.addEventListener("mouseover",C),v.addEventListener("mouseout",j),b(!0),()=>{v.removeEventListener("mouseover",C),v.removeEventListener("mouseout",j)}},[]),e.jsxs(e.Fragment,{children:[!g&&e.jsx("div",{className:Ne.tooltipDummy,ref:w}),_&&e.jsx(st,{className:N(Ne.tooltipContent,a),parentRef:x,pointerClassName:Ne.pointer,preferredWidth:f,children:e.jsx(z,{heading:h,withInternalPadding:!0,contentViewType:"vertical",children:r})})]})}function $(m){return m.id}const Vt="common",zt={booleanYesLabel:"Yes",booleanNoLabel:"No"},Ut={namespace:Vt,strings:zt},Wt="_boolean-output_kg1uq_1",Qt={booleanOutput:Wt};function Zt(m){const{className:a,invalidText:h,value:r}=m,f=rt(Ut);let g;return r===!0?g=f.booleanYesLabel:r===!1?g=f.booleanNoLabel:g=h,e.jsx("div",{className:N(Qt.booleanOutput,a),children:g})}const qt="_date-output_4jzjo_1",Gt={dateOutput:qt};function Yt(m){const{value:a,format:h,className:r,invalidText:f}=m,g=s.useMemo(()=>ft(a,h),[a,h]);return e.jsx("div",{className:N(Gt.dateOutput,r),children:g??f})}const Kt="_dropdown-menu_16hml_1",Xt="_icons_16hml_4",Jt="_content_16hml_5",ea="_actions_16hml_6",ta="_dropdown-icon_16hml_10",aa="_dropdown-content_16hml_16",le={dropdownMenu:Kt,icons:Xt,content:Jt,actions:ea,dropdownIcon:ta,dropdownContent:aa};function na(m){const a=s.useRef(null),{className:h,popupClassName:r,children:f,label:g,activeClassName:b,icons:_,variant:y="secondary",actions:x,withoutDropdownIcon:w,componentRef:C,elementRef:j=a,persistent:v,preferredPopupWidth:S}=m,p=s.useRef(null),[k,I]=s.useState(!1);s.useEffect(()=>{C&&(C.current={setShowDropdown:I})},[C,I]);const R=s.useCallback(()=>{I(ie=>!ie)},[I]),T=s.useCallback((ie,ae)=>{ae||ie&&v||I(!1)},[I,v]);vt(k,T,p,j);const G=s.useMemo(()=>({setShowDropdown:I}),[I]),U=!!x||!w;return e.jsxs(pt.Provider,{value:G,children:[e.jsx(Z,{name:void 0,className:N(le.dropdownMenu,k&&b,h),elementRef:j,onClick:R,variant:y,actionsContainerClassName:le.actions,iconsContainerClassName:le.icons,childrenContainerClassName:le.content,actions:U?e.jsxs(e.Fragment,{children:[x,!w&&(k?e.jsx(xt,{className:le.dropdownIcon}):e.jsx(_t,{className:le.dropdownIcon}))]}):void 0,icons:_,children:g}),k&&e.jsx(st,{elementRef:p,className:N(le.dropdownContent,r),parentRef:j,preferredWidth:S,children:f})]})}const sa="_info-popup_i3rna_1",ra="_label_i3rna_2",ia="_icon_i3rna_7",oa="_dropdown-container_i3rna_15",la="_content_i3rna_20",ge={infoPopup:sa,label:ra,icon:ia,dropdownContainer:oa,content:la};function ca(m){const{className:a,icon:h=e.jsx(Pt,{}),infoLabel:r,title:f,description:g,withoutIcon:b,popupClassName:_,descriptionClassName:y}=m;return e.jsx(na,{label:e.jsxs("div",{className:ge.label,children:[r,!b&&h&&e.jsx("div",{className:ge.icon,children:h})]}),popupClassName:N(ge.dropdownContainer,_),className:N(ge.infoPopup,a),variant:"tertiary",withoutDropdownIcon:!0,children:e.jsx(z,{heading:f,childrenContainerClassName:N(y,ge.content),withInternalPadding:!0,children:g})})}const da="_progress-wrapper_x340w_1",ua="_title_x340w_7",ma="_total_x340w_11",ha="_progress_x340w_1",fe={progressWrapper:da,title:ua,total:ma,progress:ha};function Ye(m){const{className:a,title:h,description:r,totalValue:f,value:g,showPercentageInTitle:b,children:_,color:y="var(--go-ui-color-primary-red)"}=m,x=re(g)?g:0,w=re(f)?f:0;let C;return w===0?C=0:C=x/w*100,e.jsxs("div",{className:N(fe.progressWrapper,a),children:[(h||b)&&e.jsxs("div",{className:fe.title,children:[h,b&&e.jsx(we,{value:C,suffix:"%"})]}),e.jsx("div",{className:fe.total,children:e.jsx("div",{className:fe.progress,style:{width:`${C}%`,backgroundColor:y}})}),r&&e.jsx("div",{className:fe.description,children:r}),_]})}const ga="_legend-element_1a9ic_1",fa="_color_1a9ic_7",va="_icon-container_1a9ic_14",pa="_icon_1a9ic_14",xa="_label_1a9ic_31",ve={legendElement:ga,color:fa,iconContainer:va,icon:pa,label:xa};function _a(m){const{className:a,colorClassName:h,iconClassName:r,color:f,label:g,iconSrc:b}=m;return e.jsxs("div",{className:N(ve.legendElement,a),children:[b?e.jsx("div",{style:{backgroundColor:f},className:ve.iconContainer,children:e.jsx("img",{className:N(ve.icon,r),src:b,alt:""})}):e.jsx("div",{style:{backgroundColor:f},className:N(ve.color,h)}),e.jsx("div",{className:ve.label,children:g})]})}const Ca="_text-output_10oza_1",ya="_with-background_10oza_6",ba="_label_10oza_11",ja="_with-colon_10oza_12",Na="_value_10oza_17",wa="_text-type_10oza_18",Sa="_strong_10oza_24",ee={textOutput:Ca,withBackground:ya,label:ba,withColon:ja,value:Na,textType:wa,strong:Sa};function Ke(m){const{className:a,label:h,icon:r,description:f,labelClassName:g,descriptionClassName:b,valueClassName:_,strongLabel:y,strongValue:x,strongDescription:w,withoutLabelColon:C,withBackground:j,invalidText:v=nt,...S}=m,{value:p}=m;let k=v;return S.valueType==="number"?k=e.jsx(we,{...S,invalidText:v}):S.valueType==="date"?k=e.jsx(Yt,{...S,invalidText:v}):S.valueType==="boolean"?k=e.jsx(Zt,{...S,invalidText:v}):p instanceof Date||(k=p||v),e.jsxs("div",{className:N(ee.textOutput,j&&ee.withBackground,a),children:[r,h&&e.jsx("div",{className:N(ee.label,y&&ee.strong,g,!C&&ee.withColon),children:h}),e.jsx("div",{className:N(ee.value,x&&ee.strong,S.valueType==="text"&&ee.textType,_),children:k}),f&&e.jsx("div",{className:N(ee.description,w&&ee.strong,b),children:f})]})}const Ma="_pie-chart_pyr7m_1",Ia="_legend_pyr7m_7",Da="_legend-item_pyr7m_13",pe={pieChart:Ma,legend:Ia,legendItem:Da},Ea=70,Ta=40;function Xe(m,a=1){return Math.round(m*10**a)/10**a}function Je(m,a){const h=(a-90)*Math.PI/180;return{x:Xe(m+m*Math.cos(h)),y:Xe(m+m*Math.sin(h))}}function ka(m,a,h){let r=h;const f=r-a===360;f&&(r-=1);const g=Je(m,a),b=Je(m,r),_=r-a<=180?0:1,y=["M",g.x,g.y,"A",m,m,0,_,1,b.x,b.y];return f?y.push("Z"):y.push("L",m,m,"L",g.x,g.y,"Z"),y.join(" ")}function xe(m){const{className:a,data:h,valueSelector:r,labelSelector:f,keySelector:g,colorSelector:b,colors:_,pieRadius:y=Ea,chartPadding:x=Ta,legendClassName:w,showPercentageInLegend:C}=m,j=Ct(h?.map(p=>r(p))),v=q(j)||j===0?1:j,S=s.useMemo(()=>{let p=0;const k=h?.map(I=>{const R=r(I);if(q(R))return;const T=360*(R/v);return p+=T,{key:g(I),value:R,label:f(I),startAngle:p-T,percentage:yt(R,v),endAngle:p,datum:I}}).filter(re)??[];return b?k.map(({datum:I,...R})=>({...R,color:b(I)})):k.map(({datum:I,...R},T)=>({...R,color:_[T%_.length]}))},[h,g,r,f,v,b,_]);return e.jsxs("div",{className:N(pe.pieChart,a),children:[e.jsx("svg",{className:pe.svg,style:{width:`${x+y*2}px`,height:`${x+y*2}px`},children:e.jsx("g",{style:{transform:`translate(${x/2}px, ${x/2}px)`},children:S.map(p=>e.jsx("path",{className:pe.path,d:ka(y,p.startAngle,p.endAngle),fill:p.color,children:e.jsx(Ht,{description:e.jsx(Ke,{label:p.label,value:p.value})})},p.key))})}),e.jsx("div",{className:N(pe.legend,w),children:S.map(p=>e.jsx(_a,{className:pe.legendItem,label:C?e.jsx(Ke,{label:p.label,value:p.percentage,valueType:"number",prefix:"(",suffix:"%)",withoutLabelColon:!0}):p.label,color:p.color},p.key))})]})}const La="_td_1k4cn_1",Pa={td:La};function Ra(m){const{className:a,children:h,...r}=m;return e.jsx("td",{className:N(a,Pa.td),...r,children:h})}function it(m){const{className:a,children:h,...r}=m;return e.jsx("tr",{className:a,...r,children:h})}const $a="_row_1829z_1",Ba="_cell_1829z_2",et={row:$a,cell:Ba};function Aa(m){const{data:a,keySelector:h,columns:r,rowClassName:f,cellClassName:g,rowModifier:b}=m;return e.jsx(e.Fragment,{children:a?.map((_,y)=>{const x=h(_,y),w=r.map(v=>{const{id:S,cellRenderer:p,cellRendererClassName:k,cellRendererParams:I,cellContainerClassName:R}=v,T=I(x,_,y,a),G=e.jsx(p,{className:k,...T,name:S});return e.jsx(Ra,{className:N(et.cell,R,typeof g=="function"?g(x,_,S):g),children:G},S)}),C=e.jsx(it,{className:N(et.row,typeof f=="function"?f(x,_):f),children:w});let j=C;return b&&(j=b({rowKey:x,row:C,cells:w,columns:r,datum:_})),e.jsx(s.Fragment,{children:j},x)})})}const Fa="_th_cdv41_1",Oa="_resize-handle_cdv41_8",tt={th:Fa,resizeHandle:Oa};function Ha(m){const{className:a,children:h,onResize:r,onResizeComplete:f,name:g,...b}=m,_=s.useRef(null),y=s.useRef(),x=s.useRef(),w=s.useRef(),C=s.useCallback(v=>{var S;if(re(y.current)&&_.current&&r){v.preventDefault(),v.stopPropagation();const p=v.clientX-y.current;if(re(x.current)){const k=x.current+p;w.current=k,r(k,g)}else x.current=(S=_.current)==null?void 0:S.offsetWidth}},[r,g]),j=s.useCallback(v=>{var S;v.preventDefault(),y.current=v.clientX,x.current=(S=_.current)==null?void 0:S.offsetWidth,window.addEventListener("mousemove",C,!0)},[C]);return s.useEffect(()=>{const v=()=>{y.current=void 0,x.current=void 0,f&&re(w.current)&&f(w.current,g),window.removeEventListener("mousemove",C,!0)};return window.addEventListener("mouseup",v,!0),()=>{window.removeEventListener("mouseup",v,!0),window.removeEventListener("mousemove",C,!0)}},[C,g,f]),e.jsxs("th",{ref:_,className:N(a,tt.th),...b,children:[r&&e.jsx("div",{role:"presentation",className:tt.resizeHandle,onMouseDown:j}),h]})}const Va="_table_nilhy_1",za="_table-overflow-wrapper_nilhy_8",Ua="_table-element_nilhy_13",Wa="_header-row_nilhy_23",Qa="_header-element_nilhy_24",Za="_header-component_nilhy_29",ce={table:Va,tableOverflowWrapper:za,tableElement:Ua,headerRow:Wa,headerElement:Qa,headerComponent:Za};function qa(m,a){return a??m.columnWidth??wt}function B(m){const{data:a,keySelector:h,columns:r,caption:f,className:g,captionClassName:b,headerRowClassName:_,headerCellClassName:y,rowClassName:x,cellClassName:w,rowModifier:C,fixedColumnWidth:j,resizableColumn:v,headersHidden:S,pending:p,filtered:k,errored:I=!1}=m,R=s.useRef(null),[T]=he.useState(()=>bt()),[G,U]=he.useState({});s.useEffect(()=>{U(W=>{if(q(R.current))return W;const E=R.current.getBoundingClientRect(),{width:O}=E;let A=r.map(M=>({id:M.id,stretch:!!M.columnStretch,width:qa(M,W[M.id])}));const X=ye(A.filter(M=>M.stretch).map(M=>M.width)),ne=ye(A.filter(M=>!M.stretch).map(M=>M.width)),Y=(O-ne)/X;return Y>1&&(A=A.map(M=>({...M,width:M.stretch?M.width*Y:M.width}))),jt(A,M=>M.id,M=>M.width)})},[r]);const ie=he.useCallback((W,E)=>{const O=document.getElementById(`${T}-${E}`),A=Math.max(W,80);if(q(O)||(O.style.width=`${A}px`,!j))return;const X=document.getElementById(T);if(q(X))return;const ne=ye(r.map(Y=>Y.id===E?A:G[Y.id]));X.style.width=`${ne}px`},[T,G,r,j]),ae=he.useCallback((W,E)=>{re(E)&&U(O=>({...O,[E]:Math.max(W,80)}))},[U]),be=he.useMemo(()=>ye(r.map(W=>G[W.id])),[G,r]),K=q(a)||a.length===0||Object.keys(G).length===0;return e.jsxs("div",{ref:R,className:N(ce.table,g),children:[!K&&e.jsx("div",{className:ce.tableOverflowWrapper,children:e.jsxs("table",{className:ce.tableElement,style:j?{width:`${be}px`}:void 0,id:T,children:[f&&e.jsx("caption",{className:b,children:f}),e.jsx("colgroup",{children:r.map(W=>{const{id:E,columnClassName:O}=W,A=G[E],X=j?{width:`${A}px`}:void 0;return e.jsx("col",{id:`${T}-${E}`,style:X,className:N(ce.column,O)},E)})}),!S&&e.jsx("thead",{children:e.jsx(it,{className:N(ce.headerRow,_),children:r.map((W,E)=>{const{id:O,title:A,headerCellRenderer:X,headerCellRendererClassName:ne,headerCellRendererParams:Y,headerContainerClassName:M}=W,se=e.jsx(X,{...Y,name:O,title:A,index:E,className:N(ne,ce.headerComponent)});return e.jsx(Ha,{scope:"col",name:O,onResize:v?ie:void 0,onResizeComplete:v?ae:void 0,className:N(ce.headerElement,typeof y=="function"?y(O):y,M),children:se},O)})})}),e.jsx("tbody",{children:e.jsx(Aa,{data:a,keySelector:h,columns:r,rowClassName:x,cellClassName:w,rowModifier:C})})]})}),e.jsx(Nt,{filtered:k,empty:K,errored:I,pending:p,overlayPending:!0})]})}function Ga(m){const{className:a,value:h}=m;return q(h)?null:e.jsx("div",{className:a,children:h})}const Ya="common",Ka={sortTableButtonTitle:"Sort Table"},Xa={namespace:Ya,strings:Ka},Ja="_header-cell_vn24d_1",en="_sort-button_vn24d_8",tn="_icon_vn24d_12",an="_info-popup-icon_vn24d_17",de={headerCell:Ja,sortButton:en,icon:tn,infoPopupIcon:an};function ot(m){const{className:a,titleClassName:h,title:r,name:f,sortable:g,defaultSortDirection:b="asc",infoTitle:_,infoDescription:y}=m,{sorting:x,setSorting:w}=s.useContext(St),C=rt(Xa),j=x?.name===f?x.direction:void 0,v=s.useRef(null),S=s.useCallback(()=>{if(q(w))return;let p;q(j)?p=b:j==="asc"?p="dsc":j==="dsc"&&(p="asc"),w(p?{name:f,direction:p}:void 0)},[f,w,j,b]);return e.jsxs("div",{ref:v,className:N(a,de.headerCell),children:[g&&e.jsxs(Z,{name:void 0,variant:"tertiary",onClick:S,title:C.sortTableButtonTitle,className:de.sortButton,children:[q(j)&&e.jsx(Rt,{className:de.icon}),j==="asc"&&e.jsx(Lt,{className:de.icon}),j==="dsc"&&e.jsx(kt,{className:de.icon})]}),e.jsx("div",{className:N(h,de.title),children:r}),_&&y&&e.jsx(ca,{className:de.infoPopupIcon,title:_,description:y})]})}const at={};function Q(m,a,h,r){return{id:m,title:a,columnClassName:r?.columnClassName,headerCellRenderer:ot,headerCellRendererClassName:r?.headerCellRendererClassName,headerContainerClassName:r?.headerContainerClassName,headerCellRendererParams:{sortable:r?.sortable,infoTitle:r?.headerInfoTitle,infoDescription:r?.headerInfoDescription},cellRendererClassName:r?.cellRendererClassName,cellContainerClassName:r?.cellContainerClassName,cellRenderer:Ga,cellRendererParams:(f,g)=>({value:h(g)||"--"}),valueSelector:h,valueComparator:(f,g)=>Mt(h(f),h(g)),columnWidth:r?.columnWidth,columnStretch:r?.columnStretch,columnStyle:r?.columnStyle}}function D(m,a,h,r){return{id:m,title:a,columnClassName:r?.columnClassName,headerCellRenderer:ot,headerCellRendererClassName:N(at.numberCellHeader,r?.headerCellRendererClassName),headerContainerClassName:r?.headerContainerClassName,headerCellRendererParams:{sortable:r?.sortable,infoTitle:r?.headerInfoTitle,infoDescription:r?.headerInfoDescription},cellRendererClassName:N(at.numberCell,r?.cellRendererClassName),cellContainerClassName:r?.cellContainerClassName,cellRenderer:we,cellRendererParams:(f,g)=>({value:h(g),suffix:r?.suffix,maximumFractionDigits:r?.maximumFractionDigits,invalidText:"--"}),valueSelector:h,valueComparator:(f,g)=>It(h(f),h(g)),columnWidth:r?.columnWidth,columnStretch:r?.columnStretch,columnStyle:r?.columnStyle}}const nn="_tabSelector_vlxoe_1",sn="_progressSection_vlxoe_14",rn="_progressLabel_vlxoe_20",on="_chartGrid_vlxoe_28",ln="_chartContainer_vlxoe_40",cn="_tableContainer_vlxoe_51",dn="_modelPerformance_vlxoe_59",un="_loadingContainer_vlxoe_67",mn="_errorContainer_vlxoe_77",hn="_userInteractionCards_vlxoe_96",gn="_userInteractionCard_vlxoe_96",fn="_userInteractionCardValue_vlxoe_116",vn="_userInteractionCardLabel_vlxoe_123",pn="_userInteractionCardButton_vlxoe_130",xn="_summaryStatsCards_vlxoe_148",_n="_summaryStatsCard_vlxoe_148",Cn="_summaryStatsCardValue_vlxoe_169",yn="_summaryStatsCardLabel_vlxoe_176",c={tabSelector:nn,progressSection:sn,progressLabel:rn,chartGrid:on,chartContainer:ln,tableContainer:cn,modelPerformance:dn,loadingContainer:un,errorContainer:mn,userInteractionCards:hn,userInteractionCard:gn,userInteractionCardValue:fn,userInteractionCardLabel:vn,userInteractionCardButton:pn,summaryStatsCards:xn,summaryStatsCard:_n,summaryStatsCardValue:Cn,summaryStatsCardLabel:yn};function jn(){const[m]=Dt(),[a,h]=s.useState(null),[r,f]=s.useState(!0),[g,b]=s.useState("crisis_maps"),[_,y]=s.useState([]),[x,w]=s.useState([]),[C,j]=s.useState([]),[v,S]=s.useState([]),[p,k]=s.useState(!1),[I,R]=s.useState(!1),[T,G]=s.useState(!1),[U,ie]=s.useState(!1),[ae,be]=s.useState(!1),[K,W]=s.useState(!1),E=t=>{k(t==="editTime"),R(t==="percentage"),G(t==="delete"),ie(t==="regions"),be(t==="sources"),W(t==="types")},O=[{key:"crisis_maps",label:"Crisis Maps"},{key:"drone_images",label:"Drone Images"}],A=s.useCallback((t,l)=>{if(!t||!l)return 0;const i=t.toLowerCase().replace(/[^\w\s]/g,"").split(/\s+/).filter(u=>u.length>0),n=l.toLowerCase().replace(/[^\w\s]/g,"").split(/\s+/).filter(u=>u.length>0);if(i.length===0&&n.length===0)return 1;if(i.length===0||n.length===0)return 0;const o=new Set(i),d=new Set(n),P=new Set([...o].filter(u=>d.has(u))),F=new Set([...o,...d]);return P.size/F.size},[]),X=s.useCallback(async()=>{f(!0);try{const l=await(await fetch("/api/images")).json(),i={},n=l.filter(u=>u.image_type==="crisis_map"),o=l.filter(u=>u.image_type==="drone_image"),d={totalCaptions:l.length,sources:{},types:{},regions:{},models:{},modelEditTimes:i,percentageModified:0,modelPercentageData:{},totalDeleteCount:0,deleteRate:0,crisisMaps:n,droneImages:o};l.forEach(u=>{if(u.source&&(d.sources[u.source]=(d.sources[u.source]||0)+1),u.event_type&&(d.types[u.event_type]=(d.types[u.event_type]||0)+1),u.countries&&u.countries.forEach(L=>{L.r_code&&(d.regions[L.r_code]=(d.regions[L.r_code]||0)+1)}),u.model){const L=u.model,V=d.models[L]||={count:0,avgAccuracy:0,avgContext:0,avgUsability:0,totalScore:0,deleteCount:0};if(V.count++,u.accuracy!=null&&(V.avgAccuracy+=u.accuracy),u.context!=null&&(V.avgContext+=u.context),u.usability!=null&&(V.avgUsability+=u.usability),u.created_at&&u.updated_at){const te=new Date(u.created_at).getTime(),Ce=new Date(u.updated_at).getTime()-te;Ce>0&&(i[L]||(i[L]=[]),i[L].push(Ce))}}}),_.forEach(u=>{u.s_code&&!d.sources[u.s_code]&&(d.sources[u.s_code]=0)}),x.forEach(u=>{u.t_code&&!d.types[u.t_code]&&(d.types[u.t_code]=0)}),C.forEach(u=>{u.r_code&&!d.regions[u.r_code]&&(d.regions[u.r_code]=0)}),["GPT-4","Claude","Gemini","Llama","Other"].forEach(u=>{d.models[u]||(d.models[u]={count:0,avgAccuracy:0,avgContext:0,avgUsability:0,totalScore:0,deleteCount:0})}),Object.values(d.models).forEach(u=>{u.count>0&&(u.avgAccuracy=Math.round(u.avgAccuracy/u.count),u.avgContext=Math.round(u.avgContext/u.count),u.avgUsability=Math.round(u.avgUsability/u.count),u.totalScore=Math.round((u.avgAccuracy+u.avgContext+u.avgUsability)/3))});const F=l.filter(u=>u.generated&&u.edited);if(F.length>0){const L=[...F.map(oe=>A(oe.generated,oe.edited))].sort((oe,Ce)=>oe-Ce),V=Math.floor(L.length/2),te=L.length%2===0?(L[V-1]+L[V])/2:L[V];d.percentageModified=Math.round((1-te)*100)}const H={};l.forEach(u=>{if(u.model&&u.generated&&u.edited){const L=A(u.generated,u.edited),V=Math.round((1-L)*100);H[u.model]||(H[u.model]=[]),H[u.model].push(V)}}),d.modelPercentageData=H;try{const u=await fetch("/api/models");if(u.ok){const L=await u.json();if(L.models){L.models.forEach(te=>{d.models[te.m_code]&&(d.models[te.m_code].deleteCount=te.delete_count||0)});const V=L.models.reduce((te,oe)=>te+(oe.delete_count||0),0);d.totalDeleteCount=V,d.deleteRate=V>0?Math.round(V/(V+l.length)*100):0}}}catch(u){console.log("Could not fetch model delete counts:",u)}h(d)}catch{h(null)}finally{f(!1)}},[_,x,C,A]),ne=s.useCallback(async()=>{try{const[t,l,i,n]=await Promise.all([fetch("/api/sources"),fetch("/api/types"),fetch("/api/regions"),fetch("/api/models")]),o=await t.json(),d=await l.json(),P=await i.json(),F=await n.json();y(o),w(d),j(P),S(F.models||[])}catch(t){console.log("Could not fetch lookup data:",t)}},[]);s.useEffect(()=>{const t=m.get("view");(t==="crisis_maps"||t==="drone_images")&&b(t)},[m]),s.useEffect(()=>{ne()},[ne]),s.useEffect(()=>{_.length>0&&x.length>0&&C.length>0&&v.length>0&&X()},[_,x,C,v,X]);const Y=s.useCallback(t=>{const l=_.find(i=>i.s_code===t);return l?l.label:t},[_]),M=s.useCallback(t=>{if(t.length===0)return 0;const l=[...t].sort((n,o)=>n-o),i=Math.floor(l.length/2);return l.length%2===0?Math.round((l[i-1]+l[i])/2):l[i]},[]),se=s.useCallback(t=>{const l=Math.floor(t/1e3),i=Math.floor(l/60),n=Math.floor(i/60);return n>0?`${n}h ${i%60}m`:i>0?`${i}m ${l%60}s`:`${l}s`},[]),_e=s.useCallback(t=>{const l=x.find(i=>i.t_code===t);return l?l.label:t},[x]),J=s.useCallback(t=>{const l=v.find(i=>i.m_code===t);return l?l.label:t},[v]),Se=s.useMemo(()=>a?Object.entries(a.modelEditTimes||{}).filter(([,t])=>t.length>0).sort(([,t],[,l])=>M(l)-M(t)).map(([t,l],i)=>({id:i+1,name:J(t),count:l.length,avgEditTime:M(l),minEditTime:Math.min(...l),maxEditTime:Math.max(...l)})):[],[a,M,J]),Me=s.useMemo(()=>a?Object.entries(a.modelPercentageData||{}).filter(([,t])=>t.length>0).sort(([,t],[,l])=>{const i=[...t].sort((H,u)=>H-u),n=[...l].sort((H,u)=>H-u),o=Math.floor(i.length/2),d=Math.floor(n.length/2),P=i.length%2===0?(i[o-1]+i[o])/2:i[o];return(n.length%2===0?(n[d-1]+n[d])/2:n[d])-P}).map(([t,l],i)=>{const n=[...l].sort((P,F)=>P-F),o=Math.floor(n.length/2),d=n.length%2===0?Math.round((n[o-1]+n[o])/2):n[o];return{id:i+1,name:J(t),count:l.length,avgPercentageModified:d,minPercentageModified:Math.min(...l),maxPercentageModified:Math.max(...l)}}):[],[a,J]),Ie=s.useMemo(()=>a?Object.entries(a.models).filter(([,t])=>t.count>0).map(([t,l],i)=>{const n=[l.avgAccuracy,l.avgContext,l.avgUsability],o=n.reduce((F,H)=>F+H,0)/n.length,d=n.reduce((F,H)=>F+Math.pow(H-o,2),0)/n.length,P=Math.round(100-Math.sqrt(d));return{id:i+1,name:J(t),consistency:Math.max(0,P),avgScore:Math.round(o),count:l.count}}).sort((t,l)=>l.consistency-t.consistency):[],[a,J]),De=s.useMemo(()=>[Q("name","Region",t=>t.name),D("count","Count",t=>t.count),D("percentage","% of Total",t=>t.percentage,{suffix:"%",maximumFractionDigits:0})],[]),Ee=s.useMemo(()=>[Q("name","Type",t=>t.name),D("count","Count",t=>t.count),D("percentage","% of Total",t=>t.percentage,{suffix:"%",maximumFractionDigits:0})],[]),lt=s.useMemo(()=>[Q("name","Source",t=>t.name),D("count","Count",t=>t.count),D("percentage","% of Total",t=>t.percentage,{suffix:"%",maximumFractionDigits:0})],[]),Te=s.useMemo(()=>[Q("name","Model",t=>t.name),D("count","Count",t=>t.count),D("accuracy","Accuracy",t=>t.accuracy,{suffix:"%",maximumFractionDigits:0}),D("context","Context",t=>t.context,{suffix:"%",maximumFractionDigits:0}),D("usability","Usability",t=>t.usability,{suffix:"%",maximumFractionDigits:0}),D("totalScore","Total Score",t=>t.totalScore,{suffix:"%",maximumFractionDigits:0})],[]),ke=s.useMemo(()=>[Q("name","Model",t=>t.name),D("count","Count",t=>t.count),Q("avgEditTime","Median Edit Time",t=>se(t.avgEditTime)),Q("minEditTime","Min Edit Time",t=>se(t.minEditTime)),Q("maxEditTime","Max Edit Time",t=>se(t.maxEditTime))],[se]),Le=s.useMemo(()=>[Q("name","Model",t=>t.name),D("count","Count",t=>t.count),D("avgPercentageModified","Median % Modified",t=>t.avgPercentageModified,{suffix:"%",maximumFractionDigits:0}),D("minPercentageModified","Min % Modified",t=>t.minPercentageModified,{suffix:"%",maximumFractionDigits:0}),D("maxPercentageModified","Max % Modified",t=>t.maxPercentageModified,{suffix:"%",maximumFractionDigits:0})],[]),Pe=s.useMemo(()=>[Q("name","Model",t=>t.name),D("count","Total Count",t=>t.count),D("deleteCount","Delete Count",t=>t.deleteCount),D("deleteRate","Delete Rate",t=>t.deleteRate,{suffix:"%",maximumFractionDigits:1})],[]),ct=s.useMemo(()=>[Q("source","Source",t=>t.source),D("avgQuality","Average Quality",t=>t.avgQuality,{suffix:"%",maximumFractionDigits:0}),D("count","Count",t=>t.count)],[]),Re=s.useMemo(()=>[Q("eventType","Event Type",t=>t.eventType),D("avgQuality","Average Quality",t=>t.avgQuality,{suffix:"%",maximumFractionDigits:0}),D("count","Count",t=>t.count)],[]),$e=s.useMemo(()=>[Q("name","Model",t=>t.name),D("consistency","Consistency",t=>t.consistency,{suffix:"%",maximumFractionDigits:0}),D("avgScore","Average Score",t=>t.avgScore,{suffix:"%",maximumFractionDigits:0}),D("count","Count",t=>t.count)],[]),ue=s.useCallback(t=>a?t==="crisis_map"?a.crisisMaps.length:t==="drone_image"?a.droneImages.length:0:0,[a]),Be=s.useCallback(t=>{if(!a)return[];const l=t==="crisis_map"?a.crisisMaps:a.droneImages,i={};return l.forEach(n=>{n.countries&&n.countries.forEach(o=>{o.r_code&&(i[o.r_code]=(i[o.r_code]||0)+1)})}),Object.entries(i).filter(([,n])=>n>0).map(([n,o])=>({name:C.find(d=>d.r_code===n)?.label||n,value:o}))},[a,C]),Ae=s.useCallback(t=>{if(!a)return[];const l=t==="crisis_map"?a.crisisMaps:a.droneImages,i={};l.forEach(o=>{o.countries&&o.countries.forEach(d=>{d.r_code&&(i[d.r_code]=(i[d.r_code]||0)+1)})});const n=C.reduce((o,d)=>(d.r_code&&(o[d.r_code]={name:d.label,count:i[d.r_code]||0}),o),{});return Object.entries(n).sort(([,o],[,d])=>d.count-o.count).map(([,{name:o,count:d}],P)=>({id:P+1,name:o,count:d,percentage:l.length>0?Math.round(d/l.length*100):0}))},[a,C]),dt=s.useCallback(t=>{if(!a)return[];const l=t==="crisis_map"?a.crisisMaps:a.droneImages,i={};return l.forEach(n=>{n.source&&(i[n.source]=(i[n.source]||0)+1)}),Object.entries(i).filter(([,n])=>n>0).map(([n,o])=>({name:_.find(d=>d.s_code===n)?.label||n,value:o}))},[a,_]),ut=s.useCallback(t=>{if(!a)return[];const l=t==="crisis_map"?a.crisisMaps:a.droneImages,i={};return l.forEach(n=>{n.source&&(i[n.source]=(i[n.source]||0)+1)}),Object.entries(i).sort(([,n],[,o])=>o-n).map(([n,o],d)=>({id:d+1,name:Y(n),count:o,percentage:l.length>0?Math.round(o/l.length*100):0}))},[a,Y]),Fe=s.useCallback(t=>{if(!a)return[];const l=t==="crisis_map"?a.crisisMaps:a.droneImages,i={};return l.forEach(n=>{n.event_type&&(i[n.event_type]=(i[n.event_type]||0)+1)}),Object.entries(i).filter(([,n])=>n>0).map(([n,o])=>({name:x.find(d=>d.t_code===n)?.label||n,value:o}))},[a,x]),Oe=s.useCallback(t=>{if(!a)return[];const l=t==="crisis_map"?a.crisisMaps:a.droneImages,i={};return l.forEach(n=>{n.event_type&&(i[n.event_type]=(i[n.event_type]||0)+1)}),Object.entries(i).sort(([,n],[,o])=>o-n).map(([n,o],d)=>({id:d+1,name:_e(n),count:o,percentage:l.length>0?Math.round(o/l.length*100):0}))},[a,_e]),He=s.useCallback(t=>{if(!a)return"No data available";const l=t==="crisis_map"?a.crisisMaps:a.droneImages,i=new Set;l.forEach(d=>{d.model&&i.add(d.model)}),console.log(`Debug ${t}:`,{totalImages:l.length,usedModels:Array.from(i),availableEditTimes:Object.keys(a.modelEditTimes),modelEditTimesData:a.modelEditTimes});const o=Object.entries(a.modelEditTimes).filter(([d])=>i.has(d)).flatMap(([,d])=>d);return o.length===0?"No data available":se(M(o))},[a,se,M]),Ve=s.useCallback(()=>{if(!a)return"No data available";const t=a.totalCaptions||0,l=a.percentageModified||0;return t>0?Math.round(l/t*100):0},[a]),ze=s.useCallback(()=>a&&a.deleteRate>=0?`${a.deleteRate}%`:"No data available",[a]),Ue=s.useCallback(t=>{if(!a)return[];const l=t==="crisis_map"?a.crisisMaps:a.droneImages,i=new Set;return l.forEach(o=>{o.model&&i.add(o.model)}),Se.filter(o=>{const d=v.find(P=>P.label===o.name)?.m_code;return d&&i.has(d)})},[a,Se,v]),We=s.useCallback(t=>{if(!a)return[];const l=t==="crisis_map"?a.crisisMaps:a.droneImages,i=new Set;return l.forEach(o=>{o.model&&i.add(o.model)}),Me.filter(o=>{const d=v.find(P=>P.label===o.name)?.m_code;return d&&i.has(d)})},[a,Me,v]),Qe=s.useCallback(t=>{if(!a)return[];const l=t==="crisis_map"?a.crisisMaps:a.droneImages,i={};return l.forEach(n=>{n.model&&(i[n.model]||(i[n.model]={count:0,deleteCount:0}),i[n.model].count++)}),Object.entries(i).map(([n,o],d)=>{const F=a.models?.[n]?.deleteCount||0,H=o.count>0?Math.round(F/o.count*100*10)/10:0;return{id:d+1,name:J(n),count:o.count,deleteCount:F,deleteRate:H}}).sort((n,o)=>o.count-n.count)},[a,J]),Ze=s.useCallback(t=>{if(!a)return[];const l=t==="crisis_map"?a.crisisMaps:a.droneImages,i={};return l.forEach(n=>{n.model&&(i[n.model]||(i[n.model]={count:0,totalAccuracy:0,totalContext:0,totalUsability:0}),i[n.model].count++,n.accuracy!=null&&(i[n.model].totalAccuracy+=n.accuracy),n.context!=null&&(i[n.model].totalContext+=n.context),n.usability!=null&&(i[n.model].totalUsability+=n.usability))}),Object.entries(i).map(([n,o],d)=>({id:d+1,name:J(n),count:o.count,accuracy:o.count>0?Math.round(o.totalAccuracy/o.count):0,context:o.count>0?Math.round(o.totalContext/o.count):0,usability:o.count>0?Math.round(o.totalUsability/o.count):0,totalScore:o.count>0?Math.round((o.totalAccuracy+o.totalContext+o.totalUsability)/(3*o.count)):0})).sort((n,o)=>o.totalScore-n.totalScore)},[a,J]),mt=s.useCallback(t=>{if(!a)return[];const l=t==="crisis_map"?a.crisisMaps:a.droneImages,i={};return l.forEach(n=>{n.source&&(i[n.source]||(i[n.source]={total:0,count:0,totalImages:0}),i[n.source].totalImages+=1,n.accuracy!=null&&(i[n.source].total+=n.accuracy,i[n.source].count+=1))}),Object.entries(i).map(([n,o],d)=>({id:d+1,source:Y(n),avgQuality:o.count>0?Math.round(o.total/o.count):0,count:o.totalImages}))},[a,Y]),qe=s.useCallback(t=>{if(!a)return[];const l=t==="crisis_map"?a.crisisMaps:a.droneImages,i={};return l.forEach(n=>{n.event_type&&(i[n.event_type]||(i[n.event_type]={total:0,count:0,totalImages:0}),i[n.event_type].totalImages+=1,n.accuracy!=null&&(i[n.event_type].total+=n.accuracy,i[n.event_type].count+=1))}),Object.entries(i).map(([n,o],d)=>({id:d+1,eventType:_e(n),avgQuality:o.count>0?Math.round(o.total/o.count):0,count:o.totalImages}))},[a,_e]),Ge=s.useCallback(t=>{if(!a)return[];const l=t==="crisis_map"?a.crisisMaps:a.droneImages,i=new Set;return l.forEach(o=>{o.model&&i.add(o.model)}),Ie.filter(o=>{const d=v.find(P=>P.label===o.name)?.m_code;return d&&i.has(d)})},[a,Ie,v]);if(r)return e.jsx(je,{children:e.jsx("div",{className:c.loadingContainer,children:e.jsx(Et,{})})});if(!a)return e.jsx(je,{children:e.jsx("div",{className:c.errorContainer,children:e.jsx("div",{className:"text-red-500",children:"Failed to load analytics data. Please try again."})})});const me=["#F5333F","#F64752","#F75C65","#F87079","#F9858C","#FA999F","#FBADB2","#FCC2C5"];return e.jsx(je,{children:e.jsxs("div",{className:"max-w-7xl mx-auto",children:[e.jsx("div",{className:c.tabSelector,children:e.jsx(Tt,{name:"analytics-view",value:g,onChange:t=>{(t==="crisis_maps"||t==="drone_images")&&b(t)},options:O,keySelector:t=>t.key,labelSelector:t=>t.label})}),g==="crisis_maps"?e.jsxs("div",{className:c.chartGrid,children:[e.jsxs(z,{heading:"Summary Statistics",headingLevel:3,withHeaderBorder:!0,withInternalPadding:!0,children:[e.jsxs("div",{className:c.summaryStatsCards,children:[e.jsxs("div",{className:c.summaryStatsCard,children:[e.jsx("div",{className:c.summaryStatsCardValue,children:ue("crisis_map")}),e.jsx("div",{className:c.summaryStatsCardLabel,children:"Total Crisis Maps"})]}),e.jsxs("div",{className:c.summaryStatsCard,children:[e.jsx("div",{className:c.summaryStatsCardValue,children:"2000"}),e.jsx("div",{className:c.summaryStatsCardLabel,children:"Target Amount"})]})]}),e.jsxs("div",{className:c.progressSection,children:[e.jsxs("div",{className:c.progressLabel,children:[e.jsx("span",{children:"Progress towards target"}),e.jsxs("span",{children:[Math.round(ue("crisis_map")/2e3*100),"%"]})]}),e.jsx(Ye,{value:ue("crisis_map"),totalValue:2e3})]})]}),e.jsxs(z,{heading:"Distribution Analysis",headingLevel:3,withHeaderBorder:!0,withInternalPadding:!0,children:[e.jsxs("div",{className:c.userInteractionCards,children:[e.jsxs("div",{className:c.userInteractionCard,children:[e.jsx("div",{className:c.userInteractionCardLabel,children:"Regions Distribution"}),e.jsx("div",{className:c.chartContainer,children:e.jsx(xe,{data:Be("crisis_map"),valueSelector:t=>t.value,labelSelector:t=>t.name,keySelector:t=>t.name,colors:me,showPercentageInLegend:!0})}),e.jsx(Z,{name:"view-regions-details",variant:U?"primary":"secondary",onClick:()=>E(U?"none":"regions"),className:c.userInteractionCardButton,children:U?"Hide Details":"View Details"})]}),e.jsxs("div",{className:c.userInteractionCard,children:[e.jsx("div",{className:c.userInteractionCardLabel,children:"Sources Distribution"}),e.jsx("div",{className:c.chartContainer,children:e.jsx(xe,{data:dt("crisis_map"),valueSelector:t=>t.value,labelSelector:t=>t.name,keySelector:t=>t.name,colors:me,showPercentageInLegend:!0})}),e.jsx(Z,{name:"view-sources-details",variant:ae?"primary":"secondary",onClick:()=>E(ae?"none":"sources"),className:c.userInteractionCardButton,children:ae?"Hide Details":"View Details"})]}),e.jsxs("div",{className:c.userInteractionCard,children:[e.jsx("div",{className:c.userInteractionCardLabel,children:"Types Distribution"}),e.jsx("div",{className:c.chartContainer,children:e.jsx(xe,{data:Fe("crisis_map"),valueSelector:t=>t.value,labelSelector:t=>t.name,keySelector:t=>t.name,colors:me,showPercentageInLegend:!0})}),e.jsx(Z,{name:"view-types-details",variant:K?"primary":"secondary",onClick:()=>E(K?"none":"types"),className:c.userInteractionCardButton,children:K?"Hide Details":"View Details"})]})]}),U&&e.jsx("div",{className:c.modelPerformance,children:e.jsx(B,{data:Ae("crisis_map"),columns:De,keySelector:$,filtered:!1,pending:!1})}),ae&&e.jsx("div",{className:c.modelPerformance,children:e.jsx(B,{data:ut("crisis_map"),columns:lt,keySelector:$,filtered:!1,pending:!1})}),K&&e.jsx("div",{className:c.modelPerformance,children:e.jsx(B,{data:Oe("crisis_map"),columns:Ee,keySelector:$,filtered:!1,pending:!1})})]}),e.jsxs(z,{heading:"User Interaction Statistics",headingLevel:3,withHeaderBorder:!0,withInternalPadding:!0,children:[e.jsxs("div",{className:c.userInteractionCards,children:[e.jsxs("div",{className:c.userInteractionCard,children:[e.jsx("div",{className:c.userInteractionCardValue,children:He("crisis_map")}),e.jsx("div",{className:c.userInteractionCardLabel,children:"Median Edit Time"}),e.jsx(Z,{name:"view-edit-time-details",variant:p?"primary":"secondary",onClick:()=>E(p?"none":"editTime"),className:c.userInteractionCardButton,children:p?"Hide Details":"View Details"})]}),e.jsxs("div",{className:c.userInteractionCard,children:[e.jsx("div",{className:c.userInteractionCardValue,children:Ve()}),e.jsx("div",{className:c.userInteractionCardLabel,children:"Median % Modified"}),e.jsx(Z,{name:"view-percentage-details",variant:I?"primary":"secondary",onClick:()=>E(I?"none":"percentage"),className:c.userInteractionCardButton,children:I?"Hide Details":"View Details"})]}),e.jsxs("div",{className:c.userInteractionCard,children:[e.jsx("div",{className:c.userInteractionCardValue,children:ze()}),e.jsx("div",{className:c.userInteractionCardLabel,children:"Delete Rate"}),e.jsx(Z,{name:"view-delete-details",variant:T?"primary":"secondary",onClick:()=>E(T?"none":"delete"),className:c.userInteractionCardButton,children:T?"Hide Details":"View Details"})]})]}),p&&e.jsx("div",{className:c.modelPerformance,children:e.jsx(B,{data:Ue("crisis_map"),columns:ke,keySelector:$,filtered:!1,pending:!1})}),I&&e.jsx("div",{className:c.modelPerformance,children:e.jsx(B,{data:We("crisis_map"),columns:Le,keySelector:$,filtered:!1,pending:!1})}),T&&e.jsx("div",{className:c.modelPerformance,children:e.jsx(B,{data:Qe("crisis_map"),columns:Pe,keySelector:$,filtered:!1,pending:!1})})]}),e.jsx(z,{heading:"Model Performance",headingLevel:3,withHeaderBorder:!0,withInternalPadding:!0,children:e.jsx("div",{className:c.modelPerformance,children:e.jsx(B,{data:Ze("crisis_map"),columns:Te,keySelector:$,filtered:!1,pending:!1})})}),e.jsx(z,{heading:"Quality-Source Correlation",headingLevel:3,withHeaderBorder:!0,withInternalPadding:!0,children:e.jsx("div",{className:c.tableContainer,children:e.jsx(B,{data:mt("crisis_map"),columns:ct,keySelector:$,filtered:!1,pending:!1})})}),e.jsx(z,{heading:"Quality-Event Type Correlation",headingLevel:3,withHeaderBorder:!0,withInternalPadding:!0,children:e.jsx("div",{className:c.tableContainer,children:e.jsx(B,{data:qe("crisis_map"),columns:Re,keySelector:$,filtered:!1,pending:!1})})}),e.jsx(z,{heading:"Model Consistency Analysis",headingLevel:3,withHeaderBorder:!0,withInternalPadding:!0,children:e.jsx("div",{className:c.tableContainer,children:e.jsx(B,{data:Ge("crisis_map"),columns:$e,keySelector:$,filtered:!1,pending:!1})})})]}):e.jsxs("div",{className:c.chartGrid,children:[e.jsxs(z,{heading:"Summary Statistics",headingLevel:3,withHeaderBorder:!0,withInternalPadding:!0,children:[e.jsxs("div",{className:c.summaryStatsCards,children:[e.jsxs("div",{className:c.summaryStatsCard,children:[e.jsx("div",{className:c.summaryStatsCardValue,children:ue("drone_image")}),e.jsx("div",{className:c.summaryStatsCardLabel,children:"Total Drone Images"})]}),e.jsxs("div",{className:c.summaryStatsCard,children:[e.jsx("div",{className:c.summaryStatsCardValue,children:"2000"}),e.jsx("div",{className:c.summaryStatsCardLabel,children:"Target Amount"})]})]}),e.jsxs("div",{className:c.progressSection,children:[e.jsxs("div",{className:c.progressLabel,children:[e.jsx("span",{children:"Progress towards target"}),e.jsxs("span",{children:[Math.round(ue("drone_image")/2e3*100),"%"]})]}),e.jsx(Ye,{value:ue("drone_image"),totalValue:2e3})]})]}),e.jsxs(z,{heading:"Distribution Analysis",headingLevel:3,withHeaderBorder:!0,withInternalPadding:!0,children:[e.jsxs("div",{className:c.userInteractionCards,children:[e.jsxs("div",{className:c.userInteractionCard,children:[e.jsx("div",{className:c.userInteractionCardLabel,children:"Regions Distribution"}),e.jsx("div",{className:c.chartContainer,children:e.jsx(xe,{data:Be("drone_image"),valueSelector:t=>t.value,labelSelector:t=>t.name,keySelector:t=>t.name,colors:me,showPercentageInLegend:!0})}),e.jsx(Z,{name:"view-regions-details",variant:U?"primary":"secondary",onClick:()=>E(U?"none":"regions"),className:c.userInteractionCardButton,children:U?"Hide Details":"View Details"})]}),e.jsxs("div",{className:c.userInteractionCard,children:[e.jsx("div",{className:c.userInteractionCardLabel,children:"Types Distribution"}),e.jsx("div",{className:c.chartContainer,children:e.jsx(xe,{data:Fe("drone_image"),valueSelector:t=>t.value,labelSelector:t=>t.name,keySelector:t=>t.name,colors:me,showPercentageInLegend:!0})}),e.jsx(Z,{name:"view-types-details",variant:K?"primary":"secondary",onClick:()=>E(K?"none":"types"),className:c.userInteractionCardButton,children:K?"Hide Details":"View Details"})]})]}),U&&e.jsx("div",{className:c.modelPerformance,children:e.jsx(B,{data:Ae("drone_image"),columns:De,keySelector:$,filtered:!1,pending:!1})}),K&&e.jsx("div",{className:c.modelPerformance,children:e.jsx(B,{data:Oe("drone_image"),columns:Ee,keySelector:$,filtered:!1,pending:!1})})]}),e.jsxs(z,{heading:"User Interaction Statistics",headingLevel:3,withHeaderBorder:!0,withInternalPadding:!0,children:[e.jsxs("div",{className:c.userInteractionCards,children:[e.jsxs("div",{className:c.userInteractionCard,children:[e.jsx("div",{className:c.userInteractionCardValue,children:He("drone_image")}),e.jsx("div",{className:c.userInteractionCardLabel,children:"Median Edit Time"}),e.jsx(Z,{name:"view-edit-time-details",variant:p?"primary":"secondary",onClick:()=>E(p?"none":"editTime"),className:c.userInteractionCardButton,children:p?"Hide Details":"View Details"})]}),e.jsxs("div",{className:c.userInteractionCard,children:[e.jsx("div",{className:c.userInteractionCardValue,children:Ve()}),e.jsx("div",{className:c.userInteractionCardLabel,children:"Median % Modified"}),e.jsx(Z,{name:"view-percentage-details",variant:I?"primary":"secondary",onClick:()=>E(I?"none":"percentage"),className:c.userInteractionCardButton,children:I?"Hide Details":"View Details"})]}),e.jsxs("div",{className:c.userInteractionCard,children:[e.jsx("div",{className:c.userInteractionCardValue,children:ze()}),e.jsx("div",{className:c.userInteractionCardLabel,children:"Delete Rate"}),e.jsx(Z,{name:"view-delete-details",variant:T?"primary":"secondary",onClick:()=>E(T?"none":"delete"),className:c.userInteractionCardButton,children:T?"Hide Details":"View Details"})]})]}),p&&e.jsx("div",{className:c.modelPerformance,children:e.jsx(B,{data:Ue("drone_image"),columns:ke,keySelector:$,filtered:!1,pending:!1})}),I&&e.jsx("div",{className:c.modelPerformance,children:e.jsx(B,{data:We("drone_image"),columns:Le,keySelector:$,filtered:!1,pending:!1})}),T&&e.jsx("div",{className:c.modelPerformance,children:e.jsx(B,{data:Qe("drone_image"),columns:Pe,keySelector:$,filtered:!1,pending:!1})})]}),e.jsx(z,{heading:"Model Performance",headingLevel:3,withHeaderBorder:!0,withInternalPadding:!0,children:e.jsx("div",{className:c.modelPerformance,children:e.jsx(B,{data:Ze("drone_image"),columns:Te,keySelector:$,filtered:!1,pending:!1})})}),e.jsx(z,{heading:"Quality-Event Type Correlation",headingLevel:3,withHeaderBorder:!0,withInternalPadding:!0,children:e.jsx("div",{className:c.tableContainer,children:e.jsx(B,{data:qe("drone_image"),columns:Re,keySelector:$,filtered:!1,pending:!1})})}),e.jsx(z,{heading:"Model Consistency Analysis",headingLevel:3,withHeaderBorder:!0,withInternalPadding:!0,children:e.jsx("div",{className:c.tableContainer,children:e.jsx(B,{data:Ge("drone_image"),columns:$e,keySelector:$,filtered:!1,pending:!1})})})]})]})})}export{jn as default};
|
|
|
|
|
|
py_backend/static/assets/jszip.min-DJ3yWU3V.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
| 1 |
-
import{X as bt,Y as It}from"./index-DnPgbq1Q.js";function vt(yt){throw new Error('Could not dynamically require "'+yt+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var kt={exports:{}};/*!
|
| 2 |
-
|
| 3 |
-
JSZip v3.10.1 - A JavaScript class for generating and reading zip files
|
| 4 |
-
<http://stuartk.com/jszip>
|
| 5 |
-
|
| 6 |
-
(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
|
| 7 |
-
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
|
| 8 |
-
|
| 9 |
-
JSZip uses the library pako released under the MIT license :
|
| 10 |
-
https://github.com/nodeca/pako/blob/main/LICENSE
|
| 11 |
-
*/var zt;function Ot(){return zt||(zt=1,function(yt,Tt){(function(b){yt.exports=b()})(function(){return function b(U,k,l){function o(_,y){if(!k[_]){if(!U[_]){var p=typeof vt=="function"&&vt;if(!y&&p)return p(_,!0);if(n)return n(_,!0);var g=new Error("Cannot find module '"+_+"'");throw g.code="MODULE_NOT_FOUND",g}var i=k[_]={exports:{}};U[_][0].call(i.exports,function(d){var r=U[_][1][d];return o(r||d)},i,i.exports,b,U,k,l)}return k[_].exports}for(var n=typeof vt=="function"&&vt,u=0;u<l.length;u++)o(l[u]);return o}({1:[function(b,U,k){var l=b("./utils"),o=b("./support"),n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";k.encode=function(u){for(var _,y,p,g,i,d,r,h=[],a=0,c=u.length,v=c,S=l.getTypeOf(u)!=="string";a<u.length;)v=c-a,p=S?(_=u[a++],y=a<c?u[a++]:0,a<c?u[a++]:0):(_=u.charCodeAt(a++),y=a<c?u.charCodeAt(a++):0,a<c?u.charCodeAt(a++):0),g=_>>2,i=(3&_)<<4|y>>4,d=1<v?(15&y)<<2|p>>6:64,r=2<v?63&p:64,h.push(n.charAt(g)+n.charAt(i)+n.charAt(d)+n.charAt(r));return h.join("")},k.decode=function(u){var _,y,p,g,i,d,r=0,h=0,a="data:";if(u.substr(0,a.length)===a)throw new Error("Invalid base64 input, it looks like a data url.");var c,v=3*(u=u.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(u.charAt(u.length-1)===n.charAt(64)&&v--,u.charAt(u.length-2)===n.charAt(64)&&v--,v%1!=0)throw new Error("Invalid base64 input, bad content length.");for(c=o.uint8array?new Uint8Array(0|v):new Array(0|v);r<u.length;)_=n.indexOf(u.charAt(r++))<<2|(g=n.indexOf(u.charAt(r++)))>>4,y=(15&g)<<4|(i=n.indexOf(u.charAt(r++)))>>2,p=(3&i)<<6|(d=n.indexOf(u.charAt(r++))),c[h++]=_,i!==64&&(c[h++]=y),d!==64&&(c[h++]=p);return c}},{"./support":30,"./utils":32}],2:[function(b,U,k){var l=b("./external"),o=b("./stream/DataWorker"),n=b("./stream/Crc32Probe"),u=b("./stream/DataLengthProbe");function _(y,p,g,i,d){this.compressedSize=y,this.uncompressedSize=p,this.crc32=g,this.compression=i,this.compressedContent=d}_.prototype={getContentWorker:function(){var y=new o(l.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new u("data_length")),p=this;return y.on("end",function(){if(this.streamInfo.data_length!==p.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),y},getCompressedWorker:function(){return new o(l.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},_.createWorkerFrom=function(y,p,g){return y.pipe(new n).pipe(new u("uncompressedSize")).pipe(p.compressWorker(g)).pipe(new u("compressedSize")).withStreamInfo("compression",p)},U.exports=_},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(b,U,k){var l=b("./stream/GenericWorker");k.STORE={magic:"\0\0",compressWorker:function(){return new l("STORE compression")},uncompressWorker:function(){return new l("STORE decompression")}},k.DEFLATE=b("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(b,U,k){var l=b("./utils"),o=function(){for(var n,u=[],_=0;_<256;_++){n=_;for(var y=0;y<8;y++)n=1&n?3988292384^n>>>1:n>>>1;u[_]=n}return u}();U.exports=function(n,u){return n!==void 0&&n.length?l.getTypeOf(n)!=="string"?function(_,y,p,g){var i=o,d=g+p;_^=-1;for(var r=g;r<d;r++)_=_>>>8^i[255&(_^y[r])];return-1^_}(0|u,n,n.length,0):function(_,y,p,g){var i=o,d=g+p;_^=-1;for(var r=g;r<d;r++)_=_>>>8^i[255&(_^y.charCodeAt(r))];return-1^_}(0|u,n,n.length,0):0}},{"./utils":32}],5:[function(b,U,k){k.base64=!1,k.binary=!1,k.dir=!1,k.createFolders=!0,k.date=null,k.compression=null,k.compressionOptions=null,k.comment=null,k.unixPermissions=null,k.dosPermissions=null},{}],6:[function(b,U,k){var l=null;l=typeof Promise<"u"?Promise:b("lie"),U.exports={Promise:l}},{lie:37}],7:[function(b,U,k){var l=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=b("pako"),n=b("./utils"),u=b("./stream/GenericWorker"),_=l?"uint8array":"array";function y(p,g){u.call(this,"FlateWorker/"+p),this._pako=null,this._pakoAction=p,this._pakoOptions=g,this.meta={}}k.magic="\b\0",n.inherits(y,u),y.prototype.processChunk=function(p){this.meta=p.meta,this._pako===null&&this._createPako(),this._pako.push(n.transformTo(_,p.data),!1)},y.prototype.flush=function(){u.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},y.prototype.cleanUp=function(){u.prototype.cleanUp.call(this),this._pako=null},y.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var p=this;this._pako.onData=function(g){p.push({data:g,meta:p.meta})}},k.compressWorker=function(p){return new y("Deflate",p)},k.uncompressWorker=function(){return new y("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(b,U,k){function l(i,d){var r,h="";for(r=0;r<d;r++)h+=String.fromCharCode(255&i),i>>>=8;return h}function o(i,d,r,h,a,c){var v,S,x=i.file,D=i.compression,O=c!==_.utf8encode,j=n.transformTo("string",c(x.name)),I=n.transformTo("string",_.utf8encode(x.name)),W=x.comment,q=n.transformTo("string",c(W)),m=n.transformTo("string",_.utf8encode(W)),B=I.length!==x.name.length,e=m.length!==W.length,T="",J="",P="",$=x.dir,L=x.date,V={crc32:0,compressedSize:0,uncompressedSize:0};d&&!r||(V.crc32=i.crc32,V.compressedSize=i.compressedSize,V.uncompressedSize=i.uncompressedSize);var E=0;d&&(E|=8),O||!B&&!e||(E|=2048);var C=0,X=0;$&&(C|=16),a==="UNIX"?(X=798,C|=function(H,nt){var ot=H;return H||(ot=nt?16893:33204),(65535&ot)<<16}(x.unixPermissions,$)):(X=20,C|=function(H){return 63&(H||0)}(x.dosPermissions)),v=L.getUTCHours(),v<<=6,v|=L.getUTCMinutes(),v<<=5,v|=L.getUTCSeconds()/2,S=L.getUTCFullYear()-1980,S<<=4,S|=L.getUTCMonth()+1,S<<=5,S|=L.getUTCDate(),B&&(J=l(1,1)+l(y(j),4)+I,T+="up"+l(J.length,2)+J),e&&(P=l(1,1)+l(y(q),4)+m,T+="uc"+l(P.length,2)+P);var G="";return G+=`
|
| 12 |
-
\0`,G+=l(E,2),G+=D.magic,G+=l(v,2),G+=l(S,2),G+=l(V.crc32,4),G+=l(V.compressedSize,4),G+=l(V.uncompressedSize,4),G+=l(j.length,2),G+=l(T.length,2),{fileRecord:p.LOCAL_FILE_HEADER+G+j+T,dirRecord:p.CENTRAL_FILE_HEADER+l(X,2)+G+l(q.length,2)+"\0\0\0\0"+l(C,4)+l(h,4)+j+T+q}}var n=b("../utils"),u=b("../stream/GenericWorker"),_=b("../utf8"),y=b("../crc32"),p=b("../signature");function g(i,d,r,h){u.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=d,this.zipPlatform=r,this.encodeFileName=h,this.streamFiles=i,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}n.inherits(g,u),g.prototype.push=function(i){var d=i.meta.percent||0,r=this.entriesCount,h=this._sources.length;this.accumulate?this.contentBuffer.push(i):(this.bytesWritten+=i.data.length,u.prototype.push.call(this,{data:i.data,meta:{currentFile:this.currentFile,percent:r?(d+100*(r-h-1))/r:100}}))},g.prototype.openedSource=function(i){this.currentSourceOffset=this.bytesWritten,this.currentFile=i.file.name;var d=this.streamFiles&&!i.file.dir;if(d){var r=o(i,d,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},g.prototype.closedSource=function(i){this.accumulate=!1;var d=this.streamFiles&&!i.file.dir,r=o(i,d,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),d)this.push({data:function(h){return p.DATA_DESCRIPTOR+l(h.crc32,4)+l(h.compressedSize,4)+l(h.uncompressedSize,4)}(i),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},g.prototype.flush=function(){for(var i=this.bytesWritten,d=0;d<this.dirRecords.length;d++)this.push({data:this.dirRecords[d],meta:{percent:100}});var r=this.bytesWritten-i,h=function(a,c,v,S,x){var D=n.transformTo("string",x(S));return p.CENTRAL_DIRECTORY_END+"\0\0\0\0"+l(a,2)+l(a,2)+l(c,4)+l(v,4)+l(D.length,2)+D}(this.dirRecords.length,r,i,this.zipComment,this.encodeFileName);this.push({data:h,meta:{percent:100}})},g.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},g.prototype.registerPrevious=function(i){this._sources.push(i);var d=this;return i.on("data",function(r){d.processChunk(r)}),i.on("end",function(){d.closedSource(d.previous.streamInfo),d._sources.length?d.prepareNextSource():d.end()}),i.on("error",function(r){d.error(r)}),this},g.prototype.resume=function(){return!!u.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},g.prototype.error=function(i){var d=this._sources;if(!u.prototype.error.call(this,i))return!1;for(var r=0;r<d.length;r++)try{d[r].error(i)}catch{}return!0},g.prototype.lock=function(){u.prototype.lock.call(this);for(var i=this._sources,d=0;d<i.length;d++)i[d].lock()},U.exports=g},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(b,U,k){var l=b("../compressions"),o=b("./ZipFileWorker");k.generateWorker=function(n,u,_){var y=new o(u.streamFiles,_,u.platform,u.encodeFileName),p=0;try{n.forEach(function(g,i){p++;var d=function(c,v){var S=c||v,x=l[S];if(!x)throw new Error(S+" is not a valid compression method !");return x}(i.options.compression,u.compression),r=i.options.compressionOptions||u.compressionOptions||{},h=i.dir,a=i.date;i._compressWorker(d,r).withStreamInfo("file",{name:g,dir:h,date:a,comment:i.comment||"",unixPermissions:i.unixPermissions,dosPermissions:i.dosPermissions}).pipe(y)}),y.entriesCount=p}catch(g){y.error(g)}return y}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(b,U,k){function l(){if(!(this instanceof l))return new l;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var o=new l;for(var n in this)typeof this[n]!="function"&&(o[n]=this[n]);return o}}(l.prototype=b("./object")).loadAsync=b("./load"),l.support=b("./support"),l.defaults=b("./defaults"),l.version="3.10.1",l.loadAsync=function(o,n){return new l().loadAsync(o,n)},l.external=b("./external"),U.exports=l},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(b,U,k){var l=b("./utils"),o=b("./external"),n=b("./utf8"),u=b("./zipEntries"),_=b("./stream/Crc32Probe"),y=b("./nodejsUtils");function p(g){return new o.Promise(function(i,d){var r=g.decompressed.getContentWorker().pipe(new _);r.on("error",function(h){d(h)}).on("end",function(){r.streamInfo.crc32!==g.decompressed.crc32?d(new Error("Corrupted zip : CRC32 mismatch")):i()}).resume()})}U.exports=function(g,i){var d=this;return i=l.extend(i||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:n.utf8decode}),y.isNode&&y.isStream(g)?o.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):l.prepareContent("the loaded zip file",g,!0,i.optimizedBinaryString,i.base64).then(function(r){var h=new u(i);return h.load(r),h}).then(function(r){var h=[o.Promise.resolve(r)],a=r.files;if(i.checkCRC32)for(var c=0;c<a.length;c++)h.push(p(a[c]));return o.Promise.all(h)}).then(function(r){for(var h=r.shift(),a=h.files,c=0;c<a.length;c++){var v=a[c],S=v.fileNameStr,x=l.resolve(v.fileNameStr);d.file(x,v.decompressed,{binary:!0,optimizedBinaryString:!0,date:v.date,dir:v.dir,comment:v.fileCommentStr.length?v.fileCommentStr:null,unixPermissions:v.unixPermissions,dosPermissions:v.dosPermissions,createFolders:i.createFolders}),v.dir||(d.file(x).unsafeOriginalName=S)}return h.zipComment.length&&(d.comment=h.zipComment),d})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(b,U,k){var l=b("../utils"),o=b("../stream/GenericWorker");function n(u,_){o.call(this,"Nodejs stream input adapter for "+u),this._upstreamEnded=!1,this._bindStream(_)}l.inherits(n,o),n.prototype._bindStream=function(u){var _=this;(this._stream=u).pause(),u.on("data",function(y){_.push({data:y,meta:{percent:0}})}).on("error",function(y){_.isPaused?this.generatedError=y:_.error(y)}).on("end",function(){_.isPaused?_._upstreamEnded=!0:_.end()})},n.prototype.pause=function(){return!!o.prototype.pause.call(this)&&(this._stream.pause(),!0)},n.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},U.exports=n},{"../stream/GenericWorker":28,"../utils":32}],13:[function(b,U,k){var l=b("readable-stream").Readable;function o(n,u,_){l.call(this,u),this._helper=n;var y=this;n.on("data",function(p,g){y.push(p)||y._helper.pause(),_&&_(g)}).on("error",function(p){y.emit("error",p)}).on("end",function(){y.push(null)})}b("../utils").inherits(o,l),o.prototype._read=function(){this._helper.resume()},U.exports=o},{"../utils":32,"readable-stream":16}],14:[function(b,U,k){U.exports={isNode:typeof Buffer<"u",newBufferFrom:function(l,o){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(l,o);if(typeof l=="number")throw new Error('The "data" argument must not be a number');return new Buffer(l,o)},allocBuffer:function(l){if(Buffer.alloc)return Buffer.alloc(l);var o=new Buffer(l);return o.fill(0),o},isBuffer:function(l){return Buffer.isBuffer(l)},isStream:function(l){return l&&typeof l.on=="function"&&typeof l.pause=="function"&&typeof l.resume=="function"}}},{}],15:[function(b,U,k){function l(x,D,O){var j,I=n.getTypeOf(D),W=n.extend(O||{},y);W.date=W.date||new Date,W.compression!==null&&(W.compression=W.compression.toUpperCase()),typeof W.unixPermissions=="string"&&(W.unixPermissions=parseInt(W.unixPermissions,8)),W.unixPermissions&&16384&W.unixPermissions&&(W.dir=!0),W.dosPermissions&&16&W.dosPermissions&&(W.dir=!0),W.dir&&(x=a(x)),W.createFolders&&(j=h(x))&&c.call(this,j,!0);var q=I==="string"&&W.binary===!1&&W.base64===!1;O&&O.binary!==void 0||(W.binary=!q),(D instanceof p&&D.uncompressedSize===0||W.dir||!D||D.length===0)&&(W.base64=!1,W.binary=!0,D="",W.compression="STORE",I="string");var m=null;m=D instanceof p||D instanceof u?D:d.isNode&&d.isStream(D)?new r(x,D):n.prepareContent(x,D,W.binary,W.optimizedBinaryString,W.base64);var B=new g(x,m,W);this.files[x]=B}var o=b("./utf8"),n=b("./utils"),u=b("./stream/GenericWorker"),_=b("./stream/StreamHelper"),y=b("./defaults"),p=b("./compressedObject"),g=b("./zipObject"),i=b("./generate"),d=b("./nodejsUtils"),r=b("./nodejs/NodejsStreamInputAdapter"),h=function(x){x.slice(-1)==="/"&&(x=x.substring(0,x.length-1));var D=x.lastIndexOf("/");return 0<D?x.substring(0,D):""},a=function(x){return x.slice(-1)!=="/"&&(x+="/"),x},c=function(x,D){return D=D!==void 0?D:y.createFolders,x=a(x),this.files[x]||l.call(this,x,null,{dir:!0,createFolders:D}),this.files[x]};function v(x){return Object.prototype.toString.call(x)==="[object RegExp]"}var S={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(x){var D,O,j;for(D in this.files)j=this.files[D],(O=D.slice(this.root.length,D.length))&&D.slice(0,this.root.length)===this.root&&x(O,j)},filter:function(x){var D=[];return this.forEach(function(O,j){x(O,j)&&D.push(j)}),D},file:function(x,D,O){if(arguments.length!==1)return x=this.root+x,l.call(this,x,D,O),this;if(v(x)){var j=x;return this.filter(function(W,q){return!q.dir&&j.test(W)})}var I=this.files[this.root+x];return I&&!I.dir?I:null},folder:function(x){if(!x)return this;if(v(x))return this.filter(function(I,W){return W.dir&&x.test(I)});var D=this.root+x,O=c.call(this,D),j=this.clone();return j.root=O.name,j},remove:function(x){x=this.root+x;var D=this.files[x];if(D||(x.slice(-1)!=="/"&&(x+="/"),D=this.files[x]),D&&!D.dir)delete this.files[x];else for(var O=this.filter(function(I,W){return W.name.slice(0,x.length)===x}),j=0;j<O.length;j++)delete this.files[O[j].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(x){var D,O={};try{if((O=n.extend(x||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:o.utf8encode})).type=O.type.toLowerCase(),O.compression=O.compression.toUpperCase(),O.type==="binarystring"&&(O.type="string"),!O.type)throw new Error("No output type specified.");n.checkSupport(O.type),O.platform!=="darwin"&&O.platform!=="freebsd"&&O.platform!=="linux"&&O.platform!=="sunos"||(O.platform="UNIX"),O.platform==="win32"&&(O.platform="DOS");var j=O.comment||this.comment||"";D=i.generateWorker(this,O,j)}catch(I){(D=new u("error")).error(I)}return new _(D,O.type||"string",O.mimeType)},generateAsync:function(x,D){return this.generateInternalStream(x).accumulate(D)},generateNodeStream:function(x,D){return(x=x||{}).type||(x.type="nodebuffer"),this.generateInternalStream(x).toNodejsStream(D)}};U.exports=S},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(b,U,k){U.exports=b("stream")},{stream:void 0}],17:[function(b,U,k){var l=b("./DataReader");function o(n){l.call(this,n);for(var u=0;u<this.data.length;u++)n[u]=255&n[u]}b("../utils").inherits(o,l),o.prototype.byteAt=function(n){return this.data[this.zero+n]},o.prototype.lastIndexOfSignature=function(n){for(var u=n.charCodeAt(0),_=n.charCodeAt(1),y=n.charCodeAt(2),p=n.charCodeAt(3),g=this.length-4;0<=g;--g)if(this.data[g]===u&&this.data[g+1]===_&&this.data[g+2]===y&&this.data[g+3]===p)return g-this.zero;return-1},o.prototype.readAndCheckSignature=function(n){var u=n.charCodeAt(0),_=n.charCodeAt(1),y=n.charCodeAt(2),p=n.charCodeAt(3),g=this.readData(4);return u===g[0]&&_===g[1]&&y===g[2]&&p===g[3]},o.prototype.readData=function(n){if(this.checkOffset(n),n===0)return[];var u=this.data.slice(this.zero+this.index,this.zero+this.index+n);return this.index+=n,u},U.exports=o},{"../utils":32,"./DataReader":18}],18:[function(b,U,k){var l=b("../utils");function o(n){this.data=n,this.length=n.length,this.index=0,this.zero=0}o.prototype={checkOffset:function(n){this.checkIndex(this.index+n)},checkIndex:function(n){if(this.length<this.zero+n||n<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+n+"). Corrupted zip ?")},setIndex:function(n){this.checkIndex(n),this.index=n},skip:function(n){this.setIndex(this.index+n)},byteAt:function(){},readInt:function(n){var u,_=0;for(this.checkOffset(n),u=this.index+n-1;u>=this.index;u--)_=(_<<8)+this.byteAt(u);return this.index+=n,_},readString:function(n){return l.transformTo("string",this.readData(n))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var n=this.readInt(4);return new Date(Date.UTC(1980+(n>>25&127),(n>>21&15)-1,n>>16&31,n>>11&31,n>>5&63,(31&n)<<1))}},U.exports=o},{"../utils":32}],19:[function(b,U,k){var l=b("./Uint8ArrayReader");function o(n){l.call(this,n)}b("../utils").inherits(o,l),o.prototype.readData=function(n){this.checkOffset(n);var u=this.data.slice(this.zero+this.index,this.zero+this.index+n);return this.index+=n,u},U.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(b,U,k){var l=b("./DataReader");function o(n){l.call(this,n)}b("../utils").inherits(o,l),o.prototype.byteAt=function(n){return this.data.charCodeAt(this.zero+n)},o.prototype.lastIndexOfSignature=function(n){return this.data.lastIndexOf(n)-this.zero},o.prototype.readAndCheckSignature=function(n){return n===this.readData(4)},o.prototype.readData=function(n){this.checkOffset(n);var u=this.data.slice(this.zero+this.index,this.zero+this.index+n);return this.index+=n,u},U.exports=o},{"../utils":32,"./DataReader":18}],21:[function(b,U,k){var l=b("./ArrayReader");function o(n){l.call(this,n)}b("../utils").inherits(o,l),o.prototype.readData=function(n){if(this.checkOffset(n),n===0)return new Uint8Array(0);var u=this.data.subarray(this.zero+this.index,this.zero+this.index+n);return this.index+=n,u},U.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(b,U,k){var l=b("../utils"),o=b("../support"),n=b("./ArrayReader"),u=b("./StringReader"),_=b("./NodeBufferReader"),y=b("./Uint8ArrayReader");U.exports=function(p){var g=l.getTypeOf(p);return l.checkSupport(g),g!=="string"||o.uint8array?g==="nodebuffer"?new _(p):o.uint8array?new y(l.transformTo("uint8array",p)):new n(l.transformTo("array",p)):new u(p)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(b,U,k){k.LOCAL_FILE_HEADER="PK",k.CENTRAL_FILE_HEADER="PK",k.CENTRAL_DIRECTORY_END="PK",k.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",k.ZIP64_CENTRAL_DIRECTORY_END="PK",k.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(b,U,k){var l=b("./GenericWorker"),o=b("../utils");function n(u){l.call(this,"ConvertWorker to "+u),this.destType=u}o.inherits(n,l),n.prototype.processChunk=function(u){this.push({data:o.transformTo(this.destType,u.data),meta:u.meta})},U.exports=n},{"../utils":32,"./GenericWorker":28}],25:[function(b,U,k){var l=b("./GenericWorker"),o=b("../crc32");function n(){l.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}b("../utils").inherits(n,l),n.prototype.processChunk=function(u){this.streamInfo.crc32=o(u.data,this.streamInfo.crc32||0),this.push(u)},U.exports=n},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(b,U,k){var l=b("../utils"),o=b("./GenericWorker");function n(u){o.call(this,"DataLengthProbe for "+u),this.propName=u,this.withStreamInfo(u,0)}l.inherits(n,o),n.prototype.processChunk=function(u){if(u){var _=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=_+u.data.length}o.prototype.processChunk.call(this,u)},U.exports=n},{"../utils":32,"./GenericWorker":28}],27:[function(b,U,k){var l=b("../utils"),o=b("./GenericWorker");function n(u){o.call(this,"DataWorker");var _=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,u.then(function(y){_.dataIsReady=!0,_.data=y,_.max=y&&y.length||0,_.type=l.getTypeOf(y),_.isPaused||_._tickAndRepeat()},function(y){_.error(y)})}l.inherits(n,o),n.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},n.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,l.delay(this._tickAndRepeat,[],this)),!0)},n.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(l.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},n.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var u=null,_=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":u=this.data.substring(this.index,_);break;case"uint8array":u=this.data.subarray(this.index,_);break;case"array":case"nodebuffer":u=this.data.slice(this.index,_)}return this.index=_,this.push({data:u,meta:{percent:this.max?this.index/this.max*100:0}})},U.exports=n},{"../utils":32,"./GenericWorker":28}],28:[function(b,U,k){function l(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}l.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,n){return this._listeners[o].push(n),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,n){if(this._listeners[o])for(var u=0;u<this._listeners[o].length;u++)this._listeners[o][u].call(this,n)},pipe:function(o){return o.registerPrevious(this)},registerPrevious:function(o){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=o.streamInfo,this.mergeStreamInfo(),this.previous=o;var n=this;return o.on("data",function(u){n.processChunk(u)}),o.on("end",function(){n.end()}),o.on("error",function(u){n.error(u)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var o=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),o=!0),this.previous&&this.previous.resume(),!o},flush:function(){},processChunk:function(o){this.push(o)},withStreamInfo:function(o,n){return this.extraStreamInfo[o]=n,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var o in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,o)&&(this.streamInfo[o]=this.extraStreamInfo[o])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var o="Worker "+this.name;return this.previous?this.previous+" -> "+o:o}},U.exports=l},{}],29:[function(b,U,k){var l=b("../utils"),o=b("./ConvertWorker"),n=b("./GenericWorker"),u=b("../base64"),_=b("../support"),y=b("../external"),p=null;if(_.nodestream)try{p=b("../nodejs/NodejsStreamOutputAdapter")}catch{}function g(d,r){return new y.Promise(function(h,a){var c=[],v=d._internalType,S=d._outputType,x=d._mimeType;d.on("data",function(D,O){c.push(D),r&&r(O)}).on("error",function(D){c=[],a(D)}).on("end",function(){try{var D=function(O,j,I){switch(O){case"blob":return l.newBlob(l.transformTo("arraybuffer",j),I);case"base64":return u.encode(j);default:return l.transformTo(O,j)}}(S,function(O,j){var I,W=0,q=null,m=0;for(I=0;I<j.length;I++)m+=j[I].length;switch(O){case"string":return j.join("");case"array":return Array.prototype.concat.apply([],j);case"uint8array":for(q=new Uint8Array(m),I=0;I<j.length;I++)q.set(j[I],W),W+=j[I].length;return q;case"nodebuffer":return Buffer.concat(j);default:throw new Error("concat : unsupported type '"+O+"'")}}(v,c),x);h(D)}catch(O){a(O)}c=[]}).resume()})}function i(d,r,h){var a=r;switch(r){case"blob":case"arraybuffer":a="uint8array";break;case"base64":a="string"}try{this._internalType=a,this._outputType=r,this._mimeType=h,l.checkSupport(a),this._worker=d.pipe(new o(a)),d.lock()}catch(c){this._worker=new n("error"),this._worker.error(c)}}i.prototype={accumulate:function(d){return g(this,d)},on:function(d,r){var h=this;return d==="data"?this._worker.on(d,function(a){r.call(h,a.data,a.meta)}):this._worker.on(d,function(){l.delay(r,arguments,h)}),this},resume:function(){return l.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(d){if(l.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new p(this,{objectMode:this._outputType!=="nodebuffer"},d)}},U.exports=i},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(b,U,k){if(k.base64=!0,k.array=!0,k.string=!0,k.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",k.nodebuffer=typeof Buffer<"u",k.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")k.blob=!1;else{var l=new ArrayBuffer(0);try{k.blob=new Blob([l],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(l),k.blob=o.getBlob("application/zip").size===0}catch{k.blob=!1}}}try{k.nodestream=!!b("readable-stream").Readable}catch{k.nodestream=!1}},{"readable-stream":16}],31:[function(b,U,k){for(var l=b("./utils"),o=b("./support"),n=b("./nodejsUtils"),u=b("./stream/GenericWorker"),_=new Array(256),y=0;y<256;y++)_[y]=252<=y?6:248<=y?5:240<=y?4:224<=y?3:192<=y?2:1;_[254]=_[254]=1;function p(){u.call(this,"utf-8 decode"),this.leftOver=null}function g(){u.call(this,"utf-8 encode")}k.utf8encode=function(i){return o.nodebuffer?n.newBufferFrom(i,"utf-8"):function(d){var r,h,a,c,v,S=d.length,x=0;for(c=0;c<S;c++)(64512&(h=d.charCodeAt(c)))==55296&&c+1<S&&(64512&(a=d.charCodeAt(c+1)))==56320&&(h=65536+(h-55296<<10)+(a-56320),c++),x+=h<128?1:h<2048?2:h<65536?3:4;for(r=o.uint8array?new Uint8Array(x):new Array(x),c=v=0;v<x;c++)(64512&(h=d.charCodeAt(c)))==55296&&c+1<S&&(64512&(a=d.charCodeAt(c+1)))==56320&&(h=65536+(h-55296<<10)+(a-56320),c++),h<128?r[v++]=h:(h<2048?r[v++]=192|h>>>6:(h<65536?r[v++]=224|h>>>12:(r[v++]=240|h>>>18,r[v++]=128|h>>>12&63),r[v++]=128|h>>>6&63),r[v++]=128|63&h);return r}(i)},k.utf8decode=function(i){return o.nodebuffer?l.transformTo("nodebuffer",i).toString("utf-8"):function(d){var r,h,a,c,v=d.length,S=new Array(2*v);for(r=h=0;r<v;)if((a=d[r++])<128)S[h++]=a;else if(4<(c=_[a]))S[h++]=65533,r+=c-1;else{for(a&=c===2?31:c===3?15:7;1<c&&r<v;)a=a<<6|63&d[r++],c--;1<c?S[h++]=65533:a<65536?S[h++]=a:(a-=65536,S[h++]=55296|a>>10&1023,S[h++]=56320|1023&a)}return S.length!==h&&(S.subarray?S=S.subarray(0,h):S.length=h),l.applyFromCharCode(S)}(i=l.transformTo(o.uint8array?"uint8array":"array",i))},l.inherits(p,u),p.prototype.processChunk=function(i){var d=l.transformTo(o.uint8array?"uint8array":"array",i.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var r=d;(d=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),d.set(r,this.leftOver.length)}else d=this.leftOver.concat(d);this.leftOver=null}var h=function(c,v){var S;for((v=v||c.length)>c.length&&(v=c.length),S=v-1;0<=S&&(192&c[S])==128;)S--;return S<0||S===0?v:S+_[c[S]]>v?S:v}(d),a=d;h!==d.length&&(o.uint8array?(a=d.subarray(0,h),this.leftOver=d.subarray(h,d.length)):(a=d.slice(0,h),this.leftOver=d.slice(h,d.length))),this.push({data:k.utf8decode(a),meta:i.meta})},p.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:k.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},k.Utf8DecodeWorker=p,l.inherits(g,u),g.prototype.processChunk=function(i){this.push({data:k.utf8encode(i.data),meta:i.meta})},k.Utf8EncodeWorker=g},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(b,U,k){var l=b("./support"),o=b("./base64"),n=b("./nodejsUtils"),u=b("./external");function _(r){return r}function y(r,h){for(var a=0;a<r.length;++a)h[a]=255&r.charCodeAt(a);return h}b("setimmediate"),k.newBlob=function(r,h){k.checkSupport("blob");try{return new Blob([r],{type:h})}catch{try{var a=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return a.append(r),a.getBlob(h)}catch{throw new Error("Bug : can't construct the Blob.")}}};var p={stringifyByChunk:function(r,h,a){var c=[],v=0,S=r.length;if(S<=a)return String.fromCharCode.apply(null,r);for(;v<S;)h==="array"||h==="nodebuffer"?c.push(String.fromCharCode.apply(null,r.slice(v,Math.min(v+a,S)))):c.push(String.fromCharCode.apply(null,r.subarray(v,Math.min(v+a,S)))),v+=a;return c.join("")},stringifyByChar:function(r){for(var h="",a=0;a<r.length;a++)h+=String.fromCharCode(r[a]);return h},applyCanBeUsed:{uint8array:function(){try{return l.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return l.nodebuffer&&String.fromCharCode.apply(null,n.allocBuffer(1)).length===1}catch{return!1}}()}};function g(r){var h=65536,a=k.getTypeOf(r),c=!0;if(a==="uint8array"?c=p.applyCanBeUsed.uint8array:a==="nodebuffer"&&(c=p.applyCanBeUsed.nodebuffer),c)for(;1<h;)try{return p.stringifyByChunk(r,a,h)}catch{h=Math.floor(h/2)}return p.stringifyByChar(r)}function i(r,h){for(var a=0;a<r.length;a++)h[a]=r[a];return h}k.applyFromCharCode=g;var d={};d.string={string:_,array:function(r){return y(r,new Array(r.length))},arraybuffer:function(r){return d.string.uint8array(r).buffer},uint8array:function(r){return y(r,new Uint8Array(r.length))},nodebuffer:function(r){return y(r,n.allocBuffer(r.length))}},d.array={string:g,array:_,arraybuffer:function(r){return new Uint8Array(r).buffer},uint8array:function(r){return new Uint8Array(r)},nodebuffer:function(r){return n.newBufferFrom(r)}},d.arraybuffer={string:function(r){return g(new Uint8Array(r))},array:function(r){return i(new Uint8Array(r),new Array(r.byteLength))},arraybuffer:_,uint8array:function(r){return new Uint8Array(r)},nodebuffer:function(r){return n.newBufferFrom(new Uint8Array(r))}},d.uint8array={string:g,array:function(r){return i(r,new Array(r.length))},arraybuffer:function(r){return r.buffer},uint8array:_,nodebuffer:function(r){return n.newBufferFrom(r)}},d.nodebuffer={string:g,array:function(r){return i(r,new Array(r.length))},arraybuffer:function(r){return d.nodebuffer.uint8array(r).buffer},uint8array:function(r){return i(r,new Uint8Array(r.length))},nodebuffer:_},k.transformTo=function(r,h){if(h=h||"",!r)return h;k.checkSupport(r);var a=k.getTypeOf(h);return d[a][r](h)},k.resolve=function(r){for(var h=r.split("/"),a=[],c=0;c<h.length;c++){var v=h[c];v==="."||v===""&&c!==0&&c!==h.length-1||(v===".."?a.pop():a.push(v))}return a.join("/")},k.getTypeOf=function(r){return typeof r=="string"?"string":Object.prototype.toString.call(r)==="[object Array]"?"array":l.nodebuffer&&n.isBuffer(r)?"nodebuffer":l.uint8array&&r instanceof Uint8Array?"uint8array":l.arraybuffer&&r instanceof ArrayBuffer?"arraybuffer":void 0},k.checkSupport=function(r){if(!l[r.toLowerCase()])throw new Error(r+" is not supported by this platform")},k.MAX_VALUE_16BITS=65535,k.MAX_VALUE_32BITS=-1,k.pretty=function(r){var h,a,c="";for(a=0;a<(r||"").length;a++)c+="\\x"+((h=r.charCodeAt(a))<16?"0":"")+h.toString(16).toUpperCase();return c},k.delay=function(r,h,a){setImmediate(function(){r.apply(a||null,h||[])})},k.inherits=function(r,h){function a(){}a.prototype=h.prototype,r.prototype=new a},k.extend=function(){var r,h,a={};for(r=0;r<arguments.length;r++)for(h in arguments[r])Object.prototype.hasOwnProperty.call(arguments[r],h)&&a[h]===void 0&&(a[h]=arguments[r][h]);return a},k.prepareContent=function(r,h,a,c,v){return u.Promise.resolve(h).then(function(S){return l.blob&&(S instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(S))!==-1)&&typeof FileReader<"u"?new u.Promise(function(x,D){var O=new FileReader;O.onload=function(j){x(j.target.result)},O.onerror=function(j){D(j.target.error)},O.readAsArrayBuffer(S)}):S}).then(function(S){var x=k.getTypeOf(S);return x?(x==="arraybuffer"?S=k.transformTo("uint8array",S):x==="string"&&(v?S=o.decode(S):a&&c!==!0&&(S=function(D){return y(D,l.uint8array?new Uint8Array(D.length):new Array(D.length))}(S))),S):u.Promise.reject(new Error("Can't read the data of '"+r+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(b,U,k){var l=b("./reader/readerFor"),o=b("./utils"),n=b("./signature"),u=b("./zipEntry"),_=b("./support");function y(p){this.files=[],this.loadOptions=p}y.prototype={checkSignature:function(p){if(!this.reader.readAndCheckSignature(p)){this.reader.index-=4;var g=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+o.pretty(g)+", expected "+o.pretty(p)+")")}},isSignature:function(p,g){var i=this.reader.index;this.reader.setIndex(p);var d=this.reader.readString(4)===g;return this.reader.setIndex(i),d},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var p=this.reader.readData(this.zipCommentLength),g=_.uint8array?"uint8array":"array",i=o.transformTo(g,p);this.zipComment=this.loadOptions.decodeFileName(i)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var p,g,i,d=this.zip64EndOfCentralSize-44;0<d;)p=this.reader.readInt(2),g=this.reader.readInt(4),i=this.reader.readData(g),this.zip64ExtensibleData[p]={id:p,length:g,value:i}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var p,g;for(p=0;p<this.files.length;p++)g=this.files[p],this.reader.setIndex(g.localHeaderOffset),this.checkSignature(n.LOCAL_FILE_HEADER),g.readLocalPart(this.reader),g.handleUTF8(),g.processAttributes()},readCentralDir:function(){var p;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(n.CENTRAL_FILE_HEADER);)(p=new u({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(p);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var p=this.reader.lastIndexOfSignature(n.CENTRAL_DIRECTORY_END);if(p<0)throw this.isSignature(0,n.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(p);var g=p;if(this.checkSignature(n.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===o.MAX_VALUE_16BITS||this.diskWithCentralDirStart===o.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===o.MAX_VALUE_16BITS||this.centralDirRecords===o.MAX_VALUE_16BITS||this.centralDirSize===o.MAX_VALUE_32BITS||this.centralDirOffset===o.MAX_VALUE_32BITS){if(this.zip64=!0,(p=this.reader.lastIndexOfSignature(n.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(p),this.checkSignature(n.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,n.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(n.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(n.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var i=this.centralDirOffset+this.centralDirSize;this.zip64&&(i+=20,i+=12+this.zip64EndOfCentralSize);var d=g-i;if(0<d)this.isSignature(g,n.CENTRAL_FILE_HEADER)||(this.reader.zero=d);else if(d<0)throw new Error("Corrupted zip: missing "+Math.abs(d)+" bytes.")},prepareReader:function(p){this.reader=l(p)},load:function(p){this.prepareReader(p),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},U.exports=y},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(b,U,k){var l=b("./reader/readerFor"),o=b("./utils"),n=b("./compressedObject"),u=b("./crc32"),_=b("./utf8"),y=b("./compressions"),p=b("./support");function g(i,d){this.options=i,this.loadOptions=d}g.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(i){var d,r;if(i.skip(22),this.fileNameLength=i.readInt(2),r=i.readInt(2),this.fileName=i.readData(this.fileNameLength),i.skip(r),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((d=function(h){for(var a in y)if(Object.prototype.hasOwnProperty.call(y,a)&&y[a].magic===h)return y[a];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+o.pretty(this.compressionMethod)+" unknown (inner file : "+o.transformTo("string",this.fileName)+")");this.decompressed=new n(this.compressedSize,this.uncompressedSize,this.crc32,d,i.readData(this.compressedSize))},readCentralPart:function(i){this.versionMadeBy=i.readInt(2),i.skip(2),this.bitFlag=i.readInt(2),this.compressionMethod=i.readString(2),this.date=i.readDate(),this.crc32=i.readInt(4),this.compressedSize=i.readInt(4),this.uncompressedSize=i.readInt(4);var d=i.readInt(2);if(this.extraFieldsLength=i.readInt(2),this.fileCommentLength=i.readInt(2),this.diskNumberStart=i.readInt(2),this.internalFileAttributes=i.readInt(2),this.externalFileAttributes=i.readInt(4),this.localHeaderOffset=i.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");i.skip(d),this.readExtraFields(i),this.parseZIP64ExtraField(i),this.fileComment=i.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var i=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),i==0&&(this.dosPermissions=63&this.externalFileAttributes),i==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var i=l(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=i.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=i.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=i.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=i.readInt(4))}},readExtraFields:function(i){var d,r,h,a=i.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});i.index+4<a;)d=i.readInt(2),r=i.readInt(2),h=i.readData(r),this.extraFields[d]={id:d,length:r,value:h};i.setIndex(a)},handleUTF8:function(){var i=p.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=_.utf8decode(this.fileName),this.fileCommentStr=_.utf8decode(this.fileComment);else{var d=this.findExtraFieldUnicodePath();if(d!==null)this.fileNameStr=d;else{var r=o.transformTo(i,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var h=this.findExtraFieldUnicodeComment();if(h!==null)this.fileCommentStr=h;else{var a=o.transformTo(i,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(a)}}},findExtraFieldUnicodePath:function(){var i=this.extraFields[28789];if(i){var d=l(i.value);return d.readInt(1)!==1||u(this.fileName)!==d.readInt(4)?null:_.utf8decode(d.readData(i.length-5))}return null},findExtraFieldUnicodeComment:function(){var i=this.extraFields[25461];if(i){var d=l(i.value);return d.readInt(1)!==1||u(this.fileComment)!==d.readInt(4)?null:_.utf8decode(d.readData(i.length-5))}return null}},U.exports=g},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(b,U,k){function l(d,r,h){this.name=d,this.dir=h.dir,this.date=h.date,this.comment=h.comment,this.unixPermissions=h.unixPermissions,this.dosPermissions=h.dosPermissions,this._data=r,this._dataBinary=h.binary,this.options={compression:h.compression,compressionOptions:h.compressionOptions}}var o=b("./stream/StreamHelper"),n=b("./stream/DataWorker"),u=b("./utf8"),_=b("./compressedObject"),y=b("./stream/GenericWorker");l.prototype={internalStream:function(d){var r=null,h="string";try{if(!d)throw new Error("No output type specified.");var a=(h=d.toLowerCase())==="string"||h==="text";h!=="binarystring"&&h!=="text"||(h="string"),r=this._decompressWorker();var c=!this._dataBinary;c&&!a&&(r=r.pipe(new u.Utf8EncodeWorker)),!c&&a&&(r=r.pipe(new u.Utf8DecodeWorker))}catch(v){(r=new y("error")).error(v)}return new o(r,h,"")},async:function(d,r){return this.internalStream(d).accumulate(r)},nodeStream:function(d,r){return this.internalStream(d||"nodebuffer").toNodejsStream(r)},_compressWorker:function(d,r){if(this._data instanceof _&&this._data.compression.magic===d.magic)return this._data.getCompressedWorker();var h=this._decompressWorker();return this._dataBinary||(h=h.pipe(new u.Utf8EncodeWorker)),_.createWorkerFrom(h,d,r)},_decompressWorker:function(){return this._data instanceof _?this._data.getContentWorker():this._data instanceof y?this._data:new n(this._data)}};for(var p=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],g=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},i=0;i<p.length;i++)l.prototype[p[i]]=g;U.exports=l},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(b,U,k){(function(l){var o,n,u=l.MutationObserver||l.WebKitMutationObserver;if(u){var _=0,y=new u(d),p=l.document.createTextNode("");y.observe(p,{characterData:!0}),o=function(){p.data=_=++_%2}}else if(l.setImmediate||l.MessageChannel===void 0)o="document"in l&&"onreadystatechange"in l.document.createElement("script")?function(){var r=l.document.createElement("script");r.onreadystatechange=function(){d(),r.onreadystatechange=null,r.parentNode.removeChild(r),r=null},l.document.documentElement.appendChild(r)}:function(){setTimeout(d,0)};else{var g=new l.MessageChannel;g.port1.onmessage=d,o=function(){g.port2.postMessage(0)}}var i=[];function d(){var r,h;n=!0;for(var a=i.length;a;){for(h=i,i=[],r=-1;++r<a;)h[r]();a=i.length}n=!1}U.exports=function(r){i.push(r)!==1||n||o()}}).call(this,typeof bt<"u"?bt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(b,U,k){var l=b("immediate");function o(){}var n={},u=["REJECTED"],_=["FULFILLED"],y=["PENDING"];function p(a){if(typeof a!="function")throw new TypeError("resolver must be a function");this.state=y,this.queue=[],this.outcome=void 0,a!==o&&r(this,a)}function g(a,c,v){this.promise=a,typeof c=="function"&&(this.onFulfilled=c,this.callFulfilled=this.otherCallFulfilled),typeof v=="function"&&(this.onRejected=v,this.callRejected=this.otherCallRejected)}function i(a,c,v){l(function(){var S;try{S=c(v)}catch(x){return n.reject(a,x)}S===a?n.reject(a,new TypeError("Cannot resolve promise with itself")):n.resolve(a,S)})}function d(a){var c=a&&a.then;if(a&&(typeof a=="object"||typeof a=="function")&&typeof c=="function")return function(){c.apply(a,arguments)}}function r(a,c){var v=!1;function S(O){v||(v=!0,n.reject(a,O))}function x(O){v||(v=!0,n.resolve(a,O))}var D=h(function(){c(x,S)});D.status==="error"&&S(D.value)}function h(a,c){var v={};try{v.value=a(c),v.status="success"}catch(S){v.status="error",v.value=S}return v}(U.exports=p).prototype.finally=function(a){if(typeof a!="function")return this;var c=this.constructor;return this.then(function(v){return c.resolve(a()).then(function(){return v})},function(v){return c.resolve(a()).then(function(){throw v})})},p.prototype.catch=function(a){return this.then(null,a)},p.prototype.then=function(a,c){if(typeof a!="function"&&this.state===_||typeof c!="function"&&this.state===u)return this;var v=new this.constructor(o);return this.state!==y?i(v,this.state===_?a:c,this.outcome):this.queue.push(new g(v,a,c)),v},g.prototype.callFulfilled=function(a){n.resolve(this.promise,a)},g.prototype.otherCallFulfilled=function(a){i(this.promise,this.onFulfilled,a)},g.prototype.callRejected=function(a){n.reject(this.promise,a)},g.prototype.otherCallRejected=function(a){i(this.promise,this.onRejected,a)},n.resolve=function(a,c){var v=h(d,c);if(v.status==="error")return n.reject(a,v.value);var S=v.value;if(S)r(a,S);else{a.state=_,a.outcome=c;for(var x=-1,D=a.queue.length;++x<D;)a.queue[x].callFulfilled(c)}return a},n.reject=function(a,c){a.state=u,a.outcome=c;for(var v=-1,S=a.queue.length;++v<S;)a.queue[v].callRejected(c);return a},p.resolve=function(a){return a instanceof this?a:n.resolve(new this(o),a)},p.reject=function(a){var c=new this(o);return n.reject(c,a)},p.all=function(a){var c=this;if(Object.prototype.toString.call(a)!=="[object Array]")return this.reject(new TypeError("must be an array"));var v=a.length,S=!1;if(!v)return this.resolve([]);for(var x=new Array(v),D=0,O=-1,j=new this(o);++O<v;)I(a[O],O);return j;function I(W,q){c.resolve(W).then(function(m){x[q]=m,++D!==v||S||(S=!0,n.resolve(j,x))},function(m){S||(S=!0,n.reject(j,m))})}},p.race=function(a){var c=this;if(Object.prototype.toString.call(a)!=="[object Array]")return this.reject(new TypeError("must be an array"));var v=a.length,S=!1;if(!v)return this.resolve([]);for(var x=-1,D=new this(o);++x<v;)O=a[x],c.resolve(O).then(function(j){S||(S=!0,n.resolve(D,j))},function(j){S||(S=!0,n.reject(D,j))});var O;return D}},{immediate:36}],38:[function(b,U,k){var l={};(0,b("./lib/utils/common").assign)(l,b("./lib/deflate"),b("./lib/inflate"),b("./lib/zlib/constants")),U.exports=l},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(b,U,k){var l=b("./zlib/deflate"),o=b("./utils/common"),n=b("./utils/strings"),u=b("./zlib/messages"),_=b("./zlib/zstream"),y=Object.prototype.toString,p=0,g=-1,i=0,d=8;function r(a){if(!(this instanceof r))return new r(a);this.options=o.assign({level:g,method:d,chunkSize:16384,windowBits:15,memLevel:8,strategy:i,to:""},a||{});var c=this.options;c.raw&&0<c.windowBits?c.windowBits=-c.windowBits:c.gzip&&0<c.windowBits&&c.windowBits<16&&(c.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new _,this.strm.avail_out=0;var v=l.deflateInit2(this.strm,c.level,c.method,c.windowBits,c.memLevel,c.strategy);if(v!==p)throw new Error(u[v]);if(c.header&&l.deflateSetHeader(this.strm,c.header),c.dictionary){var S;if(S=typeof c.dictionary=="string"?n.string2buf(c.dictionary):y.call(c.dictionary)==="[object ArrayBuffer]"?new Uint8Array(c.dictionary):c.dictionary,(v=l.deflateSetDictionary(this.strm,S))!==p)throw new Error(u[v]);this._dict_set=!0}}function h(a,c){var v=new r(c);if(v.push(a,!0),v.err)throw v.msg||u[v.err];return v.result}r.prototype.push=function(a,c){var v,S,x=this.strm,D=this.options.chunkSize;if(this.ended)return!1;S=c===~~c?c:c===!0?4:0,typeof a=="string"?x.input=n.string2buf(a):y.call(a)==="[object ArrayBuffer]"?x.input=new Uint8Array(a):x.input=a,x.next_in=0,x.avail_in=x.input.length;do{if(x.avail_out===0&&(x.output=new o.Buf8(D),x.next_out=0,x.avail_out=D),(v=l.deflate(x,S))!==1&&v!==p)return this.onEnd(v),!(this.ended=!0);x.avail_out!==0&&(x.avail_in!==0||S!==4&&S!==2)||(this.options.to==="string"?this.onData(n.buf2binstring(o.shrinkBuf(x.output,x.next_out))):this.onData(o.shrinkBuf(x.output,x.next_out)))}while((0<x.avail_in||x.avail_out===0)&&v!==1);return S===4?(v=l.deflateEnd(this.strm),this.onEnd(v),this.ended=!0,v===p):S!==2||(this.onEnd(p),!(x.avail_out=0))},r.prototype.onData=function(a){this.chunks.push(a)},r.prototype.onEnd=function(a){a===p&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=a,this.msg=this.strm.msg},k.Deflate=r,k.deflate=h,k.deflateRaw=function(a,c){return(c=c||{}).raw=!0,h(a,c)},k.gzip=function(a,c){return(c=c||{}).gzip=!0,h(a,c)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(b,U,k){var l=b("./zlib/inflate"),o=b("./utils/common"),n=b("./utils/strings"),u=b("./zlib/constants"),_=b("./zlib/messages"),y=b("./zlib/zstream"),p=b("./zlib/gzheader"),g=Object.prototype.toString;function i(r){if(!(this instanceof i))return new i(r);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},r||{});var h=this.options;h.raw&&0<=h.windowBits&&h.windowBits<16&&(h.windowBits=-h.windowBits,h.windowBits===0&&(h.windowBits=-15)),!(0<=h.windowBits&&h.windowBits<16)||r&&r.windowBits||(h.windowBits+=32),15<h.windowBits&&h.windowBits<48&&(15&h.windowBits)==0&&(h.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new y,this.strm.avail_out=0;var a=l.inflateInit2(this.strm,h.windowBits);if(a!==u.Z_OK)throw new Error(_[a]);this.header=new p,l.inflateGetHeader(this.strm,this.header)}function d(r,h){var a=new i(h);if(a.push(r,!0),a.err)throw a.msg||_[a.err];return a.result}i.prototype.push=function(r,h){var a,c,v,S,x,D,O=this.strm,j=this.options.chunkSize,I=this.options.dictionary,W=!1;if(this.ended)return!1;c=h===~~h?h:h===!0?u.Z_FINISH:u.Z_NO_FLUSH,typeof r=="string"?O.input=n.binstring2buf(r):g.call(r)==="[object ArrayBuffer]"?O.input=new Uint8Array(r):O.input=r,O.next_in=0,O.avail_in=O.input.length;do{if(O.avail_out===0&&(O.output=new o.Buf8(j),O.next_out=0,O.avail_out=j),(a=l.inflate(O,u.Z_NO_FLUSH))===u.Z_NEED_DICT&&I&&(D=typeof I=="string"?n.string2buf(I):g.call(I)==="[object ArrayBuffer]"?new Uint8Array(I):I,a=l.inflateSetDictionary(this.strm,D)),a===u.Z_BUF_ERROR&&W===!0&&(a=u.Z_OK,W=!1),a!==u.Z_STREAM_END&&a!==u.Z_OK)return this.onEnd(a),!(this.ended=!0);O.next_out&&(O.avail_out!==0&&a!==u.Z_STREAM_END&&(O.avail_in!==0||c!==u.Z_FINISH&&c!==u.Z_SYNC_FLUSH)||(this.options.to==="string"?(v=n.utf8border(O.output,O.next_out),S=O.next_out-v,x=n.buf2string(O.output,v),O.next_out=S,O.avail_out=j-S,S&&o.arraySet(O.output,O.output,v,S,0),this.onData(x)):this.onData(o.shrinkBuf(O.output,O.next_out)))),O.avail_in===0&&O.avail_out===0&&(W=!0)}while((0<O.avail_in||O.avail_out===0)&&a!==u.Z_STREAM_END);return a===u.Z_STREAM_END&&(c=u.Z_FINISH),c===u.Z_FINISH?(a=l.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===u.Z_OK):c!==u.Z_SYNC_FLUSH||(this.onEnd(u.Z_OK),!(O.avail_out=0))},i.prototype.onData=function(r){this.chunks.push(r)},i.prototype.onEnd=function(r){r===u.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg},k.Inflate=i,k.inflate=d,k.inflateRaw=function(r,h){return(h=h||{}).raw=!0,d(r,h)},k.ungzip=d},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(b,U,k){var l=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";k.assign=function(u){for(var _=Array.prototype.slice.call(arguments,1);_.length;){var y=_.shift();if(y){if(typeof y!="object")throw new TypeError(y+"must be non-object");for(var p in y)y.hasOwnProperty(p)&&(u[p]=y[p])}}return u},k.shrinkBuf=function(u,_){return u.length===_?u:u.subarray?u.subarray(0,_):(u.length=_,u)};var o={arraySet:function(u,_,y,p,g){if(_.subarray&&u.subarray)u.set(_.subarray(y,y+p),g);else for(var i=0;i<p;i++)u[g+i]=_[y+i]},flattenChunks:function(u){var _,y,p,g,i,d;for(_=p=0,y=u.length;_<y;_++)p+=u[_].length;for(d=new Uint8Array(p),_=g=0,y=u.length;_<y;_++)i=u[_],d.set(i,g),g+=i.length;return d}},n={arraySet:function(u,_,y,p,g){for(var i=0;i<p;i++)u[g+i]=_[y+i]},flattenChunks:function(u){return[].concat.apply([],u)}};k.setTyped=function(u){u?(k.Buf8=Uint8Array,k.Buf16=Uint16Array,k.Buf32=Int32Array,k.assign(k,o)):(k.Buf8=Array,k.Buf16=Array,k.Buf32=Array,k.assign(k,n))},k.setTyped(l)},{}],42:[function(b,U,k){var l=b("./common"),o=!0,n=!0;try{String.fromCharCode.apply(null,[0])}catch{o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{n=!1}for(var u=new l.Buf8(256),_=0;_<256;_++)u[_]=252<=_?6:248<=_?5:240<=_?4:224<=_?3:192<=_?2:1;function y(p,g){if(g<65537&&(p.subarray&&n||!p.subarray&&o))return String.fromCharCode.apply(null,l.shrinkBuf(p,g));for(var i="",d=0;d<g;d++)i+=String.fromCharCode(p[d]);return i}u[254]=u[254]=1,k.string2buf=function(p){var g,i,d,r,h,a=p.length,c=0;for(r=0;r<a;r++)(64512&(i=p.charCodeAt(r)))==55296&&r+1<a&&(64512&(d=p.charCodeAt(r+1)))==56320&&(i=65536+(i-55296<<10)+(d-56320),r++),c+=i<128?1:i<2048?2:i<65536?3:4;for(g=new l.Buf8(c),r=h=0;h<c;r++)(64512&(i=p.charCodeAt(r)))==55296&&r+1<a&&(64512&(d=p.charCodeAt(r+1)))==56320&&(i=65536+(i-55296<<10)+(d-56320),r++),i<128?g[h++]=i:(i<2048?g[h++]=192|i>>>6:(i<65536?g[h++]=224|i>>>12:(g[h++]=240|i>>>18,g[h++]=128|i>>>12&63),g[h++]=128|i>>>6&63),g[h++]=128|63&i);return g},k.buf2binstring=function(p){return y(p,p.length)},k.binstring2buf=function(p){for(var g=new l.Buf8(p.length),i=0,d=g.length;i<d;i++)g[i]=p.charCodeAt(i);return g},k.buf2string=function(p,g){var i,d,r,h,a=g||p.length,c=new Array(2*a);for(i=d=0;i<a;)if((r=p[i++])<128)c[d++]=r;else if(4<(h=u[r]))c[d++]=65533,i+=h-1;else{for(r&=h===2?31:h===3?15:7;1<h&&i<a;)r=r<<6|63&p[i++],h--;1<h?c[d++]=65533:r<65536?c[d++]=r:(r-=65536,c[d++]=55296|r>>10&1023,c[d++]=56320|1023&r)}return y(c,d)},k.utf8border=function(p,g){var i;for((g=g||p.length)>p.length&&(g=p.length),i=g-1;0<=i&&(192&p[i])==128;)i--;return i<0||i===0?g:i+u[p[i]]>g?i:g}},{"./common":41}],43:[function(b,U,k){U.exports=function(l,o,n,u){for(var _=65535&l|0,y=l>>>16&65535|0,p=0;n!==0;){for(n-=p=2e3<n?2e3:n;y=y+(_=_+o[u++]|0)|0,--p;);_%=65521,y%=65521}return _|y<<16|0}},{}],44:[function(b,U,k){U.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(b,U,k){var l=function(){for(var o,n=[],u=0;u<256;u++){o=u;for(var _=0;_<8;_++)o=1&o?3988292384^o>>>1:o>>>1;n[u]=o}return n}();U.exports=function(o,n,u,_){var y=l,p=_+u;o^=-1;for(var g=_;g<p;g++)o=o>>>8^y[255&(o^n[g])];return-1^o}},{}],46:[function(b,U,k){var l,o=b("../utils/common"),n=b("./trees"),u=b("./adler32"),_=b("./crc32"),y=b("./messages"),p=0,g=4,i=0,d=-2,r=-1,h=4,a=2,c=8,v=9,S=286,x=30,D=19,O=2*S+1,j=15,I=3,W=258,q=W+I+1,m=42,B=113,e=1,T=2,J=3,P=4;function $(t,R){return t.msg=y[R],R}function L(t){return(t<<1)-(4<t?9:0)}function V(t){for(var R=t.length;0<=--R;)t[R]=0}function E(t){var R=t.state,A=R.pending;A>t.avail_out&&(A=t.avail_out),A!==0&&(o.arraySet(t.output,R.pending_buf,R.pending_out,A,t.next_out),t.next_out+=A,R.pending_out+=A,t.total_out+=A,t.avail_out-=A,R.pending-=A,R.pending===0&&(R.pending_out=0))}function C(t,R){n._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,R),t.block_start=t.strstart,E(t.strm)}function X(t,R){t.pending_buf[t.pending++]=R}function G(t,R){t.pending_buf[t.pending++]=R>>>8&255,t.pending_buf[t.pending++]=255&R}function H(t,R){var A,f,s=t.max_chain_length,w=t.strstart,F=t.prev_length,N=t.nice_match,z=t.strstart>t.w_size-q?t.strstart-(t.w_size-q):0,Z=t.window,K=t.w_mask,M=t.prev,Y=t.strstart+W,rt=Z[w+F-1],tt=Z[w+F];t.prev_length>=t.good_match&&(s>>=2),N>t.lookahead&&(N=t.lookahead);do if(Z[(A=R)+F]===tt&&Z[A+F-1]===rt&&Z[A]===Z[w]&&Z[++A]===Z[w+1]){w+=2,A++;do;while(Z[++w]===Z[++A]&&Z[++w]===Z[++A]&&Z[++w]===Z[++A]&&Z[++w]===Z[++A]&&Z[++w]===Z[++A]&&Z[++w]===Z[++A]&&Z[++w]===Z[++A]&&Z[++w]===Z[++A]&&w<Y);if(f=W-(Y-w),w=Y-W,F<f){if(t.match_start=R,N<=(F=f))break;rt=Z[w+F-1],tt=Z[w+F]}}while((R=M[R&K])>z&&--s!=0);return F<=t.lookahead?F:t.lookahead}function nt(t){var R,A,f,s,w,F,N,z,Z,K,M=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=M+(M-q)){for(o.arraySet(t.window,t.window,M,M,0),t.match_start-=M,t.strstart-=M,t.block_start-=M,R=A=t.hash_size;f=t.head[--R],t.head[R]=M<=f?f-M:0,--A;);for(R=A=M;f=t.prev[--R],t.prev[R]=M<=f?f-M:0,--A;);s+=M}if(t.strm.avail_in===0)break;if(F=t.strm,N=t.window,z=t.strstart+t.lookahead,Z=s,K=void 0,K=F.avail_in,Z<K&&(K=Z),A=K===0?0:(F.avail_in-=K,o.arraySet(N,F.input,F.next_in,K,z),F.state.wrap===1?F.adler=u(F.adler,N,K,z):F.state.wrap===2&&(F.adler=_(F.adler,N,K,z)),F.next_in+=K,F.total_in+=K,K),t.lookahead+=A,t.lookahead+t.insert>=I)for(w=t.strstart-t.insert,t.ins_h=t.window[w],t.ins_h=(t.ins_h<<t.hash_shift^t.window[w+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[w+I-1])&t.hash_mask,t.prev[w&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=w,w++,t.insert--,!(t.lookahead+t.insert<I)););}while(t.lookahead<q&&t.strm.avail_in!==0)}function ot(t,R){for(var A,f;;){if(t.lookahead<q){if(nt(t),t.lookahead<q&&R===p)return e;if(t.lookahead===0)break}if(A=0,t.lookahead>=I&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+I-1])&t.hash_mask,A=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),A!==0&&t.strstart-A<=t.w_size-q&&(t.match_length=H(t,A)),t.match_length>=I)if(f=n._tr_tally(t,t.strstart-t.match_start,t.match_length-I),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=I){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+I-1])&t.hash_mask,A=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart,--t.match_length!=0;);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else f=n._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(f&&(C(t,!1),t.strm.avail_out===0))return e}return t.insert=t.strstart<I-1?t.strstart:I-1,R===g?(C(t,!0),t.strm.avail_out===0?J:P):t.last_lit&&(C(t,!1),t.strm.avail_out===0)?e:T}function Q(t,R){for(var A,f,s;;){if(t.lookahead<q){if(nt(t),t.lookahead<q&&R===p)return e;if(t.lookahead===0)break}if(A=0,t.lookahead>=I&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+I-1])&t.hash_mask,A=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=I-1,A!==0&&t.prev_length<t.max_lazy_match&&t.strstart-A<=t.w_size-q&&(t.match_length=H(t,A),t.match_length<=5&&(t.strategy===1||t.match_length===I&&4096<t.strstart-t.match_start)&&(t.match_length=I-1)),t.prev_length>=I&&t.match_length<=t.prev_length){for(s=t.strstart+t.lookahead-I,f=n._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-I),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=s&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+I-1])&t.hash_mask,A=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),--t.prev_length!=0;);if(t.match_available=0,t.match_length=I-1,t.strstart++,f&&(C(t,!1),t.strm.avail_out===0))return e}else if(t.match_available){if((f=n._tr_tally(t,0,t.window[t.strstart-1]))&&C(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return e}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(f=n._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<I-1?t.strstart:I-1,R===g?(C(t,!0),t.strm.avail_out===0?J:P):t.last_lit&&(C(t,!1),t.strm.avail_out===0)?e:T}function et(t,R,A,f,s){this.good_length=t,this.max_lazy=R,this.nice_length=A,this.max_chain=f,this.func=s}function st(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=c,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new o.Buf16(2*O),this.dyn_dtree=new o.Buf16(2*(2*x+1)),this.bl_tree=new o.Buf16(2*(2*D+1)),V(this.dyn_ltree),V(this.dyn_dtree),V(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new o.Buf16(j+1),this.heap=new o.Buf16(2*S+1),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new o.Buf16(2*S+1),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function it(t){var R;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=a,(R=t.state).pending=0,R.pending_out=0,R.wrap<0&&(R.wrap=-R.wrap),R.status=R.wrap?m:B,t.adler=R.wrap===2?0:1,R.last_flush=p,n._tr_init(R),i):$(t,d)}function lt(t){var R=it(t);return R===i&&function(A){A.window_size=2*A.w_size,V(A.head),A.max_lazy_match=l[A.level].max_lazy,A.good_match=l[A.level].good_length,A.nice_match=l[A.level].nice_length,A.max_chain_length=l[A.level].max_chain,A.strstart=0,A.block_start=0,A.lookahead=0,A.insert=0,A.match_length=A.prev_length=I-1,A.match_available=0,A.ins_h=0}(t.state),R}function ht(t,R,A,f,s,w){if(!t)return d;var F=1;if(R===r&&(R=6),f<0?(F=0,f=-f):15<f&&(F=2,f-=16),s<1||v<s||A!==c||f<8||15<f||R<0||9<R||w<0||h<w)return $(t,d);f===8&&(f=9);var N=new st;return(t.state=N).strm=t,N.wrap=F,N.gzhead=null,N.w_bits=f,N.w_size=1<<N.w_bits,N.w_mask=N.w_size-1,N.hash_bits=s+7,N.hash_size=1<<N.hash_bits,N.hash_mask=N.hash_size-1,N.hash_shift=~~((N.hash_bits+I-1)/I),N.window=new o.Buf8(2*N.w_size),N.head=new o.Buf16(N.hash_size),N.prev=new o.Buf16(N.w_size),N.lit_bufsize=1<<s+6,N.pending_buf_size=4*N.lit_bufsize,N.pending_buf=new o.Buf8(N.pending_buf_size),N.d_buf=1*N.lit_bufsize,N.l_buf=3*N.lit_bufsize,N.level=R,N.strategy=w,N.method=A,lt(t)}l=[new et(0,0,0,0,function(t,R){var A=65535;for(A>t.pending_buf_size-5&&(A=t.pending_buf_size-5);;){if(t.lookahead<=1){if(nt(t),t.lookahead===0&&R===p)return e;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var f=t.block_start+A;if((t.strstart===0||t.strstart>=f)&&(t.lookahead=t.strstart-f,t.strstart=f,C(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-q&&(C(t,!1),t.strm.avail_out===0))return e}return t.insert=0,R===g?(C(t,!0),t.strm.avail_out===0?J:P):(t.strstart>t.block_start&&(C(t,!1),t.strm.avail_out),e)}),new et(4,4,8,4,ot),new et(4,5,16,8,ot),new et(4,6,32,32,ot),new et(4,4,16,16,Q),new et(8,16,32,32,Q),new et(8,16,128,128,Q),new et(8,32,128,256,Q),new et(32,128,258,1024,Q),new et(32,258,258,4096,Q)],k.deflateInit=function(t,R){return ht(t,R,c,15,8,0)},k.deflateInit2=ht,k.deflateReset=lt,k.deflateResetKeep=it,k.deflateSetHeader=function(t,R){return t&&t.state?t.state.wrap!==2?d:(t.state.gzhead=R,i):d},k.deflate=function(t,R){var A,f,s,w;if(!t||!t.state||5<R||R<0)return t?$(t,d):d;if(f=t.state,!t.output||!t.input&&t.avail_in!==0||f.status===666&&R!==g)return $(t,t.avail_out===0?-5:d);if(f.strm=t,A=f.last_flush,f.last_flush=R,f.status===m)if(f.wrap===2)t.adler=0,X(f,31),X(f,139),X(f,8),f.gzhead?(X(f,(f.gzhead.text?1:0)+(f.gzhead.hcrc?2:0)+(f.gzhead.extra?4:0)+(f.gzhead.name?8:0)+(f.gzhead.comment?16:0)),X(f,255&f.gzhead.time),X(f,f.gzhead.time>>8&255),X(f,f.gzhead.time>>16&255),X(f,f.gzhead.time>>24&255),X(f,f.level===9?2:2<=f.strategy||f.level<2?4:0),X(f,255&f.gzhead.os),f.gzhead.extra&&f.gzhead.extra.length&&(X(f,255&f.gzhead.extra.length),X(f,f.gzhead.extra.length>>8&255)),f.gzhead.hcrc&&(t.adler=_(t.adler,f.pending_buf,f.pending,0)),f.gzindex=0,f.status=69):(X(f,0),X(f,0),X(f,0),X(f,0),X(f,0),X(f,f.level===9?2:2<=f.strategy||f.level<2?4:0),X(f,3),f.status=B);else{var F=c+(f.w_bits-8<<4)<<8;F|=(2<=f.strategy||f.level<2?0:f.level<6?1:f.level===6?2:3)<<6,f.strstart!==0&&(F|=32),F+=31-F%31,f.status=B,G(f,F),f.strstart!==0&&(G(f,t.adler>>>16),G(f,65535&t.adler)),t.adler=1}if(f.status===69)if(f.gzhead.extra){for(s=f.pending;f.gzindex<(65535&f.gzhead.extra.length)&&(f.pending!==f.pending_buf_size||(f.gzhead.hcrc&&f.pending>s&&(t.adler=_(t.adler,f.pending_buf,f.pending-s,s)),E(t),s=f.pending,f.pending!==f.pending_buf_size));)X(f,255&f.gzhead.extra[f.gzindex]),f.gzindex++;f.gzhead.hcrc&&f.pending>s&&(t.adler=_(t.adler,f.pending_buf,f.pending-s,s)),f.gzindex===f.gzhead.extra.length&&(f.gzindex=0,f.status=73)}else f.status=73;if(f.status===73)if(f.gzhead.name){s=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>s&&(t.adler=_(t.adler,f.pending_buf,f.pending-s,s)),E(t),s=f.pending,f.pending===f.pending_buf_size)){w=1;break}w=f.gzindex<f.gzhead.name.length?255&f.gzhead.name.charCodeAt(f.gzindex++):0,X(f,w)}while(w!==0);f.gzhead.hcrc&&f.pending>s&&(t.adler=_(t.adler,f.pending_buf,f.pending-s,s)),w===0&&(f.gzindex=0,f.status=91)}else f.status=91;if(f.status===91)if(f.gzhead.comment){s=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>s&&(t.adler=_(t.adler,f.pending_buf,f.pending-s,s)),E(t),s=f.pending,f.pending===f.pending_buf_size)){w=1;break}w=f.gzindex<f.gzhead.comment.length?255&f.gzhead.comment.charCodeAt(f.gzindex++):0,X(f,w)}while(w!==0);f.gzhead.hcrc&&f.pending>s&&(t.adler=_(t.adler,f.pending_buf,f.pending-s,s)),w===0&&(f.status=103)}else f.status=103;if(f.status===103&&(f.gzhead.hcrc?(f.pending+2>f.pending_buf_size&&E(t),f.pending+2<=f.pending_buf_size&&(X(f,255&t.adler),X(f,t.adler>>8&255),t.adler=0,f.status=B)):f.status=B),f.pending!==0){if(E(t),t.avail_out===0)return f.last_flush=-1,i}else if(t.avail_in===0&&L(R)<=L(A)&&R!==g)return $(t,-5);if(f.status===666&&t.avail_in!==0)return $(t,-5);if(t.avail_in!==0||f.lookahead!==0||R!==p&&f.status!==666){var N=f.strategy===2?function(z,Z){for(var K;;){if(z.lookahead===0&&(nt(z),z.lookahead===0)){if(Z===p)return e;break}if(z.match_length=0,K=n._tr_tally(z,0,z.window[z.strstart]),z.lookahead--,z.strstart++,K&&(C(z,!1),z.strm.avail_out===0))return e}return z.insert=0,Z===g?(C(z,!0),z.strm.avail_out===0?J:P):z.last_lit&&(C(z,!1),z.strm.avail_out===0)?e:T}(f,R):f.strategy===3?function(z,Z){for(var K,M,Y,rt,tt=z.window;;){if(z.lookahead<=W){if(nt(z),z.lookahead<=W&&Z===p)return e;if(z.lookahead===0)break}if(z.match_length=0,z.lookahead>=I&&0<z.strstart&&(M=tt[Y=z.strstart-1])===tt[++Y]&&M===tt[++Y]&&M===tt[++Y]){rt=z.strstart+W;do;while(M===tt[++Y]&&M===tt[++Y]&&M===tt[++Y]&&M===tt[++Y]&&M===tt[++Y]&&M===tt[++Y]&&M===tt[++Y]&&M===tt[++Y]&&Y<rt);z.match_length=W-(rt-Y),z.match_length>z.lookahead&&(z.match_length=z.lookahead)}if(z.match_length>=I?(K=n._tr_tally(z,1,z.match_length-I),z.lookahead-=z.match_length,z.strstart+=z.match_length,z.match_length=0):(K=n._tr_tally(z,0,z.window[z.strstart]),z.lookahead--,z.strstart++),K&&(C(z,!1),z.strm.avail_out===0))return e}return z.insert=0,Z===g?(C(z,!0),z.strm.avail_out===0?J:P):z.last_lit&&(C(z,!1),z.strm.avail_out===0)?e:T}(f,R):l[f.level].func(f,R);if(N!==J&&N!==P||(f.status=666),N===e||N===J)return t.avail_out===0&&(f.last_flush=-1),i;if(N===T&&(R===1?n._tr_align(f):R!==5&&(n._tr_stored_block(f,0,0,!1),R===3&&(V(f.head),f.lookahead===0&&(f.strstart=0,f.block_start=0,f.insert=0))),E(t),t.avail_out===0))return f.last_flush=-1,i}return R!==g?i:f.wrap<=0?1:(f.wrap===2?(X(f,255&t.adler),X(f,t.adler>>8&255),X(f,t.adler>>16&255),X(f,t.adler>>24&255),X(f,255&t.total_in),X(f,t.total_in>>8&255),X(f,t.total_in>>16&255),X(f,t.total_in>>24&255)):(G(f,t.adler>>>16),G(f,65535&t.adler)),E(t),0<f.wrap&&(f.wrap=-f.wrap),f.pending!==0?i:1)},k.deflateEnd=function(t){var R;return t&&t.state?(R=t.state.status)!==m&&R!==69&&R!==73&&R!==91&&R!==103&&R!==B&&R!==666?$(t,d):(t.state=null,R===B?$(t,-3):i):d},k.deflateSetDictionary=function(t,R){var A,f,s,w,F,N,z,Z,K=R.length;if(!t||!t.state||(w=(A=t.state).wrap)===2||w===1&&A.status!==m||A.lookahead)return d;for(w===1&&(t.adler=u(t.adler,R,K,0)),A.wrap=0,K>=A.w_size&&(w===0&&(V(A.head),A.strstart=0,A.block_start=0,A.insert=0),Z=new o.Buf8(A.w_size),o.arraySet(Z,R,K-A.w_size,A.w_size,0),R=Z,K=A.w_size),F=t.avail_in,N=t.next_in,z=t.input,t.avail_in=K,t.next_in=0,t.input=R,nt(A);A.lookahead>=I;){for(f=A.strstart,s=A.lookahead-(I-1);A.ins_h=(A.ins_h<<A.hash_shift^A.window[f+I-1])&A.hash_mask,A.prev[f&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=f,f++,--s;);A.strstart=f,A.lookahead=I-1,nt(A)}return A.strstart+=A.lookahead,A.block_start=A.strstart,A.insert=A.lookahead,A.lookahead=0,A.match_length=A.prev_length=I-1,A.match_available=0,t.next_in=N,t.input=z,t.avail_in=F,A.wrap=w,i},k.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(b,U,k){U.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(b,U,k){U.exports=function(l,o){var n,u,_,y,p,g,i,d,r,h,a,c,v,S,x,D,O,j,I,W,q,m,B,e,T;n=l.state,u=l.next_in,e=l.input,_=u+(l.avail_in-5),y=l.next_out,T=l.output,p=y-(o-l.avail_out),g=y+(l.avail_out-257),i=n.dmax,d=n.wsize,r=n.whave,h=n.wnext,a=n.window,c=n.hold,v=n.bits,S=n.lencode,x=n.distcode,D=(1<<n.lenbits)-1,O=(1<<n.distbits)-1;t:do{v<15&&(c+=e[u++]<<v,v+=8,c+=e[u++]<<v,v+=8),j=S[c&D];e:for(;;){if(c>>>=I=j>>>24,v-=I,(I=j>>>16&255)===0)T[y++]=65535&j;else{if(!(16&I)){if((64&I)==0){j=S[(65535&j)+(c&(1<<I)-1)];continue e}if(32&I){n.mode=12;break t}l.msg="invalid literal/length code",n.mode=30;break t}W=65535&j,(I&=15)&&(v<I&&(c+=e[u++]<<v,v+=8),W+=c&(1<<I)-1,c>>>=I,v-=I),v<15&&(c+=e[u++]<<v,v+=8,c+=e[u++]<<v,v+=8),j=x[c&O];r:for(;;){if(c>>>=I=j>>>24,v-=I,!(16&(I=j>>>16&255))){if((64&I)==0){j=x[(65535&j)+(c&(1<<I)-1)];continue r}l.msg="invalid distance code",n.mode=30;break t}if(q=65535&j,v<(I&=15)&&(c+=e[u++]<<v,(v+=8)<I&&(c+=e[u++]<<v,v+=8)),i<(q+=c&(1<<I)-1)){l.msg="invalid distance too far back",n.mode=30;break t}if(c>>>=I,v-=I,(I=y-p)<q){if(r<(I=q-I)&&n.sane){l.msg="invalid distance too far back",n.mode=30;break t}if(B=a,(m=0)===h){if(m+=d-I,I<W){for(W-=I;T[y++]=a[m++],--I;);m=y-q,B=T}}else if(h<I){if(m+=d+h-I,(I-=h)<W){for(W-=I;T[y++]=a[m++],--I;);if(m=0,h<W){for(W-=I=h;T[y++]=a[m++],--I;);m=y-q,B=T}}}else if(m+=h-I,I<W){for(W-=I;T[y++]=a[m++],--I;);m=y-q,B=T}for(;2<W;)T[y++]=B[m++],T[y++]=B[m++],T[y++]=B[m++],W-=3;W&&(T[y++]=B[m++],1<W&&(T[y++]=B[m++]))}else{for(m=y-q;T[y++]=T[m++],T[y++]=T[m++],T[y++]=T[m++],2<(W-=3););W&&(T[y++]=T[m++],1<W&&(T[y++]=T[m++]))}break}}break}}while(u<_&&y<g);u-=W=v>>3,c&=(1<<(v-=W<<3))-1,l.next_in=u,l.next_out=y,l.avail_in=u<_?_-u+5:5-(u-_),l.avail_out=y<g?g-y+257:257-(y-g),n.hold=c,n.bits=v}},{}],49:[function(b,U,k){var l=b("../utils/common"),o=b("./adler32"),n=b("./crc32"),u=b("./inffast"),_=b("./inftrees"),y=1,p=2,g=0,i=-2,d=1,r=852,h=592;function a(m){return(m>>>24&255)+(m>>>8&65280)+((65280&m)<<8)+((255&m)<<24)}function c(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new l.Buf16(320),this.work=new l.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function v(m){var B;return m&&m.state?(B=m.state,m.total_in=m.total_out=B.total=0,m.msg="",B.wrap&&(m.adler=1&B.wrap),B.mode=d,B.last=0,B.havedict=0,B.dmax=32768,B.head=null,B.hold=0,B.bits=0,B.lencode=B.lendyn=new l.Buf32(r),B.distcode=B.distdyn=new l.Buf32(h),B.sane=1,B.back=-1,g):i}function S(m){var B;return m&&m.state?((B=m.state).wsize=0,B.whave=0,B.wnext=0,v(m)):i}function x(m,B){var e,T;return m&&m.state?(T=m.state,B<0?(e=0,B=-B):(e=1+(B>>4),B<48&&(B&=15)),B&&(B<8||15<B)?i:(T.window!==null&&T.wbits!==B&&(T.window=null),T.wrap=e,T.wbits=B,S(m))):i}function D(m,B){var e,T;return m?(T=new c,(m.state=T).window=null,(e=x(m,B))!==g&&(m.state=null),e):i}var O,j,I=!0;function W(m){if(I){var B;for(O=new l.Buf32(512),j=new l.Buf32(32),B=0;B<144;)m.lens[B++]=8;for(;B<256;)m.lens[B++]=9;for(;B<280;)m.lens[B++]=7;for(;B<288;)m.lens[B++]=8;for(_(y,m.lens,0,288,O,0,m.work,{bits:9}),B=0;B<32;)m.lens[B++]=5;_(p,m.lens,0,32,j,0,m.work,{bits:5}),I=!1}m.lencode=O,m.lenbits=9,m.distcode=j,m.distbits=5}function q(m,B,e,T){var J,P=m.state;return P.window===null&&(P.wsize=1<<P.wbits,P.wnext=0,P.whave=0,P.window=new l.Buf8(P.wsize)),T>=P.wsize?(l.arraySet(P.window,B,e-P.wsize,P.wsize,0),P.wnext=0,P.whave=P.wsize):(T<(J=P.wsize-P.wnext)&&(J=T),l.arraySet(P.window,B,e-T,J,P.wnext),(T-=J)?(l.arraySet(P.window,B,e-T,T,0),P.wnext=T,P.whave=P.wsize):(P.wnext+=J,P.wnext===P.wsize&&(P.wnext=0),P.whave<P.wsize&&(P.whave+=J))),0}k.inflateReset=S,k.inflateReset2=x,k.inflateResetKeep=v,k.inflateInit=function(m){return D(m,15)},k.inflateInit2=D,k.inflate=function(m,B){var e,T,J,P,$,L,V,E,C,X,G,H,nt,ot,Q,et,st,it,lt,ht,t,R,A,f,s=0,w=new l.Buf8(4),F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!m||!m.state||!m.output||!m.input&&m.avail_in!==0)return i;(e=m.state).mode===12&&(e.mode=13),$=m.next_out,J=m.output,V=m.avail_out,P=m.next_in,T=m.input,L=m.avail_in,E=e.hold,C=e.bits,X=L,G=V,R=g;t:for(;;)switch(e.mode){case d:if(e.wrap===0){e.mode=13;break}for(;C<16;){if(L===0)break t;L--,E+=T[P++]<<C,C+=8}if(2&e.wrap&&E===35615){w[e.check=0]=255&E,w[1]=E>>>8&255,e.check=n(e.check,w,2,0),C=E=0,e.mode=2;break}if(e.flags=0,e.head&&(e.head.done=!1),!(1&e.wrap)||(((255&E)<<8)+(E>>8))%31){m.msg="incorrect header check",e.mode=30;break}if((15&E)!=8){m.msg="unknown compression method",e.mode=30;break}if(C-=4,t=8+(15&(E>>>=4)),e.wbits===0)e.wbits=t;else if(t>e.wbits){m.msg="invalid window size",e.mode=30;break}e.dmax=1<<t,m.adler=e.check=1,e.mode=512&E?10:12,C=E=0;break;case 2:for(;C<16;){if(L===0)break t;L--,E+=T[P++]<<C,C+=8}if(e.flags=E,(255&e.flags)!=8){m.msg="unknown compression method",e.mode=30;break}if(57344&e.flags){m.msg="unknown header flags set",e.mode=30;break}e.head&&(e.head.text=E>>8&1),512&e.flags&&(w[0]=255&E,w[1]=E>>>8&255,e.check=n(e.check,w,2,0)),C=E=0,e.mode=3;case 3:for(;C<32;){if(L===0)break t;L--,E+=T[P++]<<C,C+=8}e.head&&(e.head.time=E),512&e.flags&&(w[0]=255&E,w[1]=E>>>8&255,w[2]=E>>>16&255,w[3]=E>>>24&255,e.check=n(e.check,w,4,0)),C=E=0,e.mode=4;case 4:for(;C<16;){if(L===0)break t;L--,E+=T[P++]<<C,C+=8}e.head&&(e.head.xflags=255&E,e.head.os=E>>8),512&e.flags&&(w[0]=255&E,w[1]=E>>>8&255,e.check=n(e.check,w,2,0)),C=E=0,e.mode=5;case 5:if(1024&e.flags){for(;C<16;){if(L===0)break t;L--,E+=T[P++]<<C,C+=8}e.length=E,e.head&&(e.head.extra_len=E),512&e.flags&&(w[0]=255&E,w[1]=E>>>8&255,e.check=n(e.check,w,2,0)),C=E=0}else e.head&&(e.head.extra=null);e.mode=6;case 6:if(1024&e.flags&&(L<(H=e.length)&&(H=L),H&&(e.head&&(t=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Array(e.head.extra_len)),l.arraySet(e.head.extra,T,P,H,t)),512&e.flags&&(e.check=n(e.check,T,H,P)),L-=H,P+=H,e.length-=H),e.length))break t;e.length=0,e.mode=7;case 7:if(2048&e.flags){if(L===0)break t;for(H=0;t=T[P+H++],e.head&&t&&e.length<65536&&(e.head.name+=String.fromCharCode(t)),t&&H<L;);if(512&e.flags&&(e.check=n(e.check,T,H,P)),L-=H,P+=H,t)break t}else e.head&&(e.head.name=null);e.length=0,e.mode=8;case 8:if(4096&e.flags){if(L===0)break t;for(H=0;t=T[P+H++],e.head&&t&&e.length<65536&&(e.head.comment+=String.fromCharCode(t)),t&&H<L;);if(512&e.flags&&(e.check=n(e.check,T,H,P)),L-=H,P+=H,t)break t}else e.head&&(e.head.comment=null);e.mode=9;case 9:if(512&e.flags){for(;C<16;){if(L===0)break t;L--,E+=T[P++]<<C,C+=8}if(E!==(65535&e.check)){m.msg="header crc mismatch",e.mode=30;break}C=E=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),m.adler=e.check=0,e.mode=12;break;case 10:for(;C<32;){if(L===0)break t;L--,E+=T[P++]<<C,C+=8}m.adler=e.check=a(E),C=E=0,e.mode=11;case 11:if(e.havedict===0)return m.next_out=$,m.avail_out=V,m.next_in=P,m.avail_in=L,e.hold=E,e.bits=C,2;m.adler=e.check=1,e.mode=12;case 12:if(B===5||B===6)break t;case 13:if(e.last){E>>>=7&C,C-=7&C,e.mode=27;break}for(;C<3;){if(L===0)break t;L--,E+=T[P++]<<C,C+=8}switch(e.last=1&E,C-=1,3&(E>>>=1)){case 0:e.mode=14;break;case 1:if(W(e),e.mode=20,B!==6)break;E>>>=2,C-=2;break t;case 2:e.mode=17;break;case 3:m.msg="invalid block type",e.mode=30}E>>>=2,C-=2;break;case 14:for(E>>>=7&C,C-=7&C;C<32;){if(L===0)break t;L--,E+=T[P++]<<C,C+=8}if((65535&E)!=(E>>>16^65535)){m.msg="invalid stored block lengths",e.mode=30;break}if(e.length=65535&E,C=E=0,e.mode=15,B===6)break t;case 15:e.mode=16;case 16:if(H=e.length){if(L<H&&(H=L),V<H&&(H=V),H===0)break t;l.arraySet(J,T,P,H,$),L-=H,P+=H,V-=H,$+=H,e.length-=H;break}e.mode=12;break;case 17:for(;C<14;){if(L===0)break t;L--,E+=T[P++]<<C,C+=8}if(e.nlen=257+(31&E),E>>>=5,C-=5,e.ndist=1+(31&E),E>>>=5,C-=5,e.ncode=4+(15&E),E>>>=4,C-=4,286<e.nlen||30<e.ndist){m.msg="too many length or distance symbols",e.mode=30;break}e.have=0,e.mode=18;case 18:for(;e.have<e.ncode;){for(;C<3;){if(L===0)break t;L--,E+=T[P++]<<C,C+=8}e.lens[F[e.have++]]=7&E,E>>>=3,C-=3}for(;e.have<19;)e.lens[F[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,A={bits:e.lenbits},R=_(0,e.lens,0,19,e.lencode,0,e.work,A),e.lenbits=A.bits,R){m.msg="invalid code lengths set",e.mode=30;break}e.have=0,e.mode=19;case 19:for(;e.have<e.nlen+e.ndist;){for(;et=(s=e.lencode[E&(1<<e.lenbits)-1])>>>16&255,st=65535&s,!((Q=s>>>24)<=C);){if(L===0)break t;L--,E+=T[P++]<<C,C+=8}if(st<16)E>>>=Q,C-=Q,e.lens[e.have++]=st;else{if(st===16){for(f=Q+2;C<f;){if(L===0)break t;L--,E+=T[P++]<<C,C+=8}if(E>>>=Q,C-=Q,e.have===0){m.msg="invalid bit length repeat",e.mode=30;break}t=e.lens[e.have-1],H=3+(3&E),E>>>=2,C-=2}else if(st===17){for(f=Q+3;C<f;){if(L===0)break t;L--,E+=T[P++]<<C,C+=8}C-=Q,t=0,H=3+(7&(E>>>=Q)),E>>>=3,C-=3}else{for(f=Q+7;C<f;){if(L===0)break t;L--,E+=T[P++]<<C,C+=8}C-=Q,t=0,H=11+(127&(E>>>=Q)),E>>>=7,C-=7}if(e.have+H>e.nlen+e.ndist){m.msg="invalid bit length repeat",e.mode=30;break}for(;H--;)e.lens[e.have++]=t}}if(e.mode===30)break;if(e.lens[256]===0){m.msg="invalid code -- missing end-of-block",e.mode=30;break}if(e.lenbits=9,A={bits:e.lenbits},R=_(y,e.lens,0,e.nlen,e.lencode,0,e.work,A),e.lenbits=A.bits,R){m.msg="invalid literal/lengths set",e.mode=30;break}if(e.distbits=6,e.distcode=e.distdyn,A={bits:e.distbits},R=_(p,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,A),e.distbits=A.bits,R){m.msg="invalid distances set",e.mode=30;break}if(e.mode=20,B===6)break t;case 20:e.mode=21;case 21:if(6<=L&&258<=V){m.next_out=$,m.avail_out=V,m.next_in=P,m.avail_in=L,e.hold=E,e.bits=C,u(m,G),$=m.next_out,J=m.output,V=m.avail_out,P=m.next_in,T=m.input,L=m.avail_in,E=e.hold,C=e.bits,e.mode===12&&(e.back=-1);break}for(e.back=0;et=(s=e.lencode[E&(1<<e.lenbits)-1])>>>16&255,st=65535&s,!((Q=s>>>24)<=C);){if(L===0)break t;L--,E+=T[P++]<<C,C+=8}if(et&&(240&et)==0){for(it=Q,lt=et,ht=st;et=(s=e.lencode[ht+((E&(1<<it+lt)-1)>>it)])>>>16&255,st=65535&s,!(it+(Q=s>>>24)<=C);){if(L===0)break t;L--,E+=T[P++]<<C,C+=8}E>>>=it,C-=it,e.back+=it}if(E>>>=Q,C-=Q,e.back+=Q,e.length=st,et===0){e.mode=26;break}if(32&et){e.back=-1,e.mode=12;break}if(64&et){m.msg="invalid literal/length code",e.mode=30;break}e.extra=15&et,e.mode=22;case 22:if(e.extra){for(f=e.extra;C<f;){if(L===0)break t;L--,E+=T[P++]<<C,C+=8}e.length+=E&(1<<e.extra)-1,E>>>=e.extra,C-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=23;case 23:for(;et=(s=e.distcode[E&(1<<e.distbits)-1])>>>16&255,st=65535&s,!((Q=s>>>24)<=C);){if(L===0)break t;L--,E+=T[P++]<<C,C+=8}if((240&et)==0){for(it=Q,lt=et,ht=st;et=(s=e.distcode[ht+((E&(1<<it+lt)-1)>>it)])>>>16&255,st=65535&s,!(it+(Q=s>>>24)<=C);){if(L===0)break t;L--,E+=T[P++]<<C,C+=8}E>>>=it,C-=it,e.back+=it}if(E>>>=Q,C-=Q,e.back+=Q,64&et){m.msg="invalid distance code",e.mode=30;break}e.offset=st,e.extra=15&et,e.mode=24;case 24:if(e.extra){for(f=e.extra;C<f;){if(L===0)break t;L--,E+=T[P++]<<C,C+=8}e.offset+=E&(1<<e.extra)-1,E>>>=e.extra,C-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){m.msg="invalid distance too far back",e.mode=30;break}e.mode=25;case 25:if(V===0)break t;if(H=G-V,e.offset>H){if((H=e.offset-H)>e.whave&&e.sane){m.msg="invalid distance too far back",e.mode=30;break}nt=H>e.wnext?(H-=e.wnext,e.wsize-H):e.wnext-H,H>e.length&&(H=e.length),ot=e.window}else ot=J,nt=$-e.offset,H=e.length;for(V<H&&(H=V),V-=H,e.length-=H;J[$++]=ot[nt++],--H;);e.length===0&&(e.mode=21);break;case 26:if(V===0)break t;J[$++]=e.length,V--,e.mode=21;break;case 27:if(e.wrap){for(;C<32;){if(L===0)break t;L--,E|=T[P++]<<C,C+=8}if(G-=V,m.total_out+=G,e.total+=G,G&&(m.adler=e.check=e.flags?n(e.check,J,G,$-G):o(e.check,J,G,$-G)),G=V,(e.flags?E:a(E))!==e.check){m.msg="incorrect data check",e.mode=30;break}C=E=0}e.mode=28;case 28:if(e.wrap&&e.flags){for(;C<32;){if(L===0)break t;L--,E+=T[P++]<<C,C+=8}if(E!==(4294967295&e.total)){m.msg="incorrect length check",e.mode=30;break}C=E=0}e.mode=29;case 29:R=1;break t;case 30:R=-3;break t;case 31:return-4;case 32:default:return i}return m.next_out=$,m.avail_out=V,m.next_in=P,m.avail_in=L,e.hold=E,e.bits=C,(e.wsize||G!==m.avail_out&&e.mode<30&&(e.mode<27||B!==4))&&q(m,m.output,m.next_out,G-m.avail_out)?(e.mode=31,-4):(X-=m.avail_in,G-=m.avail_out,m.total_in+=X,m.total_out+=G,e.total+=G,e.wrap&&G&&(m.adler=e.check=e.flags?n(e.check,J,G,m.next_out-G):o(e.check,J,G,m.next_out-G)),m.data_type=e.bits+(e.last?64:0)+(e.mode===12?128:0)+(e.mode===20||e.mode===15?256:0),(X==0&&G===0||B===4)&&R===g&&(R=-5),R)},k.inflateEnd=function(m){if(!m||!m.state)return i;var B=m.state;return B.window&&(B.window=null),m.state=null,g},k.inflateGetHeader=function(m,B){var e;return m&&m.state?(2&(e=m.state).wrap)==0?i:((e.head=B).done=!1,g):i},k.inflateSetDictionary=function(m,B){var e,T=B.length;return m&&m.state?(e=m.state).wrap!==0&&e.mode!==11?i:e.mode===11&&o(1,B,T,0)!==e.check?-3:q(m,B,T,T)?(e.mode=31,-4):(e.havedict=1,g):i},k.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(b,U,k){var l=b("../utils/common"),o=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],n=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],u=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],_=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];U.exports=function(y,p,g,i,d,r,h,a){var c,v,S,x,D,O,j,I,W,q=a.bits,m=0,B=0,e=0,T=0,J=0,P=0,$=0,L=0,V=0,E=0,C=null,X=0,G=new l.Buf16(16),H=new l.Buf16(16),nt=null,ot=0;for(m=0;m<=15;m++)G[m]=0;for(B=0;B<i;B++)G[p[g+B]]++;for(J=q,T=15;1<=T&&G[T]===0;T--);if(T<J&&(J=T),T===0)return d[r++]=20971520,d[r++]=20971520,a.bits=1,0;for(e=1;e<T&&G[e]===0;e++);for(J<e&&(J=e),m=L=1;m<=15;m++)if(L<<=1,(L-=G[m])<0)return-1;if(0<L&&(y===0||T!==1))return-1;for(H[1]=0,m=1;m<15;m++)H[m+1]=H[m]+G[m];for(B=0;B<i;B++)p[g+B]!==0&&(h[H[p[g+B]]++]=B);if(O=y===0?(C=nt=h,19):y===1?(C=o,X-=257,nt=n,ot-=257,256):(C=u,nt=_,-1),m=e,D=r,$=B=E=0,S=-1,x=(V=1<<(P=J))-1,y===1&&852<V||y===2&&592<V)return 1;for(;;){for(j=m-$,W=h[B]<O?(I=0,h[B]):h[B]>O?(I=nt[ot+h[B]],C[X+h[B]]):(I=96,0),c=1<<m-$,e=v=1<<P;d[D+(E>>$)+(v-=c)]=j<<24|I<<16|W|0,v!==0;);for(c=1<<m-1;E&c;)c>>=1;if(c!==0?(E&=c-1,E+=c):E=0,B++,--G[m]==0){if(m===T)break;m=p[g+h[B]]}if(J<m&&(E&x)!==S){for($===0&&($=J),D+=e,L=1<<(P=m-$);P+$<T&&!((L-=G[P+$])<=0);)P++,L<<=1;if(V+=1<<P,y===1&&852<V||y===2&&592<V)return 1;d[S=E&x]=J<<24|P<<16|D-r|0}}return E!==0&&(d[D+E]=m-$<<24|64<<16|0),a.bits=J,0}},{"../utils/common":41}],51:[function(b,U,k){U.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(b,U,k){var l=b("../utils/common"),o=0,n=1;function u(s){for(var w=s.length;0<=--w;)s[w]=0}var _=0,y=29,p=256,g=p+1+y,i=30,d=19,r=2*g+1,h=15,a=16,c=7,v=256,S=16,x=17,D=18,O=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],j=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],I=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],W=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],q=new Array(2*(g+2));u(q);var m=new Array(2*i);u(m);var B=new Array(512);u(B);var e=new Array(256);u(e);var T=new Array(y);u(T);var J,P,$,L=new Array(i);function V(s,w,F,N,z){this.static_tree=s,this.extra_bits=w,this.extra_base=F,this.elems=N,this.max_length=z,this.has_stree=s&&s.length}function E(s,w){this.dyn_tree=s,this.max_code=0,this.stat_desc=w}function C(s){return s<256?B[s]:B[256+(s>>>7)]}function X(s,w){s.pending_buf[s.pending++]=255&w,s.pending_buf[s.pending++]=w>>>8&255}function G(s,w,F){s.bi_valid>a-F?(s.bi_buf|=w<<s.bi_valid&65535,X(s,s.bi_buf),s.bi_buf=w>>a-s.bi_valid,s.bi_valid+=F-a):(s.bi_buf|=w<<s.bi_valid&65535,s.bi_valid+=F)}function H(s,w,F){G(s,F[2*w],F[2*w+1])}function nt(s,w){for(var F=0;F|=1&s,s>>>=1,F<<=1,0<--w;);return F>>>1}function ot(s,w,F){var N,z,Z=new Array(h+1),K=0;for(N=1;N<=h;N++)Z[N]=K=K+F[N-1]<<1;for(z=0;z<=w;z++){var M=s[2*z+1];M!==0&&(s[2*z]=nt(Z[M]++,M))}}function Q(s){var w;for(w=0;w<g;w++)s.dyn_ltree[2*w]=0;for(w=0;w<i;w++)s.dyn_dtree[2*w]=0;for(w=0;w<d;w++)s.bl_tree[2*w]=0;s.dyn_ltree[2*v]=1,s.opt_len=s.static_len=0,s.last_lit=s.matches=0}function et(s){8<s.bi_valid?X(s,s.bi_buf):0<s.bi_valid&&(s.pending_buf[s.pending++]=s.bi_buf),s.bi_buf=0,s.bi_valid=0}function st(s,w,F,N){var z=2*w,Z=2*F;return s[z]<s[Z]||s[z]===s[Z]&&N[w]<=N[F]}function it(s,w,F){for(var N=s.heap[F],z=F<<1;z<=s.heap_len&&(z<s.heap_len&&st(w,s.heap[z+1],s.heap[z],s.depth)&&z++,!st(w,N,s.heap[z],s.depth));)s.heap[F]=s.heap[z],F=z,z<<=1;s.heap[F]=N}function lt(s,w,F){var N,z,Z,K,M=0;if(s.last_lit!==0)for(;N=s.pending_buf[s.d_buf+2*M]<<8|s.pending_buf[s.d_buf+2*M+1],z=s.pending_buf[s.l_buf+M],M++,N===0?H(s,z,w):(H(s,(Z=e[z])+p+1,w),(K=O[Z])!==0&&G(s,z-=T[Z],K),H(s,Z=C(--N),F),(K=j[Z])!==0&&G(s,N-=L[Z],K)),M<s.last_lit;);H(s,v,w)}function ht(s,w){var F,N,z,Z=w.dyn_tree,K=w.stat_desc.static_tree,M=w.stat_desc.has_stree,Y=w.stat_desc.elems,rt=-1;for(s.heap_len=0,s.heap_max=r,F=0;F<Y;F++)Z[2*F]!==0?(s.heap[++s.heap_len]=rt=F,s.depth[F]=0):Z[2*F+1]=0;for(;s.heap_len<2;)Z[2*(z=s.heap[++s.heap_len]=rt<2?++rt:0)]=1,s.depth[z]=0,s.opt_len--,M&&(s.static_len-=K[2*z+1]);for(w.max_code=rt,F=s.heap_len>>1;1<=F;F--)it(s,Z,F);for(z=Y;F=s.heap[1],s.heap[1]=s.heap[s.heap_len--],it(s,Z,1),N=s.heap[1],s.heap[--s.heap_max]=F,s.heap[--s.heap_max]=N,Z[2*z]=Z[2*F]+Z[2*N],s.depth[z]=(s.depth[F]>=s.depth[N]?s.depth[F]:s.depth[N])+1,Z[2*F+1]=Z[2*N+1]=z,s.heap[1]=z++,it(s,Z,1),2<=s.heap_len;);s.heap[--s.heap_max]=s.heap[1],function(tt,ut){var ct,ft,pt,at,_t,wt,dt=ut.dyn_tree,xt=ut.max_code,Ct=ut.stat_desc.static_tree,Et=ut.stat_desc.has_stree,At=ut.stat_desc.extra_bits,St=ut.stat_desc.extra_base,mt=ut.stat_desc.max_length,gt=0;for(at=0;at<=h;at++)tt.bl_count[at]=0;for(dt[2*tt.heap[tt.heap_max]+1]=0,ct=tt.heap_max+1;ct<r;ct++)mt<(at=dt[2*dt[2*(ft=tt.heap[ct])+1]+1]+1)&&(at=mt,gt++),dt[2*ft+1]=at,xt<ft||(tt.bl_count[at]++,_t=0,St<=ft&&(_t=At[ft-St]),wt=dt[2*ft],tt.opt_len+=wt*(at+_t),Et&&(tt.static_len+=wt*(Ct[2*ft+1]+_t)));if(gt!==0){do{for(at=mt-1;tt.bl_count[at]===0;)at--;tt.bl_count[at]--,tt.bl_count[at+1]+=2,tt.bl_count[mt]--,gt-=2}while(0<gt);for(at=mt;at!==0;at--)for(ft=tt.bl_count[at];ft!==0;)xt<(pt=tt.heap[--ct])||(dt[2*pt+1]!==at&&(tt.opt_len+=(at-dt[2*pt+1])*dt[2*pt],dt[2*pt+1]=at),ft--)}}(s,w),ot(Z,rt,s.bl_count)}function t(s,w,F){var N,z,Z=-1,K=w[1],M=0,Y=7,rt=4;for(K===0&&(Y=138,rt=3),w[2*(F+1)+1]=65535,N=0;N<=F;N++)z=K,K=w[2*(N+1)+1],++M<Y&&z===K||(M<rt?s.bl_tree[2*z]+=M:z!==0?(z!==Z&&s.bl_tree[2*z]++,s.bl_tree[2*S]++):M<=10?s.bl_tree[2*x]++:s.bl_tree[2*D]++,Z=z,rt=(M=0)===K?(Y=138,3):z===K?(Y=6,3):(Y=7,4))}function R(s,w,F){var N,z,Z=-1,K=w[1],M=0,Y=7,rt=4;for(K===0&&(Y=138,rt=3),N=0;N<=F;N++)if(z=K,K=w[2*(N+1)+1],!(++M<Y&&z===K)){if(M<rt)for(;H(s,z,s.bl_tree),--M!=0;);else z!==0?(z!==Z&&(H(s,z,s.bl_tree),M--),H(s,S,s.bl_tree),G(s,M-3,2)):M<=10?(H(s,x,s.bl_tree),G(s,M-3,3)):(H(s,D,s.bl_tree),G(s,M-11,7));Z=z,rt=(M=0)===K?(Y=138,3):z===K?(Y=6,3):(Y=7,4)}}u(L);var A=!1;function f(s,w,F,N){G(s,(_<<1)+(N?1:0),3),function(z,Z,K,M){et(z),X(z,K),X(z,~K),l.arraySet(z.pending_buf,z.window,Z,K,z.pending),z.pending+=K}(s,w,F)}k._tr_init=function(s){A||(function(){var w,F,N,z,Z,K=new Array(h+1);for(z=N=0;z<y-1;z++)for(T[z]=N,w=0;w<1<<O[z];w++)e[N++]=z;for(e[N-1]=z,z=Z=0;z<16;z++)for(L[z]=Z,w=0;w<1<<j[z];w++)B[Z++]=z;for(Z>>=7;z<i;z++)for(L[z]=Z<<7,w=0;w<1<<j[z]-7;w++)B[256+Z++]=z;for(F=0;F<=h;F++)K[F]=0;for(w=0;w<=143;)q[2*w+1]=8,w++,K[8]++;for(;w<=255;)q[2*w+1]=9,w++,K[9]++;for(;w<=279;)q[2*w+1]=7,w++,K[7]++;for(;w<=287;)q[2*w+1]=8,w++,K[8]++;for(ot(q,g+1,K),w=0;w<i;w++)m[2*w+1]=5,m[2*w]=nt(w,5);J=new V(q,O,p+1,g,h),P=new V(m,j,0,i,h),$=new V(new Array(0),I,0,d,c)}(),A=!0),s.l_desc=new E(s.dyn_ltree,J),s.d_desc=new E(s.dyn_dtree,P),s.bl_desc=new E(s.bl_tree,$),s.bi_buf=0,s.bi_valid=0,Q(s)},k._tr_stored_block=f,k._tr_flush_block=function(s,w,F,N){var z,Z,K=0;0<s.level?(s.strm.data_type===2&&(s.strm.data_type=function(M){var Y,rt=4093624447;for(Y=0;Y<=31;Y++,rt>>>=1)if(1&rt&&M.dyn_ltree[2*Y]!==0)return o;if(M.dyn_ltree[18]!==0||M.dyn_ltree[20]!==0||M.dyn_ltree[26]!==0)return n;for(Y=32;Y<p;Y++)if(M.dyn_ltree[2*Y]!==0)return n;return o}(s)),ht(s,s.l_desc),ht(s,s.d_desc),K=function(M){var Y;for(t(M,M.dyn_ltree,M.l_desc.max_code),t(M,M.dyn_dtree,M.d_desc.max_code),ht(M,M.bl_desc),Y=d-1;3<=Y&&M.bl_tree[2*W[Y]+1]===0;Y--);return M.opt_len+=3*(Y+1)+5+5+4,Y}(s),z=s.opt_len+3+7>>>3,(Z=s.static_len+3+7>>>3)<=z&&(z=Z)):z=Z=F+5,F+4<=z&&w!==-1?f(s,w,F,N):s.strategy===4||Z===z?(G(s,2+(N?1:0),3),lt(s,q,m)):(G(s,4+(N?1:0),3),function(M,Y,rt,tt){var ut;for(G(M,Y-257,5),G(M,rt-1,5),G(M,tt-4,4),ut=0;ut<tt;ut++)G(M,M.bl_tree[2*W[ut]+1],3);R(M,M.dyn_ltree,Y-1),R(M,M.dyn_dtree,rt-1)}(s,s.l_desc.max_code+1,s.d_desc.max_code+1,K+1),lt(s,s.dyn_ltree,s.dyn_dtree)),Q(s),N&&et(s)},k._tr_tally=function(s,w,F){return s.pending_buf[s.d_buf+2*s.last_lit]=w>>>8&255,s.pending_buf[s.d_buf+2*s.last_lit+1]=255&w,s.pending_buf[s.l_buf+s.last_lit]=255&F,s.last_lit++,w===0?s.dyn_ltree[2*F]++:(s.matches++,w--,s.dyn_ltree[2*(e[F]+p+1)]++,s.dyn_dtree[2*C(w)]++),s.last_lit===s.lit_bufsize-1},k._tr_align=function(s){G(s,2,3),H(s,v,q),function(w){w.bi_valid===16?(X(w,w.bi_buf),w.bi_buf=0,w.bi_valid=0):8<=w.bi_valid&&(w.pending_buf[w.pending++]=255&w.bi_buf,w.bi_buf>>=8,w.bi_valid-=8)}(s)}},{"../utils/common":41}],53:[function(b,U,k){U.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(b,U,k){(function(l){(function(o,n){if(!o.setImmediate){var u,_,y,p,g=1,i={},d=!1,r=o.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(o);h=h&&h.setTimeout?h:o,u={}.toString.call(o.process)==="[object process]"?function(S){process.nextTick(function(){c(S)})}:function(){if(o.postMessage&&!o.importScripts){var S=!0,x=o.onmessage;return o.onmessage=function(){S=!1},o.postMessage("","*"),o.onmessage=x,S}}()?(p="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",v,!1):o.attachEvent("onmessage",v),function(S){o.postMessage(p+S,"*")}):o.MessageChannel?((y=new MessageChannel).port1.onmessage=function(S){c(S.data)},function(S){y.port2.postMessage(S)}):r&&"onreadystatechange"in r.createElement("script")?(_=r.documentElement,function(S){var x=r.createElement("script");x.onreadystatechange=function(){c(S),x.onreadystatechange=null,_.removeChild(x),x=null},_.appendChild(x)}):function(S){setTimeout(c,0,S)},h.setImmediate=function(S){typeof S!="function"&&(S=new Function(""+S));for(var x=new Array(arguments.length-1),D=0;D<x.length;D++)x[D]=arguments[D+1];var O={callback:S,args:x};return i[g]=O,u(g),g++},h.clearImmediate=a}function a(S){delete i[S]}function c(S){if(d)setTimeout(c,0,S);else{var x=i[S];if(x){d=!0;try{(function(D){var O=D.callback,j=D.args;switch(j.length){case 0:O();break;case 1:O(j[0]);break;case 2:O(j[0],j[1]);break;case 3:O(j[0],j[1],j[2]);break;default:O.apply(n,j)}})(x)}finally{a(S),d=!1}}}}function v(S){S.source===o&&typeof S.data=="string"&&S.data.indexOf(p)===0&&c(+S.data.slice(p.length))}})(typeof self>"u"?l===void 0?this:l:self)}).call(this,typeof bt<"u"?bt:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})}(kt)),kt.exports}var Bt=Ot();const Rt=It(Bt),Ft=Object.freeze(Object.defineProperty({__proto__:null,default:Rt},Symbol.toStringTag,{value:"Module"}));export{Ft as j};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
py_backend/static/assets/useAdmin-qpJv9-Qq.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{r,W as e}from"./index-DnPgbq1Q.js";const o=()=>{const t=r.useContext(e);if(t===void 0)throw new Error("useAdmin must be used within an AdminProvider");return t};export{o as u};
|
|
|
|
|
|
py_backend/static/index.html
CHANGED
|
@@ -42,11 +42,10 @@
|
|
| 42 |
});
|
| 43 |
}
|
| 44 |
</script>
|
| 45 |
-
<script type="module" crossorigin src="/assets/index-DuuohOak.js"></script>
|
| 46 |
-
<link rel="stylesheet" crossorigin href="/assets/index-cCOeofBN.css">
|
| 47 |
</head>
|
| 48 |
<body>
|
| 49 |
-
<div id="root"></div>
|
| 50 |
-
|
| 51 |
</body>
|
| 52 |
</html>
|
|
|
|
| 42 |
});
|
| 43 |
}
|
| 44 |
</script>
|
| 45 |
+
<script type="module" crossorigin src="/assets/index-DuuohOak.js"></script>
|
| 46 |
+
<link rel="stylesheet" crossorigin href="/assets/index-cCOeofBN.css">
|
| 47 |
</head>
|
| 48 |
<body>
|
| 49 |
+
<div id="root"></div>
|
|
|
|
| 50 |
</body>
|
| 51 |
</html>
|