https://github.com/gnuboard/g7/issues/125 — 상품 상세설명을 HTML 로 저장할 때 HTMLPurifier 가 모듈 vendor 폴더 안에 정의 캐시를 만들려다 실패해 저장이 매번 500 으로 끝나던 문제를 고친다. vendor 를 읽기 전용으로 두는 표준 배포에서 그 쓰기는 예외가 아니라 PHP 경고로 나오고 Laravel 이 이를 ErrorException 으로 승격시킨다. 캐시는 설정 해시당 1회만 기록되므로 캐시가 영영 생기지 않아 재시도해도 같은 결과였다. 캐시 경로를 storage 아래로 옮기고, 그 경로마저 확보하지 못하면 캐시만 끄고 정화는 그대로 수행한다 — 캐시는 성능 장치이고 정화는 보안 장치라, 전자의 실패가 후자를 건너뛰게 만들면 안 된다. 저장은 성공하므로 운영자에게 도달하는 흔적이 로그 하나뿐이라 error 수준으로 남긴다 (출하 기본 로그 수준이 error 라 warning 은 기본 설치 상태에서 파일에 남지 않는다). 그 과정에서 갈라져 있던 두 축을 코어 한 곳으로 모은다. - 쓰기 디렉토리 확보: 억제 생성·chmod·setgid·소유권 상속·쓰기 판정 절차가 정적 게시와 정의 캐시 두 곳에 서로 다른 하드닝으로 복제돼 있었다(억제 mkdir·setgid·clearstatcache 가 사본마다 한쪽씩 빠져 있었다). FilePermissionHelper 의 ensureWritableDirectory 와 hardenDirectory 로 통합하고, 실패 사유는 out 파라미터로 올려 정책(조용한 성능 저하 대 시끄러운 실패)은 호출부가 정하게 둔다. - 확장 저장 경로: storage_path('app/modules/…') 손조립이 30곳에 흩어져 있어 테스트 격리 분기를 넣으려면 사본마다 복제해야 했고, 한 곳만 빠뜨려도 그 확장의 테스트가 운영 설정 파일을 덮어쓴다. 디스크 root 를 단일 출처로 읽는 ExtensionStoragePath 로 전환하고 테스트 분기는 config/filesystems.php 한 줄에서 끝낸다. 함께 고친 것 - 테스트가 운영 라우트 캐시로 부팅해 확장 allowlist 가 라우트 축에서 통째로 무력화되던 문제. 삭제가 아니라 경로를 돌린다 — 라우트 캐시는 확장 작업 전까지 재생성되지 않아, 삭제하면 운영 사이트가 그때까지 라우트 파일 스캔 경로로 떨어진다. - PHPUnit 프로세스가 확장 vendor 의 제3자 composer 패키지를 오토로드하지 않아 그 패키지를 쓰는 코드 경로가 통째로 테스트 불가였던 문제. 확장 자신의 오토로더를 그대로 쓰면 활성 디렉토리가 _bundled 를 이기고 base path 유추까지 깨지므로, 생성된 맵에서 제3자 항목만 골라 별도 로더로 등록한다. - 게시 폴더가 setgid 를 갖지 않아, 명령줄과 웹이 번갈아 만든 하위 폴더를 다른 쪽이 쓰지 못하던 문제. - 관리자 템플릿이 HTML 정화 라이브러리를 직접 지정하지 않아 전이 의존으로 딸려온 구버전이 쓰이던 문제. 동반 산출물 - 규정 표(·AGENTS.md) 6행 + storage-driver/service-repository/testing-guide 문서 - audit 룰 2종 + coverage 6항목. 저장소가 이미 전량 전환돼 전수 실행이 공허 통과하므로 판정식은 픽스처 36건이 잠근다 - INSTALL.md 에 설치 후 파일 권한 절 추가 (vendor 쓰기 권한 불요를 명시)
284 lines
711 KiB
JavaScript
284 lines
711 KiB
JavaScript
var SirsoftAdminBasic=(function(R,h,v,Vn){"use strict";var RA=Object.defineProperty;var eD=(R,h,v)=>h in R?RA(R,h,{enumerable:!0,configurable:!0,writable:!0,value:v}):R[h]=v;var $e=(R,h,v)=>eD(R,typeof h!="symbol"?h+"":h,v);var Xa,Cr;function jb(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const $=jb(v),Wb=()=>window.G7Core,le=v.forwardRef(({children:e,variant:t="primary",size:n="md",className:r="",...s},o)=>{const i="button",a=Wb()?.style?.mergeClasses?.(i,r)??`${i} ${r}`;return h.jsx("button",{ref:o,className:a,...s,children:e})});le.displayName="Button";const su=v.forwardRef(({accept:e,maxSize:t,onChange:n,onError:r,buttonText:s="Browse",placeholder:o="No file selected",className:i="",disabled:a,...l},c)=>{const d=v.useRef(null),u=c||d,[f,g]=v.useState(""),m={},p={};Object.entries(l).forEach(([x,M])=>{x.startsWith("data-editor-")||x==="id"||x==="onMouseMove"||x==="onMouseLeave"?m[x]=M:p[x]=M});const y=v.useCallback(()=>{!a&&u.current&&u.current.click()},[a,u]),b=v.useCallback(x=>{const M=x.target.files?.[0]||null;if(!M){g(""),n?.({target:{value:null,name:""}});return}if(t&&M.size>t*1024*1024){const S=`File size exceeds ${t}MB limit`;r?.(S),u.current&&(u.current.value=""),g("");return}g(M.name),n?.({target:{value:M,name:M.name}})},[t,n,r,u]),_=v.useCallback(x=>{x.stopPropagation(),u.current&&(u.current.value=""),g(""),n?.({target:{value:null,name:""}})},[n,u]);return h.jsxs("div",{className:`flex items-center gap-2 ${i}`,...m,children:[h.jsx("input",{ref:u,type:"file",accept:e,onChange:b,disabled:a,className:"hidden",...p}),h.jsx("button",{type:"button",onClick:y,disabled:a,className:"px-4 py-2 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md text-sm font-medium text-gray-700 dark:text-gray-200 hover:bg-gray-200 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed",children:s}),h.jsx("span",{className:"flex-1 text-sm text-gray-600 dark:text-gray-400 truncate",children:f||o}),f&&!a&&h.jsx("button",{type:"button",onClick:_,className:"p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200","aria-label":"Clear file",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})});su.displayName="FileInput";const Gb=e=>e==="checkbox"?"checkbox":e==="radio"?"radio":"input",Yb=(e,t)=>{const n=Gb(e);return t?t.split(/\s+/).filter(Boolean).includes(n)?t:`${n} ${t}`:n},Et=v.forwardRef(({label:e,error:t,className:n="",onChange:r,onKeyPress:s,value:o,defaultValue:i,type:a="text",checked:l,defaultChecked:c,...d},u)=>{const f=a==="radio"||a==="checkbox",g=Yb(a,n),m=v.useRef(!1),p=v.useRef(null);v.useImperativeHandle(u,()=>p.current);const[y,b]=v.useState(o??i??"");v.useEffect(()=>{if(!f&&!m.current&&o!==void 0){if(p.current&&document.activeElement===p.current)return;b(o)}},[o,f]);const _=v.useCallback(()=>{m.current=!0},[]),x=v.useCallback(E=>{if(m.current=!1,r){const T=E.target.value;b(T);const P=new Event("change",{bubbles:!0});Object.defineProperty(P,"target",{writable:!1,value:{value:T}}),Object.defineProperty(P,"currentTarget",{writable:!1,value:{value:T}}),r(P)}},[r]),M=v.useCallback(E=>{const T=E.target.value;b(T),!m.current&&r&&r(E)},[r]),S=v.useCallback(E=>{m.current||s&&s(E)},[s]),{loadingactions:k,formdata:N,...C}=d;if(f)return h.jsx("input",{ref:p,type:a,className:g,onChange:r,checked:l,defaultChecked:c,value:o,...C});const w=o!==void 0?{value:y}:{defaultValue:i};return h.jsx("input",{ref:p,type:a,className:g,onChange:M,onKeyPress:S,onCompositionStart:_,onCompositionEnd:x,...w,...C})});Et.displayName="Input";const lr=({label:e,error:t,className:n="",onChange:r,value:s,defaultValue:o,...i})=>{const a=v.useRef(!1),l=v.useRef(null),[c,d]=v.useState(s??o??"");v.useEffect(()=>{!a.current&&s!==void 0&&d(s)},[s]);const u=v.useCallback(()=>{a.current=!0},[]),f=v.useCallback(M=>{if(a.current=!1,r){const S=M.target.value;d(S);const k=new Event("change",{bubbles:!0});Object.defineProperty(k,"target",{writable:!1,value:{value:S}}),Object.defineProperty(k,"currentTarget",{writable:!1,value:{value:S}}),r(k)}},[r]),g=v.useCallback(M=>{const S=M.target.value;d(S),!a.current&&r&&r(M)},[r]),{loadingactions:m,formdata:p,...y}=i,b=s!==void 0?{value:c}:{defaultValue:o},x=(n??"").split(/\s+/).filter(Boolean).includes("textarea")?n??"":["textarea",n].filter(Boolean).join(" ");return h.jsx("textarea",{ref:l,className:x,onChange:g,onCompositionStart:u,onCompositionEnd:f,...b,...y})},gn=({children:e,className:t="",...n})=>h.jsx("label",{className:t,...n,children:e}),I=v.forwardRef(({children:e,className:t="",...n},r)=>h.jsx("div",{ref:r,className:t,...n,children:e})),J=({children:e,className:t="",...n})=>h.jsx("span",{className:t,...n,children:e}),kt=({children:e,className:t="",...n})=>h.jsx("p",{className:t,...n,children:e}),Nn=({className:e="",alt:t="",...n})=>h.jsx("img",{className:e,alt:t,...n}),sl=({children:e,className:t="",...n})=>h.jsx("h1",{className:t,...n,children:e}),cr=({children:e,className:t="",...n})=>h.jsx("h2",{className:t,...n,children:e}),Xr=({children:e,className:t="",...n})=>h.jsx("h3",{className:t,...n,children:e}),ou=({children:e,className:t="",...n})=>h.jsx("h4",{className:t,...n,children:e}),ol=({children:e,className:t="",...n})=>h.jsx("ul",{className:t,...n,children:e}),Kb=({children:e,className:t="",...n})=>h.jsx("ol",{className:t,...n,children:e}),il=({children:e,className:t="",...n})=>h.jsx("li",{className:t,...n,children:e}),qr=({children:e,className:t="",...n})=>h.jsx("a",{className:t,...n,children:e}),al=({children:e,className:t="",...n})=>h.jsx("form",{className:t,...n,children:e}),Jn=({children:e,className:t="",...n})=>h.jsx("svg",{className:t,...n,children:e}),Xb=window.G7Core?.createLogger?.("Comp:Select")??{log:(...e)=>console.log("[Comp:Select]",...e),warn:(...e)=>console.warn("[Comp:Select]",...e),error:(...e)=>console.error("[Comp:Select]",...e)};function qb(e){const t=window.G7Core?.state?.get?.("_global.appConfig.localeNames")?.[e];return t||{ko:"한국어",en:"English",ja:"日本語",zh:"中文",es:"Español",fr:"Français",de:"Deutsch"}[e]||e}const Zr=({children:e,label:t,error:n,options:r,className:s="",value:o,onChange:i,disabled:a,searchable:l=!1,searchPlaceholder:c,editorAttrs:d,...u})=>{const[f,g]=v.useState(!1),[m,p]=v.useState(""),[y,b]=v.useState(null),_=v.useRef(null),x=v.useRef(null),M=v.useRef(null),S=v.useRef(null),k=v.useMemo(()=>r?Array.isArray(r)?r.length===0?[]:typeof r[0]=="string"?r.map(O=>({value:O,label:qb(O)})):r:(Xb.warn("options prop is not an array:",r),null):null,[r]),N=v.useMemo(()=>k&&k.find(z=>String(z.value)===String(o))?.label||"",[k,o]),C=v.useMemo(()=>{if(!k)return null;if(!l||m.trim()==="")return k;const O=m.trim().toLowerCase();return k.filter(z=>z.label.toLowerCase().includes(O)||String(z.value).toLowerCase().includes(O))},[k,l,m]);v.useEffect(()=>{if(f&&l){p("");const O=setTimeout(()=>M.current?.focus(),0);return()=>clearTimeout(O)}f||p("")},[f,l]);const w=v.useCallback(()=>{if(!x.current)return;const O=x.current.getBoundingClientRect(),z=window.innerHeight-O.bottom,j=z<280&&O.top>z;b(j?{bottom:window.innerHeight-O.top+4,left:O.left,width:O.width}:{top:O.bottom+4,left:O.left,width:O.width})},[]);v.useEffect(()=>{if(!f){b(null);return}return w(),window.addEventListener("scroll",w,!0),window.addEventListener("resize",w),()=>{window.removeEventListener("scroll",w,!0),window.removeEventListener("resize",w)}},[f,w]),v.useEffect(()=>{const O=z=>{const U=z.target;_.current&&!_.current.contains(U)&&(!S.current||!S.current.contains(U))&&g(!1)};return f&&document.addEventListener("mousedown",O),()=>{document.removeEventListener("mousedown",O)}},[f]),v.useEffect(()=>{const O=z=>{z.key==="Escape"&&f&&(g(!1),x.current?.focus())};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[f]);const E=()=>{a||g(!f)},T=O=>{i&&i({target:{value:O},preventDefault:()=>{},stopPropagation:()=>{},type:"change"}),g(!1),x.current?.focus()};if(!k){const z=(s??"").split(/\s+/).filter(Boolean).includes("select")?s??"":["select",s].filter(Boolean).join(" ");return h.jsx("select",{className:z,value:o,onChange:i,disabled:a,...d,...u,children:e})}const P=(s??"").split(/\s+/).filter(O=>O&&!O.includes(":")).join(" "),L=P.includes("bg-"),F=/text-(gray|red|blue|green|yellow|white|black|indigo|purple|pink|orange|amber|emerald|teal|cyan|slate)-\d+|text-white|text-black/.test(P),A=L?`${s}${F?"":" text-gray-700 dark:text-gray-200"}`:`w-full px-4 py-2.5 bg-gray-100 dark:bg-gray-700 border-0 rounded-xl text-sm text-gray-700 dark:text-gray-200 font-medium focus:ring-2 focus:ring-blue-500 focus:outline-none ${s}`,D={...d,...u};return h.jsxs(I,{ref:_,className:"relative",...D,children:[h.jsxs(le,{ref:x,type:"button",onClick:E,disabled:a,className:`${A} flex items-center justify-between gap-2 text-left cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed`,"aria-haspopup":"listbox","aria-expanded":f,children:[h.jsx(J,{className:"truncate",children:N||" "}),h.jsx(Jn,{className:`w-4 h-4 flex-shrink-0 transition-transform duration-200 ${f?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),f&&y&&Vn.createPortal(h.jsxs(I,{ref:S,className:"fixed z-[9999] bg-white dark:bg-gray-800 rounded-2xl shadow-lg border border-gray-200 dark:border-gray-600 overflow-hidden",style:{top:y.top,bottom:y.bottom,left:y.left,width:y.width},role:"listbox",children:[l&&h.jsx(I,{className:"p-2 border-b border-gray-200 dark:border-gray-600",children:h.jsx(Et,{ref:M,type:"text",value:m,onChange:O=>p(O.target.value),placeholder:c??"Search...",className:"w-full px-3 py-2 bg-gray-100 dark:bg-gray-700 border-0 rounded-lg text-sm text-gray-700 dark:text-gray-200 placeholder-gray-400 dark:placeholder-gray-500 focus:ring-2 focus:ring-blue-500 focus:outline-none",role:"searchbox","aria-label":c??"Search"})}),h.jsxs(I,{className:"py-2 max-h-60 overflow-auto",children:[C&&C.length===0&&h.jsx(I,{className:"px-4 py-3 text-sm text-gray-500 dark:text-gray-400 text-center",children:m?"No results":""}),(C??[]).map(O=>{const z=String(O.value)===String(o);return h.jsxs(le,{type:"button",onClick:()=>!O.disabled&&T(O.value),disabled:O.disabled,className:`w-full px-4 py-3 text-left text-sm flex items-center justify-between hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors ${z?"text-blue-600 dark:text-blue-400 font-medium":"text-gray-700 dark:text-gray-200"} ${O.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,role:"option","aria-selected":z,children:[h.jsx(J,{children:O.label}),z&&h.jsx(Jn,{className:"w-5 h-5 text-blue-600 dark:text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})]},O.value)})]})]}),document.body)]})},Zb=({children:e,className:t="",...n})=>h.jsx("option",{className:t,...n,children:e}),Qb=({children:e,className:t="",...n})=>h.jsx("optgroup",{className:t,...n,children:e}),On=v.forwardRef(({label:e,className:t="",indeterminate:n=!1,...r},s)=>{const o=v.useRef(null),i=a=>{o.current=a,typeof s=="function"?s(a):s&&(s.current=a)};return v.useEffect(()=>{o.current&&(o.current.indeterminate=n)},[n]),h.jsx("input",{ref:i,type:"checkbox",className:t,...r})});On.displayName="Checkbox";const ll=({children:e,className:t="",...n})=>h.jsx("table",{className:t,...n,children:e}),cl=({children:e,className:t="",...n})=>h.jsx("thead",{className:t,...n,children:e}),dl=({children:e,className:t="",...n})=>h.jsx("tbody",{className:t,...n,children:e}),ul=({children:e,className:t="",...n})=>h.jsx("tfoot",{className:t,...n,children:e}),dr=({children:e,className:t="",...n})=>h.jsx("tr",{className:t,...n,children:e}),Qr=({children:e,className:t="",...n})=>h.jsx("th",{className:t,...n,children:e}),rn=({children:e,className:t="",...n})=>h.jsx("td",{className:t,...n,children:e}),Jo=({children:e,className:t="",...n})=>h.jsx("nav",{className:t,...n,children:e}),iu=({children:e,className:t="",...n})=>h.jsx("section",{className:t,...n,children:e}),ae=({name:e,iconStyle:t="solid",size:n,color:r,spin:s=!1,pulse:o=!1,fixedWidth:i=!1,ariaLabel:a,className:l="",style:c,...d})=>{const u={solid:"fas",regular:"far",light:"fal",duotone:"fad",brands:"fab"},f={"fa-solid":"solid","fa-regular":"regular","fa-light":"light","fa-duotone":"duotone","fa-brands":"brands"},g=typeof e=="string"?e:String(e);let m=t,p=g;for(const[_,x]of Object.entries(f))if(g.startsWith(_+" ")){m=x,p=g.substring(_.length+1);break}p=p.replace(/^fa-/,"");const y=[u[m],`fa-${p}`,n&&`fa-${n}`,s&&"fa-spin",o&&"fa-pulse",i&&"fa-fw",r,l].filter(Boolean).join(" "),b=a||p.replace(/-/g," ");return h.jsx("i",{className:y,style:c,"aria-label":b,role:"img",...d})},Jb={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-8 h-8"},au={xs:"xs",sm:"sm",md:void 0,lg:"lg",xl:"2x"},Rb=({icon:e,size:t="md",className:n="",color:r,ariaLabel:s})=>{const o=e.indexOf(":"),i=e.startsWith("fa-")||e.startsWith("fas ")||e.startsWith("far ")||e.startsWith("fab ")||e.startsWith("fal ")||e.startsWith("fad ");let a,l;i?(a="fa",l=e):o>0?(a=e.substring(0,o),l=e.substring(o+1)):(a="fa",l=e);const c=Jb[t],d=r||"";switch(a){case"fa":return h.jsx(ae,{name:l,size:au[t],className:n,color:r,ariaLabel:s});case"svg":return h.jsx("img",{src:l,className:`${c} ${d} ${n}`.trim(),alt:s||"","aria-label":s,role:"img"});case"img":return h.jsx("img",{src:l,className:`${c} ${n}`.trim(),alt:s||"",role:"img"});default:return h.jsx(ae,{name:e,size:au[t],className:n,color:r,ariaLabel:s})}},ey=({children:e,className:t="",...n})=>h.jsx("code",{className:t,...n,children:e}),ty=({children:e,className:t="",...n})=>h.jsx("pre",{className:t,...n,children:e}),ny=({children:e})=>h.jsx(h.Fragment,{children:e}),ry=({className:e="",...t})=>h.jsx("hr",{className:e,...t}),yt=({className:e="",children:t,style:n,...r})=>h.jsx("i",{className:e,style:n,...r,children:t});var he=(e=>(e.User="fa-user",e.Users="fa-users",e.UserCircle="fa-user-circle",e.UserPlus="fa-user-plus",e.UserMinus="fa-user-minus",e.UserShield="fa-user-shield",e.Search="fa-search",e.Edit="fa-edit",e.Pencil="fa-pencil-alt",e.Trash="fa-trash",e.Save="fa-save",e.Plus="fa-plus",e.Minus="fa-minus",e.Check="fa-check",e.Times="fa-times",e.Download="fa-download",e.Upload="fa-upload",e.Copy="fa-copy",e.ExternalLink="fa-external-link-alt",e.Home="fa-home",e.CaretRight="fa-caret-right",e.CaretDown="fa-caret-down",e.ChevronLeft="fa-chevron-left",e.ChevronRight="fa-chevron-right",e.ChevronUp="fa-chevron-up",e.ChevronDown="fa-chevron-down",e.AngleLeft="fa-angle-left",e.AngleRight="fa-angle-right",e.AngleUp="fa-angle-up",e.AngleDown="fa-angle-down",e.ArrowUp="fa-arrow-up",e.ArrowDown="fa-arrow-down",e.ArrowLeft="fa-arrow-left",e.ArrowRight="fa-arrow-right",e.Bars="fa-bars",e.EllipsisVertical="fa-ellipsis-v",e.EllipsisHorizontal="fa-ellipsis-h",e.CheckCircle="fa-check-circle",e.TimesCircle="fa-times-circle",e.ExclamationCircle="fa-exclamation-circle",e.ExclamationTriangle="fa-exclamation-triangle",e.InfoCircle="fa-info-circle",e.QuestionCircle="fa-question-circle",e.XCircle="fa-times-circle",e.ShoppingCart="fa-shopping-cart",e.ShoppingBag="fa-shopping-bag",e.CreditCard="fa-credit-card",e.Tag="fa-tag",e.Tags="fa-tags",e.File="fa-file",e.FileAlt="fa-file-alt",e.Folder="fa-folder",e.FolderOpen="fa-folder-open",e.Envelope="fa-envelope",e.Phone="fa-phone",e.Comment="fa-comment",e.Comments="fa-comments",e.Cog="fa-cog",e.Cogs="fa-cogs",e.Settings="fa-cog",e.Wrench="fa-wrench",e.Sliders="fa-sliders-h",e.Image="fa-image",e.Images="fa-images",e.Video="fa-video",e.Camera="fa-camera",e.Heart="fa-heart",e.Star="fa-star",e.ThumbsUp="fa-thumbs-up",e.ThumbsDown="fa-thumbs-down",e.Share="fa-share",e.Clock="fa-clock",e.Calendar="fa-calendar",e.CalendarAlt="fa-calendar-alt",e.Lock="fa-lock",e.Unlock="fa-unlock",e.Eye="fa-eye",e.EyeSlash="fa-eye-slash",e.Bell="fa-bell",e.Flag="fa-flag",e.Map="fa-map",e.MapMarker="fa-map-marker-alt",e.Globe="fa-globe",e.Link="fa-link",e.Unlink="fa-unlink",e.Sun="fa-sun",e.Moon="fa-moon",e.ChartBar="fa-chart-bar",e.ChartLine="fa-chart-line",e.ChartPie="fa-chart-pie",e.ChartArea="fa-chart-area",e.Spinner="fa-spinner",e.CircleNotch="fa-circle-notch",e.CheckBadge="fa-badge-check",e.Cube="fa-cube",e.Cubes="fa-cubes",e.Plug="fa-plug",e.PuzzlePiece="fa-puzzle-piece",e.Palette="fa-palette",e))(he||{});const sy=({title:e,content:t,imageUrl:n,imageAlt:r="",className:s="",onClick:o,style:i,id:a,editorAttrs:l})=>h.jsxs(I,{className:`card-clickable ${s}`,onClick:o,style:i,id:a,...l,children:[n&&h.jsx(I,{className:"w-full",children:h.jsx(Nn,{src:n,alt:r,className:"card-image"})}),h.jsxs(I,{className:"p-4",children:[e&&h.jsx(cr,{className:"card-title",children:e}),t&&h.jsx(kt,{className:"card-content",children:t})]})]}),Vs=({items:e,triggerLabel:t="작업",triggerIconName:n=he.EllipsisVertical,position:r="right",className:s="",style:o,children:i,onItemClick:a,id:l,editorAttrs:c})=>{const[d,u]=v.useState(!1),[f,g]=v.useState({top:0,left:0}),m=v.useRef(null),p=v.useRef(null),y=v.useCallback(()=>{if(!m.current)return;const x=m.current.getBoundingClientRect(),M=224;let S=r==="right"?x.right-M:x.left;const k=x.bottom+8;S<8&&(S=8),S+M>window.innerWidth-8&&(S=window.innerWidth-M-8),g({top:k,left:S})},[r]);v.useEffect(()=>{d&&y()},[d,y]),v.useEffect(()=>{if(!d)return;const x=()=>{u(!1)};return window.addEventListener("scroll",x,!0),window.addEventListener("resize",x),()=>{window.removeEventListener("scroll",x,!0),window.removeEventListener("resize",x)}},[d]),v.useEffect(()=>{const x=M=>{const S=M.target,k=m.current?.contains(S),N=p.current?.contains(S);!k&&!N&&u(!1)};return d&&document.addEventListener("mousedown",x),()=>{document.removeEventListener("mousedown",x)}},[d]);const b=x=>{x.disabled||(x.onClick&&x.onClick(),a&&a(x.id,x),u(!1))},_=d?Vn.createPortal(h.jsx("div",{ref:p,className:"fixed z-[9999] w-56 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg overflow-hidden",style:{top:f.top,left:f.left},children:e.filter(x=>x.if!==!1).map(x=>{if(x.divider)return h.jsx("div",{className:"border-t border-gray-200 dark:border-gray-600 my-1"},x.id);const M=x.variant==="danger"?"text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20":"text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700",S=x.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer";return h.jsxs("div",{onClick:()=>b(x),className:`flex items-center gap-3 px-4 py-3 transition-colors ${M} ${S}`,children:[x.iconName&&h.jsx(ae,{name:x.iconName,className:"w-4 h-4"}),h.jsx("span",{className:"text-sm font-medium",children:x.label})]},x.id)})}),document.body):null;return h.jsxs(I,{className:`relative inline-block ${s}`,style:o,id:l,...c,children:[i?h.jsx(I,{ref:m,onClick:()=>u(!d),className:"cursor-pointer",children:i}):h.jsxs(le,{ref:m,onClick:()=>u(!d),className:"flex items-center gap-2 px-2 py-1 bg-transparent hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:[t&&h.jsx(J,{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:t}),n&&h.jsx(ae,{name:n,className:"w-4 h-4 text-gray-500 dark:text-gray-400"})]}),_]})},Jr=(e,t)=>window.G7Core?.t?.(e,t)??e,Ro=({currentPage:e,totalPages:t,onPageChange:n,maxVisiblePages:r=5,showFirstLast:s=!0,showFirst:o,showLast:i,hasMorePages:a,className:l="",style:c,prevText:d,nextText:u,id:f,editorAttrs:g})=>{const m=t!=null,p=m?t:0,y=m?e<p:a??!1,b=(o??s)&&m,_=(i??s)&&m,x=v.useMemo(()=>{const N=[];if(!m)return N;if(p<=r+2)for(let C=1;C<=p;C++)N.push(C);else{const C=Math.floor(r/2);let w=Math.max(2,e-C),E=Math.min(p-1,e+C);e<=C+1?E=r:e>=p-C&&(w=p-r+1),N.push(1),w>2&&N.push("...");for(let T=w;T<=E;T++)N.push(T);E<p-1&&N.push("..."),p>1&&N.push(p)}return N},[e,p,m,r]),M=N=>{N<1||N===e||m&&N>p||n(N)},S=()=>{e>1&&n(e-1)},k=()=>{y&&n(e+1)};return h.jsxs(I,{className:`pagination ${l}`,style:c,role:"navigation","aria-label":Jr("common.pagination"),id:f,...g,children:[b&&h.jsx(le,{onClick:()=>M(1),disabled:e===1,className:"pagination-btn","aria-label":Jr("common.first_page"),children:"«"}),h.jsx(le,{onClick:S,disabled:e===1,className:"pagination-btn","aria-label":Jr("common.prev_page"),children:d||h.jsx(h.Fragment,{children:"‹"})}),h.jsxs(I,{className:"pagination",children:[!m&&h.jsx(J,{className:"px-3 py-1 text-sm text-gray-700 dark:text-gray-300",children:e}),x.map((N,C)=>{if(N==="...")return h.jsx(J,{className:"pagination-ellipsis",children:"..."},`ellipsis-${C}`);const w=N,E=w===e;return h.jsx(le,{onClick:()=>M(w),className:E?"pagination-btn-active":"pagination-btn","aria-label":Jr("common.page_n",{n:w}),"aria-current":E?"page":void 0,children:w},w)})]}),h.jsx(le,{onClick:k,disabled:!y,className:"pagination-btn","aria-label":Jr("common.next_page"),children:u||h.jsx(h.Fragment,{children:"›"})}),_&&h.jsx(le,{onClick:()=>M(p),disabled:e===p,className:"pagination-btn","aria-label":Jr("common.last_page"),children:"»"})]})},lu=(e,t)=>window.G7Core?.t?.(e,t)??e,oy=()=>window.G7Core?.locale?.supported?.()??["ko","en"],iy=()=>window.G7Core?.locale?.current?.()??"ko",cu=e=>{const t=lu(`common.language_${e}`);return t===`common.language_${e}`?{ko:"한국어",en:"English",ja:"日本語",zh:"中文"}[e]||e.toUpperCase():t},ay=()=>oy().map(t=>({code:t,name:cu(t),nativeName:cu(t)})),fl=({value:e={},onChange:t,inputType:n="text",layout:r="inline",availableLocales:s,defaultLocale:o,placeholder:i="",required:a=!1,disabled:l=!1,maxLength:c,rows:d=4,className:u="",name:f="multilingual_input",showCodeOnMobile:g=!1,error:m,id:p,editorAttrs:y})=>{const b=!!m,_=v.useMemo(()=>s??ay(),[s]),x=v.useMemo(()=>o??iy(),[o]),M=v.useRef(e),[S,k]=v.useState(e),N=v.useRef(JSON.stringify(e));v.useEffect(()=>{const K=JSON.stringify(e);K!==N.current&&(N.current=K,M.current=e,k(e))},[e]);const C=v.useCallback((K,Q)=>{const ne={target:{name:f,value:K}};Q&&(ne._changedKeys=Q),t?.(ne)},[t,f]),[w,E]=v.useState(()=>{if(r==="tabs"||r==="compact"){const ne=_.map(ue=>ue.code);return[x,...ne.filter(ue=>ue!==x)]}const K=Object.keys(e).filter(ne=>e[ne]!==void 0);if(K.length===0)return[x];const Q=[];return K.includes(x)&&Q.push(x),K.forEach(ne=>{ne!==x&&Q.push(ne)}),Q}),[T,P]=v.useState(x),L=v.useMemo(()=>_.filter(K=>!w.includes(K.code)),[_,w]),[F,A]=v.useState(!1);v.useEffect(()=>{if(r==="tabs"||r==="compact"){const ue=_.map(de=>de.code),ee=[x,...ue.filter(de=>de!==x)],me=w.join(","),ie=ee.join(",");me!==ie&&E(ee);return}const K=Object.keys(e).filter(ue=>e[ue]!==void 0);if(K.length===0){E([x]);return}const Q=[];K.includes(x)&&Q.push(x),K.forEach(ue=>{ue!==x&&Q.push(ue)});const ne=w.join(","),se=Q.join(",");ne!==se&&E(Q)},[e,x,r,_]);const D=v.useCallback((K,Q)=>{const ne={...M.current,[K]:Q};M.current=ne,k(ne),C(ne,[K])},[C]),O=v.useCallback(K=>{E(ne=>[...ne,K]),P(K),A(!1);const Q={...M.current,[K]:""};M.current=Q,k(Q),C(Q)},[C]),z=v.useCallback(K=>{if(K===x)return;E(ne=>ne.filter(se=>se!==K)),T===K&&P(x);const Q={...M.current};delete Q[K],M.current=Q,k(Q),C(Q)},[T,x,C]),U=v.useCallback(K=>{const Q=_.find(ne=>ne.code===K);return Q?.nativeName||Q?.name||K.toUpperCase()},[_]),j=v.useCallback(K=>!!S[K]?.trim(),[S]),Y=v.useCallback(()=>L.length===0?null:h.jsxs(I,{className:"relative",children:[h.jsxs(le,{type:"button",className:"inline-flex items-center gap-1 px-3 py-1 text-xs font-medium text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/30 hover:bg-blue-100 dark:hover:bg-blue-900/50 rounded-full border border-dashed border-blue-300 dark:border-blue-600 transition-colors",onClick:()=>A(!F),disabled:l,children:[h.jsx(ae,{name:"plus",className:"w-3 h-3"}),h.jsx(J,{children:lu("common.add_language")})]}),F&&h.jsx(I,{className:"absolute top-full left-0 mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-10 min-w-[120px]",children:L.map(K=>h.jsxs(le,{type:"button",className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 first:rounded-t-lg last:rounded-b-lg transition-colors",onClick:()=>O(K.code),children:[h.jsx(ae,{name:"globe",className:"w-3.5 h-3.5 text-gray-400 dark:text-gray-500"}),h.jsx(J,{children:K.nativeName||K.name})]},K.code))})]}),[L,F,l,O]),B=v.useCallback((K,Q=!1)=>{const ne=b?"input input-error":"input",se=b?"textarea input-error":"textarea",ue=K===x,ee=`${i}${i?" (":""}${U(K)}${i?")":""}`;return h.jsxs(I,{className:"space-y-2",children:[h.jsxs(I,{className:"flex items-center gap-2",children:[h.jsxs(J,{className:`
|
||
inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-medium
|
||
${ue?"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300":"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300"}
|
||
`,children:[h.jsx(ae,{name:"globe",className:"w-3 h-3"}),U(K),ue&&h.jsx(J,{className:"text-red-500 dark:text-red-400",children:"*"}),!ue&&h.jsx(le,{type:"button",className:"ml-0.5 p-0.5 rounded-full hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",onClick:()=>z(K),disabled:l,children:h.jsx(ae,{name:"xmark",className:"w-3 h-3"})})]}),ue&&Q&&Y()]}),n==="textarea"?h.jsx(lr,{name:`${f}[${K}]`,value:S[K]||"",onChange:me=>D(K,me.target.value),placeholder:ee,required:a&&ue,disabled:l,maxLength:c,rows:d,className:`${se} resize-vertical`}):h.jsx(Et,{type:"text",name:`${f}[${K}]`,value:S[K]||"",onChange:me=>D(K,me.target.value),placeholder:ee,required:a&&ue,disabled:l,maxLength:c,className:ne})]},K)},[f,S,D,i,a,l,c,d,n,U,x,z,Y,b]),W=v.useCallback(K=>{const Q=b?"input input-error":"input",ne=b?"textarea input-error":"textarea",se=`${i}${i?" (":""}${U(K)}${i?")":""}`;return h.jsx(I,{children:n==="textarea"?h.jsx(lr,{name:`${f}[${K}]`,value:S[K]||"",onChange:ue=>D(K,ue.target.value),placeholder:se,required:a&&K===x,disabled:l,maxLength:c,rows:d,className:`${ne} resize-vertical`}):h.jsx(Et,{type:"text",name:`${f}[${K}]`,value:S[K]||"",onChange:ue=>D(K,ue.target.value),placeholder:se,required:a&&K===x,disabled:l,maxLength:c,className:Q})},K)},[f,S,D,i,a,l,c,d,n,x,U,b]),G=()=>h.jsx(I,{className:u,children:h.jsx(I,{className:"space-y-4",children:w.map((K,Q)=>B(K,Q===0))})}),V=()=>h.jsxs(I,{className:u,children:[h.jsxs(I,{className:"flex flex-wrap items-center gap-2 mb-3",children:[w.map(K=>h.jsxs(le,{type:"button",className:`
|
||
inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-semibold transition-all
|
||
${T===K?K===x?"bg-blue-500 text-white dark:bg-blue-600 dark:text-white shadow-md scale-105":"bg-gray-500 text-white dark:bg-gray-600 dark:text-white shadow-md scale-105":K===x?"bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400 hover:bg-blue-100 dark:hover:bg-blue-900/50":"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"}
|
||
`,onClick:()=>P(K),children:[h.jsx(ae,{name:"globe",className:"w-3 h-3"}),g?h.jsxs(h.Fragment,{children:[h.jsx(J,{className:"hidden md:inline",children:U(K)}),h.jsx(J,{className:"inline md:hidden",children:K.toUpperCase()})]}):U(K),K===x&&h.jsx(J,{className:"text-red-500 dark:text-red-400",children:"*"}),j(K)&&T!==K&&h.jsx(ae,{name:"check",className:"w-3 h-3 text-green-500 dark:text-green-400"}),K!==x&&h.jsx(le,{type:"button",className:"ml-0.5 p-0.5 rounded-full hover:bg-gray-300 dark:hover:bg-gray-500 transition-colors",onClick:Q=>{Q.stopPropagation(),z(K)},disabled:l,children:h.jsx(ae,{name:"xmark",className:"w-3 h-3"})})]},K)),Y()]}),w.map(K=>h.jsx(I,{className:T===K?"block":"hidden",children:W(K)},K))]}),X=()=>{const K=b?"input input-error":"input",Q=b?"textarea input-error":"textarea";return h.jsx(I,{className:u,children:h.jsxs(I,{className:"flex items-center gap-1",children:[h.jsx(I,{className:"flex items-center shrink-0",children:w.map(ne=>h.jsxs(le,{type:"button",className:`
|
||
px-2 py-1.5 text-xs font-medium border-y border-l first:rounded-l last:rounded-r last:border-r transition-colors
|
||
${T===ne?"bg-blue-500 text-white border-blue-500 dark:bg-blue-600 dark:border-blue-600":"bg-white text-gray-600 border-gray-200 hover:bg-gray-50 dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 dark:hover:bg-gray-700"}
|
||
`,onClick:()=>P(ne),title:U(ne),children:[ne.toUpperCase(),ne===x&&h.jsx(J,{className:"text-red-400 ml-0.5",children:"*"})]},ne))}),h.jsx(I,{className:"flex-1 min-w-0",children:n==="textarea"?h.jsx(lr,{name:`${f}[${T}]`,value:S[T]||"",onChange:ne=>D(T,ne.target.value),placeholder:i,required:a&&T===x,disabled:l,maxLength:c,rows:d,className:Q}):h.jsx(Et,{type:"text",name:`${f}[${T}]`,value:S[T]||"",onChange:ne=>D(T,ne.target.value),placeholder:i,required:a&&T===x,disabled:l,maxLength:c,className:K})})]})})};return h.jsxs(I,{className:l?"opacity-50 cursor-not-allowed":void 0,id:p,...y,children:[r==="compact"?X():r==="tabs"?V():G(),b&&m&&h.jsx(J,{className:"text-xs text-red-500 dark:text-red-400 mt-1 block",children:m})]})};fl.displayName="MultilingualInput";const ly=()=>window.G7Core,hl=({checked:e,value:t,onChange:n,disabled:r=!1,label:s,description:o,size:i="md",className:a="",name:l,id:c,editorAttrs:d})=>{const[u,f]=v.useState(()=>e??t??!1);v.useEffect(()=>{f(e??t??!1)},[e,t]);const g=_=>{const x=_.target.checked;f(x),n&&!r&&n(_)},p={sm:{track:"w-9 h-5",thumb:"after:h-4 after:w-4"},md:{track:"w-11 h-6",thumb:"after:h-5 after:w-5"},lg:{track:"w-14 h-7",thumb:"after:h-6 after:w-6"}}[i],y=()=>{if(!r){const _=!u;if(f(_),n){const x=ly();x?.createChangeEvent&&n(x.createChangeEvent({checked:_,name:l}))}}},b=_=>{r||_.key!==" "&&_.key!=="Enter"&&_.key!=="Spacebar"||(_.preventDefault(),y())};return h.jsxs("div",{className:`toggle-container ${a}`,id:c,...d,children:[h.jsxs("div",{className:`toggle-switch-wrapper ${r?"cursor-not-allowed opacity-50":"cursor-pointer"}`,role:"switch","aria-checked":u,"aria-disabled":r||void 0,"aria-label":s??l,tabIndex:r?-1:0,onKeyDown:b,onClick:_=>{_.preventDefault(),_.stopPropagation(),y()},children:[h.jsx("input",{type:"checkbox",id:l,name:l,checked:u,onChange:g,disabled:r,className:"sr-only peer",tabIndex:-1}),h.jsx("div",{className:`toggle-switch-track ${p.track} ${p.thumb}`})]}),s&&h.jsx("span",{className:`toggle-label ${r?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,onClick:y,children:s}),o&&h.jsx("p",{className:"toggle-description",children:o})]})},ei=({status:e,label:t,showIcon:n=!0,iconName:r,className:s="",style:o,id:i,editorAttrs:a})=>{const l={success:"bg-green-50 dark:bg-green-900/20 text-green-700 dark:text-green-400 border-green-200 dark:border-green-800",warning:"bg-yellow-50 dark:bg-yellow-900/20 text-yellow-700 dark:text-yellow-400 border-yellow-200 dark:border-yellow-800",error:"bg-red-50 dark:bg-red-900/20 text-red-700 dark:text-red-400 border-red-200 dark:border-red-800",info:"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-400 border-blue-200 dark:border-blue-800",pending:"bg-gray-50 dark:bg-gray-700 text-gray-700 dark:text-gray-300 border-gray-200 dark:border-gray-600",default:"bg-gray-50 dark:bg-gray-700 text-gray-600 dark:text-gray-400 border-gray-200 dark:border-gray-600"},c={success:he.CheckCircle,warning:he.ExclamationTriangle,error:he.XCircle,info:he.InfoCircle,pending:he.Clock,default:he.QuestionCircle},d={success:"성공",warning:"경고",error:"오류",info:"정보",pending:"대기 중",default:"기본"},u=r||c[e],f=t||d[e],g=l[e];return h.jsxs(J,{className:`inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-medium border ${g} ${s}`,style:o,id:i,...a,children:[n&&h.jsx(ae,{name:u,className:"w-4 h-4"}),h.jsx(J,{children:f})]})},du={blue:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",green:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300",red:"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300",gray:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300",yellow:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-300",purple:"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-300",orange:"bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-300",teal:"bg-teal-100 text-teal-800 dark:bg-teal-900/30 dark:text-teal-300",cyan:"bg-cyan-100 text-cyan-800 dark:bg-cyan-900/30 dark:text-cyan-300"},cy={success:"green",warning:"yellow",danger:"red",error:"red",info:"blue",primary:"blue",secondary:"gray",text:"gray",default:"gray"},uu={sm:"px-1.5 py-0.5 text-[10px]",md:"px-2 py-0.5 text-xs",lg:"px-2.5 py-1 text-sm"},fu=({color:e,variant:t,text:n,size:r="md",className:s="",style:o,children:i,id:a,editorAttrs:l})=>{const c=e||(t?cy[t]:void 0)||"gray",d=du[c]||du.gray,u=uu[r]||uu.md;return h.jsxs(J,{className:`inline-flex items-center rounded-full font-medium ${u} ${d} ${s}`,style:o,id:a,...l,children:[n,i]})};/*! @license DOMPurify 3.4.14 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.14/LICENSE */function hu(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function dy(e){if(Array.isArray(e))return e}function uy(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,o,i,a=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(d){c=!0,s=d}finally{try{if(!l&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw s}}return a}}function fy(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hy(e,t){return dy(e)||uy(e,t)||gy(e,t)||fy()}function gy(e,t){if(e){if(typeof e=="string")return hu(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hu(e,t):void 0}}const gu=Object.entries,pu=Object.setPrototypeOf,py=Object.isFrozen,my=Object.getPrototypeOf,by=Object.getOwnPropertyDescriptor;let Tt=Object.freeze,Pt=Object.seal,Rr=Object.create,mu=typeof Reflect<"u"&&Reflect,gl=mu.apply,pl=mu.construct;Tt||(Tt=function(t){return t}),Pt||(Pt=function(t){return t}),gl||(gl=function(t,n){for(var r=arguments.length,s=new Array(r>2?r-2:0),o=2;o<r;o++)s[o-2]=arguments[o];return t.apply(n,s)}),pl||(pl=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return new t(...r)});const _r=Mt(Array.prototype.forEach),yy=Mt(Array.prototype.lastIndexOf),bu=Mt(Array.prototype.pop),Hs=Mt(Array.prototype.push),vy=Mt(Array.prototype.splice),es=Array.isArray,Us=Mt(String.prototype.toLowerCase),ml=Mt(String.prototype.toString),yu=Mt(String.prototype.match),Bs=Mt(String.prototype.replace),vu=Mt(String.prototype.indexOf),xy=Mt(String.prototype.trim),wy=Mt(Number.prototype.toString),ky=Mt(Boolean.prototype.toString),xu=typeof BigInt>"u"?null:Mt(BigInt.prototype.toString),wu=typeof Symbol>"u"?null:Mt(Symbol.prototype.toString),sn=Mt(Object.prototype.hasOwnProperty),js=Mt(Object.prototype.toString),Kt=Mt(RegExp.prototype.test),Er=Cy(TypeError);function Mt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return gl(e,t,r)}}function Cy(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return pl(e,n)}}function Ze(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Us;if(pu&&pu(e,null),!es(t))return e;let r=t.length;for(;r--;){let s=t[r];if(typeof s=="string"){const o=n(s);o!==s&&(py(t)||(t[r]=o),s=o)}e[s]=!0}return e}function Sy(e){for(let t=0;t<e.length;t++)sn(e,t)||(e[t]=null);return e}function pn(e){const t=Rr(null);for(const r of gu(e)){var n=hy(r,2);const s=n[0],o=n[1];sn(e,s)&&(es(o)?t[s]=Sy(o):o&&typeof o=="object"&&o.constructor===Object?t[s]=pn(o):t[s]=o)}return t}function _y(e){switch(typeof e){case"string":return e;case"number":return wy(e);case"boolean":return ky(e);case"bigint":return xu?xu(e):"0";case"symbol":return wu?wu(e):"Symbol()";case"undefined":return js(e);case"function":case"object":{if(e===null)return js(e);const t=e,n=Tn(t,"toString");if(typeof n=="function"){const r=n(t);return typeof r=="string"?r:js(r)}return js(e)}default:return js(e)}}function Tn(e,t){for(;e!==null;){const r=by(e,t);if(r){if(r.get)return Mt(r.get);if(typeof r.value=="function")return Mt(r.value)}e=my(e)}function n(){return null}return n}function Ey(e){try{return Kt(e,""),!0}catch{return!1}}const ku=Tt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),bl=Tt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),yl=Tt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),My=Tt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),vl=Tt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ny=Tt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Cu=Tt(["#text"]),Su=Tt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),xl=Tt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),_u=Tt(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ti=Tt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Oy=Pt(/{{[\w\W]*|^[\w\W]*}}/g),Ty=Pt(/<%[\w\W]*|^[\w\W]*%>/g),Ay=Pt(/\${[\w\W]*/g),Dy=Pt(/^data-[\-\w.\u00B7-\uFFFF]+$/),Iy=Pt(/^aria-[\-\w]+$/),Eu=Pt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ly=Pt(/^(?:\w+script|data):/i),Py=Pt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),$y=Pt(/^html$/i),Fy=Pt(/^[a-z][.\w]*(-[.\w]+)+$/i),Mu=Pt(/<[/\w!]/g),Nu=Pt(/<[/\w]/g),zy=Pt(/<\/no(script|embed|frames)/i),Vy=Pt(/\/>/i),mn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ou=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],Hy=Tt(Ze({},Ou)),Uy=(function(){const e={};return _r(Ou,t=>{e[t]=Pt(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),Tt(e)})(),By=function(){return typeof window>"u"?null:window},jy=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const s="data-tt-policy-suffix";n&&n.hasAttribute(s)&&(r=n.getAttribute(s));const o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML(i){return i},createScriptURL(i){return i}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},Tu=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ur=function(t,n,r,s){return sn(t,n)&&es(t[n])?Ze(s.base?pn(s.base):{},t[n],s.transform):r},wl=function(t,n,r){const s=sn(t,n)?t[n]:void 0;return s&&typeof s=="object"?pn(s):r()};function Au(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:By();const t=ce=>Au(ce);if(t.version="3.4.14",t.removed=[],!e||!e.document||e.document.nodeType!==mn.document||!e.Element)return t.isSupported=!1,t;let n=e.document;const r=n,s=r.currentScript;e.DocumentFragment;const o=e.HTMLTemplateElement,i=e.Node,a=e.Element,l=e.NodeFilter,c=e.NamedNodeMap;c===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const d=e.DOMParser,u=e.trustedTypes,f=a.prototype,g=Tn(f,"cloneNode"),m=Tn(f,"remove"),p=Tn(f,"nextSibling"),y=Tn(f,"childNodes"),b=Tn(f,"parentNode"),_=Tn(f,"shadowRoot"),x=Tn(f,"attributes"),M=i&&i.prototype?Tn(i.prototype,"nodeType"):null,S=i&&i.prototype?Tn(i.prototype,"nodeName"):null,k=i&&i.prototype?Tn(i.prototype,"ownerDocument"):null,N=function(H){return M?M(H):H.nodeType},C=function(H){return S?S(H):H.nodeName};if(typeof o=="function"){const ce=n.createElement("template");ce.content&&ce.content.ownerDocument&&(n=ce.content.ownerDocument)}let w,E="",T,P=!1,L=0;const F=function(){if(L>0)throw Er('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},A=function(H){F(),L++;try{return w.createHTML(H)}finally{L--}},D=function(H){F(),L++;try{return w.createScriptURL(H)}finally{L--}},O=function(){return P||(T=jy(u,s),P=!0),T},z=n,U=z.implementation,j=z.createNodeIterator,Y=z.createDocumentFragment,B=z.getElementsByTagName,W=r.importNode;let G=Tu();t.isSupported=typeof gu=="function"&&typeof b=="function"&&U&&U.createHTMLDocument!==void 0;const V=Oy,X=Ty,K=Ay,Q=Dy,ne=Iy,se=Ly,ue=Py,ee=Fy;let me=Eu,ie=null;const de=Ze({},[...ku,...bl,...yl,...vl,...Cu]);let fe=null;const be=Ze({},[...Su,...xl,..._u,...ti]);let ge=Object.seal(Rr(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ce=null,je=null;const oe=Object.seal(Rr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Te=!0,Pe=!0,Fe=!1,Ke=!0,nt=!1,dt=!0,We=!1,pt=!1,Ge=null,te=null,pe=!1,we=!1,xe=!1,ke=!1,Be=!0,Le=!1;const ze="user-content-";let Ie=!0,qe=!1,Re={},Ne=null;const Oe=Ze({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Ue=null;const lt=Ze({},["audio","video","img","source","image","track"]);let vt=null;const ut=Ze({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ot="http://www.w3.org/1998/Math/MathML",St="http://www.w3.org/2000/svg",et="http://www.w3.org/1999/xhtml";let Lt=et,Ut=!1,Gt=null;const Yt=Ze({},[ot,St,et],ml),Mn=Tt(["mi","mo","mn","ms","mtext"]);let Bt=Ze({},Mn);const tt=Tt(["annotation-xml"]);let zn=Ze({},tt);const Xo=Ze({},["title","style","font","a","script"]);let Sr=null;const qa=["application/xhtml+xml","text/html"],Jd="text/html";let xt=null,ar=null;const Za=n.createElement("form"),qo=function(H){return H instanceof RegExp||H instanceof Function},Fs=function(){let H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ar&&ar===H)return;(!H||typeof H!="object")&&(H={}),H=pn(H),Sr=qa.indexOf(H.PARSER_MEDIA_TYPE)===-1?Jd:H.PARSER_MEDIA_TYPE,xt=Sr==="application/xhtml+xml"?ml:Us,ie=ur(H,"ALLOWED_TAGS",de,{transform:xt}),fe=ur(H,"ALLOWED_ATTR",be,{transform:xt}),Gt=ur(H,"ALLOWED_NAMESPACES",Yt,{transform:ml}),vt=ur(H,"ADD_URI_SAFE_ATTR",ut,{transform:xt,base:ut}),Ue=ur(H,"ADD_DATA_URI_TAGS",lt,{transform:xt,base:lt}),Ne=ur(H,"FORBID_CONTENTS",Oe,{transform:xt}),Ce=ur(H,"FORBID_TAGS",pn({}),{transform:xt}),je=ur(H,"FORBID_ATTR",pn({}),{transform:xt}),Re=sn(H,"USE_PROFILES")?H.USE_PROFILES&&typeof H.USE_PROFILES=="object"?pn(H.USE_PROFILES):H.USE_PROFILES:!1,Te=H.ALLOW_ARIA_ATTR!==!1,Pe=H.ALLOW_DATA_ATTR!==!1,Fe=H.ALLOW_UNKNOWN_PROTOCOLS||!1,Ke=H.ALLOW_SELF_CLOSE_IN_ATTR!==!1,nt=H.SAFE_FOR_TEMPLATES||!1,dt=H.SAFE_FOR_XML!==!1,We=H.WHOLE_DOCUMENT||!1,we=H.RETURN_DOM||!1,xe=H.RETURN_DOM_FRAGMENT||!1,ke=H.RETURN_TRUSTED_TYPE||!1,pe=H.FORCE_BODY||!1,Be=H.SANITIZE_DOM!==!1,Le=H.SANITIZE_NAMED_PROPS||!1,Ie=H.KEEP_CONTENT!==!1,qe=H.IN_PLACE||!1,me=Ey(H.ALLOWED_URI_REGEXP)?H.ALLOWED_URI_REGEXP:Eu,Lt=typeof H.NAMESPACE=="string"?H.NAMESPACE:et,Bt=wl(H,"MATHML_TEXT_INTEGRATION_POINTS",()=>Ze({},Mn)),zn=wl(H,"HTML_INTEGRATION_POINTS",()=>Ze({},tt));const q=wl(H,"CUSTOM_ELEMENT_HANDLING",()=>Rr(null));if(ge=Rr(null),sn(q,"tagNameCheck")&&qo(q.tagNameCheck)&&(ge.tagNameCheck=q.tagNameCheck),sn(q,"attributeNameCheck")&&qo(q.attributeNameCheck)&&(ge.attributeNameCheck=q.attributeNameCheck),sn(q,"allowCustomizedBuiltInElements")&&typeof q.allowCustomizedBuiltInElements=="boolean"&&(ge.allowCustomizedBuiltInElements=q.allowCustomizedBuiltInElements),Pt(ge),nt&&(Pe=!1),xe&&(we=!0),Re&&(ie=Ze({},Cu),fe=Rr(null),Re.html===!0&&(Ze(ie,ku),Ze(fe,Su)),Re.svg===!0&&(Ze(ie,bl),Ze(fe,xl),Ze(fe,ti)),Re.svgFilters===!0&&(Ze(ie,yl),Ze(fe,xl),Ze(fe,ti)),Re.mathMl===!0&&(Ze(ie,vl),Ze(fe,_u),Ze(fe,ti))),oe.tagCheck=null,oe.attributeCheck=null,sn(H,"ADD_TAGS")&&(typeof H.ADD_TAGS=="function"?oe.tagCheck=H.ADD_TAGS:es(H.ADD_TAGS)&&(ie===de&&(ie=pn(ie)),Ze(ie,H.ADD_TAGS,xt))),sn(H,"ADD_ATTR")&&(typeof H.ADD_ATTR=="function"?oe.attributeCheck=H.ADD_ATTR:es(H.ADD_ATTR)&&(fe===be&&(fe=pn(fe)),Ze(fe,H.ADD_ATTR,xt))),sn(H,"ADD_FORBID_CONTENTS")&&es(H.ADD_FORBID_CONTENTS)&&(Ne===Oe&&(Ne=pn(Ne)),Ze(Ne,H.ADD_FORBID_CONTENTS,xt)),Ie&&(ie["#text"]=!0),We&&Ze(ie,["html","head","body"]),ie.table&&(Ze(ie,["tbody"]),delete Ce.tbody),H.TRUSTED_TYPES_POLICY){if(typeof H.TRUSTED_TYPES_POLICY.createHTML!="function")throw Er('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof H.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Er('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const re=w;w=H.TRUSTED_TYPES_POLICY;try{E=A("")}catch(ve){throw w=re,ve}}else H.TRUSTED_TYPES_POLICY===null?(w=void 0,E=""):(w===void 0&&(w=O()),w&&typeof E=="string"&&(E=A("")));Tt&&Tt(H),ar=H},Kr=Ze({},[...bl,...yl,...My]),Zo=Ze({},[...vl,...Ny]),Qa=function(H,q,re){return q.namespaceURI===et?H==="svg":q.namespaceURI===ot?H==="svg"&&(re==="annotation-xml"||Bt[re]):!!Kr[H]},Ja=function(H,q,re){return q.namespaceURI===et?H==="math":q.namespaceURI===St?H==="math"&&zn[re]:!!Zo[H]},Rd=function(H,q,re){return q.namespaceURI===St&&!zn[re]||q.namespaceURI===ot&&!Bt[re]?!1:!Zo[H]&&(Xo[H]||!Kr[H])},eu=function(H){let q=b(H);(!q||!q.tagName)&&(q={namespaceURI:Lt,tagName:"template"});const re=Us(H.tagName),ve=Us(q.tagName);return Gt[H.namespaceURI]?H.namespaceURI===St?Qa(re,q,ve):H.namespaceURI===ot?Ja(re,q,ve):H.namespaceURI===et?Rd(re,q,ve):!!(Sr==="application/xhtml+xml"&&Gt[H.namespaceURI]):!1},Zn=function(H){Hs(t.removed,{element:H});try{b(H).removeChild(H)}catch{if(m(H),!b(H))throw Er("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Z=function(H,q,re){try{H.removeAttributeNode(q)}catch{try{H.removeAttribute(re)}catch{}}},ye=function(H){Ve(H);const q=y(H);if(q){const ve=[];_r(q,Se=>{Hs(ve,Se)}),_r(ve,Se=>{try{m(Se)}catch{}})}const re=x(H);if(re)for(let ve=re.length-1;ve>=0;--ve){const Se=re[ve],He=Se&&Se.name;typeof He=="string"&&Z(H,Se,He)}},_e=function(H,q,re){if(!re)try{re=q.getAttributeNode(H)}catch{re=null}Hs(t.removed,{attribute:re||null,from:q});try{re?q.removeAttributeNode(re):q.removeAttribute(H)}catch{try{q.removeAttribute(H)}catch{}}if(H==="is")if(we||xe)try{Zn(q)}catch{}else try{q.setAttribute(H,"")}catch{}},ct=function(H){const q=x(H);if(q)for(let re=q.length-1;re>=0;--re){const ve=q[re],Se=ve&&ve.name;typeof Se!="string"||fe[xt(Se)]||Z(H,ve,Se)}},Ve=function(H){const q=[H];for(;q.length>0;){const re=q.pop();N(re)===mn.element&&ct(re);const Se=y(re);if(Se)for(let He=Se.length-1;He>=0;--He)q.push(Se[He])}},Ra=function(H,q){return dt?H==="patchsrc"?!0:H==="for"&&q!=="label"&&q!=="output":!1},KA=function(H){if(!dt)return;const q=[H];for(;q.length>0;){const re=q.pop(),ve=N(re);if(ve===mn.processingInstruction||ve===mn.comment&&Kt(Nu,re.data)){try{m(re)}catch{}continue}if(ve===mn.element){const He=re,mt=xt(C(re));try{He.hasAttribute&&He.hasAttribute("patchsrc")&&He.removeAttribute("patchsrc"),He.hasAttribute&&He.hasAttribute("for")&&Ra("for",mt)&&He.removeAttribute("for")}catch{}}const Se=y(re);if(Se)for(let He=Se.length-1;He>=0;--He)q.push(Se[He])}},Pb=function(H){let q=null,re=null;if(pe)H="<remove></remove>"+H;else{const He=yu(H,/^[\r\n\t ]+/);re=He&&He[0]}Sr==="application/xhtml+xml"&&Lt===et&&(H='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+H+"</body></html>");const ve=w?A(H):H;if(Lt===et)try{q=new d().parseFromString(ve,Sr)}catch{}if(!q||!q.documentElement){q=U.createDocument(Lt,"template",null);try{q.documentElement.innerHTML=Ut?E:ve}catch{}}const Se=q.body||q.documentElement;return H&&re&&Se.insertBefore(n.createTextNode(re),Se.childNodes[0]||null),Lt===et?B.call(q,We?"html":"body")[0]:We?q.documentElement:Se},$b=function(H){const q=k?k(H):H.ownerDocument;return j.call(q||H,H,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},el=function(H){return H=Bs(H,V," "),H=Bs(H,X," "),H=Bs(H,K," "),H},tu=function(H){var q;H.normalize();const re=k?k(H):H.ownerDocument,ve=j.call(re||H,H,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let Se=ve.nextNode();for(;Se;)Se.data=el(Se.data),Se=ve.nextNode();const He=(q=H.querySelectorAll)===null||q===void 0?void 0:q.call(H,"template");He&&_r(He,mt=>{zs(mt.content)&&tu(mt.content)})},tl=function(H){const q=S?S(H):null;return typeof q!="string"||xt(q)!=="form"?!1:typeof H.nodeName!="string"||typeof H.textContent!="string"||typeof H.removeChild!="function"||H.attributes!==x(H)||typeof H.removeAttribute!="function"||typeof H.setAttribute!="function"||typeof H.namespaceURI!="string"||typeof H.insertBefore!="function"||typeof H.hasChildNodes!="function"||H.nodeType!==M(H)||H.childNodes!==y(H)},zs=function(H){if(!M||typeof H!="object"||H===null)return!1;try{return M(H)===mn.documentFragment}catch{return!1}},Qo=function(H){if(!M||typeof H!="object"||H===null)return!1;try{return typeof M(H)=="number"}catch{return!1}};function Qn(ce,H,q){ce.length!==0&&_r(ce,re=>{re.call(t,H,q,ar)})}const XA=function(H,q){return!!(dt&&H.hasChildNodes()&&!Qo(H.firstElementChild)&&Kt(Mu,H.textContent)&&Kt(Mu,H.innerHTML)||dt&&H.namespaceURI===et&&Hy[q]&&(Qo(H.firstElementChild)||typeof H.textContent=="string"&&Kt(Uy[q],H.textContent))||H.nodeType===mn.processingInstruction||dt&&H.nodeType===mn.comment&&Kt(Nu,H.data))},nl=function(H,q){if(H instanceof RegExp)return Kt(H,q);if(H instanceof Function){for(var re=arguments.length,ve=new Array(re>2?re-2:0),Se=2;Se<re;Se++)ve[Se-2]=arguments[Se];return!!H(q,...ve)}return!1},qA=function(H,q,re){if(!Ce[q]&&Ub(q)&&nl(ge.tagNameCheck,q))return!1;if(Ie&&!Ne[q]){const ve=b(H),Se=y(H);if(Se&&ve){const He=Se.length;for(let mt=He-1;mt>=0;--mt){const wt=H===re?g(Se[mt],!0):Se[mt];ve.insertBefore(wt,p(H))}}}return Zn(H),!0},Fb=function(H,q,re,ve){return H.length===0?q:q===re||q===ve?pn(q):q},zb=function(H,q){return H===q||b(H)!==null?!1:(qe&&Ve(H),!0)},Vb=function(H,q){if(Qn(G.beforeSanitizeElements,H,null),zb(H,q))return!0;if(tl(H))return Zn(H),!0;const re=xt(C(H));if(ie=Fb(G.uponSanitizeElement,ie,de,Ge),Qn(G.uponSanitizeElement,H,{tagName:re,allowedTags:ie}),zb(H,q))return!0;if(XA(H,re))return Zn(H),!0;if(Ce[re]||!(oe.tagCheck instanceof Function&&oe.tagCheck(re))&&!ie[re]){const Se=qA(H,re,q);return Se===!1&&Qn(G.afterSanitizeElements,H,null),Se}if(N(H)===mn.element&&!eu(H)||(re==="noscript"||re==="noembed"||re==="noframes")&&Kt(zy,H.innerHTML))return Zn(H),!0;if(nt&&H.nodeType===mn.text){const Se=el(H.textContent);H.textContent!==Se&&(Hs(t.removed,{element:H.cloneNode()}),H.textContent=Se)}return Qn(G.afterSanitizeElements,H,null),!1},Hb=function(H,q,re){if(je[q]||Ra(q,H)||Be&&(q==="id"||q==="name")&&(re in n||re in Za))return!1;const ve=fe[q]||oe.attributeCheck instanceof Function&&oe.attributeCheck(q,H);return Pe&&Kt(Q,q)||Te&&Kt(ne,q)?!0:ve?vt[q]||Kt(me,Bs(re,ue,""))||(q==="src"||q==="xlink:href"||q==="href")&&H!=="script"&&vu(re,"data:")===0&&Ue[H]||Fe&&!Kt(se,Bs(re,ue,""))?!0:!re:Ub(H)&&nl(ge.tagNameCheck,H)&&nl(ge.attributeNameCheck,q,H)||q==="is"&&ge.allowCustomizedBuiltInElements&&nl(ge.tagNameCheck,re)},ZA=Ze({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ub=function(H){return!ZA[Us(H)]&&Kt(ee,H)},QA=function(H,q,re,ve){if(w&&typeof u=="object"&&typeof u.getAttributeType=="function"&&!re)switch(u.getAttributeType(H,q)){case"TrustedHTML":return A(ve);case"TrustedScriptURL":return D(ve)}return ve},JA=function(H,q,re,ve){try{re?H.setAttributeNS(re,q,ve):H.setAttribute(q,ve),tl(H)?Zn(H):bu(t.removed)}catch{_e(q,H)}},Bb=function(H){Qn(G.beforeSanitizeAttributes,H,null);const q=H.attributes;if(!q||tl(H))return;fe=Fb(G.uponSanitizeAttribute,fe,be,te);const re={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:fe,forceKeepAttr:void 0};let ve=q.length;const Se=xt(H.nodeName);for(;ve--;){const He=q[ve],mt=He.name,wt=He.namespaceURI,fn=He.value,hn=xt(mt),ru=fn;let nn=mt==="value"?ru:xy(ru);if(re.attrName=hn,re.attrValue=nn,re.keepAttr=!0,re.forceKeepAttr=void 0,Qn(G.uponSanitizeAttribute,H,re),nn=re.attrValue,Le&&(hn==="id"||hn==="name")&&vu(nn,ze)!==0&&(_e(mt,H,He),nn=ze+nn),dt&&Kt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,nn)){_e(mt,H,He);continue}if(hn==="attributename"&&yu(nn,"href")){_e(mt,H,He);continue}if(!re.forceKeepAttr){if(!re.keepAttr){_e(mt,H,He);continue}if(!Ke&&Kt(Vy,nn)){_e(mt,H,He);continue}if(nt&&(nn=el(nn)),!Hb(Se,hn,nn)){_e(mt,H,He);continue}nn=QA(Se,hn,wt,nn),nn!==ru&&JA(H,mt,wt,nn)}}Qn(G.afterSanitizeAttributes,H,null)},rl=function(H){let q=null;const re=$b(H);for(Qn(G.beforeSanitizeShadowDOM,H,null);q=re.nextNode();)if(Qn(G.uponSanitizeShadowNode,q,null),Vb(q,H),Bb(q),zs(q.content)&&rl(q.content),N(q)===mn.element){const ve=_(q);zs(ve)&&(nu(ve),rl(ve))}Qn(G.afterSanitizeShadowDOM,H,null)},nu=function(H){const q=[{node:H,shadow:null}];for(;q.length>0;){const re=q.pop();if(re.shadow){rl(re.shadow);continue}const ve=re.node,He=N(ve)===mn.element,mt=y(ve);if(mt)for(let wt=mt.length-1;wt>=0;--wt)q.push({node:mt[wt],shadow:null});if(He){const wt=S?S(ve):null;if(typeof wt=="string"&&xt(wt)==="template"){const fn=ve.content;zs(fn)&&q.push({node:fn,shadow:null})}}if(He){const wt=_(ve);zs(wt)&&q.push({node:null,shadow:wt},{node:wt,shadow:null})}}};return t.sanitize=function(ce){let H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},q=null,re=null,ve=null,Se=null;if(Ut=!ce,Ut&&(ce="<!-->"),typeof ce!="string"&&!Qo(ce)&&(ce=_y(ce),typeof ce!="string"))throw Er("dirty is not a string, aborting");if(!t.isSupported)return ce;pt?(ie=Ge,fe=te):Fs(H),(G.uponSanitizeElement.length>0||G.uponSanitizeAttribute.length>0)&&(ie=pn(ie)),G.uponSanitizeAttribute.length>0&&(fe=pn(fe)),t.removed=[];const He=qe&&typeof ce!="string"&&Qo(ce);if(He){KA(ce);const fn=C(ce);if(typeof fn=="string"){const hn=xt(fn);if(!ie[hn]||Ce[hn])throw ye(ce),Er("root node is forbidden and cannot be sanitized in-place")}if(tl(ce))throw ye(ce),Er("root node is clobbered and cannot be sanitized in-place");try{nu(ce)}catch(hn){throw ye(ce),hn}}else if(Qo(ce))q=Pb("<!---->"),re=q.ownerDocument.importNode(ce,!0),re.nodeType===mn.element&&re.nodeName==="BODY"||re.nodeName==="HTML"?q=re:q.appendChild(re),nu(re);else{if(!we&&!nt&&!We&&ce.indexOf("<")===-1)return w&&ke?A(ce):ce;if(q=Pb(ce),!q)return we?null:ke?E:""}q&&pe&&Zn(q.firstChild);const mt=He?ce:q;try{const fn=$b(mt);for(;ve=fn.nextNode();)Vb(ve,mt),Bb(ve),zs(ve.content)&&rl(ve.content)}catch(fn){throw He&&(ye(ce),_r(t.removed,hn=>{hn.element&&Ve(hn.element)})),fn}if(He)return _r(t.removed,fn=>{fn.element&&Ve(fn.element)}),nt&&tu(ce),ce;if(we){if(nt&&tu(q),xe)for(Se=Y.call(q.ownerDocument);q.firstChild;)Se.appendChild(q.firstChild);else Se=q;return(fe.shadowroot||fe.shadowrootmode)&&(Se=W.call(r,Se,!0)),Se}let wt=We?q.outerHTML:q.innerHTML;return We&&ie["!doctype"]&&q.ownerDocument&&q.ownerDocument.doctype&&q.ownerDocument.doctype.name&&Kt($y,q.ownerDocument.doctype.name)&&(wt="<!DOCTYPE "+q.ownerDocument.doctype.name+`>
|
||
`+wt),nt&&(wt=el(wt)),w&&ke?A(wt):wt},t.setConfig=function(){let ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Fs(ce),pt=!0,Ge=ie,te=fe},t.clearConfig=function(){ar=null,pt=!1,Ge=null,te=null,w=T,E=""},t.isValidAttribute=function(ce,H,q){ar||Fs({});const re=xt(ce),ve=xt(H);return Hb(re,ve,q)},t.addHook=function(ce,H){typeof H=="function"&&sn(G,ce)&&Hs(G[ce],H)},t.removeHook=function(ce,H){if(sn(G,ce)){if(H!==void 0){const q=yy(G[ce],H);return q===-1?void 0:vy(G[ce],q,1)[0]}return bu(G[ce])}},t.removeHooks=function(ce){sn(G,ce)&&(G[ce]=[])},t.removeAllHooks=function(){G=Tu()},t}var Wy=Au();const kl=({content:e,text:t,isHtml:n=!0,className:r="",purifyConfig:s,id:o,editorAttrs:i})=>{const a=t??e??"";if(!a||a.trim()==="")return null;if(!n){const u=`
|
||
whitespace-pre-wrap
|
||
text-gray-900 dark:text-gray-100
|
||
font-sans
|
||
${r}
|
||
`.trim().replace(/\s+/g," ");return h.jsx(I,{className:u,id:o,...i,children:a})}const l={FORBID_TAGS:["script","noscript","iframe","frame","frameset","object","embed","applet","portal","form","input","textarea","select","button","style","link","meta","base","body","head","html","title","svg","math","audio","video","source","track","canvas","details","dialog","plaintext","xmp","listing","marquee","noframes","noembed","template","slot"],FORBID_ATTR:["onerror","onload","onclick","onmouseover","onfocus","onblur","ontoggle","oncanplay","onloadstart","formaction","xlink:href","action"],ALLOW_DATA_ATTR:!0,ADD_ATTR:["target"]},c=v.useMemo(()=>{const u=s?{...l,...s,FORBID_TAGS:[...l.FORBID_TAGS,...s.FORBID_TAGS||[]],FORBID_ATTR:[...l.FORBID_ATTR,...s.FORBID_ATTR||[]]}:l;return Wy.sanitize(a,u).replace(/<a\s+([^>]*?)href=["']([^"']+)["']([^>]*?)>/gi,(g,m,p,y)=>(p.startsWith("http://")||p.startsWith("https://"))&&!g.includes("rel=")?`<a ${m}href="${p}"${y} rel="noopener noreferrer">`:g)},[a,s]),d=`
|
||
prose dark:prose-invert max-w-none
|
||
prose-p:my-2
|
||
prose-headings:font-bold prose-headings:mt-6 prose-headings:mb-4
|
||
prose-h1:text-2xl prose-h2:text-xl prose-h3:text-lg
|
||
prose-a:text-blue-600 dark:prose-a:text-blue-400
|
||
prose-a:no-underline hover:prose-a:underline
|
||
prose-blockquote:border-l-4 prose-blockquote:border-gray-300 dark:prose-blockquote:border-gray-600
|
||
prose-blockquote:pl-4 prose-blockquote:italic
|
||
prose-code:bg-gray-100 dark:prose-code:bg-gray-800
|
||
prose-code:px-1 prose-code:py-0.5 prose-code:rounded
|
||
prose-pre:bg-gray-100 dark:prose-pre:bg-gray-800
|
||
prose-pre:p-4 prose-pre:rounded-lg prose-pre:overflow-x-auto
|
||
[&_table]:w-full [&_table]:border-collapse [&_table]:border [&_table]:border-gray-300
|
||
dark:[&_table]:border-gray-600
|
||
[&_th]:border [&_th]:border-gray-300 [&_th]:px-4 [&_th]:py-2 [&_th]:bg-gray-100 [&_th]:text-left
|
||
dark:[&_th]:border-gray-600 dark:[&_th]:bg-gray-800
|
||
[&_td]:border [&_td]:border-gray-300 [&_td]:px-4 [&_td]:py-2
|
||
dark:[&_td]:border-gray-600
|
||
[&_tr:hover]:bg-gray-50 dark:[&_tr:hover]:bg-gray-700/50
|
||
after:content-[''] after:block after:clear-both
|
||
${r}
|
||
`.trim().replace(/\s+/g," ");return h.jsx(I,{className:d,dangerouslySetInnerHTML:{__html:c},id:o,...i})},ni=window.G7Core?.createLogger?.("Comp:DataGrid")??{log:(...e)=>console.log("[Comp:DataGrid]",...e),warn:(...e)=>console.warn("[Comp:DataGrid]",...e),error:(...e)=>console.error("[Comp:DataGrid]",...e)},ts=(e,t)=>window.G7Core?.t?.(e,t)??e,Gy={Div:I,Span:J,Button:le,Icon:ae,Checkbox:On,P:kt,A:qr,Label:gn,Input:Et,H1:sl,H2:cr,H3:Xr,H4:ou,Img:Nn,Select:Zr,Textarea:lr,Table:ll,Thead:cl,Tbody:dl,Tfoot:ul,Tr:dr,Th:Qr,Td:rn,MultilingualInput:fl,Toggle:hl,StatusBadge:ei,Badge:fu,HtmlContent:kl,ActionMenu:Vs},Cl=()=>{const e=window.G7Core?.getComponentMap?.();return e&&Object.keys(e).length>0?e:Gy},Sl=e=>{if(e==null)return"";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return e.map(t=>Sl(t)).join(", ");if(typeof e=="object"){if(v.isValidElement(e))return e;if(Object.keys(e).length===0)return"";try{return JSON.stringify(e)}catch{return ni.warn("객체를 문자열로 변환할 수 없습니다:",e),"[Object]"}}return String(e)},Du=(e,t)=>{if(!e)return!0;const n=window.G7Core;return typeof n?.evaluateCondition=="function"?n.evaluateCondition(e,{row:t,item:t,$item:t}):(ni.warn("G7Core.evaluateCondition 미노출 — subRow 조건을 평가할 수 없습니다:",e),!0)},ns=(e,t,n,r="",s)=>{const o=window.G7Core;if(o?.renderItemChildren){const i={row:t,value:n,$value:n};return o.renderItemChildren(e,i,Cl(),r,s?{componentContext:s}:void 0)}return ni.warn("G7Core.renderItemChildren을 사용할 수 없습니다."),null},Iu=(e,t,n)=>e?!e.includes("{{")&&!e.includes("$t:")?e:ns([{type:"basic",name:"Span",text:e}],{},null,t,n):"",_l=(e,t,n="",r)=>{const s=window.G7Core;if(s?.renderItemChildren){const o={row:t,$value:t};return s.renderItemChildren(e,o,Cl(),n,r?{componentContext:r}:void 0)}return ni.warn("G7Core.renderItemChildren을 사용할 수 없습니다."),null},Yy=({id:e,columns:t,data:n,sortable:r=!0,pagination:s=!1,pageSize:o=10,onRowClick:i,className:a="",style:l,sortField:c,sortDirection:d,onSortChange:u,selectable:f=!1,selectedIds:g=[],onSelectionChange:m,idField:p="id",selectionScope:y="free",showColumnSelector:b=!1,visibleColumns:_,onColumnVisibilityChange:x,responsiveBreakpoint:M=768,cardRenderer:S,rowActions:k,onRowAction:N,alwaysShowPagination:C=!1,serverSidePagination:w=!1,serverCurrentPage:E,serverTotalPages:T,serverHasMorePages:P,onPageChange:L,prevText:F,nextText:A,columnSelectorText:D,emptyMessage:O,actionsColumnHeader:z,requiredText:U,selectedCountText:j,showFirstLast:Y=!0,expandable:B=!1,expandedRowIds:W,onExpandChange:G,expandChildren:V,expandedRowRender:X,expandColumnWidth:K="48px",expandIconExpanded:Q=he.ChevronDown,expandIconCollapsed:ne=he.ChevronRight,expandConditionField:se,dynamicColumns:ue,dynamicColumnsInsertAfter:ee,expandContext:me,__componentContext:ie,subRowChildren:de,subRowCondition:fe,subRowClassName:be="px-6 py-2 bg-gray-50 dark:bg-gray-900",subRowRender:ge,footerCells:Ce,footerClassName:je="bg-gray-50 dark:bg-gray-800/50 font-medium",footerCardChildren:oe,editorAttrs:Te})=>{const Pe=F||void 0,Fe=A||void 0,Ke=D??ts("common.column_selector"),nt=O??ts("common.no_data"),dt=z??ts("common.actions"),We=U??ts("common.required"),pt=j??ts("common.selected_count"),Ge=Z=>j===void 0?ts("common.selected_count",{count:Z}):j.replace(/\{\{count\}\}/g,String(Z)).replace(/\{count\}/g,String(Z)),te=window.G7Core,pe=te?.useControllableState,we=te?.shallowArrayEqual,[xe,ke]=pe?pe(c,null):[c??null,()=>{}],[Be,Le]=pe?pe(d,"asc"):[d??"asc",()=>{}],[ze,Ie]=v.useState(1),[qe,Re]=pe?pe(W,[],G,{isEqual:we}):[W??[],()=>{}],[Ne,Oe]=v.useState(!1),Ue=v.useRef(null),lt=te?.useResponsive,vt=lt?.(),ut=vt?vt.width<M:typeof window<"u"&&window.innerWidth<M,ot=v.useMemo(()=>{if(!ue||!Array.isArray(ue)||ue.length===0)return t;if(ee){const Z=t.findIndex(ye=>ye.field===ee);if(Z!==-1)return[...t.slice(0,Z+1),...ue,...t.slice(Z+1)]}return[...t,...ue]},[t,ue,ee]),[St,et]=v.useState(()=>_&&_.length>0?_:t.filter(Z=>!Z.hidden).map(Z=>Z.field));v.useEffect(()=>{_&&_.length>0&&et(_)},[_]);const Lt=v.useRef("");v.useEffect(()=>{const Z=t.map(ye=>ye.field).join(",");Lt.current&&Z!==Lt.current&&(!_||_.length===0)&&et(t.filter(ye=>!ye.hidden).map(ye=>ye.field)),Lt.current=Z},[t,_]);const Ut=v.useRef([]),Gt=v.useRef(null);v.useEffect(()=>{if(ue&&ue.length>0){const Z=ue.map(ct=>ct.field);if(Gt.current===null&&(Gt.current=_!==void 0&&_.length>0,Gt.current)){Ut.current=Z;return}const ye=Ut.current,_e=Z.filter(ct=>!ye.includes(ct));if(_e.length>0){const ct=_e.filter(Ve=>!St.includes(Ve));if(ct.length>0){const Ve=[...St,...ct];et(Ve),x?.(Ve)}}Ut.current=Z}},[ue]),v.useEffect(()=>{w||Ie(1)},[n,w]),v.useEffect(()=>{const Z=ye=>{Ue.current&&!Ue.current.contains(ye.target)&&Oe(!1)};return Ne&&document.addEventListener("mousedown",Z),()=>document.removeEventListener("mousedown",Z)},[Ne]);const Yt=v.useMemo(()=>!b&&(!_||_.length===0)?ot.filter(Z=>!Z.hidden):ot.filter(Z=>St.includes(Z.field)),[ot,St,b,_]),Mn=r&&!(w&&!u),Bt=v.useMemo(()=>!xe||!r||!n?n||[]:u||w?n:[...n].sort((Z,ye)=>{const _e=Z[xe],ct=ye[xe];if(_e===ct)return 0;const Ve=_e>ct?1:-1;return Be==="asc"?Ve:-Ve}),[n,xe,Be,r,u,w]),tt=v.useMemo(()=>{if(w||!s)return Bt;const Z=(ze-1)*o,ye=Z+o;return Bt.slice(Z,ye)},[Bt,ze,o,s,w]),zn=w?E||1:ze,Xo=w?T??null:Math.ceil((Bt?.length||0)/o),Sr=C||(Xo??0)>1||P===!0||zn>1,qa=v.useCallback(Z=>{w&&L?L(Z):Ie(Z)},[w,L]),Jd=Z=>{if(!Mn||t.find(ct=>ct.field===Z)?.sortable===!1)return;const _e=xe===Z&&Be==="asc"?"desc":"asc";ke(Z),Le(_e),u?.(Z,_e)},xt=v.useCallback(()=>{if(!m||!tt)return;const Z=tt.map(_e=>_e[p]);if(Z.every(_e=>g.includes(_e)))m(g.filter(_e=>!Z.includes(_e)));else{const _e=[...new Set([...g,...Z])];m(_e)}},[tt,g,m,p]),ar=v.useCallback(Z=>{m&&(g.includes(Z)?m(g.filter(ye=>ye!==Z)):m([...g,Z]))},[g,m]);v.useEffect(()=>{if(y!=="page"||!m||g.length===0)return;const Z=new Set((tt??[]).map(_e=>_e[p])),ye=g.filter(_e=>Z.has(_e));ye.length!==g.length&&m(ye)},[y,f,tt,g,m,p]);const Za=v.useCallback(Z=>{if(ot.find(ct=>ct.field===Z)?.required)return;const _e=St.includes(Z)?St.filter(ct=>ct!==Z):[...St,Z];et(_e),x?.(_e)},[ot,St,x]),qo=v.useCallback((Z,ye)=>{N?.(Z,ye)},[N]),Fs=v.useCallback(Z=>k?k.map(ye=>{let _e=ye.disabled??!1;if(ye.disabledField&&!_e){const ct=ye.disabledField.split(".");let Ve=Z;for(const Ra of ct)Ve=Ve?.[Ra];Ve||(_e=!0)}return{...ye,disabled:_e,onClick:()=>qo(ye.id,Z)}}):[],[k,qo]),Kr=v.useCallback(Z=>{if(!se)return!0;const ye=Z[se];return Array.isArray(ye)?ye.length>0:!!ye},[se]),Zo=v.useCallback(Z=>{const ye=qe.includes(Z)?qe.filter(_e=>_e!==Z):[...qe,Z];pe?Re(ye):G&&G(ye)},[qe,G,pe,Re]),Qa=v.useCallback(Z=>qe.includes(Z),[qe]),Ja=v.useCallback(Z=>X?X(Z):V&&V.length>0&&te?.renderExpandContent?te.renderExpandContent({children:V,row:Z,expandContext:me,componentContext:ie,componentMap:Cl(),keyPrefix:`expand-${Z[p]}`}):null,[X,V,p,me,ie,ie?.state]),Rd=v.useMemo(()=>!tt||tt.length===0?!1:tt.every(Z=>g.includes(Z[p])),[tt,g,p]),eu=v.useMemo(()=>{if(!tt||tt.length===0)return!1;const Z=tt.filter(ye=>g.includes(ye[p])).length;return Z>0&&Z<tt.length},[tt,g,p]),Zn=(Z,ye)=>{const _e=Z[p],ct=Qa(_e);return h.jsxs(I,{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 mb-4",children:[h.jsxs(I,{className:"flex items-start justify-between",children:[B&&Kr(Z)&&h.jsx(le,{onClick:()=>Zo(_e),className:"p-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-gray-600 transition-colors mr-2","aria-label":ct?"Collapse card":"Expand card",children:h.jsx(ae,{name:ct?Q:ne,className:"w-4 h-4 text-gray-500 dark:text-gray-400"})}),f&&h.jsx(On,{checked:g.includes(Z[p]),onChange:()=>ar(Z[p]),className:"w-4 h-4 text-blue-600 border-gray-300 dark:border-gray-600 rounded mr-3 mt-1"}),h.jsx(I,{className:"flex-1",children:h.jsx(I,{className:"grid grid-cols-2 gap-x-4 gap-y-2",children:ye.map(Ve=>h.jsxs(I,{className:"min-w-0",children:[h.jsx(J,{className:"text-xs font-medium text-gray-500 dark:text-gray-400 uppercase",children:Ve.header}),h.jsx(I,{className:"text-sm text-gray-900 dark:text-gray-200 mt-0.5 break-words",children:Ve.cellChildren&&Ve.cellChildren.length>0?ns(Ve.cellChildren,Z,Z[Ve.field],`card-${Z[p]}-${Ve.field}`,ie):Ve.render?Ve.render(Z[Ve.field],Z):Sl(Z[Ve.field])})]},Ve.field))})}),k&&k.length>0&&h.jsx(I,{className:"ml-2",children:h.jsx(Vs,{items:Fs(Z),triggerLabel:"",triggerIconName:he.EllipsisHorizontal})})]}),B&&ct&&Kr(Z)&&h.jsx(I,{className:"mt-4 pt-4 border-t border-gray-200 dark:border-gray-700",children:Ja(Z)}),(de&&de.length>0||ge)&&Du(fe,Z)&&h.jsx(I,{className:be?`mt-3 ${be}`:"mt-3 pt-3 border-t border-gray-100 dark:border-gray-700",children:ge?ge(Z):_l(de,Z,`card-subrow-${_e}`,ie)})]})};return ut?h.jsxs(I,{id:e,className:`w-full ${a}`,style:l,...Te,children:[b&&h.jsx(I,{className:"mb-4 flex justify-end",children:h.jsxs(I,{ref:Ue,className:"relative",children:[h.jsxs(le,{onClick:()=>Oe(!Ne),className:"flex items-center gap-2 px-4 py-2 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700",children:[h.jsx(ae,{name:he.Cog,className:"w-4 h-4 text-gray-500 dark:text-gray-400"}),h.jsx(J,{className:"text-sm text-gray-700 dark:text-gray-300",children:Ke})]}),Ne&&h.jsx(I,{className:"absolute right-0 z-50 mt-2 w-64 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg",children:h.jsx(I,{className:"p-2 max-h-64 overflow-y-auto",children:ot.map(Z=>h.jsxs(I,{className:`flex items-center gap-2 px-3 py-2 rounded hover:bg-gray-50 dark:hover:bg-gray-700 ${Z.required?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,onClick:()=>!Z.required&&Za(Z.field),children:[h.jsx(On,{checked:St.includes(Z.field),disabled:Z.required,onChange:()=>{},className:"w-4 h-4 text-blue-600 border-gray-300 dark:border-gray-600 rounded"}),h.jsxs(J,{className:"text-sm text-gray-700 dark:text-gray-300",children:[Z.header,Z.required&&h.jsxs(J,{className:"text-xs text-gray-500 dark:text-gray-400 ml-1",children:["(",We,")"]})]})]},Z.field))})})]})}),f&&g.length>0&&pt&&h.jsx(I,{className:"mb-4 text-sm text-gray-600 dark:text-gray-400",children:Ge(g.length)}),h.jsx(I,{id:e?`${e}__body`:void 0,children:tt&&tt.length>0?tt.map((Z,ye)=>h.jsx(I,{children:S?S(Z,Yt):Zn(Z,Yt)},Z[p]||ye)):h.jsx(I,{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:nt})}),Ce&&Ce.length>0&&tt&&tt.length>0&&h.jsx(I,{className:`rounded-lg p-4 mt-2 ${je}`,children:oe&&oe.length>0?ns(oe,{},null,"footer-card",ie):h.jsx(I,{className:"space-y-1",children:Ce.filter(Z=>Z.text||Z.children&&Z.children.length>0).map((Z,ye)=>{const _e=Yt.find(ct=>ct.field===Z.field);return h.jsxs(I,{className:"flex justify-between text-sm",children:[h.jsx(J,{className:"text-gray-500 dark:text-gray-400",children:_e?.header||""}),h.jsx(J,{className:Z.className||"text-gray-900 dark:text-gray-100",children:Z.children&&Z.children.length>0?ns(Z.children,{},null,`footer-mobile-${ye}`,ie):Iu(Z.text,`footer-mobile-text-${ye}`,ie)})]},`footer-mobile-${ye}`)})})}),s&&Sr&&h.jsx(I,{className:"flex justify-center mt-4",children:h.jsx(Ro,{currentPage:zn,totalPages:Xo,hasMorePages:w?P:void 0,onPageChange:qa,showFirstLast:Y,maxVisiblePages:5,prevText:Pe,nextText:Fe})})]}):h.jsxs(I,{id:e,className:`w-full ${a}`,style:l,...Te,children:[b&&h.jsx(I,{className:"mb-4 flex justify-end",children:h.jsxs(I,{ref:Ue,className:"relative",children:[h.jsxs(le,{onClick:()=>Oe(!Ne),className:"flex items-center gap-2 px-4 py-2 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700",children:[h.jsx(ae,{name:he.Cog,className:"w-4 h-4 text-gray-500 dark:text-gray-400"}),h.jsx(J,{className:"text-sm text-gray-700 dark:text-gray-300",children:Ke})]}),Ne&&h.jsx(I,{className:"absolute right-0 z-50 mt-2 w-64 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg",children:h.jsx(I,{className:"p-2 max-h-64 overflow-y-auto",children:ot.map(Z=>h.jsxs(I,{className:`flex items-center gap-2 px-3 py-2 rounded hover:bg-gray-50 dark:hover:bg-gray-700 ${Z.required?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,onClick:()=>!Z.required&&Za(Z.field),children:[h.jsx(On,{checked:St.includes(Z.field),disabled:Z.required,onChange:()=>{},className:"w-4 h-4 text-blue-600 border-gray-300 dark:border-gray-600 rounded"}),h.jsxs(J,{className:"text-sm text-gray-700 dark:text-gray-300",children:[Z.header,Z.required&&h.jsxs(J,{className:"text-xs text-gray-500 dark:text-gray-400 ml-1",children:["(",We,")"]})]})]},Z.field))})})]})}),f&&g.length>0&&pt&&h.jsx(I,{className:"mb-4 text-sm text-gray-600 dark:text-gray-400",children:Ge(g.length)}),h.jsx(I,{id:e?`${e}__body`:void 0,className:"overflow-x-auto border border-gray-200 dark:border-gray-700 rounded-lg",children:h.jsxs(ll,{className:"w-full",children:[h.jsx(cl,{className:"bg-gray-50 dark:bg-gray-700",children:h.jsxs(dr,{children:[B&&h.jsx(Qr,{className:"px-2 py-3",style:{width:K}}),f&&h.jsx(Qr,{className:"px-4 py-3 w-10",children:h.jsx(On,{checked:Rd,ref:Z=>{Z&&(Z.indeterminate=eu)},onChange:xt,className:"w-4 h-4 text-blue-600 border-gray-300 dark:border-gray-600 rounded"})}),Yt.map(Z=>h.jsxs(Qr,{className:`px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider ${Mn&&Z.sortable!==!1?"cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-600":""}`,style:{width:Z.width,minWidth:Z.width},onClick:Mn?()=>Jd(Z.field):void 0,children:[Z.header,xe===Z.field&&h.jsx(J,{className:"ml-1",children:Be==="asc"?"↑":"↓"})]},Z.field)),k&&k.length>0&&h.jsx(Qr,{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider w-24",children:dt})]})}),h.jsx(dl,{className:`bg-white dark:bg-gray-800 ${be?"":"divide-y divide-gray-200 dark:divide-gray-700"}`,children:tt&&tt.length>0?tt.map((Z,ye)=>{const _e=Z[p]||ye,ct=Qa(_e);return h.jsxs(v.Fragment,{children:[h.jsxs(dr,{className:`${i?"cursor-pointer":""} hover:bg-gray-50 dark:hover:bg-gray-700 ${g.includes(Z[p])?"bg-blue-50 dark:bg-blue-900/20":""} ${be&&ye>0?"border-t border-gray-200 dark:border-gray-700":""}`,onClick:()=>i?.(Z),children:[B&&h.jsx(rn,{className:"px-2 py-4 text-center",onClick:Ve=>Ve.stopPropagation(),children:Kr(Z)?h.jsx(le,{onClick:()=>Zo(_e),className:"p-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-gray-600 transition-colors","aria-label":ct?"Collapse row":"Expand row",children:h.jsx(ae,{name:ct?Q:ne,className:"w-4 h-4 text-gray-500 dark:text-gray-400"})}):null}),f&&h.jsx(rn,{className:"px-4 py-4",onClick:Ve=>Ve.stopPropagation(),children:h.jsx(On,{checked:g.includes(Z[p]),onChange:()=>ar(Z[p]),className:"w-4 h-4 text-blue-600 border-gray-300 dark:border-gray-600 rounded"})}),Yt.map(Ve=>h.jsx(rn,{className:"px-6 py-4 align-top whitespace-nowrap text-sm text-gray-900 dark:text-gray-200",style:{width:Ve.width,minWidth:Ve.width},children:Ve.cellChildren&&Ve.cellChildren.length>0?ns(Ve.cellChildren,Z,Z[Ve.field],`${Z[p]}-${Ve.field}`,ie):Ve.render?Ve.render(Z[Ve.field],Z):Sl(Z[Ve.field])},Ve.field)),k&&k.length>0&&h.jsx(rn,{className:"px-6 py-4 text-right",onClick:Ve=>Ve.stopPropagation(),children:h.jsx(Vs,{items:Fs(Z),triggerLabel:"",triggerIconName:he.EllipsisHorizontal,position:"right"})})]}),B&&ct&&Kr(Z)&&h.jsx(dr,{className:"bg-gray-50 dark:bg-gray-900",children:h.jsx(rn,{colSpan:Yt.length+1+(f?1:0)+(k&&k.length>0?1:0),className:"px-6 py-4",children:Ja(Z)})}),(de&&de.length>0||ge)&&Du(fe,Z)&&h.jsx(dr,{className:be?"!border-t-0":"",children:h.jsx(rn,{colSpan:Yt.length+(B?1:0)+(f?1:0)+(k&&k.length>0?1:0),className:be?"p-2":be||"px-6 py-2 bg-gray-50 dark:bg-gray-900",children:be?h.jsx(I,{className:be,children:ge?ge(Z):_l(de,Z,`subrow-${_e}`,ie)}):ge?ge(Z):_l(de,Z,`subrow-${_e}`,ie)})})]},_e)}):h.jsx(dr,{children:h.jsx(rn,{colSpan:Yt.length+(B?1:0)+(f?1:0)+(k&&k.length>0?1:0),className:"px-6 py-8 text-center text-gray-500 dark:text-gray-400",children:nt})})}),Ce&&Ce.length>0&&tt&&tt.length>0&&h.jsx(ul,{children:h.jsxs(dr,{className:je,children:[B&&h.jsx(rn,{className:"px-2 py-4"}),f&&h.jsx(rn,{className:"px-4 py-4"}),(()=>{const Z=new Map(Ce.filter(ye=>ye.field).map(ye=>[ye.field,ye]));return Yt.map(ye=>{const _e=Z.get(ye.field);return _e?h.jsx(rn,{className:`px-6 py-4 text-sm text-gray-900 dark:text-gray-200 ${_e.className||""}`,colSpan:_e.colSpan,style:{width:ye.width,minWidth:ye.width},children:_e.children&&_e.children.length>0?ns(_e.children,{},null,`footer-${ye.field}`,ie):Iu(_e.text,`footer-text-${ye.field}`,ie)},`footer-${ye.field}`):h.jsx(rn,{className:"px-6 py-4",style:{width:ye.width,minWidth:ye.width}},`footer-${ye.field}`)})})(),k&&k.length>0&&h.jsx(rn,{className:"px-6 py-4"})]})})]})}),s&&Sr&&h.jsx(I,{className:"flex justify-center mt-4",children:h.jsx(Ro,{currentPage:zn,totalPages:Xo,hasMorePages:w?P:void 0,onPageChange:qa,showFirstLast:Y,maxVisiblePages:5,prevText:Pe,nextText:Fe})})]})},Ky=window.G7Core?.createLogger?.("Comp:CardGrid")??{log:(...e)=>console.log("[Comp:CardGrid]",...e),warn:(...e)=>console.warn("[Comp:CardGrid]",...e),error:(...e)=>console.error("[Comp:CardGrid]",...e)},Xy=(e,t)=>window.G7Core?.t?.(e,t)??e,qy=()=>window.G7Core?.getComponentMap?.()||{},Zy=(e,t)=>{if(!e)return!0;const n=window.G7Core;return typeof n?.evaluateCondition=="function"?n.evaluateCondition(e,{row:t,item:t,$item:t}):(Ky.warn("G7Core.evaluateCondition 미노출 — 조건을 평가할 수 없습니다:",e),!0)},Lu=(e,t,n,r,s)=>{const o=window.G7Core;if(e.name==="ActionMenu"){if(r&&r.length>0&&s)return{...e,props:{...e.props,items:r.map(i=>({...i,onClick:()=>s(i.id,t)}))}};if(e.actions&&Array.isArray(e.actions)){const i=e.props?.items||[],a=new Map(e.actions.map(c=>[c.id,c])),l=i.map(c=>{if(typeof c.onClick=="string"){const d=c.onClick,u=a.get(d);if(u&&o?.ActionDispatcher)return{...c,onClick:()=>{const f={...n};o.ActionDispatcher.dispatch(u,f)}}}return c});return{...e,props:{...e.props,items:l}}}}return e.children&&Array.isArray(e.children)?{...e,children:e.children.map(i=>Lu(i,t,n,r,s))}:e},Qy=(e,t,n,r="",s,o)=>{const i=window.G7Core;if(i?.renderItemChildren){const a=e.filter(d=>{const u=d.condition||d.if;return u?Zy(u,t):!0}),l={row:t,$value:t,index:n},c=a.map(d=>Lu(d,t,l,s,o));try{const d=qy();return i.renderItemChildren(c,l,d,r)}catch{return h.jsxs(I,{className:"text-red-600 dark:text-red-400 p-4",children:[h.jsx(kt,{children:"컴포넌트 로드 실패"}),h.jsx(kt,{className:"text-sm",children:"[CardGrid] 데이터를 표시할 수 없습니다."})]})}}return null},El=(e,t)=>{if(e.name==="Div"&&e.children&&e.children.length>0){const n=e.children.map((r,s)=>El(r,`${t}-child-${s}`)).filter(Boolean);return h.jsx(I,{className:e.props?.className||"",children:n},t)}return h.jsx(I,{className:"h-4 bg-gray-200 dark:bg-gray-700 rounded w-full animate-pulse"},t)},Pu=(e,t="skeleton")=>!e||e.length===0?null:e.map((n,r)=>{const s=`${t}-${n.id||n.name}-${r}`;return n.condition||n.if?null:(n.iteration,El(n,s))}).filter(Boolean),Jy=({data:e,cardColumns:t=[],gridColumns:n=3,gap:r=4,responsiveColumns:s,cardClassName:o="",idField:i="id",pagination:a=!0,pageSize:l=12,serverSidePagination:c=!1,serverCurrentPage:d,serverTotalPages:u,alwaysShowPagination:f=!1,onPageChange:g,paginationInfoText:m,rowActions:p,onRowAction:y,className:b="",style:_,emptyMessage:x,prevText:M,nextText:S,showSkeleton:k=!0,skeletonCount:N,skeletonCellChildren:C,id:w,editorAttrs:E})=>{const T=x??Xy("common.no_data"),P=t[0]?.cellChildren||[],[L,F]=v.useState(1);window.G7Core?.useResponsive?.();const D=c?d??1:L,O=c?u??1:Math.ceil((e?.length??0)/l),z=G=>{c?g?.(G):F(G)},U=v.useCallback((G,V)=>{y?.(G,V)},[y]),j=v.useMemo(()=>{if(!e)return[];if(!a||c)return e;const G=(L-1)*l,V=G+l;return e.slice(G,V)},[e,a,c,L,l]),Y=v.useMemo(()=>{const G=[],V=s?.sm??1;G.push(`grid-cols-${V}`),s?.sm&&G.push(`sm:grid-cols-${s.sm}`);const X=s?.md??Math.min(n,2);G.push(`md:grid-cols-${X}`);const K=s?.lg??n;return G.push(`lg:grid-cols-${K}`),s?.xl&&G.push(`xl:grid-cols-${s.xl}`),G.join(" ")},[n,s]),B=v.useMemo(()=>k?C&&C.length>0?Pu(C,"custom-skeleton"):P&&P.length>0?Pu(P,"auto-skeleton"):null:null,[k,C,P]);if(!e){if(!k)return null;const G=N??n;return h.jsx(I,{className:`grid ${Y} gap-${r} ${b}`,style:_,id:w,...E,children:Array.from({length:G}).map((V,X)=>h.jsx(I,{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-6 space-y-4",children:B},`skeleton-${X}`))})}if(j.length===0)return h.jsx(I,{className:b,style:_,id:w,...E,children:h.jsx(I,{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-12",children:h.jsx(kt,{className:"text-center text-gray-600 dark:text-gray-400",children:T})})});const W=a&&(f||O>1);return h.jsxs(I,{className:b,style:_,id:w,...E,children:[h.jsx(I,{className:`grid ${Y} gap-${r}`,children:j.map((G,V)=>h.jsx(I,{className:o,children:Qy(P,G,V,`card-${V}`,p,U)},G[i]||V))}),W&&h.jsxs(I,{className:"mt-6 space-y-4 flex flex-col items-center",children:[h.jsx(Ro,{currentPage:D,totalPages:O,onPageChange:z,showFirstLast:!1,maxVisiblePages:5,prevText:M,nextText:S}),m&&h.jsx(I,{className:"text-sm text-gray-600 dark:text-gray-400 text-center",children:m})]})]})},Ry=(e,t)=>window.G7Core?.t?.(e,t)??e,ri=({isOpen:e,onClose:t,title:n,titlePrefix:r,titleSuffix:s,closeOnBackdropClick:o=!0,closeOnOverlayClick:i,showCloseButton:a=!0,closeOnEscape:l=!0,children:c,width:d="500px",className:u="",style:f,__dataContext:g,__translationContext:m})=>{const p=i!==void 0?i:o,y=v.useRef(null),b=v.useRef(null);if(v.useEffect(()=>{const M=S=>{S.key==="Escape"&&e&&l&&t()};if(e&&l)return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[e,t,l]),v.useEffect(()=>{if(e&&y.current){b.current=document.activeElement;const M=y.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),S=M[0],k=M[M.length-1];S?.focus();const N=C=>{C.key==="Tab"&&(C.shiftKey?document.activeElement===S&&(C.preventDefault(),k?.focus()):document.activeElement===k&&(C.preventDefault(),S?.focus()))};return document.addEventListener("keydown",N),()=>{document.removeEventListener("keydown",N),b.current?.focus()}}},[e]),v.useEffect(()=>{if(e)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[e]),!e)return null;const _=f?.zIndex??50,x=(M,S)=>{if(!M||M.length===0)return null;const k=window.G7Core;if(!k)return null;const N=k.getDynamicRenderer?.();return N?M.map((C,w)=>h.jsx(N,{componentDef:C,dataContext:g||{},translationContext:m,registry:k.getComponentRegistry(),bindingEngine:k.getDataBindingEngine(),translationEngine:k.getTranslationEngine(),actionDispatcher:k.getActionDispatcher(),isRootRenderer:!1},`${S}-${w}`)):null};return h.jsxs(I,{className:"modal-wrapper",style:{zIndex:_},onClick:p?t:void 0,children:[h.jsx(I,{className:"modal-backdrop","aria-hidden":"true"}),h.jsxs(I,{ref:y,className:`modal-container ${u}`,style:{width:d,...f?{...f,zIndex:void 0}:{}},onClick:M=>M.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":n?"modal-title":void 0,children:[(n||r||s||a)&&h.jsxs(I,{className:"modal-header-row",children:[h.jsxs(I,{className:"flex-center gap-sm",children:[x(r,"title-prefix"),n&&h.jsx(I,{id:"modal-title",className:"modal-title",children:n}),x(s,"title-suffix")]}),a&&h.jsx(le,{onClick:t,className:"modal-close-btn","aria-label":Ry("common.close_modal"),children:h.jsx("svg",{className:"icon-lg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),h.jsx(I,{className:"modal-body-content",children:c})]})]})},ev=({label:e,items:t,onItemClick:n,position:r="bottom-left",variant:s="default",className:o="",style:i,id:a,editorAttrs:l})=>{const[c,d]=v.useState(!1),[u,f]=v.useState(-1),g=v.useRef(null),m=v.useRef(null),[p,y]=v.useState(r);v.useEffect(()=>{const x=M=>{g.current&&!g.current.contains(M.target)&&(d(!1),f(-1))};if(c)return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[c]),v.useEffect(()=>{const x=M=>{if(!c)return;const S=t.map((k,N)=>k.disabled?-1:N).filter(k=>k!==-1);switch(M.key){case"ArrowDown":M.preventDefault(),f(k=>{const C=(S.indexOf(k)+1)%S.length;return S[C]});break;case"ArrowUp":M.preventDefault(),f(k=>{const N=S.indexOf(k),C=N<=0?S.length-1:N-1;return S[C]});break;case"Enter":M.preventDefault(),u>=0&&!t[u].disabled&&b(t[u]);break;case"Escape":M.preventDefault(),d(!1),f(-1);break}};if(c)return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[c,u,t]),v.useEffect(()=>{if(c&&m.current&&g.current){const x=m.current.getBoundingClientRect(),M=g.current.getBoundingClientRect(),S=window.innerWidth,k=window.innerHeight,N=x.width||224,C=x.height||200;let w=r;r.includes("left")?M.left+N>S&&(w=w.replace("left","right")):M.right-N<0&&(w=w.replace("right","left")),r.includes("top")?M.top-C<0&&(w=w.replace("top","bottom")):M.bottom+C>k&&(w=w.replace("bottom","top")),y(w)}},[c,r]);const b=x=>{x.disabled||(x.onClick?.(),n?.(x.value,x),d(!1),f(-1))},_={"bottom-left":"dropdown-menu-bottom-left","bottom-right":"dropdown-menu-bottom-right","top-left":"dropdown-menu-top-left","top-right":"dropdown-menu-top-right"};return h.jsxs(I,{ref:g,className:`dropdown ${o}`,style:i,id:a,...l,children:[h.jsxs(le,{onClick:()=>d(!c),className:s==="text"?"dropdown-trigger-text":"dropdown-trigger","aria-haspopup":"true","aria-expanded":c,children:[e,s!=="text"&&h.jsx("svg",{className:`inline-block ml-2 w-4 h-4 transition-transform ${c?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),c&&h.jsx(I,{ref:m,className:`dropdown-menu ${_[p]}`,role:"menu","aria-orientation":"vertical",children:h.jsx(I,{className:"py-1",children:t.map((x,M)=>h.jsx(I,{className:`${x.disabled?"dropdown-item-disabled":"dropdown-item"} ${u===M?"dropdown-item-focused":""}`,onClick:()=>b(x),onMouseEnter:()=>!x.disabled&&f(M),role:"menuitem","aria-disabled":x.disabled,tabIndex:x.disabled?-1:0,children:x.label},x.value))})})]})},tv=({imageUrl:e,imageAlt:t="",title:n,subtitle:r,description:s,price:o,originalPrice:i,discountRate:a,currency:l="₩",buttonText:c="자세히 보기",onButtonClick:d,className:u="",style:f,id:g,editorAttrs:m})=>{const p=a&&a>0,y=(o??0).toLocaleString(),b=i?.toLocaleString();return h.jsxs(I,{className:`rounded-lg bg-white dark:bg-gray-800 shadow-md hover:shadow-xl transition-shadow border border-gray-200 dark:border-gray-700 overflow-hidden ${u}`,style:f,id:g,...m,children:[e&&h.jsxs(I,{className:"relative w-full",children:[h.jsx(Nn,{src:e,alt:t||n,className:"w-full h-64 object-cover"}),p&&h.jsx(I,{className:"absolute top-2 right-2 bg-red-500 text-white px-2 py-1 rounded-md",children:h.jsxs(J,{className:"text-sm font-bold",children:["-",a,"%"]})})]}),h.jsxs(I,{className:"p-4",children:[r&&h.jsx(Xr,{className:"text-xs font-medium text-blue-600 dark:text-blue-400 uppercase tracking-wider mb-2",children:r}),h.jsx(cr,{className:"text-xl font-bold text-gray-900 dark:text-white mb-2 line-clamp-2",children:n}),s&&h.jsx(kt,{className:"text-sm text-gray-600 dark:text-gray-400 mb-4 line-clamp-3",children:s}),h.jsxs(I,{className:"flex items-center gap-2 mb-4",children:[h.jsxs(J,{className:"text-2xl font-bold text-gray-900 dark:text-white",children:[l,y]}),i&&h.jsxs(J,{className:"text-sm text-gray-400 dark:text-gray-500 line-through",children:[l,b]})]}),c&&h.jsx(le,{onClick:d,className:"w-full bg-blue-600 hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600 text-white font-medium py-2 px-4 rounded-lg transition-colors",children:c})]})]})},nv=({value:e,label:t,change:n,changeLabel:r="전월 대비",iconName:s,trend:o="neutral",className:i="",style:a,id:l,editorAttrs:c})=>{const d=o==="up",u=o==="down",f=n!==void 0?Math.abs(n):0,g=d?"stats-trend-up":u?"stats-trend-down":"stats-trend-neutral",m=d?he.ArrowUp:u?he.ArrowDown:void 0;return h.jsxs(I,{className:`stat-card ${i}`,style:a,id:l,...c,children:[h.jsxs(I,{className:"flex-between mb-md",children:[s&&h.jsx(I,{className:"stats-icon stats-icon-blue",children:h.jsx(ae,{name:s,className:"icon-lg"})}),n!==void 0&&h.jsxs(I,{className:`stats-change ${g}`,children:[m&&h.jsx(ae,{name:m,className:"icon-sm"}),h.jsxs(J,{className:"text-sm font-semibold",children:[f,"%"]})]})]}),h.jsx(Xr,{className:"stats-value-lg",children:typeof e=="number"?e.toLocaleString():e}),h.jsx(kt,{className:"stats-label",children:t}),n!==void 0&&r&&h.jsx(I,{className:"stats-sublabel",children:h.jsx(J,{children:r})})]})},$u=()=>window.G7Core,Fu=(e,t)=>$u()?.t?.(e,t)??e,rv=({name:e="search",placeholder:t,value:n,onChange:r,onSubmit:s,showButton:o=!1,suggestions:i=[],onSuggestionClick:a,showSuggestions:l=!1,className:c="",style:d,id:u,editorAttrs:f})=>{const g=t??Fu("common.search_placeholder"),[m,p]=v.useState(""),[y,b]=v.useState(!1),_=v.useRef(null),x=v.useRef(""),M=n!==void 0?n:m,S=l&&y&&i.length>0&&M.length>0,k="w-64 pl-10 pr-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white text-sm",N=$u()?.style?.mergeClasses?.(k,c)??`${k} ${c}`;v.useEffect(()=>{n!==void 0&&(x.current=n)},[n]);const C=T=>{const P=T.target.value;p(P),r?.(T),x.current!==""&&P===""&&!T.nativeEvent.inputType&&setTimeout(()=>{const L=_.current?.querySelector("form");L&&L.requestSubmit()},0),x.current=P},w=T=>{p(T.text);const P={target:{value:T.text,name:e}};r?.(P),a?.(T),b(!1)},E=T=>{T.preventDefault(),s?.(T)};return h.jsxs(I,{ref:_,className:"relative",style:d,id:u,...f,children:[h.jsx(al,{onSubmit:E,className:"relative",children:h.jsxs(I,{className:`relative flex items-center ${o?"gap-2":""}`,children:[h.jsxs(I,{className:"relative flex-1",children:[h.jsx(I,{className:"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none",children:h.jsx(ae,{name:he.Search,className:"w-5 h-5 text-gray-400 dark:text-gray-500"})}),h.jsx(Et,{type:"search",name:e,value:M,onChange:C,onFocus:()=>b(!0),onBlur:()=>setTimeout(()=>b(!1),200),placeholder:g,className:N})]}),o&&h.jsx(le,{type:"submit",className:"px-4 py-2 bg-gray-800 dark:bg-gray-600 text-white rounded-lg hover:bg-gray-900 dark:hover:bg-gray-500 transition-colors text-sm font-medium cursor-pointer h-[42px]",children:Fu("common.search")})]})}),S&&h.jsx(I,{className:"absolute z-10 w-full mt-2 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg max-h-64 overflow-y-auto",children:i.map(T=>h.jsx(I,{className:"px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-700 cursor-pointer border-b border-gray-100 dark:border-gray-700 last:border-b-0 transition-colors",onClick:()=>w(T),children:h.jsxs(I,{className:"flex items-center gap-2",children:[h.jsx(ae,{name:he.Search,className:"w-4 h-4 text-gray-400 dark:text-gray-500"}),h.jsx(J,{className:"text-sm text-gray-700 dark:text-gray-300",children:T.text})]})},T.id))})]})},Ml=(e,t)=>window.G7Core?.t?.(e,t)??e,sv=({title:e,filters:t,onChange:n,onReset:r,showResetButton:s=!0,className:o="",style:i,id:a,editorAttrs:l})=>{const c=e??Ml("common.filter"),d=(f,g)=>{n?.(f,g)},u=(f,g,m)=>{const p=t.find(b=>b.id===f);if(!p)return;const y=Array.isArray(p.value)?p.value:[];if(typeof g=="string"){const b=y.filter(x=>typeof x=="string"),_=m?[...b,g]:b.filter(x=>x!==g);n?.(f,_)}else{const b=y.filter(x=>typeof x=="number"),_=m?[...b,g]:b.filter(x=>x!==g);n?.(f,_)}};return h.jsxs(I,{className:`rounded-lg bg-white dark:bg-gray-800 shadow-md border border-gray-200 dark:border-gray-700 p-4 ${o}`,style:i,id:a,...l,children:[h.jsxs(I,{className:"flex items-center justify-between mb-4 pb-3 border-b border-gray-200 dark:border-gray-700",children:[h.jsx(J,{className:"text-lg font-semibold text-gray-900 dark:text-white",children:c}),s&&r&&h.jsx(le,{onClick:r,className:"text-sm text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 font-medium",children:Ml("common.reset")})]}),h.jsx(I,{className:"space-y-4",children:t.map(f=>h.jsxs(I,{className:"space-y-2",children:[h.jsx(gn,{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:f.label}),f.type==="select"&&h.jsxs(Zr,{value:f.value,onChange:g=>d(f.id,g.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 focus:border-blue-500 dark:focus:border-blue-400 bg-white dark:bg-gray-700 text-gray-900 dark:text-white",children:[h.jsx("option",{value:"",children:Ml("common.select_placeholder")}),f.options.map(g=>h.jsx("option",{value:g.value,children:g.label},g.id))]}),f.type==="checkbox"&&h.jsx(I,{className:"space-y-2",children:f.options.map(g=>{const m=Array.isArray(f.value)?f.value.some(p=>p===g.value):!1;return h.jsxs(gn,{className:"flex items-center gap-2 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700 p-2 rounded-md transition-colors",children:[h.jsx(On,{checked:m,onChange:p=>u(f.id,g.value,p.target.checked),className:"w-4 h-4 text-blue-600 border-gray-300 dark:border-gray-600 rounded focus:ring-blue-500"}),h.jsx(J,{className:"text-sm text-gray-700 dark:text-gray-300",children:g.label})]},g.id)})})]},f.id))})]})},ov=({tabs:e,activeTabId:t,onTabChange:n,variant:r="default",className:s="",style:o,mobileBreakpoint:i=768,id:a,editorAttrs:l})=>{const d=window.G7Core?.useResponsive,u=d?.(),f=u?u.width<i:typeof window<"u"&&window.innerWidth<i,g=v.useRef([]),m=k=>{!k.disabled&&k.id!==t&&n?.(k.id)},p=(k,N)=>{const C=k.key==="ArrowRight"?1:k.key==="ArrowLeft"?-1:0;let w=null;if(C!==0)for(let E=1;E<=e.length;E+=1){const T=(N+C*E+e.length*E)%e.length;if(!e[T]?.disabled){w=T;break}}else if(k.key==="Home")w=e.findIndex(E=>!E.disabled);else if(k.key==="End"){for(let E=e.length-1;E>=0;E-=1)if(!e[E]?.disabled){w=E;break}}w===null||w<0||(k.preventDefault(),g.current[w]?.focus(),m(e[w]))},y=k=>{const N=k.target.value,C=Number(N),w=typeof N=="string"&&N!==""&&!Number.isNaN(C)?C:N,E=e.find(T=>String(T.id)===String(w));E&&m(E)};if(f)return h.jsx(I,{className:s,style:o,id:a,...l,children:h.jsx(Zr,{value:t!==void 0?String(t):"",onChange:y,options:e.map(k=>({value:String(k.id),label:k.badge!==void 0?`${k.label} (${k.badge})`:k.label,disabled:k.disabled})),className:"w-full"})});const b=k=>{const N=k.id===t;if(k.disabled)return"tab-btn-base tab-btn-disabled";switch(r){case"pills":return N?"tab-btn-base tab-btn-pills-active":"tab-btn-base tab-btn-pills";case"underline":return N?"tab-btn-base tab-btn-underline-active":"tab-btn-base tab-btn-underline";case"default":default:return N?"tab-btn-base tab-btn-default-active":"tab-btn-base tab-btn-default"}},_=r==="underline"?"tab-nav-underline":"tab-nav-default",x=l?.["data-editor-path"],M=e.findIndex(k=>k.id===t),S=M>=0?M:e.findIndex(k=>!k.disabled);return h.jsx(Jo,{className:`${_} ${s}`,style:o,role:"tablist","aria-orientation":"horizontal",id:a,...l,children:e.map((k,N)=>h.jsxs(le,{ref:C=>{g.current[N]=C},type:"button",role:"tab","aria-selected":k.id===t,tabIndex:N===S?0:-1,onClick:()=>m(k),onKeyDown:C=>p(C,N),disabled:k.disabled,className:b(k),...x?{"data-editor-item-path":`${x}.props.tabs.${N}`}:{},children:[k.iconName&&h.jsx(ae,{name:k.iconName,className:"w-4 h-4"}),h.jsx(J,{children:k.label}),k.badge!==void 0&&h.jsx(I,{className:"flex items-center justify-center min-w-[20px] h-5 px-1.5 bg-red-500 dark:bg-red-600 text-white dark:text-white text-xs font-bold rounded-full",children:h.jsx(J,{children:k.badge})})]},k.id))})},Nl=window.G7Core?.createLogger?.("Handler:ScrollToSection")??{log:(...e)=>console.log("[Handler:ScrollToSection]",...e),warn:(...e)=>console.warn("[Handler:ScrollToSection]",...e),error:(...e)=>console.error("[Handler:ScrollToSection]",...e)};async function zu(e,t){const n=e.params||{},{targetId:r,offset:s=120,delay:o=100,scrollContainerId:i}=n;if(!r){Nl.warn("targetId is required");return}const a=await iv(r,o);if(!a){Nl.warn(`Element not found: ${r}`);return}const l=av(a,i),c=lv(a,l,s);cv(l,c)}async function iv(e,t){await new Promise(s=>setTimeout(s,t));const n=10,r=50;for(let s=0;s<n;s++){const o=document.getElementById(e);if(o)return await new Promise(i=>setTimeout(i,50)),o;await new Promise(i=>setTimeout(i,r))}return null}function av(e,t){if(t){const o=document.getElementById(t);if(o&&Vu(o))return o;Nl.warn(`Container '${t}' ${o?"has no scroll":"not found"}, trying auto-detect`)}let n=e.parentElement,r=0;const s=10;for(;n&&n!==document.body&&r<s;){if(Vu(n))return n;n=n.parentElement,r++}return window}function Vu(e){const t=window.getComputedStyle(e);return(t.overflowY==="auto"||t.overflowY==="scroll")&&e.scrollHeight>e.clientHeight}function lv(e,t,n){if(t===window||!("getBoundingClientRect"in t))return e.getBoundingClientRect().top+window.pageYOffset-n;{const r=t.getBoundingClientRect(),s=e.getBoundingClientRect();return t.scrollTop+(s.top-r.top)-n}}function cv(e,t){e===window||!("scrollTo"in e)?window.scrollTo({top:t,behavior:"smooth"}):e.scrollTo({top:t,behavior:"smooth"})}window.G7Core?.createLogger?.("Comp:TabNavigation");const dv=({tabs:e,activeTabId:t,className:n="bg-white dark:bg-gray-800 flex gap-2 border-b border-gray-200 dark:border-gray-700 px-6",style:r,activeClassName:s="tab-btn-base tab-btn-default-active",inactiveClassName:o="tab-btn-base tab-btn-default",sectionIdPrefix:i="tab_content_",scrollOffset:a=120,scrollDelay:l=100,onTabChange:c,enableScrollSpy:d=!1,scrollSpyOffset:u=80,scrollContainerId:f,id:g,editorAttrs:m})=>{const[p,y]=v.useState(t??(e.length>0?e[0].id:"")),_=window.G7Core?.useResponsive,x=_?.(),M=x?x.width<768:typeof window<"u"&&window.innerWidth<768,S=v.useRef(!1),k=v.useRef(null),N=v.useRef([]),C=L=>{if(d&&(S.current=!0,k.current&&clearTimeout(k.current)),L.onClick){if(L.onClick(L.id),!d)return}else if(c){if(c(L.id),!d)return}else y(L.id);const F=L.scrollOffset??a,A=L.scrollDelay??l;zu({params:{targetId:`${i}${L.id}`,offset:F,delay:A,scrollContainerId:f}}),d&&(k.current=setTimeout(()=>{S.current=!1},A+500))},w=(L,F)=>{const A=L.key==="ArrowRight"?1:L.key==="ArrowLeft"?-1:0;let D=null;if(A!==0)for(let O=1;O<=e.length;O+=1){const z=(F+A*O+e.length*O)%e.length;if(!e[z]?.disabled){D=z;break}}else if(L.key==="Home")D=e.findIndex(O=>!O.disabled);else if(L.key==="End"){for(let O=e.length-1;O>=0;O-=1)if(!e[O]?.disabled){D=O;break}}D===null||D<0||(L.preventDefault(),N.current[D]?.focus(),C(e[D]))};v.useEffect(()=>{if(!d)return;const L=f?document.getElementById(f):null,F={root:L??null,rootMargin:`-${u}px 0px -30% 0px`,threshold:[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1]},A=new Map,D=()=>{const j=L,Y=j?j.scrollTop:window.pageYOffset||document.documentElement.scrollTop,B=j?j.scrollHeight:document.documentElement.scrollHeight,W=j?j.clientHeight:document.documentElement.clientHeight;return Y+W>=B-10},O=j=>{if(S.current)return;j.forEach(X=>{const K=X.target.id;X.isIntersecting?A.set(K,X.intersectionRatio):A.delete(K)});let Y=0,B="";A.forEach((X,K)=>{X>Y&&(Y=X,B=K)});const W=e[e.length-1],G=`${i}${W?.id}`,V=A.has(G);if(D()&&V&&W){y(W.id);return}if(B){const X=B.replace(i,""),K=Number(X),Q=isNaN(K)?X:K;e.some(se=>se.id===Q)&&y(Q)}},z=()=>{},U=new IntersectionObserver(O,F);return e.forEach(j=>{const Y=document.getElementById(`${i}${j.id}`);Y&&U.observe(Y)}),window.addEventListener("scroll",z,{passive:!0}),()=>{U.disconnect(),window.removeEventListener("scroll",z),k.current&&clearTimeout(k.current)}},[d,e,i,u,f]);const E=L=>{const F=L.target.value,A=Number(F),D=isNaN(A)?F:A,O=e.find(z=>z.id===D);O&&C(O)};if(M)return h.jsx(I,{className:"bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 px-4 py-3",id:g,...m,children:h.jsx(Zr,{value:String(p),onChange:E,options:e.map(L=>({value:String(L.id),label:L.label,disabled:L.disabled})),className:"w-full"})});const T=e.findIndex(L=>L.id===p),P=T>=0?T:e.findIndex(L=>!L.disabled);return h.jsx(I,{className:n,style:r,role:"tablist","aria-orientation":"horizontal",id:g,...m,children:e.map((L,F)=>h.jsxs(le,{ref:A=>{N.current[F]=A},type:"button",role:"tab","aria-selected":p===L.id,tabIndex:F===P?0:-1,className:p===L.id?s:o,disabled:L.disabled,onClick:()=>C(L),onKeyDown:A=>w(A,F),children:[L.iconName&&h.jsx(ae,{name:L.iconName,size:"sm"}),h.jsx(J,{children:L.label})]},L.id))})},uv=()=>window.G7Core,fv=({iconName:e,label:t,onClick:n,variant:r="primary",size:s="md",disabled:o=!1,className:i="",style:a,id:l,editorAttrs:c})=>{const d={sm:t?"px-3 py-1.5 text-sm":"w-8 h-8",md:t?"px-4 py-2 text-base":"w-10 h-10",lg:t?"px-5 py-2.5 text-lg":"w-12 h-12"},u={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"},f={primary:"bg-blue-600 hover:bg-blue-700 text-white border-transparent",secondary:"bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-300 border-gray-300 dark:border-gray-600",danger:"bg-red-600 hover:bg-red-700 text-white border-transparent",ghost:"bg-transparent hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300 border-transparent",outline:"bg-transparent hover:bg-gray-50 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300 border-gray-300 dark:border-gray-600"},g="inline-flex items-center justify-center gap-2 font-medium rounded-lg border transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 dark:focus:ring-blue-400",m=o?"opacity-50 cursor-not-allowed":"",p=`${g} ${d[s]} ${f[r]} ${m}`,y=uv()?.style?.mergeClasses?.(p,i)??`${p} ${i}`;return h.jsxs(le,{onClick:n,disabled:o,className:y,style:a,id:l,...c,children:[h.jsx(ae,{name:e,className:u[s]}),t]})},hv=(e,t)=>window.G7Core?.t?.(e,t)??e,Hu=({isOpen:e,onClose:t,title:n,content:r,actions:s=[],width:o="500px",closeOnOverlay:i=!0,showCloseButton:a=!0,className:l="",style:c})=>{const d=()=>{i&&t()},u={primary:"dialog-btn-primary",secondary:"dialog-btn-secondary",danger:"dialog-btn-danger",ghost:"dialog-btn-ghost"};return h.jsxs(ri,{isOpen:e,onClose:d,width:o,className:l,style:c,children:[h.jsxs(I,{className:"dialog-header",children:[h.jsx(cr,{className:"dialog-title",children:n}),a&&h.jsx(le,{onClick:t,className:"dialog-close","aria-label":hv("common.close_dialog"),children:h.jsx(ae,{name:he.Times,className:"icon-md"})})]}),h.jsx(I,{className:"dialog-body",children:r}),s.length>0&&h.jsx(I,{className:"dialog-footer",children:s.map((f,g)=>h.jsxs(le,{onClick:f.onClick,disabled:f.disabled,className:u[f.variant||"primary"],children:[f.iconName&&h.jsx(ae,{name:f.iconName,className:"icon-sm mr-2 inline-block"}),f.label]},g))})]})},Ol=(e,t)=>window.G7Core?.t?.(e,t)??e,Uu=({isOpen:e,onClose:t,title:n,message:r,confirmText:s,cancelText:o,onConfirm:i,onCancel:a,confirmButtonVariant:l="primary",cancelButtonVariant:c="secondary",width:d="500px",closeOnOverlay:u=!0,isLoading:f=!1,loadingText:g})=>{const m=s??Ol("common.confirm"),p=o??Ol("common.cancel"),y=g??Ol("common.loading"),b=()=>{i()},_=()=>{f||(a?.(),t())},x=()=>{f||t()},M={primary:"bg-blue-600 text-white hover:bg-blue-700",secondary:"bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-gray-200 hover:bg-gray-300 dark:hover:bg-gray-600",danger:"bg-red-600 text-white hover:bg-red-700",ghost:"bg-transparent text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"};return h.jsxs(ri,{isOpen:e,onClose:x,title:n,width:d,children:[h.jsx(I,{className:"py-2",children:typeof r=="string"?h.jsx(kt,{className:"text-gray-700 dark:text-gray-300",children:r}):r}),h.jsxs(I,{className:"flex justify-end gap-3 mt-6",children:[h.jsx(le,{onClick:_,disabled:f,className:"px-4 py-2 bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed",children:h.jsx(J,{children:p})}),h.jsxs(le,{onClick:b,disabled:f,className:`flex items-center gap-2 px-4 py-2 rounded-lg disabled:opacity-50 disabled:cursor-not-allowed ${M[l]}`,children:[f&&h.jsx(ae,{name:he.Spinner,className:"w-4 h-4 animate-spin"}),h.jsx(J,{children:f?y:m})]})]})]})},gv=(e,t)=>window.G7Core?.t?.(e,t)??e,pv=({isOpen:e,onClose:t,title:n,message:r,confirmText:s,onConfirm:o,confirmButtonVariant:i="primary",width:a="500px",closeOnOverlay:l=!0})=>{const u=[{label:s??gv("common.confirm"),onClick:()=>{o?.(),t()},variant:i}],f=typeof r=="string"?h.jsx(kt,{className:"text-gray-700 dark:text-gray-300",children:r}):r;return h.jsx(Hu,{isOpen:e,onClose:t,title:n,content:f,actions:u,width:a,closeOnOverlay:l})},mv=(e,t)=>window.G7Core?.t?.(e,t)??e,bv={success:he.CheckCircle,error:he.XCircle,warning:he.ExclamationTriangle,info:he.InfoCircle},Bu={success:{bg:"bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-800",text:"text-green-800 dark:text-green-300"},error:{bg:"bg-red-50 dark:bg-red-900/20 border-red-200 dark:border-red-800",text:"text-red-800 dark:text-red-300"},warning:{bg:"bg-yellow-50 dark:bg-yellow-900/20 border-yellow-200 dark:border-yellow-800",text:"text-yellow-800 dark:text-yellow-300"},info:{bg:"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800",text:"text-blue-800 dark:text-blue-300"}},yv={"top-left":"top-4 left-4","top-center":"top-4 left-1/2 -translate-x-1/2","top-right":"top-4 right-4","bottom-left":"bottom-4 left-4","bottom-center":"bottom-4 left-1/2 -translate-x-1/2","bottom-right":"bottom-4 right-4"},vv=({toasts:e,position:t="bottom-center",duration:n=3e3,onRemove:r})=>{const[s,o]=v.useState(new Map),i=v.useCallback(a=>{o(l=>{const c=new Map(l);return c.set(a,!1),c}),setTimeout(()=>{if(r)r(a);else{const l=window.G7Core;l?.state?.update&&l.state.update(c=>({toasts:(Array.isArray(c.toasts)?c.toasts:[]).filter(u=>u.id!==a)}))}},300)},[r]);return v.useEffect(()=>{!e||e.length===0||e.forEach(a=>{if(s.has(a.id))return;o(c=>{const d=new Map(c);return d.set(a.id,!0),d});const l=a.duration||n;l>0&&setTimeout(()=>{i(a.id)},l)})},[e,n,i,s]),!e||e.length===0?null:h.jsx(I,{className:`fixed z-[9999] flex flex-col gap-2 ${yv[t]}`,"aria-live":"polite","aria-atomic":"true",children:e.map(a=>h.jsx(xv,{toast:a,position:t,isVisible:s.get(a.id)??!0,onClose:()=>i(a.id)},a.id))})},xv=({toast:e,position:t,isVisible:n,onClose:r})=>{const s=Bu[e.type]||Bu.info,o=e.icon?e.icon:bv[e.type],i=t.startsWith("bottom")?"translate-y-2":"-translate-y-2";return h.jsxs(I,{className:`
|
||
flex items-center gap-3 p-4 rounded-lg border shadow-lg
|
||
min-w-[300px] max-w-md
|
||
transition-all duration-300
|
||
${s.bg}
|
||
${n?"opacity-100 translate-y-0":`opacity-0 ${i}`}
|
||
`,role:"alert",children:[h.jsx(ae,{name:o,className:`w-5 h-5 flex-shrink-0 ${s.text}`}),h.jsx(J,{className:`flex-1 text-sm font-medium ${s.text}`,children:e.message}),h.jsx(le,{onClick:r,className:`flex-shrink-0 p-1 rounded hover:bg-black/10 dark:hover:bg-white/10 ${s.text} focus:outline-none`,"aria-label":mv("common.close_notification"),children:h.jsx(ae,{name:he.Times,className:"w-4 h-4"})})]})},ju=({items:e,separator:t=h.jsx(ae,{name:he.ChevronRight,className:"w-4 h-4 text-gray-400 dark:text-gray-500"}),showHome:n=!1,homeHref:r="/",maxItems:s,className:o="",id:i,editorAttrs:a})=>{let c=n?[{label:"Home",href:r},...e]:e,d=c,u=!1;if(s&&c.length>s){u=!0;const f=c.slice(0,1),g=c.slice(-(s-2));d=[...f,...g]}return h.jsx(Jo,{className:`flex items-center space-x-2 text-sm ${o}`,"aria-label":"Breadcrumb",id:i,...a,children:h.jsx(I,{className:"flex items-center space-x-2",children:d.map((f,g)=>{const m=g===d.length-1,p=g===0;return h.jsxs(v.Fragment,{children:[u&&p&&h.jsxs(h.Fragment,{children:[h.jsx(Wu,{item:f,isLast:!1}),h.jsx(J,{className:"text-gray-400 dark:text-gray-500","aria-hidden":"true",children:t}),h.jsx(J,{className:"text-gray-500 dark:text-gray-400",children:"..."}),d.length>1&&h.jsx(J,{className:"text-gray-400 dark:text-gray-500","aria-hidden":"true",children:t})]}),(!u||!p)&&h.jsxs(h.Fragment,{children:[h.jsx(Wu,{item:f,isLast:m}),!m&&h.jsx(J,{className:"text-gray-400 dark:text-gray-500","aria-hidden":"true",children:t})]})]},g)})})})},Wu=({item:e,isLast:t})=>t||!e.href&&!e.onClick?h.jsx(J,{className:"font-medium text-gray-900 dark:text-white","aria-current":t?"page":void 0,children:e.label}):e.onClick?h.jsx(qr,{href:"#",onClick:n=>{n.preventDefault(),e.onClick?.()},className:"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 transition-colors",children:e.label}):h.jsx(qr,{href:e.href,className:"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 transition-colors",children:e.label}),wv=({title:e,description:t,iconName:n,illustrationSrc:r,illustrationAlt:s="Empty state illustration",actions:o=[],className:i="",id:a,editorAttrs:l})=>{const c={primary:"bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500",secondary:"bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-gray-200 hover:bg-gray-300 dark:hover:bg-gray-600 focus:ring-gray-500",danger:"bg-red-600 text-white hover:bg-red-700 focus:ring-red-500",ghost:"bg-transparent text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 focus:ring-gray-500"};return h.jsxs(I,{className:`flex flex-col items-center justify-center p-8 text-center ${i}`,role:"status","aria-live":"polite",id:a,...l,children:[r?h.jsx(Nn,{src:r,alt:s,className:"w-48 h-48 mb-6 object-contain"}):n?h.jsx(I,{className:"mb-6 p-4 rounded-full bg-gray-100 dark:bg-gray-700",children:h.jsx(ae,{name:n,className:"w-12 h-12 text-gray-400 dark:text-gray-500"})}):null,h.jsx(cr,{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:e}),t&&h.jsx(kt,{className:"text-gray-600 dark:text-gray-400 mb-6 max-w-md",children:t}),o.length>0&&h.jsx(I,{className:"flex flex-wrap gap-3 justify-center",children:o.map((d,u)=>h.jsxs(le,{onClick:d.onClick,className:`
|
||
px-4 py-2 rounded-md font-medium transition-colors
|
||
focus:outline-none focus:ring-2 focus:ring-offset-2
|
||
${c[d.variant||"primary"]}
|
||
`,children:[d.iconName&&h.jsx(ae,{name:d.iconName,className:"w-4 h-4 mr-2 inline-block"}),d.label]},u))})]})},kv=(e,t)=>window.G7Core?.t?.(e,t)??e,Cv=({id:e,size:t="md",color:n="text-blue-600",fullscreen:r=!1,text:s,className:o="",editorAttrs:i})=>{const a={sm:"w-4 h-4 border-2",md:"w-8 h-8 border-2",lg:"w-12 h-12 border-3",xl:"w-16 h-16 border-4"},l={sm:"text-xs",md:"text-sm",lg:"text-base",xl:"text-lg"},c=h.jsxs(I,{className:`flex flex-col items-center justify-center gap-3 ${o}`,children:[h.jsx(I,{className:`
|
||
${a[t]}
|
||
border-gray-200 dark:border-gray-700 border-t-current
|
||
rounded-full animate-spin
|
||
${n}
|
||
`,role:"status","aria-label":kv("common.loading")}),s&&h.jsx(J,{className:`${l[t]} ${n} font-medium`,children:s})]});return r?h.jsx(I,{id:e,className:"fixed inset-0 z-50 flex items-center justify-center bg-white dark:bg-gray-900 bg-opacity-90 dark:bg-opacity-90","aria-live":"polite","aria-busy":"true",...i,children:c}):h.jsx(I,{id:e,className:"flex items-center justify-center p-4","aria-live":"polite","aria-busy":"true",...i,children:c})},rs=()=>window.G7Core,Tl=(e,t)=>window.G7Core?.t?.(e,t)??e,Sv=({logo:e,logoAlt:t="Logo",menu:n=[],collapsed:r=!1,onToggleCollapse:s,className:o="",currentLocale:i,id:a,editorAttrs:l})=>{const[c,d]=v.useState(new Set),[u,f]=v.useState(i||rs()?.locale?.current?.()||"ko"),[g,m]=v.useState(window.location.pathname),p=v.useMemo(()=>{const w=[],E=T=>{for(const P of T)P.url&&w.push(P.url),P.children&&E(P.children)};return E(n),w},[n]),y=v.useCallback(w=>{let E=null;for(const T of p)(w===T||w.startsWith(T+"/"))&&(!E||T.length>E.length)&&(E=T);return E},[p]);v.useEffect(()=>{const w=rs();return w?.state?.subscribe?w.state.subscribe(T=>{const P=T?._global?.locale||w?.locale?.current?.()||"ko";f(P);const L=T?._global?.currentPath||window.location.pathname;m(L)}):void 0},[]),v.useEffect(()=>{const w=()=>{m(window.location.pathname)};return window.addEventListener("popstate",w),()=>window.removeEventListener("popstate",w)},[]),v.useEffect(()=>{i&&f(i)},[i]);const b=(w,E)=>!w||typeof E!="string"?!1:E===w?!0:E.startsWith(w+"/")?y(E)===w:!1,_=(w,E)=>{const T=new Set,P=L=>{for(const F of L)if(F.children&&F.children.length>0){if(P(F.children)||b(F.url,E))return T.add(F.id),!0}else if(b(F.url,E))return!0;return!1};return P(w),T};v.useEffect(()=>{if(n.length>0&&g){const w=_(n,g);w.size>0&&d(E=>new Set([...E,...w]))}},[g,n]);const x=w=>b(w,g),M=w=>w.children?w.children.some(E=>x(E.url)||M(E)):!1,S=w=>{d(E=>{const T=new Set(E);return T.has(w)?T.delete(w):T.add(w),T})},k=w=>typeof w=="string"?w:w[u]||w.en||Object.values(w)[0]||"",N=(w,E)=>{rs()?.dispatch?(w.preventDefault(),rs().navigation?.onComplete(()=>{rs().dispatch({handler:"setState",params:{target:"global",sidebarOpen:!1}})}),rs().dispatch({handler:"navigate",params:{path:E}})):window.location.href=E},C=(w,E=0,T=!1)=>{const P=w.children&&w.children.length>0,L=c.has(w.id),F=k(w.name),A=E>0,D=x(w.url),O=M(w),z=A?"admin-sidebar-subitem":"admin-sidebar-item",U="admin-sidebar-item-active",j="admin-sidebar-item-active-parent",Y="admin-sidebar-item-default";return h.jsxs(I,{className:A?"relative group":"",children:[A&&h.jsxs(h.Fragment,{children:[!T&&h.jsx(I,{className:"admin-sidebar-tree-line-vertical"}),h.jsx(I,{className:"admin-sidebar-tree-line-curve"})]}),P&&w.url?h.jsxs(I,{className:`
|
||
${z}
|
||
${D?U:O?j:Y}
|
||
${r?"justify-center":""}
|
||
`,children:[h.jsxs(le,{onClick:W=>N(W,w.url),className:"flex items-center justify-start flex-1 min-w-0",children:[w.icon&&h.jsx(yt,{className:`${w.icon} ${r?"":"mr-3"} w-5 h-5 flex items-center justify-center`}),!r&&h.jsx(J,{className:"truncate",children:F})]}),!r&&h.jsxs(I,{className:"admin-sidebar-chevron-trail",children:[w.module_id&&h.jsx(yt,{className:"fas fa-cube admin-sidebar-module-icon",title:"모듈 메뉴"}),h.jsx(le,{onClick:()=>S(w.id),className:"p-1 rounded hover:bg-gray-200 dark:hover:bg-gray-600","aria-label":Tl(L?"common.collapse":"common.expand"),children:h.jsx(yt,{className:`fas fa-chevron-down w-4 h-4 transition-transform ${L?"rotate-180":""}`})})]})]}):P?h.jsxs(le,{onClick:()=>S(w.id),className:`
|
||
${z}
|
||
${O?j:Y}
|
||
${r?"justify-center":""}
|
||
`,children:[h.jsxs(I,{className:"admin-sidebar-item-content",children:[w.icon&&h.jsx(I,{className:"admin-sidebar-icon-box",children:h.jsx(yt,{className:w.icon})}),!r&&h.jsx(J,{children:F})]}),!r&&h.jsxs(I,{className:"admin-sidebar-chevron-trail",children:[w.module_id&&h.jsx(yt,{className:"fas fa-cube admin-sidebar-module-icon",title:"모듈 메뉴"}),h.jsx(yt,{className:`fas fa-chevron-right w-4 h-4 text-slate-400 transition-transform duration-200 ${L?"rotate-90":""}`})]})]}):w.url?h.jsxs(le,{onClick:W=>N(W,w.url),className:`
|
||
${z}
|
||
${D?U:Y}
|
||
${r?"justify-center":""}
|
||
text-left
|
||
`,children:[h.jsxs(I,{className:"admin-sidebar-item-content",children:[w.icon&&h.jsx(I,{className:"admin-sidebar-icon-box",children:h.jsx(yt,{className:w.icon})}),!r&&h.jsx(J,{children:F})]}),!r&&w.module_id&&h.jsx(yt,{className:"fas fa-cube admin-sidebar-module-icon",title:"모듈 메뉴"})]}):h.jsxs(le,{className:`
|
||
${z}
|
||
admin-sidebar-item-disabled
|
||
${r?"justify-center":""}
|
||
text-left
|
||
`,children:[h.jsxs(I,{className:"admin-sidebar-item-content",children:[w.icon&&h.jsx(I,{className:"admin-sidebar-icon-box",children:h.jsx(yt,{className:w.icon})}),!r&&h.jsx(J,{children:F})]}),!r&&w.module_id&&h.jsx(yt,{className:"fas fa-cube admin-sidebar-module-icon",title:"모듈 메뉴"})]}),P&&!r&&L&&h.jsx(I,{className:"relative ml-2",children:w.children.map((W,G)=>C(W,E+1,G===w.children.length-1))})]},w.id)};return h.jsxs(I,{className:o,id:a,...l,children:[(e||s)&&h.jsxs(I,{className:"admin-sidebar-header",children:[e&&!r&&h.jsx(Nn,{src:e,alt:t,className:"h-8"}),s&&h.jsx(le,{onClick:s,className:"admin-sidebar-collapse-btn","aria-label":Tl(r?"common.expand_sidebar":"common.collapse_sidebar"),children:h.jsx(yt,{className:`${r?"fas fa-chevron-right":"fas fa-chevron-left"} w-5 h-5 text-slate-600 dark:text-slate-400`})})]}),h.jsx(I,{className:"admin-sidebar-menu-list",children:n.map((w,E)=>C(w,0,E===n.length-1))})]})},Ws=(e,t)=>window.G7Core?.t?.(e,t)??e,_v=({user:e={name:"",email:""},notifications:t=[],onNotificationClick:n,onProfileClick:r,onLogoutClick:s,className:o=""})=>{const[i,a]=v.useState(!1),[l,c]=v.useState(!1),d=v.useRef(null),u=v.useRef(null),f=t.filter(g=>!g.read).length;return v.useEffect(()=>{const g=m=>{d.current&&!d.current.contains(m.target)&&a(!1),u.current&&!u.current.contains(m.target)&&c(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[]),h.jsxs(I,{className:`
|
||
bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 px-6 py-4 flex items-center justify-end gap-4
|
||
${o}
|
||
`,children:[h.jsxs(I,{ref:d,className:"relative",children:[h.jsxs(le,{onClick:()=>a(!i),className:"relative p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-full transition-colors","aria-label":Ws("common.notifications"),children:[h.jsx(ae,{name:he.Bell,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),f>0&&h.jsx(J,{className:"absolute top-0 right-0 flex items-center justify-center w-5 h-5 text-xs font-bold text-white bg-red-500 rounded-full",children:f>9?"9+":f})]}),i&&h.jsxs(I,{className:"absolute right-0 mt-2 w-80 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50",children:[h.jsx(I,{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:h.jsx(J,{className:"font-semibold text-gray-900 dark:text-white",children:Ws("common.notifications")})}),h.jsx(I,{className:"max-h-96 overflow-y-auto",children:t.length===0?h.jsx(I,{className:"px-4 py-8 text-center text-gray-500 dark:text-gray-400",children:h.jsx(J,{children:Ws("common.no_notifications")})}):t.map(g=>h.jsx(le,{onClick:()=>{g.onClick?.(),n?.(g.id),a(!1)},className:`
|
||
w-full px-4 py-3 text-left hover:bg-gray-50 dark:hover:bg-gray-700 border-b border-gray-100 dark:border-gray-700 transition-colors
|
||
${g.read?"":"bg-blue-50 dark:bg-blue-900/20"}
|
||
`,children:h.jsxs(I,{className:"flex items-start gap-3",children:[g.iconName&&h.jsx(ae,{name:g.iconName,className:"w-5 h-5 text-gray-600 dark:text-gray-400 mt-0.5"}),h.jsxs(I,{className:"flex-1",children:[h.jsx(I,{className:"font-semibold text-gray-900 dark:text-white text-sm",children:g.title}),h.jsx(I,{className:"text-gray-600 dark:text-gray-400 text-sm mt-1",children:g.message}),h.jsx(I,{className:"text-gray-400 dark:text-gray-500 text-xs mt-1",children:g.time})]}),!g.read&&h.jsx(J,{className:"w-2 h-2 bg-blue-500 rounded-full mt-1.5"})]})},g.id))})]})]}),h.jsxs(I,{ref:u,className:"relative",children:[h.jsxs(le,{onClick:()=>c(!l),className:"flex items-center gap-3 px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:[e.avatar?h.jsx(Nn,{src:e.avatar,alt:e.name,className:"w-8 h-8 rounded-full object-cover"}):h.jsx(I,{className:"w-8 h-8 rounded-full bg-gray-300 dark:bg-gray-600 flex items-center justify-center",children:h.jsx(ae,{name:he.User,className:"w-5 h-5 text-gray-600 dark:text-gray-400"})}),h.jsxs(I,{className:"hidden md:block text-left",children:[h.jsx(I,{className:"font-semibold text-gray-900 dark:text-white text-sm",children:e.name}),e.role&&h.jsx(I,{className:"text-gray-500 dark:text-gray-400 text-xs",children:e.role})]}),h.jsx(ae,{name:he.ChevronDown,className:"w-4 h-4 text-gray-600 dark:text-gray-400"})]}),l&&h.jsxs(I,{className:"absolute right-0 mt-2 w-56 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50",children:[h.jsxs(I,{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:[h.jsx(I,{className:"font-semibold text-gray-900 dark:text-white",children:e.name}),h.jsx(I,{className:"text-gray-500 dark:text-gray-400 text-sm",children:e.email})]}),h.jsxs(I,{className:"py-2",children:[h.jsxs(le,{onClick:()=>{r?.(),c(!1)},className:"w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors text-gray-900 dark:text-white",children:[h.jsx(ae,{name:he.User,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),h.jsx(J,{children:Ws("common.profile_settings")})]}),h.jsxs(le,{onClick:()=>{s?.(),c(!1)},className:"w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 text-red-600 dark:text-red-400 transition-colors",children:[h.jsx(ae,{name:he.ArrowRight,className:"w-5 h-5"}),h.jsx(J,{children:Ws("common.logout")})]})]})]})]})]})},Ev=({notifications:e=[],unreadCount:t=0,hasMore:n=!1,loading:r=!1,titleText:s="Notifications",emptyText:o="No notifications",markAllReadText:i="Mark all as read",deleteAllText:a="Delete all",unreadOnlyText:l="Unread only",unreadOnly:c=!1,onNotificationClick:d,onClose:u,onLoadMore:f,onMarkAllRead:g,onDeleteAll:m,onDelete:p,onUnreadOnlyToggle:y,dropdownAlign:b="right",className:_="",id:x,editorAttrs:M})=>{const[S,k]=v.useState(!1),N=v.useRef(null),C=v.useRef(null),w=v.useRef(null),E=v.useRef(null),T=v.useRef(new Set),P=v.useRef(f),L=v.useRef(n),F=v.useRef(r),A=v.useRef(e.length),D=v.useRef(-1);v.useEffect(()=>{P.current=f,L.current=n,F.current=r,A.current=e.length}),v.useEffect(()=>{if(!E.current||!w.current||!S)return;D.current=-1;const j=new IntersectionObserver(([Y])=>{Y.isIntersecting&&(F.current||!L.current||D.current!==A.current&&(D.current=A.current,P.current?.()))},{root:w.current,threshold:.1});return j.observe(E.current),()=>j.disconnect()},[S]),v.useEffect(()=>{if(!w.current||!S)return;const j=new IntersectionObserver(B=>{B.forEach(W=>{const G=W.target.getAttribute("data-notification-id"),V=W.target.getAttribute("data-unread")==="true";G&&V&&W.isIntersecting&&T.current.add(G)})},{root:w.current,threshold:.5});return w.current.querySelectorAll("[data-notification-id]").forEach(B=>j.observe(B)),()=>j.disconnect()},[S,e]);const O=t>0?t:e.filter(j=>!j.read).length,z=v.useCallback(()=>{if(S){if(O>0){const j=Array.from(T.current).filter(Y=>{const B=e.find(W=>String(W.id)===String(Y));return B&&!B.read});j.length>0&&u?.(j)}T.current.clear(),k(!1)}},[S,u,O,e]);v.useEffect(()=>{if(!S)return;const j=Y=>{N.current&&!N.current.contains(Y.target)&&z()};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[S,z]);const U=v.useCallback(()=>{S?z():k(!0)},[S,z]);return v.useLayoutEffect(()=>{const j=C.current;if(!S||!j)return;j.style.transform="";const Y=j.getBoundingClientRect(),B=typeof window<"u"?window.innerWidth:0;if(Y.width===0&&Y.height===0)return;const W=8;let G=0;Y.right>B-W?G=-(Y.right-(B-W)):Y.left<W&&(G=W-Y.left),G!==0&&(j.style.transform=`translateX(${G}px)`)},[S,b,e.length]),h.jsxs(I,{ref:N,className:`relative ${_}`,id:x,...M,children:[h.jsxs(le,{onClick:U,className:"relative w-9 h-9 flex items-center justify-center hover:bg-gray-100 dark:hover:bg-gray-800 rounded-full transition-colors cursor-pointer","aria-label":s,children:[h.jsx(ae,{name:he.Bell,className:"text-sm text-slate-500 dark:text-slate-400"}),O>0&&h.jsx(J,{className:"absolute top-0 right-0 flex items-center justify-center w-5 h-5 text-xs font-bold text-white bg-red-500 dark:bg-red-600 rounded-full",children:O>99?"99+":O})]}),S&&h.jsxs(I,{ref:C,className:`absolute ${b==="left"?"left-0":"right-0"} mt-2 w-80 max-w-[calc(100vw-1rem)] bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50`,children:[h.jsxs(I,{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between gap-2",children:[h.jsxs(I,{className:"flex items-center gap-3 min-w-0",children:[h.jsx(J,{className:"font-semibold text-gray-900 dark:text-white",children:s}),y&&h.jsxs(I,{className:"flex items-center gap-1.5 cursor-pointer select-none",onClick:()=>y(!c),children:[h.jsx(Et,{type:"checkbox",checked:c,onChange:j=>{j.stopPropagation(),y(j.target.checked)},onClick:j=>j.stopPropagation(),className:"w-3.5 h-3.5 rounded border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-400 focus:ring-blue-500 dark:focus:ring-blue-400 cursor-pointer"}),h.jsx(J,{className:"text-xs text-gray-600 dark:text-gray-400",children:l})]})]}),h.jsxs(I,{className:"flex items-center gap-3 flex-shrink-0",children:[g&&O>0&&h.jsx(le,{onClick:()=>{g(),T.current.clear()},className:"text-xs text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 hover:underline cursor-pointer",children:i}),m&&e.length>0&&h.jsx(le,{onClick:()=>{m()},className:"text-xs text-red-600 dark:text-red-400 hover:text-red-800 dark:hover:text-red-300 hover:underline cursor-pointer",children:a})]})]}),h.jsx(I,{ref:w,className:"max-h-96 overflow-y-auto",children:e.length===0&&!r?h.jsx(I,{className:"px-4 py-8 text-center text-gray-500 dark:text-gray-400",children:h.jsx(J,{children:o})}):h.jsxs(h.Fragment,{children:[e.map(j=>{const Y=!j.read;return h.jsxs(I,{"data-notification-id":j.id,"data-unread":Y?"true":"false",onClick:()=>{j.onClick?.(),d?.(j),k(!1)},className:`group flex items-start gap-3 px-4 py-3 text-left border-b border-gray-100 dark:border-gray-700 transition-colors cursor-pointer ${Y?"bg-blue-50/70 dark:bg-blue-900/20 hover:bg-blue-50 dark:hover:bg-blue-900/30":"bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700/50 opacity-70"}`,children:[j.iconName&&h.jsx(ae,{name:j.iconName,className:`w-5 h-5 mt-0.5 flex-shrink-0 ${Y?"text-blue-600 dark:text-blue-400":"text-gray-400 dark:text-gray-500"}`}),h.jsxs(I,{className:"flex-1 min-w-0",children:[h.jsx(I,{className:`text-sm truncate ${Y?"font-semibold text-gray-900 dark:text-white":"font-normal text-gray-600 dark:text-gray-400"}`,children:j.title}),h.jsx(I,{className:`text-sm mt-1 line-clamp-2 ${Y?"text-gray-700 dark:text-gray-300":"text-gray-500 dark:text-gray-500"}`,children:j.message}),h.jsx(I,{className:"text-gray-400 dark:text-gray-500 text-xs mt-1 font-mono",children:j.time})]}),h.jsxs(I,{className:"flex flex-col items-center gap-2 flex-shrink-0",children:[Y&&h.jsx(J,{className:"w-2 h-2 bg-blue-500 dark:bg-blue-400 rounded-full mt-1.5"}),p&&h.jsx(le,{onClick:B=>{B.stopPropagation(),p(j)},className:"p-1 text-gray-400 dark:text-gray-500 hover:text-red-600 dark:hover:text-red-400 rounded hover:bg-red-50 dark:hover:bg-red-900/20 cursor-pointer opacity-0 group-hover:opacity-100 transition-opacity","aria-label":"Delete notification",children:h.jsx(ae,{name:he.Trash,className:"w-4 h-4"})})]})]},j.id)}),n&&h.jsx(I,{ref:E,className:"px-4 py-3 text-center",children:r?h.jsx(J,{className:"text-sm text-gray-400 dark:text-gray-500",children:"..."}):h.jsx(J,{className:"text-sm text-gray-400 dark:text-gray-500"})}),r&&!n&&e.length>0&&h.jsx(I,{className:"px-4 py-2 text-center",children:h.jsx(J,{className:"text-sm text-gray-400 dark:text-gray-500",children:"..."})})]})})]})]})},Gu=window.G7Core?.createLogger?.("Comp:UserProfile")??{log:(...e)=>console.log("[Comp:UserProfile]",...e),warn:(...e)=>console.warn("[Comp:UserProfile]",...e),error:(...e)=>console.error("[Comp:UserProfile]",...e)},Mv=({user:e={name:"",email:""},profileText:t="Profile Settings",logoutText:n="Logout",onProfileClick:r,onLogoutClick:s,className:o="",logoutEndpoint:i="/api/admin/auth/logout",redirectPath:a="/admin/login",showChevron:l=!0,dropdownDirection:c="up",dropdownOnly:d=!1,id:u,editorAttrs:f})=>{const[g,m]=v.useState(!1),[p,y]=v.useState(!1),b=v.useRef(null);v.useEffect(()=>{const S=k=>{b.current&&!b.current.contains(k.target)&&m(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[]);const _=()=>{const k=`; ${document.cookie}`.split("; XSRF-TOKEN=");return k.length===2?decodeURIComponent(k.pop()?.split(";").shift()||""):null},x=()=>localStorage.getItem("auth_token"),M=async()=>{if(!p)try{if(y(!0),m(!1),s){s();return}const S=_(),k=x(),N=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",...S&&{"X-XSRF-TOKEN":S},...k&&{Authorization:`Bearer ${k}`}},credentials:"include"});N.ok?(localStorage.removeItem("auth_token"),window.location.href=a):(Gu.error("로그아웃 실패:",N.statusText),localStorage.removeItem("auth_token"),window.location.href=a)}catch(S){Gu.error("로그아웃 오류:",S),localStorage.removeItem("auth_token"),window.location.href=a}finally{y(!1)}};return h.jsxs(I,{ref:b,className:d?`absolute inset-0 ${o}`:`relative ${o}`,id:u,...f,children:[h.jsx(le,{onClick:()=>m(!g),className:d?"w-full h-full opacity-0 cursor-pointer":"flex items-center gap-2 px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors w-full",children:!d&&h.jsxs(h.Fragment,{children:[e.avatar?h.jsx(Nn,{src:e.avatar,alt:e.name,className:"w-8 h-8 rounded-full object-cover"}):h.jsx(I,{className:"w-8 h-8 rounded-full bg-gray-300 dark:bg-gray-600 flex items-center justify-center",children:h.jsx(ae,{name:he.User,className:"w-5 h-5 text-gray-600 dark:text-gray-400"})}),h.jsxs(I,{className:"flex-1 text-left",children:[h.jsx(I,{className:"font-semibold text-gray-900 dark:text-white text-sm",children:e.name}),e.role&&h.jsx(I,{className:"text-gray-500 dark:text-gray-400 text-xs",children:e.role})]}),l&&h.jsx(ae,{name:he.ChevronDown,className:"w-4 h-4 text-gray-600 dark:text-gray-400"})]})}),g&&h.jsxs(I,{className:`absolute ${c==="down"?"top-full mt-2":"bottom-full mb-2"} ${d?"right-0 w-72":"left-0 w-full"} bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50`,children:[h.jsxs(I,{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",onClick:()=>{m(!1),window.G7Core?.dispatch({handler:"navigate",params:{path:`/admin/users/${e.uuid}`}})},children:[h.jsx(I,{className:"font-semibold text-gray-900 dark:text-white",children:e.name}),h.jsx(I,{className:"text-gray-500 dark:text-gray-400 text-sm",children:e.email})]}),h.jsxs(I,{className:"py-2",children:[h.jsxs(le,{onClick:()=>{m(!1),r?r():window.G7Core?.dispatch({handler:"navigate",params:{path:`/admin/users/${e.uuid}/edit`}})},className:"w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center justify-start gap-3 transition-colors",children:[h.jsx(ae,{name:he.User,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),h.jsx(J,{className:"text-gray-900 dark:text-white",children:t})]}),h.jsxs(le,{onClick:M,disabled:p,className:"w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center justify-start gap-3 text-red-600 dark:text-red-400 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[h.jsx(ae,{name:he.ArrowRight,className:"w-5 h-5"}),h.jsx(J,{children:p?"Logging out...":n})]})]})]})]})},si=window.G7Core?.createLogger?.("Comp:LanguageSelector")??{log:(...e)=>console.log("[Comp:LanguageSelector]",...e),warn:(...e)=>console.warn("[Comp:LanguageSelector]",...e),error:(...e)=>console.error("[Comp:LanguageSelector]",...e)},Yu=e=>{const t=window.G7Core?.state?.get?.("_global.appConfig.localeNames")?.[e];return t||{ko:"한국어",en:"English",ja:"日本語",zh:"中文",es:"Español",fr:"Français",de:"Deutsch"}[e]||e},Nv=({availableLocales:e=["ko","en"],languageText:t="Language",apiEndpoint:n="/api/admin/users/me/language",onLanguageChange:r,className:s="",inline:o=!1,showCode:i=!1,id:a,editorAttrs:l})=>{const[c,d]=v.useState(!1),[u,f]=v.useState(!1),[g,m]=v.useState(()=>localStorage.getItem("g7_locale")||"ko"),p=v.useRef(null);v.useEffect(()=>{if(o)return;const x=M=>{p.current&&!p.current.contains(M.target)&&d(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[o]);const y=()=>{const M=`; ${document.cookie}`.split("; XSRF-TOKEN=");return M.length===2?decodeURIComponent(M.pop()?.split(";").shift()||""):null},b=()=>localStorage.getItem("auth_token"),_=async x=>{if(!(u||x===g))try{f(!0);const M=y(),S=b();try{const k=await fetch(n,{method:"PATCH",headers:{"Content-Type":"application/json",Accept:"application/json",...M&&{"X-XSRF-TOKEN":M},...S&&{Authorization:`Bearer ${S}`}},credentials:"include",body:JSON.stringify({language:x})});k.ok||si.warn("언어 설정 저장 실패 (UI는 변경됨):",k.statusText)}catch(k){si.warn("언어 설정 API 호출 실패 (UI는 변경됨):",k)}m(x),d(!1),r?.(x),window.__templateApp?await window.__templateApp.changeLocale(x):(si.warn("TemplateApp not found, reloading page"),window.location.reload())}catch(M){si.error("언어 변경 오류:",M)}finally{f(!1)}};return o?h.jsxs(I,{className:`${s}`,id:a,...l,children:[h.jsxs(le,{onClick:()=>d(!c),disabled:u,className:"w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors",children:[h.jsx(ae,{name:he.Globe,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),h.jsx(J,{className:"text-gray-900 dark:text-white flex-1",children:t}),h.jsx(J,{className:"px-2 py-0.5 text-xs font-medium bg-blue-100 dark:bg-blue-900 text-blue-700 dark:text-blue-300 rounded",children:g.toUpperCase()}),h.jsx(ae,{name:he.ChevronDown,className:`w-4 h-4 text-gray-400 dark:text-gray-500 transition-transform ${c?"rotate-180":""}`})]}),c&&h.jsx(I,{className:"px-4 py-2 flex flex-wrap gap-2",children:e.map(x=>h.jsx(le,{onClick:()=>_(x),disabled:u,className:`
|
||
px-3 py-1.5 text-sm font-medium rounded-md transition-colors
|
||
${g===x?"bg-blue-600 text-white":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"}
|
||
${u?"opacity-50 cursor-not-allowed":""}
|
||
`,children:Yu(x)},x))})]}):h.jsxs(I,{ref:p,className:`relative ${s}`,id:a,...l,children:[h.jsxs(le,{onClick:()=>d(!c),className:i?"flex items-center gap-1.5 px-2.5 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors cursor-pointer":"p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-colors","aria-haspopup":"listbox","aria-expanded":c,"aria-label":t,children:[h.jsx(ae,{name:he.Globe,className:i?"w-4 h-4":"w-5 h-5 text-gray-600 dark:text-gray-400"}),i&&h.jsx(J,{className:"font-medium uppercase",children:g}),i&&h.jsx(ae,{name:he.ChevronDown,className:"w-3 h-3"})]}),c&&h.jsx(I,{className:"absolute right-0 mt-2 w-48 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50",children:h.jsx(I,{className:"py-2",children:e.map(x=>h.jsxs(le,{onClick:()=>_(x),disabled:u,className:`
|
||
w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors
|
||
${g===x?"bg-gray-50 dark:bg-gray-700":""}
|
||
${u?"opacity-50 cursor-not-allowed":""}
|
||
`,children:[h.jsx(J,{className:"text-gray-900 dark:text-white flex-1",children:Yu(x)}),g===x&&h.jsx(ae,{name:he.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400"})]},x))})})]})},Ov=({copyright:e="© 2026 G7",version:t,quickLinks:n=[],className:r="",changelogModalId:s,copyrightModalId:o,id:i,editorAttrs:a})=>{const l=v.useCallback(()=>{s&&window.G7Core?.dispatch?.({handler:"sequence",actions:[{handler:"apiCall",auth_required:!0,target:"/api/admin/changelog",params:{method:"GET"},onSuccess:[{handler:"setState",params:{target:"global",coreChangelogContent:"{{response.data.content}}"}},{handler:"openModal",target:s}],onError:[{handler:"openModal",target:s}]}]})},[s]),c=v.useCallback(()=>{o&&window.G7Core?.dispatch?.({handler:"sequence",actions:[{handler:"apiCall",auth_required:!0,target:"/api/admin/license",params:{method:"GET"},onSuccess:[{handler:"setState",params:{target:"global",coreLicenseContent:"{{response.data.content}}"}},{handler:"openModal",target:o}],onError:[{handler:"openModal",target:o}]}]})},[o]);return h.jsx(I,{className:`admin-footer ${r}`,id:i,...a,children:h.jsxs(I,{className:"admin-footer-row",children:[h.jsxs(I,{className:"admin-footer-group",children:[h.jsx(J,{className:o?"admin-footer-link-hover":"",onClick:o?c:void 0,children:e}),t&&h.jsxs(h.Fragment,{children:[h.jsx(J,{className:"hidden md:inline",children:"•"}),h.jsxs(J,{className:`flex-center gap-2 ${s?"admin-footer-link-hover":""}`,onClick:s?l:void 0,children:[h.jsx(ae,{name:he.Tag,className:"w-4 h-4"}),h.jsxs(J,{children:["v",t]})]})]})]}),n.length>0&&h.jsx(I,{className:"flex-center gap-4",children:n.map(d=>h.jsxs(qr,{href:d.url,className:"admin-footer-link",children:[d.iconName&&h.jsx(ae,{name:d.iconName,className:"w-4 h-4"}),h.jsx(J,{children:d.label})]},d.id))})]})})},Tv=({title:e,description:t,breadcrumbItems:n,tabs:r,onTabChange:s,actions:o,className:i="",children:a,id:l,editorAttrs:c})=>{const d=(u="secondary")=>({primary:"page-action-primary",secondary:"page-action-secondary",danger:"page-action-danger",ghost:"page-action-ghost"})[u];return h.jsxs(I,{className:i,id:l,...c,children:[n&&n.length>0&&h.jsx(I,{className:"mb-md",children:h.jsx(ju,{items:n})}),h.jsxs(I,{className:"flex-between mb-lg",children:[h.jsxs(I,{children:[h.jsx(sl,{className:"page-title",children:e}),t&&h.jsx(kt,{className:"page-description",children:t})]}),a?h.jsx(I,{className:"flex-center page-actions",children:a}):o&&o.length>0?h.jsx(I,{className:"page-actions",children:o.map(u=>h.jsxs(le,{onClick:u.onClick,disabled:u.disabled,className:d(u.variant),children:[u.iconName&&h.jsx(ae,{name:u.iconName,className:"icon-md"}),u.variant!=="ghost"&&u.label&&h.jsx(I,{children:u.label})]},u.id))}):null]}),r&&r.length>0&&h.jsx(I,{className:"tab-container",children:r.map(u=>h.jsxs(le,{onClick:()=>s?.(u.value),className:u.active?"tab-btn-active":"tab-btn",children:[h.jsx(I,{children:u.label}),u.badge!==void 0&&h.jsx(I,{className:u.active?"tab-badge-active":"tab-badge",children:u.badge})]},u.id))})]})},Av=()=>window.G7Core,Dv=({title:e,description:t,className:n="",style:r,children:s,id:o,editorAttrs:i})=>{const a="flex items-center justify-between",l=Av()?.style?.mergeClasses?.(a,n)??`${a} ${n}`;return h.jsxs(I,{className:l,style:r,id:o,...i,children:[h.jsxs(I,{children:[e&&h.jsx(cr,{className:"text-base font-semibold text-gray-900 dark:text-white",children:e}),t&&h.jsx(kt,{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:t})]}),s&&h.jsx(I,{className:"flex items-center gap-2",children:s})]})},fr=(e,t)=>window.G7Core?.t?.(e,t)??e,Iv=({image:e,imageAlt:t,vendor:n,name:r,version:s,status:o,updateAvailable:i=!1,latestVersion:a,dependencies:l=[],showLayoutEditButton:c=!1,actions:d=[],onLayoutEditClick:u,className:f="",id:g,editorAttrs:m})=>{const p=b=>({active:"success",inactive:"default",pending:"pending",error:"error"})[b],y=b=>({active:fr("common.status_active"),inactive:fr("common.status_inactive"),pending:fr("common.status_pending"),error:fr("common.status_error")})[b];return h.jsxs(I,{className:`
|
||
bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden hover:shadow-lg transition-shadow
|
||
${f}
|
||
`,id:g,...m,children:[e&&h.jsxs(I,{className:"relative",children:[h.jsx(Nn,{src:e,alt:t||fr("common.template_preview",{vendor:n,name:r}),className:"w-full h-48 object-cover"}),h.jsx(I,{className:"absolute top-3 right-3",children:h.jsx(ei,{status:p(o),label:y(o),showIcon:!0})}),i&&h.jsx(I,{className:"absolute top-3 left-3",children:h.jsxs(J,{className:"flex items-center gap-1 px-2 py-1 bg-yellow-50 dark:bg-yellow-900/20 text-yellow-700 dark:text-yellow-400 border border-yellow-200 dark:border-yellow-800 rounded-md text-xs font-semibold",children:[h.jsx(ae,{name:he.ExclamationTriangle,className:"w-3 h-3"}),h.jsx(J,{children:fr("common.update_available")})]})})]}),h.jsxs(I,{className:"p-4",children:[h.jsxs(I,{className:"flex items-start justify-between mb-3",children:[h.jsxs(I,{className:"flex-1",children:[h.jsxs(Xr,{className:"text-lg font-bold text-gray-900 dark:text-white",children:[n,"/",r]}),h.jsxs(I,{className:"flex items-center gap-2 mt-1 text-sm text-gray-600 dark:text-gray-400",children:[h.jsxs(J,{children:["v",s]}),i&&a&&h.jsxs(h.Fragment,{children:[h.jsx(J,{children:"→"}),h.jsxs(J,{className:"text-yellow-600 dark:text-yellow-400 font-semibold",children:["v",a]})]})]}),!e&&h.jsx(I,{className:"mt-2",children:h.jsx(ei,{status:p(o),label:y(o),showIcon:!0})})]}),d.length>0&&h.jsx(Vs,{items:d,triggerIconName:he.EllipsisVertical,position:"left"})]}),l.length>0&&h.jsxs(I,{className:"mb-3",children:[h.jsxs(kt,{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:[fr("common.dependencies"),":"]}),h.jsx(I,{className:"flex flex-wrap gap-1",children:l.map((b,_)=>h.jsx(J,{className:"px-2 py-0.5 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 text-xs rounded",children:b},_))})]}),c&&u&&h.jsxs(le,{onClick:u,className:"w-full px-4 py-2 bg-blue-600 dark:bg-blue-500 text-white rounded-md hover:bg-blue-700 dark:hover:bg-blue-600 transition-colors flex items-center justify-center gap-2 font-medium",children:[h.jsx(ae,{name:he.Edit,className:"w-4 h-4"}),h.jsx(J,{children:fr("common.edit_layout")})]})]})]})},Ku=({type:e,message:t,dismissible:n=!1,onDismiss:r,className:s="",id:o,editorAttrs:i})=>{const a={info:{containerClass:"alert-info",iconClass:"alert-icon-info",textClass:"alert-text-info",icon:he.InfoCircle},success:{containerClass:"alert-success",iconClass:"alert-icon-success",textClass:"alert-text-success",icon:he.CheckCircle},warning:{containerClass:"alert-warning",iconClass:"alert-icon-warning",textClass:"alert-text-warning",icon:he.ExclamationTriangle},error:{containerClass:"alert-error",iconClass:"alert-icon-error",textClass:"alert-text-error",icon:he.TimesCircle}},l=a[e]??a.info;return h.jsxs(I,{className:`${l.containerClass} ${s}`,role:"alert","aria-live":"polite",id:o,...i,children:[h.jsx(ae,{name:l.icon,className:l.iconClass,ariaLabel:`${e} icon`}),h.jsx(kt,{className:l.textClass,children:t}),n&&h.jsx(le,{onClick:r,className:`alert-dismiss ${l.textClass}`,"aria-label":"Close alert",children:h.jsx(ae,{name:he.Times,className:l.iconClass,ariaLabel:"Close"})})]})},Lv=({layoutName:e,onBack:t,onPreview:n,onSave:r,isSaving:s=!1,className:o=""})=>{const i=`
|
||
flex items-center justify-between gap-4 p-4 bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700
|
||
${o}
|
||
`.trim().replace(/\s+/g," ");return h.jsxs(I,{className:i,children:[h.jsxs(I,{className:"flex items-center gap-3",children:[h.jsx(le,{onClick:t,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors bg-transparent border-0 cursor-pointer","aria-label":"뒤로가기",children:h.jsx(ae,{name:he.ArrowLeft,className:"text-gray-700 dark:text-gray-300",ariaLabel:"뒤로가기"})}),h.jsx(cr,{className:"text-xl font-semibold text-gray-900 dark:text-gray-100",children:e})]}),h.jsxs(I,{className:"flex items-center gap-2",children:[h.jsx(le,{onClick:n,className:"px-4 py-2 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-lg transition-colors border-0 cursor-pointer","aria-label":"미리보기",children:h.jsxs(I,{className:"flex items-center gap-2",children:[h.jsx(ae,{name:he.Eye,className:"text-gray-700 dark:text-gray-300",ariaLabel:"미리보기 아이콘"}),h.jsx("span",{children:"미리보기"})]})}),h.jsx(le,{onClick:r,disabled:s,className:`
|
||
px-4 py-2 rounded-lg transition-colors border-0 cursor-pointer
|
||
${s?"bg-blue-400 dark:bg-blue-600 cursor-not-allowed":"bg-blue-600 dark:bg-blue-500 hover:bg-blue-700 dark:hover:bg-blue-600"}
|
||
text-white
|
||
`.trim().replace(/\s+/g," "),"aria-label":s?"저장 중...":"저장",children:h.jsxs(I,{className:"flex items-center gap-2",children:[h.jsx(ae,{name:s?he.Spinner:he.Save,className:`text-white ${s?"animate-spin":""}`,ariaLabel:s?"저장 중 아이콘":"저장 아이콘"}),h.jsx("span",{children:s?"저장 중...":"저장"})]})})]})]})},Pv=({files:e,selectedId:t,onSelect:n,className:r=""})=>{const s=a=>{try{const l=new Date(a);if(isNaN(l.getTime()))return a;const c=l.getFullYear(),d=String(l.getMonth()+1).padStart(2,"0"),u=String(l.getDate()).padStart(2,"0"),f=String(l.getHours()).padStart(2,"0"),g=String(l.getMinutes()).padStart(2,"0");return`${c}-${d}-${u} ${f}:${g}`}catch{return a}},o=a=>{n(a)},i=`
|
||
w-full
|
||
${r}
|
||
`.trim().replace(/\s+/g," ");return h.jsx(I,{className:i,children:e.length===0?h.jsx(I,{className:"p-4 text-center text-gray-500 dark:text-gray-400",children:"파일이 없습니다."}):h.jsx(ol,{className:"divide-y divide-gray-200 dark:divide-gray-700",role:"listbox","aria-label":"레이아웃 파일 목록",children:e.map(a=>{const l=a.id===t,c=`
|
||
flex items-center justify-between p-4 cursor-pointer
|
||
transition-colors duration-150
|
||
${l?"bg-blue-100 dark:bg-blue-900 border-l-4 border-blue-500":"hover:bg-gray-100 dark:hover:bg-gray-800"}
|
||
`.trim().replace(/\s+/g," "),d=`
|
||
font-medium
|
||
${l?"text-blue-900 dark:text-blue-100":"text-gray-900 dark:text-gray-100"}
|
||
`.trim().replace(/\s+/g," "),u=`
|
||
text-sm
|
||
${l?"text-blue-700 dark:text-blue-300":"text-gray-500 dark:text-gray-400"}
|
||
`.trim().replace(/\s+/g," ");return h.jsx(il,{className:c,onClick:()=>o(a.id),role:"option","aria-selected":l,tabIndex:0,onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),o(a.id))},children:h.jsxs(I,{className:"flex flex-col gap-1",children:[h.jsx(J,{className:d,children:a.name}),h.jsx(J,{className:u,children:s(a.updated_at)})]})},a.id)})})})};function Xu(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function $v(e){if(Array.isArray(e))return e}function Fv(e,t,n){return(t=Wv(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zv(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,o,i,a=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(d){c=!0,s=d}finally{try{if(!l&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw s}}return a}}function Vv(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Zu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qu(Object(n),!0).forEach(function(r){Fv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hv(e,t){if(e==null)return{};var n,r,s=Uv(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function Uv(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Bv(e,t){return $v(e)||zv(e,t)||Gv(e,t)||Vv()}function jv(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wv(e){var t=jv(e,"string");return typeof t=="symbol"?t:t+""}function Gv(e,t){if(e){if(typeof e=="string")return Xu(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xu(e,t):void 0}}function Yv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ju(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Qu(Object(n),!0).forEach(function(r){Yv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kv(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(s,o){return o(s)},r)}}function Gs(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return s.length>=e.length?e.apply(this,s):function(){for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];return t.apply(n,[].concat(s,a))}}}function oi(e){return{}.toString.call(e).includes("Object")}function Xv(e){return!Object.keys(e).length}function Ys(e){return typeof e=="function"}function qv(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Zv(e,t){return oi(t)||hr("changeType"),Object.keys(t).some(function(n){return!qv(e,n)})&&hr("changeField"),t}function Qv(e){Ys(e)||hr("selectorType")}function Jv(e){Ys(e)||oi(e)||hr("handlerType"),oi(e)&&Object.values(e).some(function(t){return!Ys(t)})&&hr("handlersType")}function Rv(e){e||hr("initialIsRequired"),oi(e)||hr("initialType"),Xv(e)&&hr("initialContent")}function ex(e,t){throw new Error(e[t]||e.default)}var tx={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},hr=Gs(ex)(tx),ii={changes:Zv,selector:Qv,handler:Jv,initial:Rv};function nx(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ii.initial(e),ii.handler(t);var n={current:e},r=Gs(ox)(n,t),s=Gs(sx)(n),o=Gs(ii.changes)(e),i=Gs(rx)(n);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return ii.selector(c),c(n.current)}function l(c){Kv(r,s,o,i)(c)}return[a,l]}function rx(e,t){return Ys(t)?t(e.current):t}function sx(e,t){return e.current=Ju(Ju({},e.current),t),t}function ox(e,t,n){return Ys(t)?t(e.current):Object.keys(n).forEach(function(r){var s;return(s=t[r])===null||s===void 0?void 0:s.call(t,e.current[r])}),n}var ix={create:nx},ax={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.54.0/min/vs"}};function lx(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return s.length>=e.length?e.apply(this,s):function(){for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];return t.apply(n,[].concat(s,a))}}}function cx(e){return{}.toString.call(e).includes("Object")}function dx(e){return e||ef("configIsRequired"),cx(e)||ef("configType"),e.urls?(ux(),{paths:{vs:e.urls.monacoBase}}):e}function ux(){console.warn(Ru.deprecation)}function fx(e,t){throw new Error(e[t]||e.default)}var Ru={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
||
You are using deprecated way of configuration.
|
||
|
||
Instead of using
|
||
monaco.config({ urls: { monacoBase: '...' } })
|
||
use
|
||
monaco.config({ paths: { vs: '...' } })
|
||
|
||
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
||
`},ef=lx(fx)(Ru),hx={config:dx},gx=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(s){return n.reduceRight(function(o,i){return i(o)},s)}};function tf(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],tf(e[n],t[n]))}),Zu(Zu({},e),t)}var px={type:"cancelation",msg:"operation is manually canceled"};function Al(e){var t=!1,n=new Promise(function(r,s){e.then(function(o){return t?s(px):r(o)}),e.catch(s)});return n.cancel=function(){return t=!0},n}var mx=["monaco"],bx=ix.create({config:ax,isInitialized:!1,resolve:null,reject:null,monaco:null}),nf=Bv(bx,2),Ks=nf[0],ai=nf[1];function yx(e){var t=hx.config(e),n=t.monaco,r=Hv(t,mx);ai(function(s){return{config:tf(s.config,r),monaco:n}})}function vx(){var e=Ks(function(t){var n=t.monaco,r=t.isInitialized,s=t.resolve;return{monaco:n,isInitialized:r,resolve:s}});if(!e.isInitialized){if(ai({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Al(Dl);if(window.monaco&&window.monaco.editor)return rf(window.monaco),e.resolve(window.monaco),Al(Dl);gx(xx,kx)(Cx)}return Al(Dl)}function xx(e){return document.body.appendChild(e)}function wx(e){var t=document.createElement("script");return e&&(t.src=e),t}function kx(e){var t=Ks(function(r){var s=r.config,o=r.reject;return{config:s,reject:o}}),n=wx("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function Cx(){var e=Ks(function(n){var r=n.config,s=n.resolve,o=n.reject;return{config:r,resolve:s,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){var r=n.m;rf(r),e.resolve(r)},function(n){e.reject(n)})}function rf(e){Ks().monaco||ai({monaco:e})}function Sx(){return Ks(function(e){var t=e.monaco;return t})}var Dl=new Promise(function(e,t){return ai({resolve:e,reject:t})}),li={config:yx,init:vx,__getMonacoInstance:Sx},_x={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Il=_x,Ex={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Mx=Ex;function Nx({children:e}){return v.createElement("div",{style:Mx.container},e)}var Ox=Nx,Tx=Ox;function Ax({width:e,height:t,isEditorReady:n,loading:r,_ref:s,className:o,wrapperProps:i}){return v.createElement("section",{style:{...Il.wrapper,width:e,height:t},...i},!n&&v.createElement(Tx,null,r),v.createElement("div",{ref:s,style:{...Il.fullWidth,...!n&&Il.hide},className:o}))}var Dx=Ax,sf=v.memo(Dx);function Ix(e){v.useEffect(e,[])}var of=Ix;function Lx(e,t,n=!0){let r=v.useRef(!0);v.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var bn=Lx;function Xs(){}function ss(e,t,n,r){return Px(e,r)||$x(e,t,n,r)}function Px(e,t){return e.editor.getModel(af(e,t))}function $x(e,t,n,r){return e.editor.createModel(t,n,r?af(e,r):void 0)}function af(e,t){return e.Uri.parse(t)}function Fx({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:s,originalModelPath:o,modifiedModelPath:i,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:d="Loading...",options:u={},height:f="100%",width:g="100%",className:m,wrapperProps:p={},beforeMount:y=Xs,onMount:b=Xs}){let[_,x]=v.useState(!1),[M,S]=v.useState(!0),k=v.useRef(null),N=v.useRef(null),C=v.useRef(null),w=v.useRef(b),E=v.useRef(y),T=v.useRef(!1);of(()=>{let A=li.init();return A.then(D=>(N.current=D)&&S(!1)).catch(D=>D?.type!=="cancelation"&&console.error("Monaco initialization: error:",D)),()=>k.current?F():A.cancel()}),bn(()=>{if(k.current&&N.current){let A=k.current.getOriginalEditor(),D=ss(N.current,e||"",r||n||"text",o||"");D!==A.getModel()&&A.setModel(D)}},[o],_),bn(()=>{if(k.current&&N.current){let A=k.current.getModifiedEditor(),D=ss(N.current,t||"",s||n||"text",i||"");D!==A.getModel()&&A.setModel(D)}},[i],_),bn(()=>{let A=k.current.getModifiedEditor();A.getOption(N.current.editor.EditorOption.readOnly)?A.setValue(t||""):t!==A.getValue()&&(A.executeEdits("",[{range:A.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),A.pushUndoStop())},[t],_),bn(()=>{k.current?.getModel()?.original.setValue(e||"")},[e],_),bn(()=>{let{original:A,modified:D}=k.current.getModel();N.current.editor.setModelLanguage(A,r||n||"text"),N.current.editor.setModelLanguage(D,s||n||"text")},[n,r,s],_),bn(()=>{N.current?.editor.setTheme(c)},[c],_),bn(()=>{k.current?.updateOptions(u)},[u],_);let P=v.useCallback(()=>{if(!N.current)return;E.current(N.current);let A=ss(N.current,e||"",r||n||"text",o||""),D=ss(N.current,t||"",s||n||"text",i||"");k.current?.setModel({original:A,modified:D})},[n,t,s,e,r,o,i]),L=v.useCallback(()=>{!T.current&&C.current&&(k.current=N.current.editor.createDiffEditor(C.current,{automaticLayout:!0,...u}),P(),N.current?.editor.setTheme(c),x(!0),T.current=!0)},[u,c,P]);v.useEffect(()=>{_&&w.current(k.current,N.current)},[_]),v.useEffect(()=>{!M&&!_&&L()},[M,_,L]);function F(){let A=k.current?.getModel();a||A?.original?.dispose(),l||A?.modified?.dispose(),k.current?.dispose()}return v.createElement(sf,{width:g,height:f,isEditorReady:_,loading:d,_ref:C,className:m,wrapperProps:p})}var zx=Fx;v.memo(zx);function Vx(e){let t=v.useRef();return v.useEffect(()=>{t.current=e},[e]),t.current}var Hx=Vx,ci=new Map;function Ux({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:s,path:o,theme:i="light",line:a,loading:l="Loading...",options:c={},overrideServices:d={},saveViewState:u=!0,keepCurrentModel:f=!1,width:g="100%",height:m="100%",className:p,wrapperProps:y={},beforeMount:b=Xs,onMount:_=Xs,onChange:x,onValidate:M=Xs}){let[S,k]=v.useState(!1),[N,C]=v.useState(!0),w=v.useRef(null),E=v.useRef(null),T=v.useRef(null),P=v.useRef(_),L=v.useRef(b),F=v.useRef(),A=v.useRef(r),D=Hx(o),O=v.useRef(!1),z=v.useRef(!1);of(()=>{let Y=li.init();return Y.then(B=>(w.current=B)&&C(!1)).catch(B=>B?.type!=="cancelation"&&console.error("Monaco initialization: error:",B)),()=>E.current?j():Y.cancel()}),bn(()=>{let Y=ss(w.current,e||r||"",t||s||"",o||n||"");Y!==E.current?.getModel()&&(u&&ci.set(D,E.current?.saveViewState()),E.current?.setModel(Y),u&&E.current?.restoreViewState(ci.get(o)))},[o],S),bn(()=>{E.current?.updateOptions(c)},[c],S),bn(()=>{!E.current||r===void 0||(E.current.getOption(w.current.editor.EditorOption.readOnly)?E.current.setValue(r):r!==E.current.getValue()&&(z.current=!0,E.current.executeEdits("",[{range:E.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),E.current.pushUndoStop(),z.current=!1))},[r],S),bn(()=>{let Y=E.current?.getModel();Y&&s&&w.current?.editor.setModelLanguage(Y,s)},[s],S),bn(()=>{a!==void 0&&E.current?.revealLine(a)},[a],S),bn(()=>{w.current?.editor.setTheme(i)},[i],S);let U=v.useCallback(()=>{if(!(!T.current||!w.current)&&!O.current){L.current(w.current);let Y=o||n,B=ss(w.current,r||e||"",t||s||"",Y||"");E.current=w.current?.editor.create(T.current,{model:B,automaticLayout:!0,...c},d),u&&E.current.restoreViewState(ci.get(Y)),w.current.editor.setTheme(i),a!==void 0&&E.current.revealLine(a),k(!0),O.current=!0}},[e,t,n,r,s,o,c,d,u,i,a]);v.useEffect(()=>{S&&P.current(E.current,w.current)},[S]),v.useEffect(()=>{!N&&!S&&U()},[N,S,U]),A.current=r,v.useEffect(()=>{S&&x&&(F.current?.dispose(),F.current=E.current?.onDidChangeModelContent(Y=>{z.current||x(E.current.getValue(),Y)}))},[S,x]),v.useEffect(()=>{if(S){let Y=w.current.editor.onDidChangeMarkers(B=>{let W=E.current.getModel()?.uri;if(W&&B.find(G=>G.path===W.path)){let G=w.current.editor.getModelMarkers({resource:W});M?.(G)}});return()=>{Y?.dispose()}}return()=>{}},[S,M]);function j(){F.current?.dispose(),f?u&&ci.set(o,E.current.saveViewState()):E.current.getModel()?.dispose(),E.current.dispose()}return v.createElement(sf,{width:g,height:m,isEditorReady:S,loading:l,_ref:T,className:p,wrapperProps:y})}var Bx=Ux,jx=v.memo(Bx),Wx=jx;const Gx="0.54.0",Yx="sirsoft-admin_basic",lf="monaco-editor";function cf(){const e=window?.G7Core?.asset;return typeof e?.templateDir!="function"?!1:(li.config({paths:{vs:e.templateDir(Yx,`vendor/monaco-editor/${Gx}/vs`)}}),!0)}let di=!1;const Kx=({value:e,onChange:t,language:n="json",height:r="100%",readOnly:s=!1,theme:o="vs-dark"})=>{const i=v.useRef(null),[a,l]=v.useState(!1);di||(di=cf());const c=(f,g)=>{i.current=f,window?.G7Core?.assets?.clearFailure?.(lf),n==="json"&&g.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,schemaValidation:"error",allowComments:!1}),f.updateOptions({readOnly:s,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:14,lineNumbers:"on",renderWhitespace:"selection",automaticLayout:!0})},d=()=>{l(!0),window?.G7Core?.assets?.notifyFailure?.({id:lf,label:"코드 편집기",retry:()=>{l(!1)}})},u=f=>{t&&f!==void 0&&t({target:{value:f}})};return v.useEffect(()=>{i.current&&i.current.updateOptions({readOnly:s})},[s]),v.useEffect(()=>{if(a)return;let f=!1;return li.init().catch(()=>{f||d()}),()=>{f=!0}},[a]),a?h.jsx("div",{className:"border border-gray-300 dark:border-gray-700 rounded-lg overflow-hidden",children:h.jsx("textarea",{"data-testid":"code-editor-fallback",className:"w-full block p-3 font-mono text-sm bg-gray-100 text-gray-900 dark:bg-gray-900 dark:text-gray-100 outline-none resize-y",style:{height:r==="100%"?"480px":r},value:e,readOnly:s,spellCheck:!1,wrap:"off",onChange:f=>u(f.target.value),onKeyDown:f=>{if(f.key!=="Tab")return;f.preventDefault();const g=f.currentTarget,{selectionStart:m,selectionEnd:p}=g,y=`${e.slice(0,m)} ${e.slice(p)}`;u(y),requestAnimationFrame(()=>{g.selectionStart=g.selectionEnd=m+2})}})}):h.jsx("div",{className:"border border-gray-300 dark:border-gray-700 rounded-lg overflow-hidden",children:h.jsx(Wx,{height:r,language:n,value:e,theme:o,onChange:u,onMount:c,loading:h.jsx("div",{className:"p-4 text-sm text-gray-500 dark:text-gray-400",children:"편집기를 불러오는 중..."}),beforeMount:()=>{di||(di=cf())},options:{readOnly:s,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:14,lineNumbers:"on",renderWhitespace:"selection",automaticLayout:!0}})})},Xx=e=>{const t=new Date(e);return new Intl.DateTimeFormat("ko-KR",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(t)},df=v.memo(({version:e,isSelected:t,onSelect:n})=>{const r=v.useCallback(()=>{n?.(e.id)},[n,e.id]);return h.jsx(il,{role:"listitem","aria-selected":t,className:`
|
||
p-3 rounded-lg border cursor-pointer transition-colors
|
||
${t?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-300 hover:border-gray-400 dark:border-gray-600 dark:hover:border-gray-500"}
|
||
`,onClick:r,children:h.jsxs(I,{className:"flex justify-between items-start",children:[h.jsxs(I,{className:"flex-1",children:[h.jsxs(J,{className:"font-semibold text-gray-900 dark:text-gray-100",children:["버전 ",e.version]}),h.jsx(J,{className:"ml-2 text-sm text-gray-500 dark:text-gray-400",children:Xx(e.created_at)})]}),h.jsxs(I,{className:"flex gap-3 text-sm",children:[h.jsxs(J,{className:"text-green-600 dark:text-green-400",children:["+",e.changes_summary.added]}),h.jsxs(J,{className:"text-red-600 dark:text-red-400",children:["-",e.changes_summary.removed]})]})]})})});df.displayName="VersionListItem";const uf=({versions:e,selectedId:t,onSelect:n})=>e.length===0?h.jsx(I,{className:"p-4 text-center text-gray-500 dark:text-gray-400",children:"버전이 없습니다."}):h.jsx(ol,{role:"list",className:"space-y-2",children:e.map(r=>h.jsx(df,{version:r,isSelected:t===r.id,onSelect:n},r.id))}),qx=({layoutId:e,versions:t,onRestore:n})=>{const[r,s]=v.useState(),o=l=>{s(l)},i=()=>{r!==void 0&&n(r)},a=r===void 0;return h.jsxs(I,{className:"space-y-4",role:"region","aria-label":"레이아웃 히스토리 패널",children:[h.jsx(I,{className:"border border-gray-300 dark:border-gray-600 rounded-lg p-4",children:h.jsx(uf,{versions:t,selectedId:r,onSelect:o})}),h.jsx(I,{className:"flex justify-end",children:h.jsx(le,{variant:"primary",disabled:a,onClick:i,"aria-label":"선택한 버전으로 복원",children:"복원"})})]})},Zx=({emailLabel:e="Email",passwordLabel:t="Password",submitButtonText:n="Sign In",processingText:r="Processing...",emailPlaceholder:s="Email",passwordPlaceholder:o="Password",forgotPasswordText:i="Forgot your password?",forgotPasswordUrl:a="/admin/password/reset",emailRequiredError:l="Please enter your email.",emailInvalidError:c="Please enter a valid email address.",passwordRequiredError:d="Please enter your password.",onSubmit:u,loadingActions:f={},isLoading:g=!1,disabled:m=!1,apiError:p="",className:y="",style:b})=>{const[_,x]=v.useState(""),[M,S]=v.useState(""),[k,N]=v.useState({}),C=p,w=Object.values(f).some(F=>F===!0),E=g||w,T=m||E,P=()=>{const F={},A=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return!_||_.trim()===""?F.email=l:A.test(_)||(F.email=c),(!M||M.trim()==="")&&(F.password=d),N(F),Object.keys(F).length===0},L=async F=>{if(!P()){F.preventDefault();return}N({}),u?await u(F):F.preventDefault()};return h.jsx(I,{className:`w-full ${y}`,style:b,children:h.jsxs(al,{onSubmit:L,className:"space-y-6",noValidate:!0,children:[C&&h.jsx(I,{className:"p-4 rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800",children:h.jsx(kt,{className:"text-sm text-red-600 dark:text-red-400",children:C})}),h.jsxs(I,{children:[h.jsx(gn,{htmlFor:"email",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:e}),h.jsx(Et,{id:"email",name:"email",type:"email",value:_,onChange:F=>x(F.target.value),placeholder:s,disabled:T,className:`
|
||
w-full px-4 py-3 rounded-lg border
|
||
${k.email?"border-red-500 focus:border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:border-blue-500 focus:ring-blue-500"}
|
||
bg-white dark:bg-gray-800
|
||
text-gray-900 dark:text-white
|
||
placeholder-gray-400 dark:placeholder-gray-500
|
||
focus:outline-none focus:ring-2
|
||
disabled:opacity-50 disabled:cursor-not-allowed
|
||
transition-colors duration-200
|
||
`}),k.email&&h.jsx(kt,{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:k.email})]}),h.jsxs(I,{children:[h.jsx(gn,{htmlFor:"password",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:t}),h.jsx(Et,{id:"password",name:"password",type:"password",value:M,onChange:F=>S(F.target.value),placeholder:o,disabled:T,className:`
|
||
w-full px-4 py-3 rounded-lg border
|
||
${k.password?"border-red-500 focus:border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:border-blue-500 focus:ring-blue-500"}
|
||
bg-white dark:bg-gray-800
|
||
text-gray-900 dark:text-white
|
||
placeholder-gray-400 dark:placeholder-gray-500
|
||
focus:outline-none focus:ring-2
|
||
disabled:opacity-50 disabled:cursor-not-allowed
|
||
transition-colors duration-200
|
||
`}),k.password&&h.jsx(kt,{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:k.password})]}),a&&h.jsx(I,{className:"flex items-center justify-end",children:h.jsx(qr,{href:a,className:"text-sm text-blue-600 hover:text-blue-500 dark:text-blue-400 dark:hover:text-blue-300 transition-colors duration-200",children:i})}),h.jsx(le,{type:"submit",disabled:T,className:`
|
||
w-full px-4 py-3 rounded-lg font-medium
|
||
bg-blue-600 hover:bg-blue-700
|
||
dark:bg-blue-500 dark:hover:bg-blue-600
|
||
text-white
|
||
focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2
|
||
dark:focus:ring-offset-gray-900
|
||
disabled:opacity-50 disabled:cursor-not-allowed
|
||
transition-colors duration-200
|
||
flex items-center justify-center
|
||
`,children:E?h.jsxs(h.Fragment,{children:[h.jsxs(Jn,{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[h.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),h.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r]}):n})]})})},ff=e=>e==="auto"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e,Ll=e=>{const t=ff(e);document.documentElement.setAttribute("data-theme",t),t==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},Qx=()=>{const e=localStorage.getItem("g7_color_scheme");return e&&["auto","light","dark"].includes(e)?e:"auto"},Jx=({onThemeChange:e,className:t="",autoText:n="System",lightText:r="Light",darkText:s="Dark",id:o,editorAttrs:i})=>{const a=Qx(),[l,c]=v.useState(a),[d,u]=v.useState(!1),f=v.useRef(null);v.useEffect(()=>{Ll(l)},[]),v.useEffect(()=>{if(l!=="auto")return;const p=window.matchMedia("(prefers-color-scheme: dark)"),y=()=>{Ll("auto")};return p.addEventListener("change",y),()=>p.removeEventListener("change",y)},[l]),v.useEffect(()=>{const p=y=>{f.current&&!f.current.contains(y.target)&&u(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]);const g=p=>{c(p),localStorage.setItem("g7_color_scheme",p),Ll(p),u(!1),e?.(p)},m=()=>ff(l)==="dark"?he.Moon:he.Sun;return h.jsxs(I,{ref:f,className:`relative ${t}`,id:o,...i,children:[h.jsx(le,{onClick:()=>u(!d),className:"w-9 h-9 flex items-center justify-center hover:bg-gray-100 dark:hover:bg-gray-800 rounded-full transition-colors","aria-label":"Toggle theme",children:h.jsx(ae,{name:m(),className:"text-sm text-slate-500 dark:text-slate-400"})}),d&&h.jsx(I,{className:"absolute right-0 mt-2 w-48 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50",children:h.jsxs(I,{className:"py-2",children:[h.jsxs(le,{onClick:()=>g("auto"),className:`
|
||
w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors
|
||
${l==="auto"?"bg-gray-50 dark:bg-gray-700":""}
|
||
`,children:[h.jsx(ae,{name:he.Settings,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),h.jsx(J,{className:"flex-1 text-left text-gray-900 dark:text-white",children:n}),l==="auto"&&h.jsx(ae,{name:he.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),h.jsxs(le,{onClick:()=>g("light"),className:`
|
||
w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors
|
||
${l==="light"?"bg-gray-50 dark:bg-gray-700":""}
|
||
`,children:[h.jsx(ae,{name:he.Sun,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),h.jsx(J,{className:"flex-1 text-left text-gray-900 dark:text-white",children:r}),l==="light"&&h.jsx(ae,{name:he.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),h.jsxs(le,{onClick:()=>g("dark"),className:`
|
||
w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors
|
||
${l==="dark"?"bg-gray-50 dark:bg-gray-700":""}
|
||
`,children:[h.jsx(ae,{name:he.Moon,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),h.jsx(J,{className:"flex-1 text-left text-gray-900 dark:text-white",children:s}),l==="dark"&&h.jsx(ae,{name:he.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]})]})})]})},hf=window.G7Core?.createLogger?.("Comp:ColumnSelector")??{log:(...e)=>console.log("[Comp:ColumnSelector]",...e),warn:(...e)=>console.warn("[Comp:ColumnSelector]",...e),error:(...e)=>console.error("[Comp:ColumnSelector]",...e)},gf=(e,t)=>window.G7Core?.t?.(e,t)??e,Rx=()=>window.G7Core,ew=({id:e,columns:t,visibleColumns:n,onColumnVisibilityChange:r,triggerLabel:s,triggerIconName:o=he.Sliders,position:i="right",className:a="",style:l,requiredText:c,menuTitle:d,menuDescription:u,defaultColumns:f,triggerClassName:g,labelClassName:m,dynamicColumns:p,dynamicColumnsInsertAfter:y,editorAttrs:b})=>{const _=s??gf("common.column_selector"),x=c??gf("common.required"),M=v.useMemo(()=>{if(!p||!Array.isArray(p)||p.length===0)return t;if(y){const V=t.findIndex(X=>X.field===y);if(V!==-1)return[...t.slice(0,V+1),...p,...t.slice(V+1)]}return[...t,...p]},[t,p,y]),[S,k]=v.useState(!1),N=v.useRef(null),C=v.useRef(null),[w,E]=v.useState(!1),[T,P]=v.useState(i),L=v.useMemo(()=>{try{const V=window.G7Core?.AuthManager?.getInstance();return V?V.getUser()?.uuid:void 0}catch{return}},[]),F=e?`g7_columns_${e}${L!==void 0?`_${L}`:""}`:null,A=()=>{if(!F)return null;try{const V=localStorage.getItem(F);if(V){const X=JSON.parse(V);if(Array.isArray(X)&&X.length>0)return X}}catch(V){hf.warn("Failed to load from localStorage:",V)}return null},D=V=>{if(F)try{localStorage.setItem(F,JSON.stringify(V))}catch(X){hf.warn("Failed to save to localStorage:",X)}},O=()=>{const V=A();return V||(n&&n.length>0?n:f&&f.length>0?f:M.filter(X=>X.visible!==!1).map(X=>X.field))},[z,U]=v.useState(O);v.useEffect(()=>{w||(r&&z.length>0&&r(z),E(!0))},[w,r,z]),v.useEffect(()=>{w&&n&&n.length>0&&(A()||U(n))},[n,w]);const j=v.useRef([]),Y=v.useRef(null);v.useEffect(()=>{if(w&&p&&p.length>0){const V=p.map(Q=>Q.field);if(Y.current===null){const Q=A();if(Y.current=Q!==null,Q!==null){j.current=V;return}}const X=j.current,K=V.filter(Q=>!X.includes(Q));if(K.length>0){const Q=n&&n.length>0?n:z,ne=K.filter(se=>!Q.includes(se));if(ne.length>0){const se=[...Q,...ne];U(se),D(se),r?.(se)}}j.current=V}},[p,w]);const B=n&&n.length>0?n:z;v.useEffect(()=>{const V=X=>{N.current&&!N.current.contains(X.target)&&k(!1)};return S&&document.addEventListener("mousedown",V),()=>{document.removeEventListener("mousedown",V)}},[S]),v.useEffect(()=>{if(S&&C.current&&N.current){const V=C.current.getBoundingClientRect(),X=N.current.getBoundingClientRect(),K=window.innerWidth,Q=V.width||256;i==="right"?X.right-Q<0?P("left"):P("right"):X.left+Q>K?P("right"):P("left")}},[S,i]);const W=V=>{if(M.find(Q=>Q.field===V)?.required)return;const K=B.includes(V)?B.filter(Q=>Q!==V):[...B,V];U(K),D(K),r?.(K)},G=T==="left"?"left-0":"right-0";return h.jsxs(I,{ref:N,className:`relative inline-block ${a}`,style:l,id:e,...b,children:[h.jsxs(le,{onClick:()=>k(!S),className:Rx()?.style?.mergeClasses?.("flex items-center gap-2 px-3 py-2 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",g)??`flex items-center gap-2 px-3 py-2 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors ${g??""}`,children:[h.jsx(ae,{name:o,className:"w-5 h-5"}),_&&h.jsx(J,{className:`${m||"hidden sm:inline"} text-sm`,children:_})]}),S&&h.jsxs(I,{ref:C,className:`absolute ${G} z-50 mt-2 w-64 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg`,children:[(d||u)&&h.jsxs(I,{className:"px-4 pt-3 pb-2 border-b border-gray-200 dark:border-gray-700",children:[d&&h.jsx(J,{className:"block text-sm font-medium text-gray-900 dark:text-white",children:d}),u&&h.jsx(J,{className:"block text-xs text-gray-500 dark:text-gray-400 mt-1",children:u})]}),h.jsx(I,{className:"p-2 max-h-64 overflow-y-auto",children:M.map(V=>{const X=B.includes(V.field),K=V.required===!0;return h.jsxs(I,{onClick:()=>!K&&W(V.field),className:`flex items-center gap-2 px-3 py-2 rounded hover:bg-gray-50 dark:hover:bg-gray-700 ${K?"cursor-default":"cursor-pointer"}`,children:[h.jsx(On,{checked:X,disabled:K,readOnly:!0,className:"h-4 w-4 text-blue-600 rounded border-gray-300 dark:border-gray-600 pointer-events-none"}),h.jsx(J,{className:"text-sm text-gray-700 dark:text-gray-300",children:V.header}),K&&x&&h.jsx(J,{className:"ml-auto text-xs text-gray-400 dark:text-gray-500",children:x})]},V.field)})})]})]})},tw=window.G7Core?.createLogger?.("Comp:PageTransition")??{log:(...e)=>console.log("[Comp:PageTransition]",...e),warn:(...e)=>console.warn("[Comp:PageTransition]",...e),error:(...e)=>console.error("[Comp:PageTransition]",...e)},nw=({className:e="",style:t})=>{const[n,r]=v.useState(!1);return v.useEffect(()=>{const s=window.G7Core?.TransitionManager;if(!s){tw.warn("TransitionManager를 찾을 수 없습니다.");return}return r(s.getIsPending()),s.subscribe(i=>{r(i)})},[]),n?h.jsxs(I,{className:`fixed top-0 left-0 right-0 z-[999] ${e}`,style:t,role:"progressbar","aria-label":"페이지 로딩 중",children:[h.jsx(I,{className:"h-1 bg-gradient-to-r from-blue-500 via-blue-600 to-blue-500 animate-pulse",children:h.jsx(I,{className:"h-full bg-blue-700 animate-[loading_1.5s_ease-in-out_infinite]",style:{width:"30%",animation:"loading 1.5s ease-in-out infinite"}})}),h.jsx("style",{children:`
|
||
@keyframes loading {
|
||
0% {
|
||
transform: translateX(-100%);
|
||
}
|
||
50% {
|
||
transform: translateX(300%);
|
||
}
|
||
100% {
|
||
transform: translateX(-100%);
|
||
}
|
||
}
|
||
`})]}):null},rw=(e,t)=>window.G7Core?.t?.(e,t)??e,sw=({options:e})=>{const t=document.documentElement.classList.contains("dark"),n=t?"rgb(17,24,39)":"rgb(249,250,251)",r=t?"#6b7280":"#9ca3af",s=t?"#9ca3af":"#6b7280";return h.jsxs("div",{style:{position:"absolute",inset:0,zIndex:2147483647,overflow:"hidden",background:n,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-start",paddingTop:"15%",gap:"12px"},children:[h.jsx("div",{style:{width:"32px",height:"32px",border:`3px solid ${r}`,borderTopColor:"transparent",borderRadius:"50%",animation:"g7-spin 0.8s linear infinite"}}),h.jsx("span",{style:{color:s,fontSize:"14px"},children:e?.text||rw("nav.loading")})]})};function Mr(e){"@babel/helpers - typeof";return Mr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mr(e)}function ow(e,t){if(Mr(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Mr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pf(e){var t=ow(e,"string");return Mr(t)=="symbol"?t:t+""}function qs(e,t,n){return(t=pf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Me(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mf(Object(n),!0).forEach(function(r){qs(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mf(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iw(e){if(Array.isArray(e))return e}function aw(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,o,i,a=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(d){c=!0,s=d}finally{try{if(!l&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw s}}return a}}function Pl(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function bf(e,t){if(e){if(typeof e=="string")return Pl(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pl(e,t):void 0}}function lw(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rn(e,t){return iw(e)||aw(e,t)||bf(e,t)||lw()}function cw(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Hn(e,t){if(e==null)return{};var n,r,s=cw(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}var dw=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function yf(e){var t=e.defaultInputValue,n=t===void 0?"":t,r=e.defaultMenuIsOpen,s=r===void 0?!1:r,o=e.defaultValue,i=o===void 0?null:o,a=e.inputValue,l=e.menuIsOpen,c=e.onChange,d=e.onInputChange,u=e.onMenuClose,f=e.onMenuOpen,g=e.value,m=Hn(e,dw),p=v.useState(a!==void 0?a:n),y=Rn(p,2),b=y[0],_=y[1],x=v.useState(l!==void 0?l:s),M=Rn(x,2),S=M[0],k=M[1],N=v.useState(g!==void 0?g:i),C=Rn(N,2),w=C[0],E=C[1],T=v.useCallback(function(z,U){typeof c=="function"&&c(z,U),E(z)},[c]),P=v.useCallback(function(z,U){var j;typeof d=="function"&&(j=d(z,U)),_(j!==void 0?j:z)},[d]),L=v.useCallback(function(){typeof f=="function"&&f(),k(!0)},[f]),F=v.useCallback(function(){typeof u=="function"&&u(),k(!1)},[u]),A=a!==void 0?a:b,D=l!==void 0?l:S,O=g!==void 0?g:w;return Me(Me({},m),{},{inputValue:A,menuIsOpen:D,onChange:T,onInputChange:P,onMenuClose:F,onMenuOpen:L,value:O})}function De(){return De=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},De.apply(null,arguments)}function uw(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,pf(r.key),r)}}function fw(e,t,n){return t&&vf(e.prototype,t),n&&vf(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function $l(e,t){return $l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},$l(e,t)}function hw(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$l(e,t)}function ui(e){return ui=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ui(e)}function xf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(xf=function(){return!!e})()}function gw(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pw(e,t){if(t&&(Mr(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gw(e)}function mw(e){var t=xf();return function(){var n,r=ui(e);if(t){var s=ui(this).constructor;n=Reflect.construct(r,arguments,s)}else n=r.apply(this,arguments);return pw(this,n)}}function bw(e){if(Array.isArray(e))return Pl(e)}function yw(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vw(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function os(e){return bw(e)||yw(e)||bf(e)||vw()}function xw(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function ww(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var kw=(function(){function e(n){var r=this;this._insertTag=function(s){var o;r.tags.length===0?r.insertionPoint?o=r.insertionPoint.nextSibling:r.prepend?o=r.container.firstChild:o=r.before:o=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(s,o),r.tags.push(s)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(ww(this));var s=this.tags[this.tags.length-1];if(this.isSpeedy){var o=xw(s);try{o.insertRule(r,o.cssRules.length)}catch{}}else s.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var s;return(s=r.parentNode)==null?void 0:s.removeChild(r)}),this.tags=[],this.ctr=0},e})(),Xt="-ms-",fi="-moz-",rt="-webkit-",wf="comm",Fl="rule",zl="decl",Cw="@import",kf="@keyframes",Sw="@layer",_w=Math.abs,hi=String.fromCharCode,Ew=Object.assign;function Mw(e,t){return jt(e,0)^45?(((t<<2^jt(e,0))<<2^jt(e,1))<<2^jt(e,2))<<2^jt(e,3):0}function Cf(e){return e.trim()}function Nw(e,t){return(e=t.exec(e))?e[0]:e}function st(e,t,n){return e.replace(t,n)}function Vl(e,t){return e.indexOf(t)}function jt(e,t){return e.charCodeAt(t)|0}function Zs(e,t,n){return e.slice(t,n)}function Un(e){return e.length}function Hl(e){return e.length}function gi(e,t){return t.push(e),e}function Ow(e,t){return e.map(t).join("")}var pi=1,is=1,Sf=0,on=0,Nt=0,as="";function mi(e,t,n,r,s,o,i){return{value:e,root:t,parent:n,type:r,props:s,children:o,line:pi,column:is,length:i,return:""}}function Qs(e,t){return Ew(mi("",null,null,"",null,null,0),e,{length:-e.length},t)}function Tw(){return Nt}function Aw(){return Nt=on>0?jt(as,--on):0,is--,Nt===10&&(is=1,pi--),Nt}function yn(){return Nt=on<Sf?jt(as,on++):0,is++,Nt===10&&(is=1,pi++),Nt}function Bn(){return jt(as,on)}function bi(){return on}function Js(e,t){return Zs(as,e,t)}function Rs(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function _f(e){return pi=is=1,Sf=Un(as=e),on=0,[]}function Ef(e){return as="",e}function yi(e){return Cf(Js(on-1,Ul(e===91?e+2:e===40?e+1:e)))}function Dw(e){for(;(Nt=Bn())&&Nt<33;)yn();return Rs(e)>2||Rs(Nt)>3?"":" "}function Iw(e,t){for(;--t&&yn()&&!(Nt<48||Nt>102||Nt>57&&Nt<65||Nt>70&&Nt<97););return Js(e,bi()+(t<6&&Bn()==32&&yn()==32))}function Ul(e){for(;yn();)switch(Nt){case e:return on;case 34:case 39:e!==34&&e!==39&&Ul(Nt);break;case 40:e===41&&Ul(e);break;case 92:yn();break}return on}function Lw(e,t){for(;yn()&&e+Nt!==57;)if(e+Nt===84&&Bn()===47)break;return"/*"+Js(t,on-1)+"*"+hi(e===47?e:yn())}function Pw(e){for(;!Rs(Bn());)yn();return Js(e,on)}function $w(e){return Ef(vi("",null,null,null,[""],e=_f(e),0,[0],e))}function vi(e,t,n,r,s,o,i,a,l){for(var c=0,d=0,u=i,f=0,g=0,m=0,p=1,y=1,b=1,_=0,x="",M=s,S=o,k=r,N=x;y;)switch(m=_,_=yn()){case 40:if(m!=108&&jt(N,u-1)==58){Vl(N+=st(yi(_),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:N+=yi(_);break;case 9:case 10:case 13:case 32:N+=Dw(m);break;case 92:N+=Iw(bi()-1,7);continue;case 47:switch(Bn()){case 42:case 47:gi(Fw(Lw(yn(),bi()),t,n),l);break;default:N+="/"}break;case 123*p:a[c++]=Un(N)*b;case 125*p:case 59:case 0:switch(_){case 0:case 125:y=0;case 59+d:b==-1&&(N=st(N,/\f/g,"")),g>0&&Un(N)-u&&gi(g>32?Nf(N+";",r,n,u-1):Nf(st(N," ","")+";",r,n,u-2),l);break;case 59:N+=";";default:if(gi(k=Mf(N,t,n,c,d,s,a,x,M=[],S=[],u),o),_===123)if(d===0)vi(N,t,k,k,M,o,u,a,S);else switch(f===99&&jt(N,3)===110?100:f){case 100:case 108:case 109:case 115:vi(e,k,k,r&&gi(Mf(e,k,k,0,0,s,a,x,s,M=[],u),S),s,S,u,a,r?M:S);break;default:vi(N,k,k,k,[""],S,0,a,S)}}c=d=g=0,p=b=1,x=N="",u=i;break;case 58:u=1+Un(N),g=m;default:if(p<1){if(_==123)--p;else if(_==125&&p++==0&&Aw()==125)continue}switch(N+=hi(_),_*p){case 38:b=d>0?1:(N+="\f",-1);break;case 44:a[c++]=(Un(N)-1)*b,b=1;break;case 64:Bn()===45&&(N+=yi(yn())),f=Bn(),d=u=Un(x=N+=Pw(bi())),_++;break;case 45:m===45&&Un(N)==2&&(p=0)}}return o}function Mf(e,t,n,r,s,o,i,a,l,c,d){for(var u=s-1,f=s===0?o:[""],g=Hl(f),m=0,p=0,y=0;m<r;++m)for(var b=0,_=Zs(e,u+1,u=_w(p=i[m])),x=e;b<g;++b)(x=Cf(p>0?f[b]+" "+_:st(_,/&\f/g,f[b])))&&(l[y++]=x);return mi(e,t,n,s===0?Fl:a,l,c,d)}function Fw(e,t,n){return mi(e,t,n,wf,hi(Tw()),Zs(e,2,-2),0)}function Nf(e,t,n,r){return mi(e,t,n,zl,Zs(e,0,r),Zs(e,r+1,-1),r)}function ls(e,t){for(var n="",r=Hl(e),s=0;s<r;s++)n+=t(e[s],s,e,t)||"";return n}function zw(e,t,n,r){switch(e.type){case Sw:if(e.children.length)break;case Cw:case zl:return e.return=e.return||e.value;case wf:return"";case kf:return e.return=e.value+"{"+ls(e.children,r)+"}";case Fl:e.value=e.props.join(",")}return Un(n=ls(e.children,r))?e.return=e.value+"{"+n+"}":""}function Vw(e){var t=Hl(e);return function(n,r,s,o){for(var i="",a=0;a<t;a++)i+=e[a](n,r,s,o)||"";return i}}function Hw(e){return function(t){t.root||(t=t.return)&&e(t)}}function Uw(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Bw=function(t,n,r){for(var s=0,o=0;s=o,o=Bn(),s===38&&o===12&&(n[r]=1),!Rs(o);)yn();return Js(t,on)},jw=function(t,n){var r=-1,s=44;do switch(Rs(s)){case 0:s===38&&Bn()===12&&(n[r]=1),t[r]+=Bw(on-1,n,r);break;case 2:t[r]+=yi(s);break;case 4:if(s===44){t[++r]=Bn()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=hi(s)}while(s=yn());return t},Ww=function(t,n){return Ef(jw(_f(t),n))},Of=new WeakMap,Gw=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,s=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!Of.get(r))&&!s){Of.set(t,!0);for(var o=[],i=Ww(n,o),a=r.props,l=0,c=0;l<i.length;l++)for(var d=0;d<a.length;d++,c++)t.props[c]=o[l]?i[l].replace(/&\f/g,a[d]):a[d]+" "+i[l]}}},Yw=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function Tf(e,t){switch(Mw(e,t)){case 5103:return rt+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return rt+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return rt+e+fi+e+Xt+e+e;case 6828:case 4268:return rt+e+Xt+e+e;case 6165:return rt+e+Xt+"flex-"+e+e;case 5187:return rt+e+st(e,/(\w+).+(:[^]+)/,rt+"box-$1$2"+Xt+"flex-$1$2")+e;case 5443:return rt+e+Xt+"flex-item-"+st(e,/flex-|-self/,"")+e;case 4675:return rt+e+Xt+"flex-line-pack"+st(e,/align-content|flex-|-self/,"")+e;case 5548:return rt+e+Xt+st(e,"shrink","negative")+e;case 5292:return rt+e+Xt+st(e,"basis","preferred-size")+e;case 6060:return rt+"box-"+st(e,"-grow","")+rt+e+Xt+st(e,"grow","positive")+e;case 4554:return rt+st(e,/([^-])(transform)/g,"$1"+rt+"$2")+e;case 6187:return st(st(st(e,/(zoom-|grab)/,rt+"$1"),/(image-set)/,rt+"$1"),e,"")+e;case 5495:case 3959:return st(e,/(image-set\([^]*)/,rt+"$1$`$1");case 4968:return st(st(e,/(.+:)(flex-)?(.*)/,rt+"box-pack:$3"+Xt+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+rt+e+e;case 4095:case 3583:case 4068:case 2532:return st(e,/(.+)-inline(.+)/,rt+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Un(e)-1-t>6)switch(jt(e,t+1)){case 109:if(jt(e,t+4)!==45)break;case 102:return st(e,/(.+:)(.+)-([^]+)/,"$1"+rt+"$2-$3$1"+fi+(jt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Vl(e,"stretch")?Tf(st(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(jt(e,t+1)!==115)break;case 6444:switch(jt(e,Un(e)-3-(~Vl(e,"!important")&&10))){case 107:return st(e,":",":"+rt)+e;case 101:return st(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+rt+(jt(e,14)===45?"inline-":"")+"box$3$1"+rt+"$2$3$1"+Xt+"$2box$3")+e}break;case 5936:switch(jt(e,t+11)){case 114:return rt+e+Xt+st(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return rt+e+Xt+st(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return rt+e+Xt+st(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return rt+e+Xt+e+e}return e}var Kw=function(t,n,r,s){if(t.length>-1&&!t.return)switch(t.type){case zl:t.return=Tf(t.value,t.length);break;case kf:return ls([Qs(t,{value:st(t.value,"@","@"+rt)})],s);case Fl:if(t.length)return Ow(t.props,function(o){switch(Nw(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ls([Qs(t,{props:[st(o,/:(read-\w+)/,":"+fi+"$1")]})],s);case"::placeholder":return ls([Qs(t,{props:[st(o,/:(plac\w+)/,":"+rt+"input-$1")]}),Qs(t,{props:[st(o,/:(plac\w+)/,":"+fi+"$1")]}),Qs(t,{props:[st(o,/:(plac\w+)/,Xt+"input-$1")]})],s)}return""})}},Xw=[Kw],qw=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(p){var y=p.getAttribute("data-emotion");y.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var s=t.stylisPlugins||Xw,o={},i,a=[];i=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(p){for(var y=p.getAttribute("data-emotion").split(" "),b=1;b<y.length;b++)o[y[b]]=!0;a.push(p)});var l,c=[Gw,Yw];{var d,u=[zw,Hw(function(p){d.insert(p)})],f=Vw(c.concat(s,u)),g=function(y){return ls($w(y),f)};l=function(y,b,_,x){d=_,g(y?y+"{"+b.styles+"}":b.styles),x&&(m.inserted[b.name]=!0)}}var m={key:n,sheet:new kw({key:n,container:i,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:o,registered:{},insert:l};return m.sheet.hydrate(a),m},Bl={exports:{}},it={};/** @license React v16.13.1
|
||
* react-is.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var Af;function Zw(){if(Af)return it;Af=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,_=e?Symbol.for("react.scope"):60119;function x(S){if(typeof S=="object"&&S!==null){var k=S.$$typeof;switch(k){case t:switch(S=S.type,S){case l:case c:case r:case o:case s:case u:return S;default:switch(S=S&&S.$$typeof,S){case a:case d:case m:case g:case i:return S;default:return k}}case n:return k}}}function M(S){return x(S)===c}return it.AsyncMode=l,it.ConcurrentMode=c,it.ContextConsumer=a,it.ContextProvider=i,it.Element=t,it.ForwardRef=d,it.Fragment=r,it.Lazy=m,it.Memo=g,it.Portal=n,it.Profiler=o,it.StrictMode=s,it.Suspense=u,it.isAsyncMode=function(S){return M(S)||x(S)===l},it.isConcurrentMode=M,it.isContextConsumer=function(S){return x(S)===a},it.isContextProvider=function(S){return x(S)===i},it.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===t},it.isForwardRef=function(S){return x(S)===d},it.isFragment=function(S){return x(S)===r},it.isLazy=function(S){return x(S)===m},it.isMemo=function(S){return x(S)===g},it.isPortal=function(S){return x(S)===n},it.isProfiler=function(S){return x(S)===o},it.isStrictMode=function(S){return x(S)===s},it.isSuspense=function(S){return x(S)===u},it.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===r||S===c||S===o||S===s||S===u||S===f||typeof S=="object"&&S!==null&&(S.$$typeof===m||S.$$typeof===g||S.$$typeof===i||S.$$typeof===a||S.$$typeof===d||S.$$typeof===y||S.$$typeof===b||S.$$typeof===_||S.$$typeof===p)},it.typeOf=x,it}var Df;function Qw(){return Df||(Df=1,Bl.exports=Zw()),Bl.exports}var jl,If;function Jw(){if(If)return jl;If=1;var e=Qw(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};o[e.ForwardRef]=r,o[e.Memo]=s;function i(m){return e.isMemo(m)?s:o[m.$$typeof]||t}var a=Object.defineProperty,l=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,u=Object.getPrototypeOf,f=Object.prototype;function g(m,p,y){if(typeof p!="string"){if(f){var b=u(p);b&&b!==f&&g(m,b,y)}var _=l(p);c&&(_=_.concat(c(p)));for(var x=i(m),M=i(p),S=0;S<_.length;++S){var k=_[S];if(!n[k]&&!(y&&y[k])&&!(M&&M[k])&&!(x&&x[k])){var N=d(p,k);try{a(m,k,N)}catch{}}}}return m}return jl=g,jl}Jw();var Rw=!0;function e1(e,t,n){var r="";return n.split(" ").forEach(function(s){e[s]!==void 0?t.push(e[s]+";"):s&&(r+=s+" ")}),r}var Lf=function(t,n,r){var s=t.key+"-"+n.name;(r===!1||Rw===!1)&&t.registered[s]===void 0&&(t.registered[s]=n.styles)},t1=function(t,n,r){Lf(t,n,r);var s=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var o=n;do t.insert(n===o?"."+s:"",o,t.sheet,!0),o=o.next;while(o!==void 0)}};function n1(e){for(var t=0,n,r=0,s=e.length;s>=4;++r,s-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(s){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var r1={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},s1=/[A-Z]|^ms/g,o1=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Pf=function(t){return t.charCodeAt(1)===45},$f=function(t){return t!=null&&typeof t!="boolean"},Wl=Uw(function(e){return Pf(e)?e:e.replace(s1,"-$&").toLowerCase()}),Ff=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(o1,function(r,s,o){return jn={name:s,styles:o,next:jn},s})}return r1[t]!==1&&!Pf(t)&&typeof n=="number"&&n!==0?n+"px":n};function eo(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var s=n;if(s.anim===1)return jn={name:s.name,styles:s.styles,next:jn},s.name;var o=n;if(o.styles!==void 0){var i=o.next;if(i!==void 0)for(;i!==void 0;)jn={name:i.name,styles:i.styles,next:jn},i=i.next;var a=o.styles+";";return a}return i1(e,t,n)}case"function":{if(e!==void 0){var l=jn,c=n(e);return jn=l,eo(e,t,c)}break}}var d=n;return d}function i1(e,t,n){var r="";if(Array.isArray(n))for(var s=0;s<n.length;s++)r+=eo(e,t,n[s])+";";else for(var o in n){var i=n[o];if(typeof i!="object"){var a=i;$f(a)&&(r+=Wl(o)+":"+Ff(o,a)+";")}else if(Array.isArray(i)&&typeof i[0]=="string"&&t==null)for(var l=0;l<i.length;l++)$f(i[l])&&(r+=Wl(o)+":"+Ff(o,i[l])+";");else{var c=eo(e,t,i);switch(o){case"animation":case"animationName":{r+=Wl(o)+":"+c+";";break}default:r+=o+"{"+c+"}"}}}return r}var zf=/label:\s*([^\s;{]+)\s*(;|$)/g,jn;function Vf(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,s="";jn=void 0;var o=e[0];if(o==null||o.raw===void 0)r=!1,s+=eo(n,t,o);else{var i=o;s+=i[0]}for(var a=1;a<e.length;a++)if(s+=eo(n,t,e[a]),r){var l=o;s+=l[a]}zf.lastIndex=0;for(var c="",d;(d=zf.exec(s))!==null;)c+="-"+d[1];var u=n1(s)+c;return{name:u,styles:s,next:jn}}var a1=function(t){return t()},l1=$.useInsertionEffect?$.useInsertionEffect:!1,c1=l1||a1,Hf=$.createContext(typeof HTMLElement<"u"?qw({key:"css"}):null);Hf.Provider;var d1=function(t){return v.forwardRef(function(n,r){var s=v.useContext(Hf);return t(n,s,r)})},u1=$.createContext({}),Gl={}.hasOwnProperty,Yl="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",f1=function(t,n){var r={};for(var s in n)Gl.call(n,s)&&(r[s]=n[s]);return r[Yl]=t,r},h1=function(t){var n=t.cache,r=t.serialized,s=t.isStringTag;return Lf(n,r,s),c1(function(){return t1(n,r,s)}),null},g1=d1(function(e,t,n){var r=e.css;typeof r=="string"&&t.registered[r]!==void 0&&(r=t.registered[r]);var s=e[Yl],o=[r],i="";typeof e.className=="string"?i=e1(t.registered,o,e.className):e.className!=null&&(i=e.className+" ");var a=Vf(o,void 0,$.useContext(u1));i+=t.key+"-"+a.name;var l={};for(var c in e)Gl.call(e,c)&&c!=="css"&&c!==Yl&&(l[c]=e[c]);return l.className=i,n&&(l.ref=n),$.createElement($.Fragment,null,$.createElement(h1,{cache:t,serialized:a,isStringTag:typeof s=="string"}),$.createElement(s,l))}),p1=g1,Ee=function(t,n){var r=arguments;if(n==null||!Gl.call(n,"css"))return $.createElement.apply(void 0,r);var s=r.length,o=new Array(s);o[0]=p1,o[1]=f1(t,n);for(var i=2;i<s;i++)o[i]=r[i];return $.createElement.apply(null,o)};(function(e){var t;t||(t=e.JSX||(e.JSX={}))})(Ee||(Ee={}));function Kl(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Vf(t)}function m1(){var e=Kl.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}function b1(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const y1=Math.min,v1=Math.max,xi=Math.round,wi=Math.floor,ki=e=>({x:e,y:e});function x1(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Ci(){return typeof window<"u"}function Uf(e){return jf(e)?(e.nodeName||"").toLowerCase():"#document"}function er(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Bf(e){var t;return(t=(jf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function jf(e){return Ci()?e instanceof Node||e instanceof er(e).Node:!1}function w1(e){return Ci()?e instanceof Element||e instanceof er(e).Element:!1}function Xl(e){return Ci()?e instanceof HTMLElement||e instanceof er(e).HTMLElement:!1}function Wf(e){return!Ci()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof er(e).ShadowRoot}const k1=new Set(["inline","contents"]);function Gf(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=ql(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!k1.has(s)}function C1(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const S1=new Set(["html","body","#document"]);function _1(e){return S1.has(Uf(e))}function ql(e){return er(e).getComputedStyle(e)}function E1(e){if(Uf(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Wf(e)&&e.host||Bf(e);return Wf(t)?t.host:t}function Yf(e){const t=E1(e);return _1(t)?e.ownerDocument?e.ownerDocument.body:e.body:Xl(t)&&Gf(t)?t:Yf(t)}function Si(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Yf(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),i=er(s);if(o){const a=Zl(i);return t.concat(i,i.visualViewport||[],Gf(s)?s:[],a&&n?Si(a):[])}return t.concat(s,Si(s,[],n))}function Zl(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function M1(e){const t=ql(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Xl(e),o=s?e.offsetWidth:n,i=s?e.offsetHeight:r,a=xi(n)!==o||xi(r)!==i;return a&&(n=o,r=i),{width:n,height:r,$:a}}function Ql(e){return w1(e)?e:e.contextElement}function Kf(e){const t=Ql(e);if(!Xl(t))return ki(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=M1(t);let i=(o?xi(n.width):n.width)/r,a=(o?xi(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const N1=ki(0);function O1(e){const t=er(e);return!C1()||!t.visualViewport?N1:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function T1(e,t,n){return!1}function Xf(e,t,n,r){t===void 0&&(t=!1);const s=e.getBoundingClientRect(),o=Ql(e);let i=ki(1);t&&(i=Kf(e));const a=T1()?O1(o):ki(0);let l=(s.left+a.x)/i.x,c=(s.top+a.y)/i.y,d=s.width/i.x,u=s.height/i.y;if(o){const f=er(o),g=r;let m=f,p=Zl(m);for(;p&&r&&g!==m;){const y=Kf(p),b=p.getBoundingClientRect(),_=ql(p),x=b.left+(p.clientLeft+parseFloat(_.paddingLeft))*y.x,M=b.top+(p.clientTop+parseFloat(_.paddingTop))*y.y;l*=y.x,c*=y.y,d*=y.x,u*=y.y,l+=x,c+=M,m=er(p),p=Zl(m)}}return x1({width:d,height:u,x:l,y:c})}function qf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function A1(e,t){let n=null,r;const s=Bf(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const c=e.getBoundingClientRect(),{left:d,top:u,width:f,height:g}=c;if(a||t(),!f||!g)return;const m=wi(u),p=wi(s.clientWidth-(d+f)),y=wi(s.clientHeight-(u+g)),b=wi(d),x={rootMargin:-m+"px "+-p+"px "+-y+"px "+-b+"px",threshold:v1(0,y1(1,l))||1};let M=!0;function S(k){const N=k[0].intersectionRatio;if(N!==l){if(!M)return i();N?i(!1,N):r=setTimeout(()=>{i(!1,1e-7)},1e3)}N===1&&!qf(c,e.getBoundingClientRect())&&i(),M=!1}try{n=new IntersectionObserver(S,{...x,root:s.ownerDocument})}catch{n=new IntersectionObserver(S,x)}n.observe(e)}return i(!0),o}function D1(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Ql(e),d=s||o?[...c?Si(c):[],...Si(t)]:[];d.forEach(b=>{s&&b.addEventListener("scroll",n,{passive:!0}),o&&b.addEventListener("resize",n)});const u=c&&a?A1(c,n):null;let f=-1,g=null;i&&(g=new ResizeObserver(b=>{let[_]=b;_&&_.target===c&&g&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=g)==null||x.observe(t)})),n()}),c&&!l&&g.observe(c),g.observe(t));let m,p=l?Xf(e):null;l&&y();function y(){const b=Xf(e);p&&!qf(p,b)&&n(),p=b,m=requestAnimationFrame(y)}return n(),()=>{var b;d.forEach(_=>{s&&_.removeEventListener("scroll",n),o&&_.removeEventListener("resize",n)}),u?.(),(b=g)==null||b.disconnect(),g=null,l&&cancelAnimationFrame(m)}}var Jl=v.useLayoutEffect,I1=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],_i=function(){};function L1(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function P1(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];var o=[].concat(r);if(t&&e)for(var i in t)t.hasOwnProperty(i)&&t[i]&&o.push("".concat(L1(e,i)));return o.filter(function(a){return a}).map(function(a){return String(a).trim()}).join(" ")}var Ei=function(t){return W1(t)?t.filter(Boolean):Mr(t)==="object"&&t!==null?[t]:[]},Zf=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=Hn(t,I1);return Me({},n)},Ct=function(t,n,r){var s=t.cx,o=t.getStyles,i=t.getClassNames,a=t.className;return{css:o(n,t),className:s(r??{},i(n,t),a)}};function Mi(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function $1(e){return Mi(e)?window.innerHeight:e.clientHeight}function Qf(e){return Mi(e)?window.pageYOffset:e.scrollTop}function Ni(e,t){if(Mi(e)){window.scrollTo(0,t);return}e.scrollTop=t}function F1(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var s=e;s=s.parentElement;)if(t=getComputedStyle(s),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return s;return document.documentElement}function z1(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function Oi(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:_i,s=Qf(e),o=t-s,i=10,a=0;function l(){a+=i;var c=z1(a,s,o,n);Ni(e,c),a<n?window.requestAnimationFrame(l):r(e)}l()}function Jf(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),s=t.offsetHeight/3;r.bottom+s>n.bottom?Ni(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+s,e.scrollHeight)):r.top-s<n.top&&Ni(e,Math.max(t.offsetTop-s,0))}function V1(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function Rf(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function H1(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var eh=!1,U1={get passive(){return eh=!0}},Ti=typeof window<"u"?window:{};Ti.addEventListener&&Ti.removeEventListener&&(Ti.addEventListener("p",_i,U1),Ti.removeEventListener("p",_i,!1));var B1=eh;function j1(e){return e!=null}function W1(e){return Array.isArray(e)}function to(e,t,n){return e?t:n}function tD(e){return e}function nD(e){return e}var G1=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];var o=Object.entries(t).filter(function(i){var a=Rn(i,1),l=a[0];return!r.includes(l)});return o.reduce(function(i,a){var l=Rn(a,2),c=l[0],d=l[1];return i[c]=d,i},{})},Y1=["children","innerProps"],K1=["children","innerProps"];function X1(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,s=e.placement,o=e.shouldScroll,i=e.isFixedPosition,a=e.controlHeight,l=F1(n),c={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return c;var d=l.getBoundingClientRect(),u=d.height,f=n.getBoundingClientRect(),g=f.bottom,m=f.height,p=f.top,y=n.offsetParent.getBoundingClientRect(),b=y.top,_=i?window.innerHeight:$1(l),x=Qf(l),M=parseInt(getComputedStyle(n).marginBottom,10),S=parseInt(getComputedStyle(n).marginTop,10),k=b-S,N=_-p,C=k+x,w=u-x-p,E=g-_+x+M,T=x+p-S,P=160;switch(s){case"auto":case"bottom":if(N>=m)return{placement:"bottom",maxHeight:t};if(w>=m&&!i)return o&&Oi(l,E,P),{placement:"bottom",maxHeight:t};if(!i&&w>=r||i&&N>=r){o&&Oi(l,E,P);var L=i?N-M:w-M;return{placement:"bottom",maxHeight:L}}if(s==="auto"||i){var F=t,A=i?k:C;return A>=r&&(F=Math.min(A-M-a,t)),{placement:"top",maxHeight:F}}if(s==="bottom")return o&&Ni(l,E),{placement:"bottom",maxHeight:t};break;case"top":if(k>=m)return{placement:"top",maxHeight:t};if(C>=m&&!i)return o&&Oi(l,T,P),{placement:"top",maxHeight:t};if(!i&&C>=r||i&&k>=r){var D=t;return(!i&&C>=r||i&&k>=r)&&(D=i?k-S:C-S),o&&Oi(l,T,P),{placement:"top",maxHeight:D}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(s,'".'))}return c}function q1(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var th=function(t){return t==="auto"?"bottom":t},Z1=function(t,n){var r,s=t.placement,o=t.theme,i=o.borderRadius,a=o.spacing,l=o.colors;return Me((r={label:"menu"},qs(r,q1(s),"100%"),qs(r,"position","absolute"),qs(r,"width","100%"),qs(r,"zIndex",1),r),n?{}:{backgroundColor:l.neutral0,borderRadius:i,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},nh=v.createContext(null),Q1=function(t){var n=t.children,r=t.minMenuHeight,s=t.maxMenuHeight,o=t.menuPlacement,i=t.menuPosition,a=t.menuShouldScrollIntoView,l=t.theme,c=v.useContext(nh)||{},d=c.setPortalPlacement,u=v.useRef(null),f=v.useState(s),g=Rn(f,2),m=g[0],p=g[1],y=v.useState(null),b=Rn(y,2),_=b[0],x=b[1],M=l.spacing.controlHeight;return Jl(function(){var S=u.current;if(S){var k=i==="fixed",N=a&&!k,C=X1({maxHeight:s,menuEl:S,minHeight:r,placement:o,shouldScroll:N,isFixedPosition:k,controlHeight:M});p(C.maxHeight),x(C.placement),d?.(C.placement)}},[s,o,i,a,r,d,M]),n({ref:u,placerProps:Me(Me({},t),{},{placement:_||th(o),maxHeight:m})})},J1=function(t){var n=t.children,r=t.innerRef,s=t.innerProps;return Ee("div",De({},Ct(t,"menu",{menu:!0}),{ref:r},s),n)},R1=J1,ek=function(t,n){var r=t.maxHeight,s=t.theme.spacing.baseUnit;return Me({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:s,paddingTop:s})},tk=function(t){var n=t.children,r=t.innerProps,s=t.innerRef,o=t.isMulti;return Ee("div",De({},Ct(t,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:s},r),n)},rh=function(t,n){var r=t.theme,s=r.spacing.baseUnit,o=r.colors;return Me({textAlign:"center"},n?{}:{color:o.neutral40,padding:"".concat(s*2,"px ").concat(s*3,"px")})},nk=rh,rk=rh,sk=function(t){var n=t.children,r=n===void 0?"No options":n,s=t.innerProps,o=Hn(t,Y1);return Ee("div",De({},Ct(Me(Me({},o),{},{children:r,innerProps:s}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),s),r)},ok=function(t){var n=t.children,r=n===void 0?"Loading...":n,s=t.innerProps,o=Hn(t,K1);return Ee("div",De({},Ct(Me(Me({},o),{},{children:r,innerProps:s}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),s),r)},ik=function(t){var n=t.rect,r=t.offset,s=t.position;return{left:n.left,position:s,top:r,width:n.width,zIndex:1}},ak=function(t){var n=t.appendTo,r=t.children,s=t.controlElement,o=t.innerProps,i=t.menuPlacement,a=t.menuPosition,l=v.useRef(null),c=v.useRef(null),d=v.useState(th(i)),u=Rn(d,2),f=u[0],g=u[1],m=v.useMemo(function(){return{setPortalPlacement:g}},[]),p=v.useState(null),y=Rn(p,2),b=y[0],_=y[1],x=v.useCallback(function(){if(s){var N=V1(s),C=a==="fixed"?0:window.pageYOffset,w=N[f]+C;(w!==b?.offset||N.left!==b?.rect.left||N.width!==b?.rect.width)&&_({offset:w,rect:N})}},[s,a,f,b?.offset,b?.rect.left,b?.rect.width]);Jl(function(){x()},[x]);var M=v.useCallback(function(){typeof c.current=="function"&&(c.current(),c.current=null),s&&l.current&&(c.current=D1(s,l.current,x,{elementResize:"ResizeObserver"in window}))},[s,x]);Jl(function(){M()},[M]);var S=v.useCallback(function(N){l.current=N,M()},[M]);if(!n&&a!=="fixed"||!b)return null;var k=Ee("div",De({ref:S},Ct(Me(Me({},t),{},{offset:b.offset,position:a,rect:b.rect}),"menuPortal",{"menu-portal":!0}),o),r);return Ee(nh.Provider,{value:m},n?Vn.createPortal(k,n):k)},lk=function(t){var n=t.isDisabled,r=t.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},ck=function(t){var n=t.children,r=t.innerProps,s=t.isDisabled,o=t.isRtl;return Ee("div",De({},Ct(t,"container",{"--is-disabled":s,"--is-rtl":o}),r),n)},dk=function(t,n){var r=t.theme.spacing,s=t.isMulti,o=t.hasValue,i=t.selectProps.controlShouldRenderValue;return Me({alignItems:"center",display:s&&o&&i?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},uk=function(t){var n=t.children,r=t.innerProps,s=t.isMulti,o=t.hasValue;return Ee("div",De({},Ct(t,"valueContainer",{"value-container":!0,"value-container--is-multi":s,"value-container--has-value":o}),r),n)},fk=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},hk=function(t){var n=t.children,r=t.innerProps;return Ee("div",De({},Ct(t,"indicatorsContainer",{indicators:!0}),r),n)},sh,gk=["size"],pk=["innerProps","isRtl","size"],mk={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},oh=function(t){var n=t.size,r=Hn(t,gk);return Ee("svg",De({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:mk},r))},Rl=function(t){return Ee(oh,De({size:20},t),Ee("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},ih=function(t){return Ee(oh,De({size:20},t),Ee("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},ah=function(t,n){var r=t.isFocused,s=t.theme,o=s.spacing.baseUnit,i=s.colors;return Me({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?i.neutral60:i.neutral20,padding:o*2,":hover":{color:r?i.neutral80:i.neutral40}})},bk=ah,yk=function(t){var n=t.children,r=t.innerProps;return Ee("div",De({},Ct(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||Ee(ih,null))},vk=ah,xk=function(t){var n=t.children,r=t.innerProps;return Ee("div",De({},Ct(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||Ee(Rl,null))},wk=function(t,n){var r=t.isDisabled,s=t.theme,o=s.spacing.baseUnit,i=s.colors;return Me({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?i.neutral10:i.neutral20,marginBottom:o*2,marginTop:o*2})},kk=function(t){var n=t.innerProps;return Ee("span",De({},n,Ct(t,"indicatorSeparator",{"indicator-separator":!0})))},Ck=m1(sh||(sh=b1([`
|
||
0%, 80%, 100% { opacity: 0; }
|
||
40% { opacity: 1; }
|
||
`]))),Sk=function(t,n){var r=t.isFocused,s=t.size,o=t.theme,i=o.colors,a=o.spacing.baseUnit;return Me({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:s,lineHeight:1,marginRight:s,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?i.neutral60:i.neutral20,padding:a*2})},ec=function(t){var n=t.delay,r=t.offset;return Ee("span",{css:Kl({animation:"".concat(Ck," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},_k=function(t){var n=t.innerProps,r=t.isRtl,s=t.size,o=s===void 0?4:s,i=Hn(t,pk);return Ee("div",De({},Ct(Me(Me({},i),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Ee(ec,{delay:0,offset:r}),Ee(ec,{delay:160,offset:!0}),Ee(ec,{delay:320,offset:!r}))},Ek=function(t,n){var r=t.isDisabled,s=t.isFocused,o=t.theme,i=o.colors,a=o.borderRadius,l=o.spacing;return Me({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?i.neutral5:i.neutral0,borderColor:r?i.neutral10:s?i.primary:i.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:s?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:s?i.primary:i.neutral30}})},Mk=function(t){var n=t.children,r=t.isDisabled,s=t.isFocused,o=t.innerRef,i=t.innerProps,a=t.menuIsOpen;return Ee("div",De({ref:o},Ct(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":s,"control--menu-is-open":a}),i,{"aria-disabled":r||void 0}),n)},Nk=Mk,Ok=["data"],Tk=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},Ak=function(t){var n=t.children,r=t.cx,s=t.getStyles,o=t.getClassNames,i=t.Heading,a=t.headingProps,l=t.innerProps,c=t.label,d=t.theme,u=t.selectProps;return Ee("div",De({},Ct(t,"group",{group:!0}),l),Ee(i,De({},a,{selectProps:u,theme:d,getStyles:s,getClassNames:o,cx:r}),c),Ee("div",null,n))},Dk=function(t,n){var r=t.theme,s=r.colors,o=r.spacing;return Me({label:"group",cursor:"default",display:"block"},n?{}:{color:s.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},Ik=function(t){var n=Zf(t);n.data;var r=Hn(n,Ok);return Ee("div",De({},Ct(t,"groupHeading",{"group-heading":!0}),r))},Lk=Ak,Pk=["innerRef","isDisabled","isHidden","inputClassName"],$k=function(t,n){var r=t.isDisabled,s=t.value,o=t.theme,i=o.spacing,a=o.colors;return Me(Me({visibility:r?"hidden":"visible",transform:s?"translateZ(0)":""},Fk),n?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:a.neutral80})},lh={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Fk={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Me({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},lh)},zk=function(t){return Me({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},lh)},Vk=function(t){var n=t.cx,r=t.value,s=Zf(t),o=s.innerRef,i=s.isDisabled,a=s.isHidden,l=s.inputClassName,c=Hn(s,Pk);return Ee("div",De({},Ct(t,"input",{"input-container":!0}),{"data-value":r||""}),Ee("input",De({className:n({input:!0},l),ref:o,style:zk(a),disabled:i},c)))},Hk=Vk,Uk=function(t,n){var r=t.theme,s=r.spacing,o=r.borderRadius,i=r.colors;return Me({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:i.neutral10,borderRadius:o/2,margin:s.baseUnit/2})},Bk=function(t,n){var r=t.theme,s=r.borderRadius,o=r.colors,i=t.cropWithEllipsis;return Me({overflow:"hidden",textOverflow:i||i===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:s/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},jk=function(t,n){var r=t.theme,s=r.spacing,o=r.borderRadius,i=r.colors,a=t.isFocused;return Me({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:a?i.dangerLight:void 0,paddingLeft:s.baseUnit,paddingRight:s.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},ch=function(t){var n=t.children,r=t.innerProps;return Ee("div",r,n)},Wk=ch,Gk=ch;function Yk(e){var t=e.children,n=e.innerProps;return Ee("div",De({role:"button"},n),t||Ee(Rl,{size:14}))}var Kk=function(t){var n=t.children,r=t.components,s=t.data,o=t.innerProps,i=t.isDisabled,a=t.removeProps,l=t.selectProps,c=r.Container,d=r.Label,u=r.Remove;return Ee(c,{data:s,innerProps:Me(Me({},Ct(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),o),selectProps:l},Ee(d,{data:s,innerProps:Me({},Ct(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),Ee(u,{data:s,innerProps:Me(Me({},Ct(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},a),selectProps:l}))},Xk=Kk,qk=function(t,n){var r=t.isDisabled,s=t.isFocused,o=t.isSelected,i=t.theme,a=i.spacing,l=i.colors;return Me({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?l.primary:s?l.primary25:"transparent",color:r?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?l.primary:l.primary50}})},Zk=function(t){var n=t.children,r=t.isDisabled,s=t.isFocused,o=t.isSelected,i=t.innerRef,a=t.innerProps;return Ee("div",De({},Ct(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":s,"option--is-selected":o}),{ref:i,"aria-disabled":r},a),n)},Qk=Zk,Jk=function(t,n){var r=t.theme,s=r.spacing,o=r.colors;return Me({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:s.baseUnit/2,marginRight:s.baseUnit/2})},Rk=function(t){var n=t.children,r=t.innerProps;return Ee("div",De({},Ct(t,"placeholder",{placeholder:!0}),r),n)},eC=Rk,tC=function(t,n){var r=t.isDisabled,s=t.theme,o=s.spacing,i=s.colors;return Me({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?i.neutral40:i.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},nC=function(t){var n=t.children,r=t.isDisabled,s=t.innerProps;return Ee("div",De({},Ct(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),s),n)},rC=nC,Ai={ClearIndicator:xk,Control:Nk,DropdownIndicator:yk,DownChevron:ih,CrossIcon:Rl,Group:Lk,GroupHeading:Ik,IndicatorsContainer:hk,IndicatorSeparator:kk,Input:Hk,LoadingIndicator:_k,Menu:R1,MenuList:tk,MenuPortal:ak,LoadingMessage:ok,NoOptionsMessage:sk,MultiValue:Xk,MultiValueContainer:Wk,MultiValueLabel:Gk,MultiValueRemove:Yk,Option:Qk,Placeholder:eC,SelectContainer:ck,SingleValue:rC,ValueContainer:uk},sC=function(t){return Me(Me({},Ai),t.components)},dh=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function oC(e,t){return!!(e===t||dh(e)&&dh(t))}function iC(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!oC(e[n],t[n]))return!1;return!0}function aC(e,t){t===void 0&&(t=iC);var n=null;function r(){for(var s=[],o=0;o<arguments.length;o++)s[o]=arguments[o];if(n&&n.lastThis===this&&t(s,n.lastArgs))return n.lastResult;var i=e.apply(this,s);return n={lastResult:i,lastArgs:s,lastThis:this},i}return r.clear=function(){n=null},r}for(var lC={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},cC=function(t){return Ee("span",De({css:lC},t))},uh=cC,dC={guidance:function(t){var n=t.isSearchable,r=t.isMulti,s=t.tabSelectsValue,o=t.context,i=t.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(s?", press Tab to select the option and exit the menu":"",".");case"input":return i?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,r=t.label,s=r===void 0?"":r,o=t.labels,i=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(s,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return i?"option ".concat(s," is disabled. Select another option."):"option ".concat(s,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,s=t.options,o=t.label,i=o===void 0?"":o,a=t.selectValue,l=t.isDisabled,c=t.isSelected,d=t.isAppleDevice,u=function(p,y){return p&&p.length?"".concat(p.indexOf(y)+1," of ").concat(p.length):""};if(n==="value"&&a)return"value ".concat(i," focused, ").concat(u(a,r),".");if(n==="menu"&&d){var f=l?" disabled":"",g="".concat(c?" selected":"").concat(f);return"".concat(i).concat(g,", ").concat(u(s,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},uC=function(t){var n=t.ariaSelection,r=t.focusedOption,s=t.focusedValue,o=t.focusableOptions,i=t.isFocused,a=t.selectValue,l=t.selectProps,c=t.id,d=t.isAppleDevice,u=l.ariaLiveMessages,f=l.getOptionLabel,g=l.inputValue,m=l.isMulti,p=l.isOptionDisabled,y=l.isSearchable,b=l.menuIsOpen,_=l.options,x=l.screenReaderStatus,M=l.tabSelectsValue,S=l.isLoading,k=l["aria-label"],N=l["aria-live"],C=v.useMemo(function(){return Me(Me({},dC),u||{})},[u]),w=v.useMemo(function(){var A="";if(n&&C.onChange){var D=n.option,O=n.options,z=n.removedValue,U=n.removedValues,j=n.value,Y=function(Q){return Array.isArray(Q)?null:Q},B=z||D||Y(j),W=B?f(B):"",G=O||U||void 0,V=G?G.map(f):[],X=Me({isDisabled:B&&p(B,a),label:W,labels:V},n);A=C.onChange(X)}return A},[n,C,p,a,f]),E=v.useMemo(function(){var A="",D=r||s,O=!!(r&&a&&a.includes(r));if(D&&C.onFocus){var z={focused:D,label:f(D),isDisabled:p(D,a),isSelected:O,options:o,context:D===r?"menu":"value",selectValue:a,isAppleDevice:d};A=C.onFocus(z)}return A},[r,s,f,p,C,o,a,d]),T=v.useMemo(function(){var A="";if(b&&_.length&&!S&&C.onFilter){var D=x({count:o.length});A=C.onFilter({inputValue:g,resultsMessage:D})}return A},[o,g,b,C,_,x,S]),P=n?.action==="initial-input-focus",L=v.useMemo(function(){var A="";if(C.guidance){var D=s?"value":b?"menu":"input";A=C.guidance({"aria-label":k,context:D,isDisabled:r&&p(r,a),isMulti:m,isSearchable:y,tabSelectsValue:M,isInitialFocus:P})}return A},[k,r,s,m,p,y,b,C,a,M,P]),F=Ee(v.Fragment,null,Ee("span",{id:"aria-selection"},w),Ee("span",{id:"aria-focused"},E),Ee("span",{id:"aria-results"},T),Ee("span",{id:"aria-guidance"},L));return Ee(v.Fragment,null,Ee(uh,{id:c},P&&F),Ee(uh,{"aria-live":N,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},i&&!P&&F))},fC=uC,tc=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],hC=new RegExp("["+tc.map(function(e){return e.letters}).join("")+"]","g"),fh={},nc=0;nc<tc.length;nc++)for(var rc=tc[nc],sc=0;sc<rc.letters.length;sc++)fh[rc.letters[sc]]=rc.base;var hh=function(t){return t.replace(hC,function(n){return fh[n]})},gC=aC(hh),gh=function(t){return t.replace(/^\s+|\s+$/g,"")},pC=function(t){return"".concat(t.label," ").concat(t.value)},mC=function(t){return function(n,r){if(n.data.__isNew__)return!0;var s=Me({ignoreCase:!0,ignoreAccents:!0,stringify:pC,trim:!0,matchFrom:"any"},t),o=s.ignoreCase,i=s.ignoreAccents,a=s.stringify,l=s.trim,c=s.matchFrom,d=l?gh(r):r,u=l?gh(a(n)):a(n);return o&&(d=d.toLowerCase(),u=u.toLowerCase()),i&&(d=gC(d),u=hh(u)),c==="start"?u.substr(0,d.length)===d:u.indexOf(d)>-1}},bC=["innerRef"];function yC(e){var t=e.innerRef,n=Hn(e,bC),r=G1(n,"onExited","in","enter","exit","appear");return Ee("input",De({ref:t},r,{css:Kl({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var vC=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function xC(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,s=e.onTopArrive,o=e.onTopLeave,i=v.useRef(!1),a=v.useRef(!1),l=v.useRef(0),c=v.useRef(null),d=v.useCallback(function(y,b){if(c.current!==null){var _=c.current,x=_.scrollTop,M=_.scrollHeight,S=_.clientHeight,k=c.current,N=b>0,C=M-S-x,w=!1;C>b&&i.current&&(r&&r(y),i.current=!1),N&&a.current&&(o&&o(y),a.current=!1),N&&b>C?(n&&!i.current&&n(y),k.scrollTop=M,w=!0,i.current=!0):!N&&-b>x&&(s&&!a.current&&s(y),k.scrollTop=0,w=!0,a.current=!0),w&&vC(y)}},[n,r,s,o]),u=v.useCallback(function(y){d(y,y.deltaY)},[d]),f=v.useCallback(function(y){l.current=y.changedTouches[0].clientY},[]),g=v.useCallback(function(y){var b=l.current-y.changedTouches[0].clientY;d(y,b)},[d]),m=v.useCallback(function(y){if(y){var b=B1?{passive:!1}:!1;y.addEventListener("wheel",u,b),y.addEventListener("touchstart",f,b),y.addEventListener("touchmove",g,b)}},[g,f,u]),p=v.useCallback(function(y){y&&(y.removeEventListener("wheel",u,!1),y.removeEventListener("touchstart",f,!1),y.removeEventListener("touchmove",g,!1))},[g,f,u]);return v.useEffect(function(){if(t){var y=c.current;return m(y),function(){p(y)}}},[t,m,p]),function(y){c.current=y}}var ph=["boxSizing","height","overflow","paddingRight","position"],mh={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function bh(e){e.cancelable&&e.preventDefault()}function yh(e){e.stopPropagation()}function vh(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function xh(){return"ontouchstart"in window||navigator.maxTouchPoints}var wh=!!(typeof window<"u"&&window.document&&window.document.createElement),no=0,cs={capture:!1,passive:!1};function wC(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,s=v.useRef({}),o=v.useRef(null),i=v.useCallback(function(l){if(wh){var c=document.body,d=c&&c.style;if(r&&ph.forEach(function(m){var p=d&&d[m];s.current[m]=p}),r&&no<1){var u=parseInt(s.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,g=window.innerWidth-f+u||0;Object.keys(mh).forEach(function(m){var p=mh[m];d&&(d[m]=p)}),d&&(d.paddingRight="".concat(g,"px"))}c&&xh()&&(c.addEventListener("touchmove",bh,cs),l&&(l.addEventListener("touchstart",vh,cs),l.addEventListener("touchmove",yh,cs))),no+=1}},[r]),a=v.useCallback(function(l){if(wh){var c=document.body,d=c&&c.style;no=Math.max(no-1,0),r&&no<1&&ph.forEach(function(u){var f=s.current[u];d&&(d[u]=f)}),c&&xh()&&(c.removeEventListener("touchmove",bh,cs),l&&(l.removeEventListener("touchstart",vh,cs),l.removeEventListener("touchmove",yh,cs)))}},[r]);return v.useEffect(function(){if(t){var l=o.current;return i(l),function(){a(l)}}},[t,i,a]),function(l){o.current=l}}var kC=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},CC={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function SC(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,s=r===void 0?!0:r,o=e.onBottomArrive,i=e.onBottomLeave,a=e.onTopArrive,l=e.onTopLeave,c=xC({isEnabled:s,onBottomArrive:o,onBottomLeave:i,onTopArrive:a,onTopLeave:l}),d=wC({isEnabled:n}),u=function(g){c(g),d(g)};return Ee(v.Fragment,null,n&&Ee("div",{onClick:kC,css:CC}),t(u))}var _C={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},EC=function(t){var n=t.name,r=t.onFocus;return Ee("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:_C,value:"",onChange:function(){}})},MC=EC;function oc(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function NC(){return oc(/^iPhone/i)}function kh(){return oc(/^Mac/i)}function OC(){return oc(/^iPad/i)||kh()&&navigator.maxTouchPoints>1}function TC(){return NC()||OC()}function AC(){return kh()||TC()}var DC=function(t){return t.label},Ch=function(t){return t.label},Sh=function(t){return t.value},IC=function(t){return!!t.isDisabled},LC={clearIndicator:vk,container:lk,control:Ek,dropdownIndicator:bk,group:Tk,groupHeading:Dk,indicatorsContainer:fk,indicatorSeparator:wk,input:$k,loadingIndicator:Sk,loadingMessage:rk,menu:Z1,menuList:ek,menuPortal:ik,multiValue:Uk,multiValueLabel:Bk,multiValueRemove:jk,noOptionsMessage:nk,option:qk,placeholder:Jk,singleValue:tC,valueContainer:dk},PC={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},$C=4,_h=4,FC=38,zC=_h*2,VC={baseUnit:_h,controlHeight:FC,menuGutter:zC},ic={borderRadius:$C,colors:PC,spacing:VC},HC={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Rf(),captureMenuScroll:!Rf(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:mC(),formatGroupLabel:DC,getOptionLabel:Ch,getOptionValue:Sh,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:IC,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!H1(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Eh(e,t,n,r){var s=Ah(e,t,n),o=Dh(e,t,n),i=Th(e,t),a=Ii(e,t);return{type:"option",data:t,isDisabled:s,isSelected:o,label:i,value:a,index:r}}function Di(e,t){return e.options.map(function(n,r){if("options"in n){var s=n.options.map(function(i,a){return Eh(e,i,t,a)}).filter(function(i){return Oh(e,i)});return s.length>0?{type:"group",data:n,options:s,index:r}:void 0}var o=Eh(e,n,t,r);return Oh(e,o)?o:void 0}).filter(j1)}function Mh(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,os(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function Nh(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,os(r.options.map(function(s){return{data:s.data,id:"".concat(t,"-").concat(r.index,"-").concat(s.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function UC(e,t){return Mh(Di(e,t))}function Oh(e,t){var n=e.inputValue,r=n===void 0?"":n,s=t.data,o=t.isSelected,i=t.label,a=t.value;return(!Lh(e)||!o)&&Ih(e,{label:i,value:a,data:s},r)}function BC(e,t){var n=e.focusedValue,r=e.selectValue,s=r.indexOf(n);if(s>-1){var o=t.indexOf(n);if(o>-1)return n;if(s<t.length)return t[s]}return null}function jC(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var ac=function(t,n){var r,s=(r=t.find(function(o){return o.data===n}))===null||r===void 0?void 0:r.id;return s||null},Th=function(t,n){return t.getOptionLabel(n)},Ii=function(t,n){return t.getOptionValue(n)};function Ah(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function Dh(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=Ii(e,t);return n.some(function(s){return Ii(e,s)===r})}function Ih(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var Lh=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},WC=1,lc=(function(e){hw(n,e);var t=mw(n);function n(r){var s;if(uw(this,n),s=t.call(this,r),s.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},s.blockOptionHover=!1,s.isComposing=!1,s.commonProps=void 0,s.initialTouchX=0,s.initialTouchY=0,s.openAfterFocus=!1,s.scrollToFocusedOptionOnUpdate=!1,s.userIsDragging=void 0,s.controlRef=null,s.getControlRef=function(l){s.controlRef=l},s.focusedOptionRef=null,s.getFocusedOptionRef=function(l){s.focusedOptionRef=l},s.menuListRef=null,s.getMenuListRef=function(l){s.menuListRef=l},s.inputRef=null,s.getInputRef=function(l){s.inputRef=l},s.focus=s.focusInput,s.blur=s.blurInput,s.onChange=function(l,c){var d=s.props,u=d.onChange,f=d.name;c.name=f,s.ariaOnChange(l,c),u(l,c)},s.setValue=function(l,c,d){var u=s.props,f=u.closeMenuOnSelect,g=u.isMulti,m=u.inputValue;s.onInputChange("",{action:"set-value",prevInputValue:m}),f&&(s.setState({inputIsHiddenAfterUpdate:!g}),s.onMenuClose()),s.setState({clearFocusValueOnUpdate:!0}),s.onChange(l,{action:c,option:d})},s.selectOption=function(l){var c=s.props,d=c.blurInputOnSelect,u=c.isMulti,f=c.name,g=s.state.selectValue,m=u&&s.isOptionSelected(l,g),p=s.isOptionDisabled(l,g);if(m){var y=s.getOptionValue(l);s.setValue(g.filter(function(b){return s.getOptionValue(b)!==y}),"deselect-option",l)}else if(!p)u?s.setValue([].concat(os(g),[l]),"select-option",l):s.setValue(l,"select-option");else{s.ariaOnChange(l,{action:"select-option",option:l,name:f});return}d&&s.blurInput()},s.removeValue=function(l){var c=s.props.isMulti,d=s.state.selectValue,u=s.getOptionValue(l),f=d.filter(function(m){return s.getOptionValue(m)!==u}),g=to(c,f,f[0]||null);s.onChange(g,{action:"remove-value",removedValue:l}),s.focusInput()},s.clearValue=function(){var l=s.state.selectValue;s.onChange(to(s.props.isMulti,[],null),{action:"clear",removedValues:l})},s.popValue=function(){var l=s.props.isMulti,c=s.state.selectValue,d=c[c.length-1],u=c.slice(0,c.length-1),f=to(l,u,u[0]||null);d&&s.onChange(f,{action:"pop-value",removedValue:d})},s.getFocusedOptionId=function(l){return ac(s.state.focusableOptionsWithIds,l)},s.getFocusableOptionsWithIds=function(){return Nh(Di(s.props,s.state.selectValue),s.getElementId("option"))},s.getValue=function(){return s.state.selectValue},s.cx=function(){for(var l=arguments.length,c=new Array(l),d=0;d<l;d++)c[d]=arguments[d];return P1.apply(void 0,[s.props.classNamePrefix].concat(c))},s.getOptionLabel=function(l){return Th(s.props,l)},s.getOptionValue=function(l){return Ii(s.props,l)},s.getStyles=function(l,c){var d=s.props.unstyled,u=LC[l](c,d);u.boxSizing="border-box";var f=s.props.styles[l];return f?f(u,c):u},s.getClassNames=function(l,c){var d,u;return(d=(u=s.props.classNames)[l])===null||d===void 0?void 0:d.call(u,c)},s.getElementId=function(l){return"".concat(s.state.instancePrefix,"-").concat(l)},s.getComponents=function(){return sC(s.props)},s.buildCategorizedOptions=function(){return Di(s.props,s.state.selectValue)},s.getCategorizedOptions=function(){return s.props.menuIsOpen?s.buildCategorizedOptions():[]},s.buildFocusableOptions=function(){return Mh(s.buildCategorizedOptions())},s.getFocusableOptions=function(){return s.props.menuIsOpen?s.buildFocusableOptions():[]},s.ariaOnChange=function(l,c){s.setState({ariaSelection:Me({value:l},c)})},s.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),s.focusInput())},s.onMenuMouseMove=function(l){s.blockOptionHover=!1},s.onControlMouseDown=function(l){if(!l.defaultPrevented){var c=s.props.openMenuOnClick;s.state.isFocused?s.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&s.onMenuClose():c&&s.openMenu("first"):(c&&(s.openAfterFocus=!0),s.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},s.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!s.props.isDisabled){var c=s.props,d=c.isMulti,u=c.menuIsOpen;s.focusInput(),u?(s.setState({inputIsHiddenAfterUpdate:!d}),s.onMenuClose()):s.openMenu("first"),l.preventDefault()}},s.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(s.clearValue(),l.preventDefault(),s.openAfterFocus=!1,l.type==="touchend"?s.focusInput():setTimeout(function(){return s.focusInput()}))},s.onScroll=function(l){typeof s.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&Mi(l.target)&&s.props.onMenuClose():typeof s.props.closeMenuOnScroll=="function"&&s.props.closeMenuOnScroll(l)&&s.props.onMenuClose()},s.onCompositionStart=function(){s.isComposing=!0},s.onCompositionEnd=function(){s.isComposing=!1},s.onTouchStart=function(l){var c=l.touches,d=c&&c.item(0);d&&(s.initialTouchX=d.clientX,s.initialTouchY=d.clientY,s.userIsDragging=!1)},s.onTouchMove=function(l){var c=l.touches,d=c&&c.item(0);if(d){var u=Math.abs(d.clientX-s.initialTouchX),f=Math.abs(d.clientY-s.initialTouchY),g=5;s.userIsDragging=u>g||f>g}},s.onTouchEnd=function(l){s.userIsDragging||(s.controlRef&&!s.controlRef.contains(l.target)&&s.menuListRef&&!s.menuListRef.contains(l.target)&&s.blurInput(),s.initialTouchX=0,s.initialTouchY=0)},s.onControlTouchEnd=function(l){s.userIsDragging||s.onControlMouseDown(l)},s.onClearIndicatorTouchEnd=function(l){s.userIsDragging||s.onClearIndicatorMouseDown(l)},s.onDropdownIndicatorTouchEnd=function(l){s.userIsDragging||s.onDropdownIndicatorMouseDown(l)},s.handleInputChange=function(l){var c=s.props.inputValue,d=l.currentTarget.value;s.setState({inputIsHiddenAfterUpdate:!1}),s.onInputChange(d,{action:"input-change",prevInputValue:c}),s.props.menuIsOpen||s.onMenuOpen()},s.onInputFocus=function(l){s.props.onFocus&&s.props.onFocus(l),s.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(s.openAfterFocus||s.props.openMenuOnFocus)&&s.openMenu("first"),s.openAfterFocus=!1},s.onInputBlur=function(l){var c=s.props.inputValue;if(s.menuListRef&&s.menuListRef.contains(document.activeElement)){s.inputRef.focus();return}s.props.onBlur&&s.props.onBlur(l),s.onInputChange("",{action:"input-blur",prevInputValue:c}),s.onMenuClose(),s.setState({focusedValue:null,isFocused:!1})},s.onOptionHover=function(l){if(!(s.blockOptionHover||s.state.focusedOption===l)){var c=s.getFocusableOptions(),d=c.indexOf(l);s.setState({focusedOption:l,focusedOptionId:d>-1?s.getFocusedOptionId(l):null})}},s.shouldHideSelectedOptions=function(){return Lh(s.props)},s.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),s.focus()},s.onKeyDown=function(l){var c=s.props,d=c.isMulti,u=c.backspaceRemovesValue,f=c.escapeClearsValue,g=c.inputValue,m=c.isClearable,p=c.isDisabled,y=c.menuIsOpen,b=c.onKeyDown,_=c.tabSelectsValue,x=c.openMenuOnFocus,M=s.state,S=M.focusedOption,k=M.focusedValue,N=M.selectValue;if(!p&&!(typeof b=="function"&&(b(l),l.defaultPrevented))){switch(s.blockOptionHover=!0,l.key){case"ArrowLeft":if(!d||g)return;s.focusValue("previous");break;case"ArrowRight":if(!d||g)return;s.focusValue("next");break;case"Delete":case"Backspace":if(g)return;if(k)s.removeValue(k);else{if(!u)return;d?s.popValue():m&&s.clearValue()}break;case"Tab":if(s.isComposing||l.shiftKey||!y||!_||!S||x&&s.isOptionSelected(S,N))return;s.selectOption(S);break;case"Enter":if(l.keyCode===229)break;if(y){if(!S||s.isComposing)return;s.selectOption(S);break}return;case"Escape":y?(s.setState({inputIsHiddenAfterUpdate:!1}),s.onInputChange("",{action:"menu-close",prevInputValue:g}),s.onMenuClose()):m&&f&&s.clearValue();break;case" ":if(g)return;if(!y){s.openMenu("first");break}if(!S)return;s.selectOption(S);break;case"ArrowUp":y?s.focusOption("up"):s.openMenu("last");break;case"ArrowDown":y?s.focusOption("down"):s.openMenu("first");break;case"PageUp":if(!y)return;s.focusOption("pageup");break;case"PageDown":if(!y)return;s.focusOption("pagedown");break;case"Home":if(!y)return;s.focusOption("first");break;case"End":if(!y)return;s.focusOption("last");break;default:return}l.preventDefault()}},s.state.instancePrefix="react-select-"+(s.props.instanceId||++WC),s.state.selectValue=Ei(r.value),r.menuIsOpen&&s.state.selectValue.length){var o=s.getFocusableOptionsWithIds(),i=s.buildFocusableOptions(),a=i.indexOf(s.state.selectValue[0]);s.state.focusableOptionsWithIds=o,s.state.focusedOption=i[a],s.state.focusedOptionId=ac(o,i[a])}return s}return fw(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Jf(this.menuListRef,this.focusedOptionRef),AC()&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(s){var o=this.props,i=o.isDisabled,a=o.menuIsOpen,l=this.state.isFocused;(l&&!i&&s.isDisabled||l&&a&&!s.menuIsOpen)&&this.focusInput(),l&&i&&!s.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!i&&s.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Jf(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(s,o){this.props.onInputChange(s,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(s){var o=this,i=this.state,a=i.selectValue,l=i.isFocused,c=this.buildFocusableOptions(),d=s==="first"?0:c.length-1;if(!this.props.isMulti){var u=c.indexOf(a[0]);u>-1&&(d=u)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:c[d],focusedOptionId:this.getFocusedOptionId(c[d])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(s){var o=this.state,i=o.selectValue,a=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=i.indexOf(a);a||(l=-1);var c=i.length-1,d=-1;if(i.length){switch(s){case"previous":l===0?d=0:l===-1?d=c:d=l-1;break;case"next":l>-1&&l<c&&(d=l+1);break}this.setState({inputIsHidden:d!==-1,focusedValue:i[d]})}}}},{key:"focusOption",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,i=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var l=0,c=a.indexOf(i);i||(c=-1),s==="up"?l=c>0?c-1:a.length-1:s==="down"?l=(c+1)%a.length:s==="pageup"?(l=c-o,l<0&&(l=0)):s==="pagedown"?(l=c+o,l>a.length-1&&(l=a.length-1)):s==="last"&&(l=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[l])})}}},{key:"getTheme",value:(function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(ic):Me(Me({},ic),this.props.theme):ic})},{key:"getCommonProps",value:function(){var s=this.clearValue,o=this.cx,i=this.getStyles,a=this.getClassNames,l=this.getValue,c=this.selectOption,d=this.setValue,u=this.props,f=u.isMulti,g=u.isRtl,m=u.options,p=this.hasValue();return{clearValue:s,cx:o,getStyles:i,getClassNames:a,getValue:l,hasValue:p,isMulti:f,isRtl:g,options:m,selectOption:c,selectProps:u,setValue:d,theme:this.getTheme()}}},{key:"hasValue",value:function(){var s=this.state.selectValue;return s.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var s=this.props,o=s.isClearable,i=s.isMulti;return o===void 0?i:o}},{key:"isOptionDisabled",value:function(s,o){return Ah(this.props,s,o)}},{key:"isOptionSelected",value:function(s,o){return Dh(this.props,s,o)}},{key:"filterOption",value:function(s,o){return Ih(this.props,s,o)}},{key:"formatOptionLabel",value:function(s,o){if(typeof this.props.formatOptionLabel=="function"){var i=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(s,{context:o,inputValue:i,selectValue:a})}else return this.getOptionLabel(s)}},{key:"formatGroupLabel",value:function(s){return this.props.formatGroupLabel(s)}},{key:"startListeningComposition",value:(function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))})},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:(function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))})},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:(function(){var s=this.props,o=s.isDisabled,i=s.isSearchable,a=s.inputId,l=s.inputValue,c=s.tabIndex,d=s.form,u=s.menuIsOpen,f=s.required,g=this.getComponents(),m=g.Input,p=this.state,y=p.inputIsHidden,b=p.ariaSelection,_=this.commonProps,x=a||this.getElementId("input"),M=Me(Me(Me({"aria-autocomplete":"list","aria-expanded":u,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":f,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},u&&{"aria-controls":this.getElementId("listbox")}),!i&&{"aria-readonly":!0}),this.hasValue()?b?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return i?$.createElement(m,De({},_,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:x,innerRef:this.getInputRef,isDisabled:o,isHidden:y,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:c,form:d,type:"text",value:l},M)):$.createElement(yC,De({id:x,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:_i,onFocus:this.onInputFocus,disabled:o,tabIndex:c,inputMode:"none",form:d,value:""},M))})},{key:"renderPlaceholderOrValue",value:function(){var s=this,o=this.getComponents(),i=o.MultiValue,a=o.MultiValueContainer,l=o.MultiValueLabel,c=o.MultiValueRemove,d=o.SingleValue,u=o.Placeholder,f=this.commonProps,g=this.props,m=g.controlShouldRenderValue,p=g.isDisabled,y=g.isMulti,b=g.inputValue,_=g.placeholder,x=this.state,M=x.selectValue,S=x.focusedValue,k=x.isFocused;if(!this.hasValue()||!m)return b?null:$.createElement(u,De({},f,{key:"placeholder",isDisabled:p,isFocused:k,innerProps:{id:this.getElementId("placeholder")}}),_);if(y)return M.map(function(C,w){var E=C===S,T="".concat(s.getOptionLabel(C),"-").concat(s.getOptionValue(C));return $.createElement(i,De({},f,{components:{Container:a,Label:l,Remove:c},isFocused:E,isDisabled:p,key:T,index:w,removeProps:{onClick:function(){return s.removeValue(C)},onTouchEnd:function(){return s.removeValue(C)},onMouseDown:function(L){L.preventDefault()}},data:C}),s.formatOptionLabel(C,"value"))});if(b)return null;var N=M[0];return $.createElement(d,De({},f,{data:N,isDisabled:p}),this.formatOptionLabel(N,"value"))}},{key:"renderClearIndicator",value:function(){var s=this.getComponents(),o=s.ClearIndicator,i=this.commonProps,a=this.props,l=a.isDisabled,c=a.isLoading,d=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||c)return null;var u={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return $.createElement(o,De({},i,{innerProps:u,isFocused:d}))}},{key:"renderLoadingIndicator",value:function(){var s=this.getComponents(),o=s.LoadingIndicator,i=this.commonProps,a=this.props,l=a.isDisabled,c=a.isLoading,d=this.state.isFocused;if(!o||!c)return null;var u={"aria-hidden":"true"};return $.createElement(o,De({},i,{innerProps:u,isDisabled:l,isFocused:d}))}},{key:"renderIndicatorSeparator",value:function(){var s=this.getComponents(),o=s.DropdownIndicator,i=s.IndicatorSeparator;if(!o||!i)return null;var a=this.commonProps,l=this.props.isDisabled,c=this.state.isFocused;return $.createElement(i,De({},a,{isDisabled:l,isFocused:c}))}},{key:"renderDropdownIndicator",value:function(){var s=this.getComponents(),o=s.DropdownIndicator;if(!o)return null;var i=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,c={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return $.createElement(o,De({},i,{innerProps:c,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var s=this,o=this.getComponents(),i=o.Group,a=o.GroupHeading,l=o.Menu,c=o.MenuList,d=o.MenuPortal,u=o.LoadingMessage,f=o.NoOptionsMessage,g=o.Option,m=this.commonProps,p=this.state.focusedOption,y=this.props,b=y.captureMenuScroll,_=y.inputValue,x=y.isLoading,M=y.loadingMessage,S=y.minMenuHeight,k=y.maxMenuHeight,N=y.menuIsOpen,C=y.menuPlacement,w=y.menuPosition,E=y.menuPortalTarget,T=y.menuShouldBlockScroll,P=y.menuShouldScrollIntoView,L=y.noOptionsMessage,F=y.onMenuScrollToTop,A=y.onMenuScrollToBottom;if(!N)return null;var D=function(W,G){var V=W.type,X=W.data,K=W.isDisabled,Q=W.isSelected,ne=W.label,se=W.value,ue=p===X,ee=K?void 0:function(){return s.onOptionHover(X)},me=K?void 0:function(){return s.selectOption(X)},ie="".concat(s.getElementId("option"),"-").concat(G),de={id:ie,onClick:me,onMouseMove:ee,onMouseOver:ee,tabIndex:-1,role:"option","aria-selected":s.state.isAppleDevice?void 0:Q};return $.createElement(g,De({},m,{innerProps:de,data:X,isDisabled:K,isSelected:Q,key:ie,label:ne,type:V,value:se,isFocused:ue,innerRef:ue?s.getFocusedOptionRef:void 0}),s.formatOptionLabel(W.data,"menu"))},O;if(this.hasOptions())O=this.getCategorizedOptions().map(function(B){if(B.type==="group"){var W=B.data,G=B.options,V=B.index,X="".concat(s.getElementId("group"),"-").concat(V),K="".concat(X,"-heading");return $.createElement(i,De({},m,{key:X,data:W,options:G,Heading:a,headingProps:{id:K,data:B.data},label:s.formatGroupLabel(B.data)}),B.options.map(function(Q){return D(Q,"".concat(V,"-").concat(Q.index))}))}else if(B.type==="option")return D(B,"".concat(B.index))});else if(x){var z=M({inputValue:_});if(z===null)return null;O=$.createElement(u,m,z)}else{var U=L({inputValue:_});if(U===null)return null;O=$.createElement(f,m,U)}var j={minMenuHeight:S,maxMenuHeight:k,menuPlacement:C,menuPosition:w,menuShouldScrollIntoView:P},Y=$.createElement(Q1,De({},m,j),function(B){var W=B.ref,G=B.placerProps,V=G.placement,X=G.maxHeight;return $.createElement(l,De({},m,j,{innerRef:W,innerProps:{onMouseDown:s.onMenuMouseDown,onMouseMove:s.onMenuMouseMove},isLoading:x,placement:V}),$.createElement(SC,{captureEnabled:b,onTopArrive:F,onBottomArrive:A,lockEnabled:T},function(K){return $.createElement(c,De({},m,{innerRef:function(ne){s.getMenuListRef(ne),K(ne)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:s.getElementId("listbox")},isLoading:x,maxHeight:X,focusedOption:p}),O)}))});return E||w==="fixed"?$.createElement(d,De({},m,{appendTo:E,controlElement:this.controlRef,menuPlacement:C,menuPosition:w}),Y):Y}},{key:"renderFormField",value:function(){var s=this,o=this.props,i=o.delimiter,a=o.isDisabled,l=o.isMulti,c=o.name,d=o.required,u=this.state.selectValue;if(d&&!this.hasValue()&&!a)return $.createElement(MC,{name:c,onFocus:this.onValueInputFocus});if(!(!c||a))if(l)if(i){var f=u.map(function(p){return s.getOptionValue(p)}).join(i);return $.createElement("input",{name:c,type:"hidden",value:f})}else{var g=u.length>0?u.map(function(p,y){return $.createElement("input",{key:"i-".concat(y),name:c,type:"hidden",value:s.getOptionValue(p)})}):$.createElement("input",{name:c,type:"hidden",value:""});return $.createElement("div",null,g)}else{var m=u[0]?this.getOptionValue(u[0]):"";return $.createElement("input",{name:c,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var s=this.commonProps,o=this.state,i=o.ariaSelection,a=o.focusedOption,l=o.focusedValue,c=o.isFocused,d=o.selectValue,u=this.getFocusableOptions();return $.createElement(fC,De({},s,{id:this.getElementId("live-region"),ariaSelection:i,focusedOption:a,focusedValue:l,isFocused:c,selectValue:d,focusableOptions:u,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var s=this.getComponents(),o=s.Control,i=s.IndicatorsContainer,a=s.SelectContainer,l=s.ValueContainer,c=this.props,d=c.className,u=c.id,f=c.isDisabled,g=c.menuIsOpen,m=this.state.isFocused,p=this.commonProps=this.getCommonProps();return $.createElement(a,De({},p,{className:d,innerProps:{id:u,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:m}),this.renderLiveRegion(),$.createElement(o,De({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:m,menuIsOpen:g}),$.createElement(l,De({},p,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),$.createElement(i,De({},p,{isDisabled:f}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(s,o){var i=o.prevProps,a=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,c=o.ariaSelection,d=o.isFocused,u=o.prevWasFocused,f=o.instancePrefix,g=s.options,m=s.value,p=s.menuIsOpen,y=s.inputValue,b=s.isMulti,_=Ei(m),x={};if(i&&(m!==i.value||g!==i.options||p!==i.menuIsOpen||y!==i.inputValue)){var M=p?UC(s,_):[],S=p?Nh(Di(s,_),"".concat(f,"-option")):[],k=a?BC(o,_):null,N=jC(o,M),C=ac(S,N);x={selectValue:_,focusedOption:N,focusedOptionId:C,focusableOptionsWithIds:S,focusedValue:k,clearFocusValueOnUpdate:!1}}var w=l!=null&&s!==i?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},E=c,T=d&&u;return d&&!T&&(E={value:to(b,_,_[0]||null),options:_,action:"initial-input-focus"},T=!u),c?.action==="initial-input-focus"&&(E=null),Me(Me(Me({},x),w),{},{prevProps:s,ariaSelection:E,prevWasFocused:T})}}]),n})(v.Component);lc.defaultProps=HC;var GC=v.forwardRef(function(e,t){var n=yf(e);return $.createElement(lc,De({ref:t},n))}),Ph=GC,YC=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],$h=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,s=String(t).toLowerCase(),o=String(r.getOptionValue(n)).toLowerCase(),i=String(r.getOptionLabel(n)).toLowerCase();return o===s||i===s},cc={formatCreateLabel:function(t){return'Create "'.concat(t,'"')},isValidNewOption:function(t,n,r,s){return!(!t||n.some(function(o){return $h(t,o,s)})||r.some(function(o){return $h(t,o,s)}))},getNewOptionData:function(t,n){return{label:n,value:t,__isNew__:!0}}};function KC(e){var t=e.allowCreateWhileLoading,n=t===void 0?!1:t,r=e.createOptionPosition,s=r===void 0?"last":r,o=e.formatCreateLabel,i=o===void 0?cc.formatCreateLabel:o,a=e.isValidNewOption,l=a===void 0?cc.isValidNewOption:a,c=e.getNewOptionData,d=c===void 0?cc.getNewOptionData:c,u=e.onCreateOption,f=e.options,g=f===void 0?[]:f,m=e.onChange,p=Hn(e,YC),y=p.getOptionValue,b=y===void 0?Sh:y,_=p.getOptionLabel,x=_===void 0?Ch:_,M=p.inputValue,S=p.isLoading,k=p.isMulti,N=p.value,C=p.name,w=v.useMemo(function(){return l(M,Ei(N),g,{getOptionValue:b,getOptionLabel:x})?d(M,i(M)):void 0},[i,d,x,b,M,l,g,N]),E=v.useMemo(function(){return(n||!S)&&w?s==="first"?[w].concat(os(g)):[].concat(os(g),[w]):g},[n,s,S,w,g]),T=v.useCallback(function(P,L){if(L.action!=="select-option")return m(P,L);var F=Array.isArray(P)?P:[P];if(F[F.length-1]===w){if(u)u(M);else{var A=d(M,M),D={action:"create-option",name:C,option:A};m(to(k,[].concat(os(Ei(N)),[A]),A),D)}return}m(P,L)},[d,M,k,C,w,u,m,N]);return Me(Me({},p),{},{options:E,onChange:T})}var XC=v.forwardRef(function(e,t){var n=yf(e),r=KC(n);return $.createElement(lc,De({ref:t},r))}),Fh=XC;const Wt={control:"input-tag",valueContainer:"gap-1 flex flex-wrap",multiValue:{blue:"bg-blue-100 dark:bg-blue-900/20 rounded px-1.5 py-0.5 flex items-center gap-1",green:"bg-green-100 dark:bg-green-900/20 rounded px-1.5 py-0.5 flex items-center gap-1",amber:"bg-amber-100 dark:bg-amber-900/20 rounded px-1.5 py-0.5 flex items-center gap-1",red:"bg-red-100 dark:bg-red-900/20 rounded px-1.5 py-0.5 flex items-center gap-1",purple:"bg-purple-100 dark:bg-purple-900/20 rounded px-1.5 py-0.5 flex items-center gap-1",gray:"bg-gray-100 dark:bg-gray-700/50 rounded px-1.5 py-0.5 flex items-center gap-1"},multiValueLabel:{blue:"text-blue-700 dark:text-blue-300 text-xs",green:"text-green-700 dark:text-green-300 text-xs font-semibold",amber:"text-amber-700 dark:text-amber-300 text-xs font-semibold",red:"text-red-700 dark:text-red-300 text-xs font-semibold",purple:"text-purple-700 dark:text-purple-300 text-xs font-semibold",gray:"text-gray-700 dark:text-gray-300 text-xs"},multiValueRemove:{blue:"text-blue-700 dark:text-blue-300 hover:bg-red-100 dark:hover:bg-red-900/30 hover:text-red-600 dark:hover:text-red-400 rounded px-1",green:"text-green-700 dark:text-green-300 hover:bg-red-100 dark:hover:bg-red-900/30 hover:text-red-600 dark:hover:text-red-400 rounded px-1",amber:"text-amber-700 dark:text-amber-300 hover:bg-red-100 dark:hover:bg-red-900/30 hover:text-red-600 dark:hover:text-red-400 rounded px-1",red:"text-red-700 dark:text-red-300 hover:bg-red-100 dark:hover:bg-red-900/30 hover:text-red-600 dark:hover:text-red-400 rounded px-1",purple:"text-purple-700 dark:text-purple-300 hover:bg-red-100 dark:hover:bg-red-900/30 hover:text-red-600 dark:hover:text-red-400 rounded px-1",gray:"text-gray-700 dark:text-gray-300 hover:bg-red-100 dark:hover:bg-red-900/30 hover:text-red-600 dark:hover:text-red-400 rounded px-1"},input:"text-gray-900 dark:text-white text-sm",placeholder:"text-gray-400 dark:text-gray-500 text-sm",menu:"mt-2 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg",menuList:"py-1",option:{base:"px-3 py-2 cursor-pointer text-gray-900 dark:text-white text-[13px]",selected:"bg-blue-100 dark:bg-blue-900/20",focused:"bg-gray-100 dark:bg-gray-700",default:"bg-white dark:bg-gray-800"},noOptionsMessage:"px-3 py-2 text-gray-500 dark:text-gray-400 text-[13px]",checkbox:{base:"w-4 h-4 rounded border flex items-center justify-center text-white text-[10px] shrink-0",selected:"bg-blue-500 border-blue-500",unselected:"border-gray-400 dark:border-gray-500"}},zh=e=>{const{data:t,isSelected:n}=e;return h.jsx(Ai.Option,{...e,children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:`${Wt.checkbox.base} ${n?Wt.checkbox.selected:Wt.checkbox.unselected}`,children:n?"✓":""}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("span",{className:"text-[13px]",children:t.label}),t.count!==void 0&&t.count>0&&h.jsxs("span",{className:"text-gray-500 dark:text-gray-400 text-[10px]",children:["(",t.count,")"]})]}),t.description&&h.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 truncate",children:t.description})]})]})})},Vh=e=>h.jsx(Ai.GroupHeading,{...e,children:h.jsx("div",{className:"px-3 py-1.5 text-xs font-medium text-gray-500 dark:text-gray-400 bg-gray-50 dark:bg-gray-800/50 border-b border-gray-200 dark:border-gray-700",children:e.data.label})}),qC=e=>{const{data:t}=e;return h.jsxs(Ai.MultiValueLabel,{...e,children:[h.jsx("span",{children:t.label}),t.count!==void 0&&t.count>0&&h.jsxs("span",{className:"text-xs opacity-60 ml-1",children:["(",t.count,")"]})]})},ZC=({value:e,options:t=[],onChange:n,creatable:r=!1,placeholder:s="검색 또는 입력...",noOptionsMessage:o="검색 결과가 없습니다",formatCreateLabel:i,createLabelSuffix:a="추가",maxItems:l,disabled:c=!1,onBeforeRemove:d,onCreateOption:u,className:f="",tagVariants:g,defaultVariant:m="blue",name:p,isMulti:y=!0,isClearable:b=!0,isSearchable:_=!0,delimiters:x=[","],splitOnPaste:M=!0,onInputChange:S,id:k,editorAttrs:N})=>{const C=c===!0||c==="true",w=v.useCallback(ee=>ee==null?[]:Array.isArray(ee)?ee:[ee],[]),[E,T]=v.useState(()=>w(e)),[P,L]=v.useState(""),F=v.useRef(void 0);v.useEffect(()=>{const ee=(ie,de)=>!ie&&!de?!0:!ie||!de||ie.length!==de.length?!1:ie.every((fe,be)=>fe===de[be]),me=w(e);ee(me,F.current)||(T(me),F.current=me)},[e,w]);const A=v.useMemo(()=>i?typeof i=="string"?ee=>`${i} "${ee}"`:i:ee=>h.jsxs("span",{className:"text-[13px]",children:[h.jsx("strong",{children:ee})," ",a]}),[i,a]),D=v.useMemo(()=>!E||!Array.isArray(E)?[]:E.map(ee=>t.find(ie=>ie.value===ee)||{value:ee,label:String(ee)}).filter(ee=>ee!==void 0),[E,t]),O=v.useMemo(()=>{const ee=new Set(t.map(Ce=>Ce.value)),me=E?E.filter(Ce=>!ee.has(Ce)).map(Ce=>({value:Ce,label:String(Ce)})):[],ie=[...t,...me];if(!ie.some(Ce=>Ce.group))return ie;const fe=new Map,be=[];ie.forEach(Ce=>{if(Ce.group){const je=fe.get(Ce.group)||[];je.push(Ce),fe.set(Ce.group,je)}else be.push(Ce)});const ge=[];return fe.forEach((Ce,je)=>{ge.push({label:je,options:Ce})}),be.length>0&&ge.push({label:"",options:be}),ge},[t,E]),z=v.useCallback(ee=>({target:{value:ee},currentTarget:{value:ee},preventDefault:()=>{},stopPropagation:()=>{}}),[]),U=v.useCallback(ee=>{if(!x?.length)return[ee.trim()].filter(Boolean);const me=x.map(de=>de.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),ie=new RegExp(`[${me.join("")}]`);return ee.split(ie).map(de=>de.trim()).filter(Boolean)},[x]),j=v.useCallback((ee,me)=>{if(me.action!=="input-change"){L(ee);return}if(S&&S(z(ee)),!x?.some(be=>ee.includes(be))||!r||!y){L(ee);return}const fe=U(ee).filter(be=>be&&!E.includes(be));if(fe.length>0){const be=l?l-E.length:1/0,ge=fe.slice(0,be);if(ge.length>0){const Ce=[...E,...ge];T(Ce),n(z(Ce))}}L("")},[x,r,y,U,E,l,n,z,S]),Y=v.useCallback(ee=>{if(!M||!r||!y)return;const me=ee.clipboardData.getData("text"),ie=U(me);if(ie.length<=1)return;ee.preventDefault();const de=ie.filter(fe=>fe&&!E.includes(fe));if(de.length>0){const fe=l?l-E.length:1/0,be=de.slice(0,fe);if(be.length>0){const ge=[...E,...be];T(ge),n(z(ge))}}},[M,r,y,U,E,l,n,z]),B=v.useCallback((ee,me)=>{if((me.action==="remove-value"||me.action==="pop-value")&&me.removedValue&&d){const de=d(me.removedValue);if(de!==!0){const fe=typeof de=="string"?de:`"${me.removedValue.label}"은(는) 제거할 수 없습니다.`;alert(fe);return}}if(l&&ee.length>l)return;const ie=ee.map(de=>de.value);T(ie),n(z(ie))},[n,d,l,z]),W=v.useCallback((ee,me)=>{if(me.action==="clear"&&E.length>0&&d){const fe=t.find(ge=>ge.value===E[0])||{value:E[0],label:String(E[0])},be=d(fe);if(be!==!0){const ge=typeof be=="string"?be:`"${fe.label}"은(는) 제거할 수 없습니다.`;alert(ge);return}}const ie=ee?ee.value:null,de=ee?[ee.value]:[];T(de),n(z(ie))},[n,d,E,t,z]),G=v.useCallback(ee=>{u&&u(ee);const me=[...E||[],ee];T(me),n(z(me))},[n,u,E,z]),V=v.useCallback(ee=>!ee||!ee.trim()?!1:!E?.includes(ee.trim()),[E]),X=v.useCallback(ee=>{const me=P.trim();if(ee.key==="Tab"&&r&&y&&me){if(E.includes(me))ee.preventDefault(),L("");else if(!l||E.length<l){ee.preventDefault();const ie=[...E,me];T(ie),n(z(ie)),L("")}return}ee.key==="Enter"&&(!me||E&&E.includes(me))&&(ee.preventDefault(),ee.stopPropagation())},[E,P,r,y,l,n,z]),K=v.useCallback(ee=>g&&g[ee]?g[ee]:m,[g,m]),Q={control:()=>`${Wt.control} ${f} ${C?"opacity-60 cursor-not-allowed":""}`,valueContainer:()=>Wt.valueContainer,multiValue:ee=>{const me=K(ee.data.value);return Wt.multiValue[me]},multiValueLabel:ee=>{const me=K(ee.data.value);return Wt.multiValueLabel[me]},multiValueRemove:ee=>{const me=K(ee.data.value);return`${Wt.multiValueRemove[me]} ${C?"pointer-events-none":""}`},singleValue:()=>"text-gray-900 dark:text-white text-sm",input:()=>Wt.input,placeholder:()=>Wt.placeholder,menu:()=>Wt.menu,menuList:()=>Wt.menuList,menuPortal:()=>"z-[9999]",option:ee=>`${Wt.option.base} ${ee.isSelected?Wt.option.selected:ee.isFocused?Wt.option.focused:Wt.option.default}`,noOptionsMessage:()=>Wt.noOptionsMessage,clearIndicator:()=>"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 cursor-pointer px-1",dropdownIndicator:()=>"text-gray-400 dark:text-gray-500 px-1"},ne={options:O,onKeyDown:X,placeholder:s,noOptionsMessage:()=>o,isDisabled:C,isSearchable:_,menuIsOpen:void 0,openMenuOnClick:!0,openMenuOnFocus:!0,menuPortalTarget:typeof document<"u"?document.body:null,menuPosition:"fixed",classNamePrefix:"tag-input",unstyled:!0,classNames:Q,styles:{menuPortal:ee=>({...ee,zIndex:9999})},...r&&y||S?{inputValue:P,onInputChange:j}:{}},se=y?E.join(","):E[0]??"";if(!y){const ee={...ne,isMulti:!1,value:D[0]||null,onChange:W,isClearable:b,closeMenuOnSelect:!0,components:{Option:zh,GroupHeading:Vh,IndicatorSeparator:()=>null,...b?{}:{ClearIndicator:()=>null}}};return r?h.jsxs(I,{id:k,...N,children:[p&&h.jsx("input",{type:"hidden",name:p,value:se}),h.jsx(Fh,{...ee,onCreateOption:G,formatCreateLabel:A,isValidNewOption:V,createOptionPosition:"first"})]}):h.jsxs(I,{id:k,...N,children:[p&&h.jsx("input",{type:"hidden",name:p,value:se}),h.jsx(Ph,{...ee})]})}const ue={...ne,isMulti:!0,value:D,onChange:B,closeMenuOnSelect:!1,hideSelectedOptions:!1,backspaceRemovesValue:!1,isClearable:!1,components:{Option:zh,GroupHeading:Vh,MultiValueLabel:qC,ClearIndicator:()=>null,DropdownIndicator:()=>null,IndicatorSeparator:()=>null}};return r?h.jsxs(I,{id:k,...N,onPaste:Y,children:[p&&h.jsx("input",{type:"hidden",name:p,value:se}),h.jsx(Fh,{...ue,onCreateOption:G,formatCreateLabel:A,isValidNewOption:V,createOptionPosition:"first"})]}):h.jsxs(I,{id:k,...N,children:[p&&h.jsx("input",{type:"hidden",name:p,value:se}),h.jsx(Ph,{...ue})]})},ds=(e,t)=>window.G7Core?.t?.(e,t)??e,QC=()=>window.G7Core?.locale?.supported?.()??["ko","en"],JC=()=>window.G7Core?.locale?.current?.()??"ko",dc=e=>{const t=ds(`common.language_${e}`);return t===`common.language_${e}`?{ko:"한국어",en:"English",ja:"日本語",zh:"中文"}[e]||e.toUpperCase():t},RC=({value:e=[],onChange:t,placeholder:n="입력 후 Enter",disabled:r=!1,creatable:s=!0,delimiters:o=[","],className:i="",name:a,error:l,maxItems:c,modalId:d,statePath:u,__componentContext:f,id:g,editorAttrs:m})=>{const p=v.useMemo(()=>QC(),[]),y=v.useMemo(()=>JC(),[]),[b,_]=v.useState(()=>e||[]),[x,M]=v.useState(""),[S,k]=v.useState(!1),[N,C]=v.useState(null),[w,E]=v.useState({}),T=v.useRef(null),P=v.useRef(void 0);v.useEffect(()=>{const V=(K,Q)=>!K&&!Q?!0:!K||!Q||K.length!==Q.length?!1:JSON.stringify(K)===JSON.stringify(Q),X=e||[];V(X,P.current)||(_(X),P.current=X)},[e]);const L=v.useCallback(V=>({target:{name:a,value:V},currentTarget:{name:a,value:V},preventDefault:()=>{},stopPropagation:()=>{}}),[a]),F=v.useCallback(V=>{const X=[];for(const K of p){const Q=V[K];Q?.trim()&&X.push(`${K.toUpperCase()}: ${Q}`)}return X.length>0?X.join(" / "):""},[p]),A=v.useCallback(V=>{const X=b.filter((K,Q)=>Q!==V);_(X),t?.(L(X))},[b,t,L]),D=v.useCallback((V,X,K)=>{const Q=window.G7Core;if(!Q?.dispatch)return;const ne=p.map(se=>({code:se,label:dc(se)}));Q.dispatch({handler:"setState",params:{target:"global",multilingualTagEdit:{fieldName:a,editingIndex:V,values:X,supportedLocales:ne,defaultLocale:y,statePath:u,currentTags:K}}}),Q.dispatch({handler:"openModal",target:d},{componentContext:f})},[a,p,y,d,u,f]),O=v.useCallback(V=>{r||(d?D(V,{...b[V]},b):(C(V),E({...b[V]}),k(!0)))},[r,b,d,D]),z=v.useCallback((V="")=>{const X={};p.forEach(K=>{X[K]=K===y?V:""}),d?(D(null,X,b),M("")):(C(null),E(X),k(!0),M(""))},[p,y,d,D,b]),U=v.useCallback(()=>{if(!Object.values(w).some(K=>K.trim()!=="")){k(!1);return}let X;N!==null?X=b.map((K,Q)=>Q===N?w:K):X=[...b,w],_(X),t?.(L(X)),k(!1),E({}),C(null)},[w,N,b,t,L]),j=v.useCallback(()=>{k(!1),E({}),C(null)},[]),Y=v.useCallback(V=>{const X=V.target.value;if(o.some(Q=>X.includes(Q))&&s){const Q=o.map(ue=>ue.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),ne=new RegExp(`[${Q.join("")}]`),se=X.split(ne).map(ue=>ue.trim()).filter(Boolean);if(se.length>0){z(se[0]);return}}M(X)},[o,s,z]),B=v.useCallback(V=>{if(V.key==="Enter"&&x.trim()&&s){if(V.preventDefault(),c&&b.length>=c)return;z(x.trim())}},[x,s,c,b.length,z]),W=v.useCallback((V,X)=>{E(K=>({...K,[V]:X}))},[]),G=!!l;return h.jsxs(I,{className:i,id:g,...m,children:[h.jsxs(I,{className:`flex flex-wrap gap-1.5 p-2 border rounded-lg bg-white dark:bg-gray-700 min-h-[42px] ${G?"border-red-500 dark:border-red-400":"border-gray-300 dark:border-gray-600 focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500"} ${r?"opacity-60 bg-gray-100 dark:bg-gray-800 cursor-not-allowed":""}`,children:[b.map((V,X)=>h.jsxs(I,{className:"flex items-center gap-1 bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 rounded px-2 py-0.5 text-sm",children:[h.jsx(J,{className:`cursor-pointer hover:underline ${r?"cursor-not-allowed":""}`,onClick:()=>O(X),children:F(V)}),!r&&h.jsx(le,{type:"button",className:"p-0 h-4 w-4 min-w-0 border-0 bg-transparent text-blue-600 dark:text-blue-400 hover:text-red-600 dark:hover:text-red-400 hover:bg-transparent",onClick:K=>{K.stopPropagation(),A(X)},children:h.jsx(ae,{name:"times",className:"text-xs"})})]},X)),s&&!r&&(!c||b.length<c)&&h.jsx("input",{ref:T,type:"text",value:x,onChange:Y,onKeyDown:B,placeholder:b.length===0?n:"",disabled:r,className:"flex-1 min-w-[120px] bg-transparent border-none outline-none text-sm text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500"})]}),l&&h.jsx(J,{className:"text-xs text-red-500 dark:text-red-400 mt-1",children:l}),!d&&h.jsx(ri,{isOpen:S,onClose:j,title:ds(N!==null?"common.edit":"common.add"),width:"400px",children:h.jsxs(I,{className:"space-y-4 p-4",children:[p.map(V=>h.jsxs(I,{className:"space-y-1",children:[h.jsxs(I,{className:"flex items-center gap-2",children:[h.jsx(J,{className:"text-sm font-medium text-gray-700 dark:text-gray-300 w-16",children:dc(V)}),h.jsxs(J,{className:"text-xs text-gray-400 dark:text-gray-500",children:["(",V.toUpperCase(),")"]})]}),h.jsx(Et,{type:"text",value:w[V]??"",onChange:X=>W(V,X.target.value),placeholder:`${dc(V)} 값 입력`,className:"w-full",autoFocus:V===y})]},V)),h.jsxs(I,{className:"flex justify-end gap-2 pt-4 border-t border-gray-200 dark:border-gray-700",children:[h.jsx(le,{type:"button",variant:"secondary",onClick:j,children:ds("common.cancel")}),h.jsx(le,{type:"button",variant:"primary",onClick:U,children:ds(N!==null?"common.save":"common.add")})]})]})}),a&&h.jsx("input",{type:"hidden",name:a,value:JSON.stringify(b)})]})},Hh=(e,t)=>window.G7Core?.t?.(e,t)??e,Uh=({type:e,identifier:t,name:n,installedModules:r=[],installedPlugins:s=[],className:o="",style:i,id:a,editorAttrs:l})=>{const c={module:he.Cubes,plugin:he.PuzzlePiece},d={module:Hh("common.module"),plugin:Hh("common.plugin")},u=v.useMemo(()=>{if(n)return n;if(t){const p=(e==="module"?r:s)?.find(y=>y.identifier===t);if(p)return p.name}},[n,t,e,r,s]),f=c[e],g=u?`${u} ${d[e]}`:d[e];return h.jsxs(J,{className:`inline-flex items-center gap-1.5 px-2 py-1 rounded text-xs font-medium text-gray-400 dark:text-gray-500 ${o}`,style:i,id:a,...l,children:[h.jsx(ae,{name:f,className:"w-3.5 h-3.5"}),h.jsx(J,{children:g})]})},eS=({options:e=[],value:t,onChange:n,multiple:r=!1,searchPlaceholder:s="Search...",onSearch:o,noResultsText:i="No results found",initialText:a="Type to search",triggerLabel:l="Select",triggerIcon:c,disabled:d=!1,className:u="",id:f,editorAttrs:g})=>{const[m,p]=v.useState(!1),[y,b]=v.useState(""),_=v.useRef(null),x=v.useRef(null),M=v.useRef(`searchable-dropdown-input-${Math.random().toString(36).slice(2,9)}`).current,S=v.useMemo(()=>t==null?[]:Array.isArray(t)?t:[t],[t]),k=v.useMemo(()=>{if(!y.trim())return e;const A=y.toLowerCase();return e.filter(D=>D.label.toLowerCase().includes(A)||D.description?.toLowerCase().includes(A))},[e,y]),N=v.useMemo(()=>{if(S.length===0)return l;if(r){const D=S.length;return D===1?e.find(z=>String(z.value)===String(S[0]))?.label||l:`${D} selected`}return e.find(D=>String(D.value)===String(S[0]))?.label||l},[S,e,r,l]);v.useEffect(()=>{const A=D=>{_.current&&!_.current.contains(D.target)&&p(!1)};return m&&document.addEventListener("mousedown",A),()=>{document.removeEventListener("mousedown",A)}},[m]),v.useEffect(()=>{const A=D=>{D.key==="Escape"&&m&&(p(!1),x.current?.focus())};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[m]),v.useEffect(()=>{if(!m){b("");return}const A=setTimeout(()=>{document.getElementById(M)?.focus()},50);return()=>{clearTimeout(A)}},[m,M]);const C=v.useCallback(()=>{d||p(A=>!A)},[d]),w=v.useCallback(A=>{const D=A.target.value;b(D),o?.(D)},[o]),E=v.useCallback(A=>{if(r){const O=S.some(z=>String(z)===String(A))?S.filter(z=>String(z)!==String(A)):[...S,A];n?.(O)}else n?.(A),p(!1),x.current?.focus()},[r,S,n]),T=A=>S.some(D=>String(D)===String(A)),P=y.length===0&&e.length===0,L=y.length>0&&k.length===0,F=k.length>0;return h.jsxs(I,{ref:_,className:`relative inline-block ${u}`,id:f,...g,children:[h.jsxs(le,{ref:x,type:"button",onClick:C,disabled:d,className:`
|
||
px-4 py-2.5 bg-gray-100 dark:bg-gray-700
|
||
border-0 rounded-xl
|
||
text-gray-700 dark:text-gray-200 font-medium
|
||
focus:ring-2 focus:ring-blue-500 focus:outline-none
|
||
flex items-center justify-between gap-2
|
||
text-left cursor-pointer
|
||
disabled:opacity-50 disabled:cursor-not-allowed
|
||
min-w-[200px]
|
||
`,"aria-haspopup":"listbox","aria-expanded":m,children:[h.jsxs(I,{className:"flex items-center gap-2",children:[c,h.jsx(J,{className:"truncate",children:N})]}),h.jsx(Jn,{className:`w-4 h-4 flex-shrink-0 transition-transform duration-200 ${m?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),m&&h.jsxs(I,{className:"absolute z-50 w-full mt-2 bg-white dark:bg-gray-800 rounded-2xl shadow-lg border border-gray-200 dark:border-gray-600 overflow-hidden min-w-[280px]",role:"listbox",children:[h.jsx(I,{className:"p-3 border-b border-gray-200 dark:border-gray-700",children:h.jsx("input",{id:M,type:"text",value:y,onChange:w,placeholder:s,className:"w-full px-3 py-2 bg-gray-50 dark:bg-gray-700 border border-gray-200 dark:border-gray-600 rounded-lg text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 focus:ring-2 focus:ring-blue-500 focus:border-transparent focus:outline-none"})}),h.jsxs(I,{className:"max-h-80 overflow-auto",children:[P&&h.jsx(I,{className:"px-4 py-6 text-center text-gray-500 dark:text-gray-400",children:a}),L&&h.jsx(I,{className:"px-4 py-6 text-center text-gray-500 dark:text-gray-400",children:i}),F&&h.jsx(I,{className:"py-2",children:k.map(A=>{const D=T(A.value);return h.jsxs(le,{type:"button",onClick:()=>!A.disabled&&E(A.value),disabled:A.disabled,className:`
|
||
w-full px-4 py-3 text-left
|
||
flex items-start gap-3
|
||
hover:bg-gray-100 dark:hover:bg-gray-700
|
||
transition-colors
|
||
${A.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"}
|
||
`,role:"option","aria-selected":D,children:[h.jsx(I,{className:"w-5 h-5 flex-shrink-0 mt-0.5",children:D&&h.jsx(Jn,{className:"w-5 h-5 text-blue-600 dark:text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),h.jsxs(I,{className:"flex-1 min-w-0",children:[h.jsx(I,{className:`font-medium ${D?"text-blue-600 dark:text-blue-400":"text-gray-900 dark:text-white"}`,children:A.label}),A.description&&h.jsx(I,{className:"text-sm text-gray-500 dark:text-gray-400 mt-0.5",children:A.description})]})]},A.value)})})]})]})]})},ro={container:{base:"tag-select",disabled:"opacity-50 cursor-not-allowed"},tag:"tag",tagRemove:"tag-remove",placeholder:"tag-select-placeholder"},tS=({options:e=[],value:t=[],onChange:n,placeholder:r="No items selected",disabled:s=!1,className:o="",id:i,editorAttrs:a})=>{const l=v.useCallback(f=>e.find(m=>String(m.value)===String(f))?.label||String(f),[e]),c=v.useCallback(f=>{if(s)return;const g=t.filter(m=>String(m)!==String(f));n?.(g)},[t,n,s]),d=v.useMemo(()=>t.map(f=>({value:f,label:l(f)})),[t,l]),u=`${ro.container.base} ${s?ro.container.disabled:""} ${o}`.trim();return h.jsx(I,{className:u,id:i,...a,children:d.length===0?h.jsx(J,{className:ro.placeholder,children:r}):d.map(f=>h.jsxs(J,{className:ro.tag,children:[f.label,!s&&h.jsx(J,{className:ro.tagRemove,onClick:()=>c(f.value),role:"button","aria-label":`Remove ${f.label}`,children:h.jsx(Jn,{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},f.value))})};function nS(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return v.useMemo(()=>r=>{t.forEach(s=>s(r))},t)}const Li=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function us(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function uc(e){return"nodeType"in e}function en(e){var t,n;return e?us(e)?e:uc(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function fc(e){const{Document:t}=en(e);return e instanceof t}function so(e){return us(e)?!1:e instanceof en(e).HTMLElement}function Bh(e){return e instanceof en(e).SVGElement}function fs(e){return e?us(e)?e.document:uc(e)?fc(e)?e:so(e)||Bh(e)?e.ownerDocument:document:document:document}const An=Li?v.useLayoutEffect:v.useEffect;function Pi(e){const t=v.useRef(e);return An(()=>{t.current=e}),v.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return t.current==null?void 0:t.current(...r)},[])}function rS(){const e=v.useRef(null),t=v.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),n=v.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function oo(e,t){t===void 0&&(t=[e]);const n=v.useRef(e);return An(()=>{n.current!==e&&(n.current=e)},t),n}function io(e,t){const n=v.useRef();return v.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function $i(e){const t=Pi(e),n=v.useRef(null),r=v.useCallback(s=>{s!==n.current&&t?.(s,n.current),n.current=s},[]);return[n,r]}function Fi(e){const t=v.useRef();return v.useEffect(()=>{t.current=e},[e]),t.current}let hc={};function ao(e,t){return v.useMemo(()=>{if(t)return t;const n=hc[e]==null?0:hc[e]+1;return hc[e]=n,e+"-"+n},[e,t])}function jh(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.reduce((o,i)=>{const a=Object.entries(i);for(const[l,c]of a){const d=o[l];d!=null&&(o[l]=d+e*c)}return o},{...t})}}const hs=jh(1),lo=jh(-1);function sS(e){return"clientX"in e&&"clientY"in e}function zi(e){if(!e)return!1;const{KeyboardEvent:t}=en(e.target);return t&&e instanceof t}function oS(e){if(!e)return!1;const{TouchEvent:t}=en(e.target);return t&&e instanceof t}function Vi(e){if(oS(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return sS(e)?{x:e.clientX,y:e.clientY}:null}const Wn=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Wn.Translate.toString(e),Wn.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Wh="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function iS(e){return e.matches(Wh)?e:e.querySelector(Wh)}const aS={display:"none"};function lS(e){let{id:t,value:n}=e;return v.createElement("div",{id:t,style:aS},n)}function cS(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return v.createElement("div",{id:t,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function dS(){const[e,t]=v.useState("");return{announce:v.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Gh=v.createContext(null);function uS(e){const t=v.useContext(Gh);v.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function fS(){const[e]=v.useState(()=>new Set),t=v.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[v.useCallback(r=>{let{type:s,event:o}=r;e.forEach(i=>{var a;return(a=i[s])==null?void 0:a.call(i,o)})},[e]),t]}const hS={draggable:`
|
||
To pick up a draggable item, press the space bar.
|
||
While dragging, use the arrow keys to move the item.
|
||
Press space again to drop the item in its new position, or press escape to cancel.
|
||
`},gS={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function pS(e){let{announcements:t=gS,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=hS}=e;const{announce:o,announcement:i}=dS(),a=ao("DndLiveRegion"),[l,c]=v.useState(!1);if(v.useEffect(()=>{c(!0)},[]),uS(v.useMemo(()=>({onDragStart(u){let{active:f}=u;o(t.onDragStart({active:f}))},onDragMove(u){let{active:f,over:g}=u;t.onDragMove&&o(t.onDragMove({active:f,over:g}))},onDragOver(u){let{active:f,over:g}=u;o(t.onDragOver({active:f,over:g}))},onDragEnd(u){let{active:f,over:g}=u;o(t.onDragEnd({active:f,over:g}))},onDragCancel(u){let{active:f,over:g}=u;o(t.onDragCancel({active:f,over:g}))}}),[o,t])),!l)return null;const d=v.createElement(v.Fragment,null,v.createElement(lS,{id:r,value:s.draggable}),v.createElement(cS,{id:a,announcement:i}));return n?Vn.createPortal(d,n):d}var At;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(At||(At={}));function Hi(){}function gs(e,t){return v.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function gc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return v.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Dn=Object.freeze({x:0,y:0});function Yh(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function mS(e,t){const n=Vi(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function Kh(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function bS(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Xh(e){let{left:t,top:n,height:r,width:s}=e;return[{x:t,y:n},{x:t+s,y:n},{x:t,y:n+r},{x:t+s,y:n+r}]}function qh(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Zh(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const pc=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=Zh(t,t.left,t.top),o=[];for(const i of r){const{id:a}=i,l=n.get(a);if(l){const c=Yh(Zh(l),s);o.push({id:a,data:{droppableContainer:i,value:c}})}}return o.sort(Kh)},yS=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=Xh(t),o=[];for(const i of r){const{id:a}=i,l=n.get(a);if(l){const c=Xh(l),d=s.reduce((f,g,m)=>f+Yh(c[m],g),0),u=Number((d/4).toFixed(4));o.push({id:a,data:{droppableContainer:i,value:u}})}}return o.sort(Kh)};function vS(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),i=s-r,a=o-n;if(r<s&&n<o){const l=t.width*t.height,c=e.width*e.height,d=i*a,u=d/(l+c-d);return Number(u.toFixed(4))}return 0}const xS=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=[];for(const o of r){const{id:i}=o,a=n.get(i);if(a){const l=vS(a,t);l>0&&s.push({id:i,data:{droppableContainer:o,value:l}})}}return s.sort(bS)};function wS(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Qh(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Dn}function kS(e){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),o=1;o<r;o++)s[o-1]=arguments[o];return s.reduce((i,a)=>({...i,top:i.top+e*a.y,bottom:i.bottom+e*a.y,left:i.left+e*a.x,right:i.right+e*a.x}),{...n})}}const CS=kS(1);function Jh(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function SS(e,t,n){const r=Jh(t);if(!r)return e;const{scaleX:s,scaleY:o,x:i,y:a}=r,l=e.left-i-(1-s)*parseFloat(n),c=e.top-a-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),d=s?e.width/s:e.width,u=o?e.height/o:e.height;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l}}const _S={ignoreTransform:!1};function ps(e,t){t===void 0&&(t=_S);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:d}=en(e).getComputedStyle(e);c&&(n=SS(n,c,d))}const{top:r,left:s,width:o,height:i,bottom:a,right:l}=n;return{top:r,left:s,width:o,height:i,bottom:a,right:l}}function Rh(e){return ps(e,{ignoreTransform:!0})}function ES(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function MS(e,t){return t===void 0&&(t=en(e).getComputedStyle(e)),t.position==="fixed"}function NS(e,t){t===void 0&&(t=en(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const o=t[s];return typeof o=="string"?n.test(o):!1})}function Ui(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(fc(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!so(s)||Bh(s)||n.includes(s))return n;const o=en(e).getComputedStyle(s);return s!==e&&NS(s,o)&&n.push(s),MS(s,o)?n:r(s.parentNode)}return e?r(e):n}function eg(e){const[t]=Ui(e,1);return t??null}function mc(e){return!Li||!e?null:us(e)?e:uc(e)?fc(e)||e===fs(e).scrollingElement?window:so(e)?e:null:null}function tg(e){return us(e)?e.scrollX:e.scrollLeft}function ng(e){return us(e)?e.scrollY:e.scrollTop}function bc(e){return{x:tg(e),y:ng(e)}}var $t;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})($t||($t={}));function rg(e){return!Li||!e?!1:e===document.scrollingElement}function sg(e){const t={x:0,y:0},n=rg(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},s=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,i=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:s,isLeft:o,isBottom:i,isRight:a,maxScroll:r,minScroll:t}}const OS={x:.2,y:.2};function TS(e,t,n,r,s){let{top:o,left:i,right:a,bottom:l}=n;r===void 0&&(r=10),s===void 0&&(s=OS);const{isTop:c,isBottom:d,isLeft:u,isRight:f}=sg(e),g={x:0,y:0},m={x:0,y:0},p={height:t.height*s.y,width:t.width*s.x};return!c&&o<=t.top+p.height?(g.y=$t.Backward,m.y=r*Math.abs((t.top+p.height-o)/p.height)):!d&&l>=t.bottom-p.height&&(g.y=$t.Forward,m.y=r*Math.abs((t.bottom-p.height-l)/p.height)),!f&&a>=t.right-p.width?(g.x=$t.Forward,m.x=r*Math.abs((t.right-p.width-a)/p.width)):!u&&i<=t.left+p.width&&(g.x=$t.Backward,m.x=r*Math.abs((t.left+p.width-i)/p.width)),{direction:g,speed:m}}function AS(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:i}=window;return{top:0,left:0,right:o,bottom:i,width:o,height:i}}const{top:t,left:n,right:r,bottom:s}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:s,width:e.clientWidth,height:e.clientHeight}}function og(e){return e.reduce((t,n)=>hs(t,bc(n)),Dn)}function DS(e){return e.reduce((t,n)=>t+tg(n),0)}function IS(e){return e.reduce((t,n)=>t+ng(n),0)}function ig(e,t){if(t===void 0&&(t=ps),!e)return;const{top:n,left:r,bottom:s,right:o}=t(e);eg(e)&&(s<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const LS=[["x",["left","right"],DS],["y",["top","bottom"],IS]];class yc{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Ui(n),s=og(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,i,a]of LS)for(const l of i)Object.defineProperty(this,l,{get:()=>{const c=a(r),d=s[o]-c;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class co{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var s;(s=this.target)==null||s.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function PS(e){const{EventTarget:t}=en(e);return e instanceof t?e:fs(e)}function vc(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var vn;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(vn||(vn={}));function ag(e){e.preventDefault()}function $S(e){e.stopPropagation()}var Xe;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Xe||(Xe={}));const lg={start:[Xe.Space,Xe.Enter],cancel:[Xe.Esc],end:[Xe.Space,Xe.Enter,Xe.Tab]},FS=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Xe.Right:return{...n,x:n.x+25};case Xe.Left:return{...n,x:n.x-25};case Xe.Down:return{...n,y:n.y+25};case Xe.Up:return{...n,y:n.y-25}}};class uo{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new co(fs(n)),this.windowListeners=new co(en(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(vn.Resize,this.handleCancel),this.windowListeners.add(vn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(vn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&ig(r),n(Dn)}handleKeyDown(t){if(zi(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:o=lg,coordinateGetter:i=FS,scrollBehavior:a="smooth"}=s,{code:l}=t;if(o.end.includes(l)){this.handleEnd(t);return}if(o.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=r.current,d=c?{x:c.left,y:c.top}:Dn;this.referenceCoordinates||(this.referenceCoordinates=d);const u=i(t,{active:n,context:r.current,currentCoordinates:d});if(u){const f=lo(u,d),g={x:0,y:0},{scrollableAncestors:m}=r.current;for(const p of m){const y=t.code,{isTop:b,isRight:_,isLeft:x,isBottom:M,maxScroll:S,minScroll:k}=sg(p),N=AS(p),C={x:Math.min(y===Xe.Right?N.right-N.width/2:N.right,Math.max(y===Xe.Right?N.left:N.left+N.width/2,u.x)),y:Math.min(y===Xe.Down?N.bottom-N.height/2:N.bottom,Math.max(y===Xe.Down?N.top:N.top+N.height/2,u.y))},w=y===Xe.Right&&!_||y===Xe.Left&&!x,E=y===Xe.Down&&!M||y===Xe.Up&&!b;if(w&&C.x!==u.x){const T=p.scrollLeft+f.x,P=y===Xe.Right&&T<=S.x||y===Xe.Left&&T>=k.x;if(P&&!f.y){p.scrollTo({left:T,behavior:a});return}P?g.x=p.scrollLeft-T:g.x=y===Xe.Right?p.scrollLeft-S.x:p.scrollLeft-k.x,g.x&&p.scrollBy({left:-g.x,behavior:a});break}else if(E&&C.y!==u.y){const T=p.scrollTop+f.y,P=y===Xe.Down&&T<=S.y||y===Xe.Up&&T>=k.y;if(P&&!f.x){p.scrollTo({top:T,behavior:a});return}P?g.y=p.scrollTop-T:g.y=y===Xe.Down?p.scrollTop-S.y:p.scrollTop-k.y,g.y&&p.scrollBy({top:-g.y,behavior:a});break}}this.handleMove(t,hs(lo(u,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}uo.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=lg,onActivation:s}=t,{active:o}=n;const{code:i}=e.nativeEvent;if(r.start.includes(i)){const a=o.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),s?.({event:e.nativeEvent}),!0)}return!1}}];function cg(e){return!!(e&&"distance"in e)}function dg(e){return!!(e&&"delay"in e)}class xc{constructor(t,n,r){var s;r===void 0&&(r=PS(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:o}=t,{target:i}=o;this.props=t,this.events=n,this.document=fs(i),this.documentListeners=new co(this.document),this.listeners=new co(r),this.windowListeners=new co(en(i)),this.initialCoordinates=(s=Vi(o))!=null?s:Dn,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(vn.Resize,this.handleCancel),this.windowListeners.add(vn.DragStart,ag),this.windowListeners.add(vn.VisibilityChange,this.handleCancel),this.windowListeners.add(vn.ContextMenu,ag),this.documentListeners.add(vn.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(dg(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(cg(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:s}=this.props;s(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(vn.Click,$S,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(vn.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:s,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!s)return;const l=(n=Vi(t))!=null?n:Dn,c=lo(s,l);if(!r&&a){if(cg(a)){if(a.tolerance!=null&&vc(c,a.tolerance))return this.handleCancel();if(vc(c,a.distance))return this.handleStart()}if(dg(a)&&vc(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}t.cancelable&&t.preventDefault(),i(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Xe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const zS={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class fo extends xc{constructor(t){const{event:n}=t,r=fs(n.target);super(t,zS,r)}}fo.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const VS={move:{name:"mousemove"},end:{name:"mouseup"}};var wc;(function(e){e[e.RightClick=2]="RightClick"})(wc||(wc={}));class HS extends xc{constructor(t){super(t,VS,fs(t.event.target))}}HS.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===wc.RightClick?!1:(r?.({event:n}),!0)}}];const kc={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class US extends xc{constructor(t){super(t,kc)}static setup(){return window.addEventListener(kc.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(kc.move.name,t)};function t(){}}}US.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:s}=n;return s.length>1?!1:(r?.({event:n}),!0)}}];var ho;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(ho||(ho={}));var Bi;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Bi||(Bi={}));function BS(e){let{acceleration:t,activator:n=ho.Pointer,canScroll:r,draggingRect:s,enabled:o,interval:i=5,order:a=Bi.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:u,threshold:f}=e;const g=WS({delta:u,disabled:!o}),[m,p]=rS(),y=v.useRef({x:0,y:0}),b=v.useRef({x:0,y:0}),_=v.useMemo(()=>{switch(n){case ho.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case ho.DraggableRect:return s}},[n,s,l]),x=v.useRef(null),M=v.useCallback(()=>{const k=x.current;if(!k)return;const N=y.current.x*b.current.x,C=y.current.y*b.current.y;k.scrollBy(N,C)},[]),S=v.useMemo(()=>a===Bi.TreeOrder?[...c].reverse():c,[a,c]);v.useEffect(()=>{if(!o||!c.length||!_){p();return}for(const k of S){if(r?.(k)===!1)continue;const N=c.indexOf(k),C=d[N];if(!C)continue;const{direction:w,speed:E}=TS(k,C,_,t,f);for(const T of["x","y"])g[T][w[T]]||(E[T]=0,w[T]=0);if(E.x>0||E.y>0){p(),x.current=k,m(M,i),y.current=E,b.current=w;return}}y.current={x:0,y:0},b.current={x:0,y:0},p()},[t,M,r,p,o,i,JSON.stringify(_),JSON.stringify(g),m,c,S,d,JSON.stringify(f)])}const jS={x:{[$t.Backward]:!1,[$t.Forward]:!1},y:{[$t.Backward]:!1,[$t.Forward]:!1}};function WS(e){let{delta:t,disabled:n}=e;const r=Fi(t);return io(s=>{if(n||!r||!s)return jS;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[$t.Backward]:s.x[$t.Backward]||o.x===-1,[$t.Forward]:s.x[$t.Forward]||o.x===1},y:{[$t.Backward]:s.y[$t.Backward]||o.y===-1,[$t.Forward]:s.y[$t.Forward]||o.y===1}}},[n,t,r])}function GS(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return io(s=>{var o;return t==null?null:(o=r??s)!=null?o:null},[r,t])}function YS(e,t){return v.useMemo(()=>e.reduce((n,r)=>{const{sensor:s}=r,o=s.activators.map(i=>({eventName:i.eventName,handler:t(i.handler,r)}));return[...n,...o]},[]),[e,t])}var go;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(go||(go={}));var Cc;(function(e){e.Optimized="optimized"})(Cc||(Cc={}));const ug=new Map;function KS(e,t){let{dragging:n,dependencies:r,config:s}=t;const[o,i]=v.useState(null),{frequency:a,measure:l,strategy:c}=s,d=v.useRef(e),u=y(),f=oo(u),g=v.useCallback(function(b){b===void 0&&(b=[]),!f.current&&i(_=>_===null?b:_.concat(b.filter(x=>!_.includes(x))))},[f]),m=v.useRef(null),p=io(b=>{if(u&&!n)return ug;if(!b||b===ug||d.current!==e||o!=null){const _=new Map;for(let x of e){if(!x)continue;if(o&&o.length>0&&!o.includes(x.id)&&x.rect.current){_.set(x.id,x.rect.current);continue}const M=x.node.current,S=M?new yc(l(M),M):null;x.rect.current=S,S&&_.set(x.id,S)}return _}return b},[e,o,n,u,l]);return v.useEffect(()=>{d.current=e},[e]),v.useEffect(()=>{u||g()},[n,u]),v.useEffect(()=>{o&&o.length>0&&i(null)},[JSON.stringify(o)]),v.useEffect(()=>{u||typeof a!="number"||m.current!==null||(m.current=setTimeout(()=>{g(),m.current=null},a))},[a,u,g,...r]),{droppableRects:p,measureDroppableContainers:g,measuringScheduled:o!=null};function y(){switch(c){case go.Always:return!1;case go.BeforeDragging:return n;default:return!n}}}function Sc(e,t){return io(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function XS(e,t){return Sc(e,t)}function qS(e){let{callback:t,disabled:n}=e;const r=Pi(t),s=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return v.useEffect(()=>()=>s?.disconnect(),[s]),s}function ji(e){let{callback:t,disabled:n}=e;const r=Pi(t),s=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return v.useEffect(()=>()=>s?.disconnect(),[s]),s}function ZS(e){return new yc(ps(e),e)}function fg(e,t,n){t===void 0&&(t=ZS);const[r,s]=v.useState(null);function o(){s(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??n)!=null?c:null}const d=t(e);return JSON.stringify(l)===JSON.stringify(d)?l:d})}const i=qS({callback(l){if(e)for(const c of l){const{type:d,target:u}=c;if(d==="childList"&&u instanceof HTMLElement&&u.contains(e)){o();break}}}}),a=ji({callback:o});return An(()=>{o(),e?(a?.observe(e),i?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),i?.disconnect())},[e]),r}function QS(e){const t=Sc(e);return Qh(e,t)}const hg=[];function JS(e){const t=v.useRef(e),n=io(r=>e?r&&r!==hg&&e&&t.current&&e.parentNode===t.current.parentNode?r:Ui(e):hg,[e]);return v.useEffect(()=>{t.current=e},[e]),n}function RS(e){const[t,n]=v.useState(null),r=v.useRef(e),s=v.useCallback(o=>{const i=mc(o.target);i&&n(a=>a?(a.set(i,bc(i)),new Map(a)):null)},[]);return v.useEffect(()=>{const o=r.current;if(e!==o){i(o);const a=e.map(l=>{const c=mc(l);return c?(c.addEventListener("scroll",s,{passive:!0}),[c,bc(c)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{i(e),i(o)};function i(a){a.forEach(l=>{const c=mc(l);c?.removeEventListener("scroll",s)})}},[s,e]),v.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,i)=>hs(o,i),Dn):og(e):Dn,[e,t])}function gg(e,t){t===void 0&&(t=[]);const n=v.useRef(null);return v.useEffect(()=>{n.current=null},t),v.useEffect(()=>{const r=e!==Dn;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?lo(e,n.current):Dn}function e_(e){v.useEffect(()=>{if(!Li)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function t_(e,t){return v.useMemo(()=>e.reduce((n,r)=>{let{eventName:s,handler:o}=r;return n[s]=i=>{o(i,t)},n},{}),[e,t])}function pg(e){return v.useMemo(()=>e?ES(e):null,[e])}const mg=[];function n_(e,t){t===void 0&&(t=ps);const[n]=e,r=pg(n?en(n):null),[s,o]=v.useState(mg);function i(){o(()=>e.length?e.map(l=>rg(l)?r:new yc(t(l),l)):mg)}const a=ji({callback:i});return An(()=>{a?.disconnect(),i(),e.forEach(l=>a?.observe(l))},[e]),s}function bg(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return so(t)?t:e}function r_(e){let{measure:t}=e;const[n,r]=v.useState(null),s=v.useCallback(c=>{for(const{target:d}of c)if(so(d)){r(u=>{const f=t(d);return u?{...u,width:f.width,height:f.height}:f});break}},[t]),o=ji({callback:s}),i=v.useCallback(c=>{const d=bg(c);o?.disconnect(),d&&o?.observe(d),r(d?t(d):null)},[t,o]),[a,l]=$i(i);return v.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const s_=[{sensor:fo,options:{}},{sensor:uo,options:{}}],o_={current:{}},Wi={draggable:{measure:Rh},droppable:{measure:Rh,strategy:go.WhileDragging,frequency:Cc.Optimized},dragOverlay:{measure:ps}};class po extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const i_={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new po,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Hi},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Wi,measureDroppableContainers:Hi,windowRect:null,measuringScheduled:!1},yg={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Hi,draggableNodes:new Map,over:null,measureDroppableContainers:Hi},mo=v.createContext(yg),vg=v.createContext(i_);function a_(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new po}}}function l_(e,t){switch(t.type){case At.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case At.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case At.DragEnd:case At.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case At.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new po(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case At.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new po(e.droppable.containers);return i.set(n,{...o,disabled:s}),{...e,droppable:{...e.droppable,containers:i}}}case At.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const o=new po(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function c_(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=v.useContext(mo),o=Fi(r),i=Fi(n?.id);return v.useEffect(()=>{if(!t&&!r&&o&&i!=null){if(!zi(o)||document.activeElement===o.target)return;const a=s.get(i);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const d of[l.current,c.current]){if(!d)continue;const u=iS(d);if(u){u.focus();break}}})}},[r,t,s,i,o]),null}function xg(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,o)=>o({transform:s,...r}),n):n}function d_(e){return v.useMemo(()=>({draggable:{...Wi.draggable,...e?.draggable},droppable:{...Wi.droppable,...e?.droppable},dragOverlay:{...Wi.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function u_(e){let{activeNode:t,measure:n,initialRect:r,config:s=!0}=e;const o=v.useRef(!1),{x:i,y:a}=typeof s=="boolean"?{x:s,y:s}:s;An(()=>{if(!i&&!a||!t){o.current=!1;return}if(o.current||!r)return;const c=t?.node.current;if(!c||c.isConnected===!1)return;const d=n(c),u=Qh(d,r);if(i||(u.x=0),a||(u.y=0),o.current=!0,Math.abs(u.x)>0||Math.abs(u.y)>0){const f=eg(c);f&&f.scrollBy({top:u.y,left:u.x})}},[t,i,a,r,n])}const Gi=v.createContext({...Dn,scaleX:1,scaleY:1});var gr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(gr||(gr={}));const _c=v.memo(function(t){var n,r,s,o;let{id:i,accessibility:a,autoScroll:l=!0,children:c,sensors:d=s_,collisionDetection:u=xS,measuring:f,modifiers:g,...m}=t;const p=v.useReducer(l_,void 0,a_),[y,b]=p,[_,x]=fS(),[M,S]=v.useState(gr.Uninitialized),k=M===gr.Initialized,{draggable:{active:N,nodes:C,translate:w},droppable:{containers:E}}=y,T=N!=null?C.get(N):null,P=v.useRef({initial:null,translated:null}),L=v.useMemo(()=>{var Ne;return N!=null?{id:N,data:(Ne=T?.data)!=null?Ne:o_,rect:P}:null},[N,T]),F=v.useRef(null),[A,D]=v.useState(null),[O,z]=v.useState(null),U=oo(m,Object.values(m)),j=ao("DndDescribedBy",i),Y=v.useMemo(()=>E.getEnabled(),[E]),B=d_(f),{droppableRects:W,measureDroppableContainers:G,measuringScheduled:V}=KS(Y,{dragging:k,dependencies:[w.x,w.y],config:B.droppable}),X=GS(C,N),K=v.useMemo(()=>O?Vi(O):null,[O]),Q=Re(),ne=XS(X,B.draggable.measure);u_({activeNode:N!=null?C.get(N):null,config:Q.layoutShiftCompensation,initialRect:ne,measure:B.draggable.measure});const se=fg(X,B.draggable.measure,ne),ue=fg(X?X.parentElement:null),ee=v.useRef({activatorEvent:null,active:null,activeNode:X,collisionRect:null,collisions:null,droppableRects:W,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:E,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),me=E.getNodeFor((n=ee.current.over)==null?void 0:n.id),ie=r_({measure:B.dragOverlay.measure}),de=(r=ie.nodeRef.current)!=null?r:X,fe=k?(s=ie.rect)!=null?s:se:null,be=!!(ie.nodeRef.current&&ie.rect),ge=QS(be?null:se),Ce=pg(de?en(de):null),je=JS(k?me??X:null),oe=n_(je),Te=xg(g,{transform:{x:w.x-ge.x,y:w.y-ge.y,scaleX:1,scaleY:1},activatorEvent:O,active:L,activeNodeRect:se,containerNodeRect:ue,draggingNodeRect:fe,over:ee.current.over,overlayNodeRect:ie.rect,scrollableAncestors:je,scrollableAncestorRects:oe,windowRect:Ce}),Pe=K?hs(K,w):null,Fe=RS(je),Ke=gg(Fe),nt=gg(Fe,[se]),dt=hs(Te,Ke),We=fe?CS(fe,Te):null,pt=L&&We?u({active:L,collisionRect:We,droppableRects:W,droppableContainers:Y,pointerCoordinates:Pe}):null,Ge=qh(pt,"id"),[te,pe]=v.useState(null),we=be?Te:hs(Te,nt),xe=wS(we,(o=te?.rect)!=null?o:null,se),ke=v.useRef(null),Be=v.useCallback((Ne,Oe)=>{let{sensor:Ue,options:lt}=Oe;if(F.current==null)return;const vt=C.get(F.current);if(!vt)return;const ut=Ne.nativeEvent,ot=new Ue({active:F.current,activeNode:vt,event:ut,options:lt,context:ee,onAbort(et){if(!C.get(et))return;const{onDragAbort:Ut}=U.current,Gt={id:et};Ut?.(Gt),_({type:"onDragAbort",event:Gt})},onPending(et,Lt,Ut,Gt){if(!C.get(et))return;const{onDragPending:Mn}=U.current,Bt={id:et,constraint:Lt,initialCoordinates:Ut,offset:Gt};Mn?.(Bt),_({type:"onDragPending",event:Bt})},onStart(et){const Lt=F.current;if(Lt==null)return;const Ut=C.get(Lt);if(!Ut)return;const{onDragStart:Gt}=U.current,Yt={activatorEvent:ut,active:{id:Lt,data:Ut.data,rect:P}};Vn.unstable_batchedUpdates(()=>{Gt?.(Yt),S(gr.Initializing),b({type:At.DragStart,initialCoordinates:et,active:Lt}),_({type:"onDragStart",event:Yt}),D(ke.current),z(ut)})},onMove(et){b({type:At.DragMove,coordinates:et})},onEnd:St(At.DragEnd),onCancel:St(At.DragCancel)});ke.current=ot;function St(et){return async function(){const{active:Ut,collisions:Gt,over:Yt,scrollAdjustedTranslate:Mn}=ee.current;let Bt=null;if(Ut&&Mn){const{cancelDrop:tt}=U.current;Bt={activatorEvent:ut,active:Ut,collisions:Gt,delta:Mn,over:Yt},et===At.DragEnd&&typeof tt=="function"&&await Promise.resolve(tt(Bt))&&(et=At.DragCancel)}F.current=null,Vn.unstable_batchedUpdates(()=>{b({type:et}),S(gr.Uninitialized),pe(null),D(null),z(null),ke.current=null;const tt=et===At.DragEnd?"onDragEnd":"onDragCancel";if(Bt){const zn=U.current[tt];zn?.(Bt),_({type:tt,event:Bt})}})}}},[C]),Le=v.useCallback((Ne,Oe)=>(Ue,lt)=>{const vt=Ue.nativeEvent,ut=C.get(lt);if(F.current!==null||!ut||vt.dndKit||vt.defaultPrevented)return;const ot={active:ut};Ne(Ue,Oe.options,ot)===!0&&(vt.dndKit={capturedBy:Oe.sensor},F.current=lt,Be(Ue,Oe))},[C,Be]),ze=YS(d,Le);e_(d),An(()=>{se&&M===gr.Initializing&&S(gr.Initialized)},[se,M]),v.useEffect(()=>{const{onDragMove:Ne}=U.current,{active:Oe,activatorEvent:Ue,collisions:lt,over:vt}=ee.current;if(!Oe||!Ue)return;const ut={active:Oe,activatorEvent:Ue,collisions:lt,delta:{x:dt.x,y:dt.y},over:vt};Vn.unstable_batchedUpdates(()=>{Ne?.(ut),_({type:"onDragMove",event:ut})})},[dt.x,dt.y]),v.useEffect(()=>{const{active:Ne,activatorEvent:Oe,collisions:Ue,droppableContainers:lt,scrollAdjustedTranslate:vt}=ee.current;if(!Ne||F.current==null||!Oe||!vt)return;const{onDragOver:ut}=U.current,ot=lt.get(Ge),St=ot&&ot.rect.current?{id:ot.id,rect:ot.rect.current,data:ot.data,disabled:ot.disabled}:null,et={active:Ne,activatorEvent:Oe,collisions:Ue,delta:{x:vt.x,y:vt.y},over:St};Vn.unstable_batchedUpdates(()=>{pe(St),ut?.(et),_({type:"onDragOver",event:et})})},[Ge]),An(()=>{ee.current={activatorEvent:O,active:L,activeNode:X,collisionRect:We,collisions:pt,droppableRects:W,draggableNodes:C,draggingNode:de,draggingNodeRect:fe,droppableContainers:E,over:te,scrollableAncestors:je,scrollAdjustedTranslate:dt},P.current={initial:fe,translated:We}},[L,X,pt,We,C,de,fe,W,E,te,je,dt]),BS({...Q,delta:w,draggingRect:We,pointerCoordinates:Pe,scrollableAncestors:je,scrollableAncestorRects:oe});const Ie=v.useMemo(()=>({active:L,activeNode:X,activeNodeRect:se,activatorEvent:O,collisions:pt,containerNodeRect:ue,dragOverlay:ie,draggableNodes:C,droppableContainers:E,droppableRects:W,over:te,measureDroppableContainers:G,scrollableAncestors:je,scrollableAncestorRects:oe,measuringConfiguration:B,measuringScheduled:V,windowRect:Ce}),[L,X,se,O,pt,ue,ie,C,E,W,te,G,je,oe,B,V,Ce]),qe=v.useMemo(()=>({activatorEvent:O,activators:ze,active:L,activeNodeRect:se,ariaDescribedById:{draggable:j},dispatch:b,draggableNodes:C,over:te,measureDroppableContainers:G}),[O,ze,L,se,b,j,C,te,G]);return v.createElement(Gh.Provider,{value:x},v.createElement(mo.Provider,{value:qe},v.createElement(vg.Provider,{value:Ie},v.createElement(Gi.Provider,{value:xe},c)),v.createElement(c_,{disabled:a?.restoreFocus===!1})),v.createElement(pS,{...a,hiddenTextDescribedById:j}));function Re(){const Ne=A?.autoScrollEnabled===!1,Oe=typeof l=="object"?l.enabled===!1:l===!1,Ue=k&&!Ne&&!Oe;return typeof l=="object"?{...l,enabled:Ue}:{enabled:Ue}}}),f_=v.createContext(null),wg="button",h_="Draggable";function g_(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const o=ao(h_),{activators:i,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:u,over:f}=v.useContext(mo),{role:g=wg,roleDescription:m="draggable",tabIndex:p=0}=s??{},y=l?.id===t,b=v.useContext(y?Gi:f_),[_,x]=$i(),[M,S]=$i(),k=t_(i,t),N=oo(n);An(()=>(u.set(t,{id:t,key:o,node:_,activatorNode:M,data:N}),()=>{const w=u.get(t);w&&w.key===o&&u.delete(t)}),[u,t]);const C=v.useMemo(()=>({role:g,tabIndex:p,"aria-disabled":r,"aria-pressed":y&&g===wg?!0:void 0,"aria-roledescription":m,"aria-describedby":d.draggable}),[r,g,p,y,m,d.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:C,isDragging:y,listeners:r?void 0:k,node:_,over:f,setNodeRef:x,setActivatorNodeRef:S,transform:b}}function kg(){return v.useContext(vg)}const p_="Droppable",m_={timeout:25};function b_(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const o=ao(p_),{active:i,dispatch:a,over:l,measureDroppableContainers:c}=v.useContext(mo),d=v.useRef({disabled:n}),u=v.useRef(!1),f=v.useRef(null),g=v.useRef(null),{disabled:m,updateMeasurementsFor:p,timeout:y}={...m_,...s},b=oo(p??r),_=v.useCallback(()=>{if(!u.current){u.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{c(Array.isArray(b.current)?b.current:[b.current]),g.current=null},y)},[y]),x=ji({callback:_,disabled:m||!i}),M=v.useCallback((C,w)=>{x&&(w&&(x.unobserve(w),u.current=!1),C&&x.observe(C))},[x]),[S,k]=$i(M),N=oo(t);return v.useEffect(()=>{!x||!S.current||(x.disconnect(),u.current=!1,x.observe(S.current))},[S,x]),v.useEffect(()=>(a({type:At.RegisterDroppable,element:{id:r,key:o,disabled:n,node:S,rect:f,data:N}}),()=>a({type:At.UnregisterDroppable,key:o,id:r})),[r]),v.useEffect(()=>{n!==d.current.disabled&&(a({type:At.SetDroppableDisabled,id:r,key:o,disabled:n}),d.current.disabled=n)},[r,o,n,a]),{active:i,rect:f,isOver:l?.id===r,node:S,over:l,setNodeRef:k}}function y_(e){let{animation:t,children:n}=e;const[r,s]=v.useState(null),[o,i]=v.useState(null),a=Fi(n);return!n&&!r&&a&&s(a),An(()=>{if(!o)return;const l=r?.key,c=r?.props.id;if(l==null||c==null){s(null);return}Promise.resolve(t(c,o)).then(()=>{s(null)})},[t,r,o]),v.createElement(v.Fragment,null,n,r?v.cloneElement(r,{ref:i}):null)}const v_={x:0,y:0,scaleX:1,scaleY:1};function x_(e){let{children:t}=e;return v.createElement(mo.Provider,{value:yg},v.createElement(Gi.Provider,{value:v_},t))}const w_={position:"fixed",touchAction:"none"},k_=e=>zi(e)?"transform 250ms ease":void 0,C_=v.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:s,children:o,className:i,rect:a,style:l,transform:c,transition:d=k_}=e;if(!a)return null;const u=s?c:{...c,scaleX:1,scaleY:1},f={...w_,width:a.width,height:a.height,top:a.top,left:a.left,transform:Wn.Transform.toString(u),transformOrigin:s&&r?mS(r,a):void 0,transition:typeof d=="function"?d(r):d,...l};return v.createElement(n,{className:i,style:f,ref:t},o)}),S_={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Wn.Transform.toString(t)},{transform:Wn.Transform.toString(n)}]},sideEffects:(e=>t=>{let{active:n,dragOverlay:r}=t;const s={},{styles:o,className:i}=e;if(o!=null&&o.active)for(const[a,l]of Object.entries(o.active))l!==void 0&&(s[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,l));if(o!=null&&o.dragOverlay)for(const[a,l]of Object.entries(o.dragOverlay))l!==void 0&&r.node.style.setProperty(a,l);return i!=null&&i.active&&n.node.classList.add(i.active),i!=null&&i.dragOverlay&&r.node.classList.add(i.dragOverlay),function(){for(const[l,c]of Object.entries(s))n.node.style.setProperty(l,c);i!=null&&i.active&&n.node.classList.remove(i.active)}})({styles:{active:{opacity:"0"}}})};function __(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:s}=e;return Pi((o,i)=>{if(t===null)return;const a=n.get(o);if(!a)return;const l=a.node.current;if(!l)return;const c=bg(i);if(!c)return;const{transform:d}=en(i).getComputedStyle(i),u=Jh(d);if(!u)return;const f=typeof t=="function"?t:E_(t);return ig(l,s.draggable.measure),f({active:{id:o,data:a.data,node:l,rect:s.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:i,rect:s.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:s,transform:u})})}function E_(e){const{duration:t,easing:n,sideEffects:r,keyframes:s}={...S_,...e};return o=>{let{active:i,dragOverlay:a,transform:l,...c}=o;if(!t)return;const d={x:a.rect.left-i.rect.left,y:a.rect.top-i.rect.top},u={scaleX:l.scaleX!==1?i.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?i.rect.height*l.scaleY/a.rect.height:1},f={x:l.x-d.x,y:l.y-d.y,...u},g=s({...c,active:i,dragOverlay:a,transform:{initial:l,final:f}}),[m]=g,p=g[g.length-1];if(JSON.stringify(m)===JSON.stringify(p))return;const y=r?.({active:i,dragOverlay:a,...c}),b=a.node.animate(g,{duration:t,easing:n,fill:"forwards"});return new Promise(_=>{b.onfinish=()=>{y?.(),_()}})}}let Cg=0;function M_(e){return v.useMemo(()=>{if(e!=null)return Cg++,Cg},[e])}const N_=v.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:s,transition:o,modifiers:i,wrapperElement:a="div",className:l,zIndex:c=999}=e;const{activatorEvent:d,active:u,activeNodeRect:f,containerNodeRect:g,draggableNodes:m,droppableContainers:p,dragOverlay:y,over:b,measuringConfiguration:_,scrollableAncestors:x,scrollableAncestorRects:M,windowRect:S}=kg(),k=v.useContext(Gi),N=M_(u?.id),C=xg(i,{activatorEvent:d,active:u,activeNodeRect:f,containerNodeRect:g,draggingNodeRect:y.rect,over:b,overlayNodeRect:y.rect,scrollableAncestors:x,scrollableAncestorRects:M,transform:k,windowRect:S}),w=Sc(f),E=__({config:r,draggableNodes:m,droppableContainers:p,measuringConfiguration:_}),T=w?y.setRef:void 0;return v.createElement(x_,null,v.createElement(y_,{animation:E},u&&N?v.createElement(C_,{key:N,id:u.id,ref:T,as:a,activatorEvent:d,adjustScale:t,className:l,transition:o,rect:w,style:{zIndex:c,...s},transform:C},n):null))});function ms(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function O_(e,t){return e.reduce((n,r,s)=>{const o=t.get(r);return o&&(n[s]=o),n},Array(e.length))}function Yi(e){return e!==null&&e>=0}function T_(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function A_(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Ki=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const o=ms(t,r,n),i=t[s],a=o[s];return!a||!i?null:{x:a.left-i.left,y:a.top-i.top,scaleX:a.width/i.width,scaleY:a.height/i.height}},Xi={scaleX:1,scaleY:1},Ec=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:o,overIndex:i}=e;const a=(t=o[n])!=null?t:r;if(!a)return null;if(s===n){const c=o[i];return c?{x:0,y:n<i?c.top+c.height-(a.top+a.height):c.top-a.top,...Xi}:null}const l=D_(o,s,n);return s>n&&s<=i?{x:0,y:-a.height-l,...Xi}:s<n&&s>=i?{x:0,y:a.height+l,...Xi}:{x:0,y:0,...Xi}};function D_(e,t,n){const r=e[t],s=e[t-1],o=e[t+1];return r?n<t?s?r.top-(s.top+s.height):o?o.top-(r.top+r.height):0:o?o.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const Sg="Sortable",_g=v.createContext({activeIndex:-1,containerId:Sg,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Ki,disabled:{draggable:!1,droppable:!1}});function qi(e){let{children:t,id:n,items:r,strategy:s=Ki,disabled:o=!1}=e;const{active:i,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:d}=kg(),u=ao(Sg,n),f=a.rect!==null,g=v.useMemo(()=>r.map(k=>typeof k=="object"&&"id"in k?k.id:k),[r]),m=i!=null,p=i?g.indexOf(i.id):-1,y=c?g.indexOf(c.id):-1,b=v.useRef(g),_=!T_(g,b.current),x=y!==-1&&p===-1||_,M=A_(o);An(()=>{_&&m&&d(g)},[_,g,m,d]),v.useEffect(()=>{b.current=g},[g]);const S=v.useMemo(()=>({activeIndex:p,containerId:u,disabled:M,disableTransforms:x,items:g,overIndex:y,useDragOverlay:f,sortedRects:O_(g,l),strategy:s}),[p,u,M.draggable,M.droppable,x,g,y,l,f,s]);return v.createElement(_g.Provider,{value:S},t)}const Eg=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return ms(n,r,s).indexOf(t)},Mg=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:o,newIndex:i,previousItems:a,previousContainerId:l,transition:c}=e;return!c||!r||a!==o&&s===i?!1:n?!0:i!==s&&t===l},I_={duration:200,easing:"ease"},Ng="transform",L_=Wn.Transition.toString({property:Ng,duration:0,easing:"linear"}),P_={roleDescription:"sortable"};function $_(e){let{disabled:t,index:n,node:r,rect:s}=e;const[o,i]=v.useState(null),a=v.useRef(n);return An(()=>{if(!t&&n!==a.current&&r.current){const l=s.current;if(l){const c=ps(r.current,{ignoreTransform:!0}),d={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(d.x||d.y)&&i(d)}}n!==a.current&&(a.current=n)},[t,n,r,s]),v.useEffect(()=>{o&&i(null)},[o]),o}function Zi(e){let{animateLayoutChanges:t=Mg,attributes:n,disabled:r,data:s,getNewIndex:o=Eg,id:i,strategy:a,resizeObserverConfig:l,transition:c=I_}=e;const{items:d,containerId:u,activeIndex:f,disabled:g,disableTransforms:m,sortedRects:p,overIndex:y,useDragOverlay:b,strategy:_}=v.useContext(_g),x=F_(r,g),M=d.indexOf(i),S=v.useMemo(()=>({sortable:{containerId:u,index:M,items:d},...s}),[u,s,M,d]),k=v.useMemo(()=>d.slice(d.indexOf(i)),[d,i]),{rect:N,node:C,isOver:w,setNodeRef:E}=b_({id:i,data:S,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:k,...l}}),{active:T,activatorEvent:P,activeNodeRect:L,attributes:F,setNodeRef:A,listeners:D,isDragging:O,over:z,setActivatorNodeRef:U,transform:j}=g_({id:i,data:S,attributes:{...P_,...n},disabled:x.draggable}),Y=nS(E,A),B=!!T,W=B&&!m&&Yi(f)&&Yi(y),G=!b&&O,V=G&&W?j:null,K=W?V??(a??_)({rects:p,activeNodeRect:L,activeIndex:f,overIndex:y,index:M}):null,Q=Yi(f)&&Yi(y)?o({id:i,items:d,activeIndex:f,overIndex:y}):M,ne=T?.id,se=v.useRef({activeId:ne,items:d,newIndex:Q,containerId:u}),ue=d!==se.current.items,ee=t({active:T,containerId:u,isDragging:O,isSorting:B,id:i,index:M,items:d,newIndex:se.current.newIndex,previousItems:se.current.items,previousContainerId:se.current.containerId,transition:c,wasDragging:se.current.activeId!=null}),me=$_({disabled:!ee,index:M,node:C,rect:N});return v.useEffect(()=>{B&&se.current.newIndex!==Q&&(se.current.newIndex=Q),u!==se.current.containerId&&(se.current.containerId=u),d!==se.current.items&&(se.current.items=d)},[B,Q,u,d]),v.useEffect(()=>{if(ne===se.current.activeId)return;if(ne!=null&&se.current.activeId==null){se.current.activeId=ne;return}const de=setTimeout(()=>{se.current.activeId=ne},50);return()=>clearTimeout(de)},[ne]),{active:T,activeIndex:f,attributes:F,data:S,rect:N,index:M,newIndex:Q,items:d,isOver:w,isSorting:B,isDragging:O,listeners:D,node:C,overIndex:y,over:z,setNodeRef:Y,setActivatorNodeRef:U,setDroppableNodeRef:E,setDraggableNodeRef:A,transform:me??K,transition:ie()};function ie(){if(me||ue&&se.current.newIndex===M)return L_;if(!(G&&!zi(P)||!c)&&(B||ee))return Wn.Transition.toString({...c,property:Ng})}}function F_(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}function bo(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const z_=[Xe.Down,Xe.Right,Xe.Up,Xe.Left],Qi=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:o,over:i,scrollableAncestors:a}}=t;if(z_.includes(e.code)){if(e.preventDefault(),!n||!r)return;const l=[];o.getEnabled().forEach(u=>{if(!u||u!=null&&u.disabled)return;const f=s.get(u.id);if(f)switch(e.code){case Xe.Down:r.top<f.top&&l.push(u);break;case Xe.Up:r.top>f.top&&l.push(u);break;case Xe.Left:r.left>f.left&&l.push(u);break;case Xe.Right:r.left<f.left&&l.push(u);break}});const c=yS({collisionRect:r,droppableRects:s,droppableContainers:l});let d=qh(c,"id");if(d===i?.id&&c.length>1&&(d=c[1].id),d!=null){const u=o.get(n.id),f=o.get(d),g=f?s.get(f.id):null,m=f?.node.current;if(m&&g&&u&&f){const y=Ui(m).some((k,N)=>a[N]!==k),b=Og(u,f),_=V_(u,f),x=y||!b?{x:0,y:0}:{x:_?r.width-g.width:0,y:_?r.height-g.height:0},M={x:g.left,y:g.top};return x.x&&x.y?M:lo(M,x)}}}};function Og(e,t){return!bo(e)||!bo(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function V_(e,t){return!bo(e)||!bo(t)||!Og(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const H_=Object.freeze(Object.defineProperty({__proto__:null,SortableContext:qi,arrayMove:ms,defaultAnimateLayoutChanges:Mg,defaultNewIndexGetter:Eg,hasSortableData:bo,rectSortingStrategy:Ki,sortableKeyboardCoordinates:Qi,useSortable:Zi,verticalListSortingStrategy:Ec},Symbol.toStringTag,{value:"Module"})),U_=()=>window.G7Core,Tg=({item:e,isSelected:t=!1,isExpanded:n=!1,level:r=0,onClick:s,onToggle:o,onExpandToggle:i,className:a="",selectedClassName:l="bg-blue-50 dark:bg-blue-900/30 border-blue-500",defaultClassName:c="bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600",dragHandleClassName:d="text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",iconContainerClassName:u="bg-gray-100 dark:bg-gray-700",contentClassName:f="",enableDrag:g=!0,toggleDisabled:m=!1})=>{const{attributes:p,listeners:y,setNodeRef:b,transform:_,transition:x,isDragging:M}=Zi({id:e.id}),S={transform:Wn.Transform.toString(_),transition:x,opacity:M?.5:1},k=r*24+12,C=`flex items-center gap-2 cursor-pointer transition-colors ${t?l:c}`,w=U_()?.style?.mergeClasses?.(C,a)??`${C} ${a}`.trim();return h.jsxs(I,{ref:b,style:S,className:w,onClick:s,children:[g&&h.jsx(I,{...p,...y,className:`flex-shrink-0 cursor-grab active:cursor-grabbing p-1 ${d}`,style:{paddingLeft:`${k}px`},children:h.jsx(ae,{name:"grip-vertical",className:"w-4 h-4"})}),!g&&r>0&&h.jsx(I,{style:{paddingLeft:`${k}px`}}),g&&h.jsx(h.Fragment,{children:e.hasChildren?h.jsx(le,{type:"button",onClick:E=>{E.stopPropagation(),i?.()},className:`flex-shrink-0 p-1 ${d}`,children:h.jsx(ae,{name:n?"chevron-down":"chevron-right",className:"w-4 h-4"})}):h.jsx(I,{className:"flex-shrink-0 w-6"})}),h.jsx(I,{className:`flex-shrink-0 w-8 h-8 flex items-center justify-center rounded ${u}`,children:h.jsx(ae,{name:e.icon||"file",className:"w-4 h-4 text-gray-600 dark:text-gray-400"})}),h.jsxs(I,{className:`flex-1 min-w-0 ${f}`,children:[h.jsxs(I,{className:"flex items-center gap-1",children:[h.jsx(J,{className:"text-sm font-medium text-gray-900 dark:text-white truncate",children:e.name}),e.isModuleMenu&&h.jsx(ae,{name:"cube",className:"w-2 h-2 text-gray-300 dark:text-gray-500 ml-2",title:e.moduleName})]}),h.jsx(J,{className:"text-xs text-gray-500 dark:text-gray-400 truncate block",children:e.url})]}),h.jsx(I,{className:"flex-shrink-0",onClick:E=>E.stopPropagation(),children:h.jsx(hl,{checked:e.isActive,onChange:()=>o?.(new MouseEvent("click")),size:"sm",disabled:m})})]})},B_=()=>window.G7Core;function Ag(e,t,n=0,r=null){const s=[];for(const o of e)s.push({item:o,depth:n,parentId:r}),o.children?.length>0&&t.has(o.id)&&s.push(...Ag(o.children,t,n+1,o.id));return s}function Mc(e,t){for(const n of e){if(n.id===t)return n;if(n.children){const r=Mc(n.children,t);if(r)return r}}return null}function Dg(e){const t=[];if(e.children)for(const n of e.children)t.push(n.id),t.push(...Dg(n));return t}function Ig(e,t){return e.filter(n=>n.id!==t).map(n=>n.children?.length>0?{...n,children:Ig(n.children,t)}:n)}function Lg(e,t,n,r){if(n===null){const s=[...e];return s.splice(r,0,t),s}return e.map(s=>{if(s.id===n){const o=[...s.children||[]];return o.splice(r,0,t),{...s,children:o}}return s.children?.length>0?{...s,children:Lg(s.children,t,n,r)}:s})}function Pg(e,t,n,r){if(t===null){const s=e.findIndex(i=>i.id===n),o=e.findIndex(i=>i.id===r);return s===-1||o===-1?e:ms(e,s,o)}return e.map(s=>{if(s.id===t&&s.children){const o=s.children.findIndex(a=>a.id===n),i=s.children.findIndex(a=>a.id===r);return o===-1||i===-1?s:{...s,children:ms(s.children,o,i)}}return s.children?.length>0?{...s,children:Pg(s.children,t,n,r)}:s})}function $g(e){const t=e.map((s,o)=>({id:s.id,order:o+1})),n={},r=s=>{s.forEach(o=>{o.children?.length>0&&(n[o.id]=o.children.map((i,a)=>({id:i.id,order:a+1})),r(o.children))})};return r(e),{parent_menus:t,child_menus:n}}const j_=({items:e=[],selectedId:t,onSelect:n,onOrderChange:r,onToggleStatus:s,title:o,className:i="",listClassName:a="",childrenContainerClassName:l="bg-gray-50 dark:bg-gray-900/50",itemClassName:c="py-2.5 px-3 mx-4 my-2 rounded-lg border",itemSelectedClassName:d,itemDefaultClassName:u,titleClassName:f="px-4 py-3 border-b border-gray-200 dark:border-gray-700",enableDrag:g=!0,toggleDisabled:m=!1,id:p,editorAttrs:y})=>{const[b,_]=v.useState(new Set),[x,M]=v.useState(null),[S,k]=v.useState(e),N=v.useRef(!1),C=v.useRef(""),w=v.useRef(""),E=v.useCallback(W=>JSON.stringify(W),[]),T=v.useCallback(W=>W.map(G=>{const V=G.children?.map(X=>X.id).join(",")||"";return`${G.id}:${V}`}).join("|"),[]);v.useEffect(()=>{const W=T(e),G=E(e);if(N.current){const V=T(S);(W===V||W!==C.current)&&(N.current=!1,C.current=W,w.current=G,(W!==V||G!==E(S))&&k(e));return}G!==w.current&&(C.current=W,w.current=G,k(e))},[e,T,E,S]);const P=gc(gs(fo,{activationConstraint:{distance:8}}),gs(uo,{coordinateGetter:Qi})),L=v.useCallback(W=>{if(typeof W=="string")return W;const V=B_()?.locale?.current?.()||"ko";return W[V]||W.en||Object.values(W)[0]||""},[]),F=v.useCallback(W=>{_(G=>{const V=new Set(G);return V.has(W)?V.delete(W):V.add(W),V})},[]),A=v.useCallback(W=>{n?.(W)},[n]),D=v.useCallback((W,G,V)=>{V.stopPropagation(),s?.(W,G)},[s]),O=W=>{M(W.active.id)},z=W=>{const{active:G,over:V}=W;if(M(null),!V||G.id===V.id)return;const X=j.find(Q=>Q.item.id===Number(G.id)),K=j.find(Q=>Q.item.id===Number(V.id));if(!(!X||!K))if(X.parentId===K.parentId){const Q=Pg(S,X.parentId,Number(G.id),Number(V.id));k(Q),N.current=!0,r?.($g(Q))}else{const Q=X.item;if(Dg(Q).includes(Number(V.id)))return;let se=Ig(S,Q.id);const ue=j.findIndex(ge=>ge.item.id===Number(G.id)),ee=j.findIndex(ge=>ge.item.id===Number(V.id)),me=ue>ee,ie=K.parentId;let de;if(ie===null)de=se.findIndex(ge=>ge.id===Number(V.id)),de===-1?de=se.length:me||(de+=1);else{const Ce=Mc(se,ie)?.children||[];de=Ce.findIndex(je=>je.id===Number(V.id)),de===-1?de=Ce.length:me||(de+=1)}const fe={...Q,parent_id:ie,children:Q.children||[]};se=Lg(se,fe,ie,de),k(se),N.current=!0;const be=$g(se);be.moved_items=[{id:Q.id,new_parent_id:ie}],r?.(be)}},U=W=>({id:W.id,name:L(W.name),slug:W.slug,url:W.url,icon:W.icon,isActive:W.is_active,isModuleMenu:!!W.module_id,moduleName:W.module?L(W.module.name):void 0,hasChildren:W.children&&W.children.length>0}),j=v.useMemo(()=>Ag(S,b),[S,b]),Y=v.useMemo(()=>j.map(W=>W.item.id),[j]),B=x?Mc(S,Number(x)):null;return h.jsxs(I,{className:i,id:p,...y,children:[o&&h.jsx(I,{className:f,children:h.jsx(Xr,{className:"text-sm font-medium text-gray-900 dark:text-white",children:o})}),h.jsxs(_c,{sensors:P,collisionDetection:pc,onDragStart:O,onDragEnd:z,children:[h.jsx(qi,{items:Y,strategy:Ec,children:h.jsx(I,{className:a,children:j.map(W=>h.jsx(I,{className:W.depth>0?l:"",children:h.jsx(Tg,{item:U(W.item),isSelected:t===W.item.id,isExpanded:b.has(W.item.id),level:W.depth,onClick:()=>A(W.item),onToggle:G=>D(W.item.id,W.item.is_active,G),onExpandToggle:()=>F(W.item.id),className:c,selectedClassName:d,defaultClassName:u,enableDrag:g,toggleDisabled:m})},W.item.id))})}),h.jsx(N_,{children:B?h.jsx(I,{className:"bg-white dark:bg-gray-800 shadow-lg rounded-lg border border-blue-500 p-3",children:h.jsx(I,{className:"flex items-center gap-2",children:h.jsx(I,{className:"text-sm font-medium text-gray-900 dark:text-white",children:L(B.name)})})}):null})]})]})},W_=[{value:"LayoutDashboard",label:"LayoutDashboard",faIcon:"tachometer-alt"},{value:"Settings",label:"Settings",faIcon:"cog"},{value:"Menu",label:"Menu",faIcon:"bars"},{value:"Users",label:"Users",faIcon:"users"},{value:"Package",label:"Package",faIcon:"cube"},{value:"Puzzle",label:"Puzzle",faIcon:"puzzle-piece"},{value:"FileText",label:"FileText",faIcon:"file-alt"},{value:"ShoppingCart",label:"ShoppingCart",faIcon:"shopping-cart"},{value:"MessageSquare",label:"MessageSquare",faIcon:"comment"},{value:"Home",label:"Home",faIcon:"home"},{value:"User",label:"User",faIcon:"user"},{value:"Search",label:"Search",faIcon:"search"},{value:"Bell",label:"Bell",faIcon:"bell"},{value:"Mail",label:"Mail",faIcon:"envelope"},{value:"Calendar",label:"Calendar",faIcon:"calendar"},{value:"Chart",label:"Chart",faIcon:"chart-bar"},{value:"Database",label:"Database",faIcon:"database"},{value:"Lock",label:"Lock",faIcon:"lock"},{value:"Globe",label:"Globe",faIcon:"globe"},{value:"Image",label:"Image",faIcon:"image"}],G_=({value:e,onChange:t,options:n=W_,placeholder:r,searchPlaceholder:s,noResultsText:o,className:i="",disabled:a=!1,name:l,id:c,editorAttrs:d})=>{const[u,f]=v.useState(!1),[g,m]=v.useState(""),p=v.useRef(null),y=n.find(x=>{if(!e)return!1;if(e.includes("fa-")){const M=e.replace(/^(fas|far|fab|fal|fad)\s+fa-/,"");return x.faIcon===M||x.faIcon===e}return x.value===e||x.faIcon===e}),b=n.filter(x=>x.label.toLowerCase().includes(g.toLowerCase()));v.useEffect(()=>{const x=M=>{p.current&&!p.current.contains(M.target)&&(f(!1),m(""))};if(u)return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[u]);const _=x=>{const M=`fas fa-${x.faIcon}`;t?.(M),f(!1),m("")};return h.jsxs(I,{ref:p,className:`relative ${i}`,id:c,...d,children:[h.jsxs(le,{type:"button",onClick:()=>!a&&f(!u),disabled:a,className:`
|
||
w-full flex items-center justify-between px-3 py-2
|
||
bg-white dark:bg-gray-800
|
||
border border-gray-300 dark:border-gray-600 rounded-lg
|
||
text-left text-sm
|
||
${a?"opacity-50 cursor-not-allowed":"hover:border-gray-400 dark:hover:border-gray-500"}
|
||
focus:outline-none focus:ring-2 focus:ring-blue-500
|
||
`,children:[h.jsx(I,{className:"flex items-center gap-2",children:y?h.jsxs(h.Fragment,{children:[h.jsx(ae,{name:y.faIcon,className:"w-4 h-4 text-gray-600 dark:text-gray-400"}),h.jsx(J,{className:"text-gray-900 dark:text-white",children:y.label})]}):h.jsx(J,{className:"text-gray-500 dark:text-gray-400",children:r})}),h.jsx(ae,{name:"chevron-down",className:`w-4 h-4 text-gray-400 dark:text-gray-500 transition-transform ${u?"rotate-180":""}`})]}),l&&h.jsx("input",{type:"hidden",name:l,value:e||""}),u&&h.jsxs(I,{className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg max-h-72 overflow-hidden",children:[h.jsx(I,{className:"p-2 border-b border-gray-200 dark:border-gray-700",children:h.jsx(Et,{type:"text",value:g,onChange:x=>m(x.target.value),placeholder:s,className:"w-full px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded bg-gray-50 dark:bg-gray-700 text-gray-900 dark:text-white",autoFocus:!0})}),h.jsx(I,{className:"max-h-56 overflow-y-auto",children:b.length>0?b.map(x=>h.jsxs(le,{type:"button",onClick:()=>_(x),className:`
|
||
w-full flex items-center gap-3 px-3 py-2 text-left text-sm
|
||
${y?.faIcon===x.faIcon?"bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":"text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700"}
|
||
`,children:[h.jsx(ae,{name:x.faIcon,className:"w-4 h-4"}),h.jsx(J,{children:x.label}),y?.faIcon===x.faIcon&&h.jsx(ae,{name:"check",className:"w-4 h-4 ml-auto text-blue-600"})]},x.value)):h.jsx(I,{className:"px-3 py-4 text-sm text-gray-500 dark:text-gray-400 text-center",children:o})})]})]})},Nc=({defaultOpen:e=!1,isOpen:t,onToggle:n,className:r="",style:s,children:o,disabled:i=!1,id:a,editorAttrs:l})=>{const[c,d]=v.useState(e),u=t!==void 0,f=u?t:c,g=v.useRef(null),[m,p]=v.useState(e?void 0:0),y=()=>{if(i)return;const _=!f;u||d(_),n?.(_)};v.useEffect(()=>{if(g.current)if(f){p(g.current.scrollHeight);const _=setTimeout(()=>{p(void 0)},300);return()=>clearTimeout(_)}else p(g.current.scrollHeight),requestAnimationFrame(()=>{p(0)})},[f]);const b={};if(v.Children.forEach(o,_=>{if(v.isValidElement(_)){const x=_.props?.slot;x==="trigger"?b.trigger=_:x==="content"&&(b.content=_)}}),!b.trigger&&!b.content){const _=v.Children.toArray(o);_.length>=2?(b.trigger=_[0],b.content=_.slice(1)):_.length===1&&(b.content=_[0])}return h.jsxs(I,{className:`border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden ${r}`,style:s,id:a,...l,children:[h.jsxs(le,{type:"button",onClick:y,disabled:i,className:`w-full flex items-center justify-between p-3 text-left bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors ${i?"opacity-50 cursor-not-allowed":""} ${f?"border-b border-gray-200 dark:border-gray-700":""}`,"aria-expanded":f,children:[h.jsx(I,{className:"flex-1",children:b.trigger}),!b.trigger&&h.jsx("svg",{className:`w-5 h-5 text-gray-500 dark:text-gray-400 transition-transform duration-200 ${f?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),h.jsx(I,{ref:g,className:"overflow-hidden transition-all duration-300 ease-in-out",style:{height:m!==void 0?`${m}px`:"auto"},children:h.jsx(I,{className:"bg-white dark:bg-gray-800",children:b.content})})]})},yo=window.G7Core,Fg=yo?.useControllableState,zg=(e,t)=>window.G7Core?.t?.(e,t)??e,Y_={"":"common.scope_type_all_desc",self:"common.scope_type_self_desc",role:"common.scope_type_role_desc"},K_=({options:e,value:t,onChange:n,disabled:r=!1})=>{const[s,o]=v.useState(!1),[i,a]=v.useState({}),l=v.useRef(null),c=e.find(u=>u.value===t)??e[0];v.useEffect(()=>{if(!s)return;const u=g=>{l.current&&!l.current.contains(g.target)&&o(!1)},f=()=>{if(!l.current)return;const g=l.current.getBoundingClientRect();a({position:"fixed",top:g.bottom+4,right:window.innerWidth-g.right,zIndex:9999})};return document.addEventListener("mousedown",u),window.addEventListener("scroll",f,!0),window.addEventListener("resize",f),()=>{document.removeEventListener("mousedown",u),window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",f)}},[s]);const d=v.useCallback(()=>{if(r||!l.current)return;const u=l.current.getBoundingClientRect();a({position:"fixed",top:u.bottom+4,right:window.innerWidth-u.right,zIndex:9999}),o(f=>!f)},[r]);return h.jsxs(I,{ref:l,className:"relative flex-shrink-0",children:[h.jsxs(I,{role:"button",tabIndex:0,onClick:u=>{u.stopPropagation(),u.preventDefault(),d()},onMouseDown:u=>u.stopPropagation(),onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.stopPropagation(),u.preventDefault(),d()),u.key==="Escape"&&o(!1)},className:`flex items-center gap-1 text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300 cursor-pointer select-none ${r?"opacity-50 cursor-not-allowed":"hover:border-blue-400 dark:hover:border-blue-500"}`,children:[h.jsx(J,{children:c?.label??""}),h.jsx(ae,{name:he.ChevronDown,className:"w-3 h-3 text-gray-400 dark:text-gray-500"})]}),s&&h.jsx(I,{style:i,className:"w-56 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-lg shadow-lg py-1",children:e.map(u=>{const f=u.value??"",g=Y_[f],m=g?zg(g):"",p=u.value===t;return h.jsxs(I,{role:"option","aria-selected":p,onClick:y=>{y.stopPropagation(),y.preventDefault(),n(u.value),o(!1)},onMouseDown:y=>y.stopPropagation(),className:`px-3 py-2 cursor-pointer transition-colors ${p?"bg-blue-50 dark:bg-blue-900/30":"hover:bg-gray-50 dark:hover:bg-gray-700/50"}`,children:[h.jsxs(I,{className:"flex items-center justify-between",children:[h.jsx(J,{className:`text-xs font-medium ${p?"text-blue-700 dark:text-blue-300":"text-gray-900 dark:text-white"}`,children:u.label}),p&&h.jsx(ae,{name:he.Check,className:"w-3.5 h-3.5 text-blue-600 dark:text-blue-400"})]}),m&&h.jsx(J,{className:"block text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:m})]},f||"__null__")})})]})},X_=(e,t)=>{if(e.length!==t.length)return!1;const n=[...e].sort((s,o)=>s.id-o.id),r=[...t].sort((s,o)=>s.id-o.id);return n.every((s,o)=>s.id===r[o].id&&s.scope_type===r[o].scope_type)},q_=({data:e=[],value:t=[],onChange:n,scopeOptions:r=[],className:s="",disabled:o=!1,desktopColumns:i=2,installedModules:a=[],installedPlugins:l=[],id:c,editorAttrs:d})=>{const u=v.useCallback(E=>{if(n){const T=yo?.createChangeEvent?yo.createChangeEvent({value:E}):{target:{value:E}};n(T)}},[n]),[f,g]=Fg?Fg(t,[],u,{isEqual:X_}):(()=>{const[E,T]=v.useState(t),P=v.useRef(n);P.current=n;const L=v.useRef(!1);v.useEffect(()=>{if(L.current){L.current=!1;return}T(t)},[t]);const F=v.useCallback(A=>{L.current=!0,T(D=>{const O=typeof A=="function"?A(D):A;if(P.current){const z=yo?.createChangeEvent?yo.createChangeEvent({value:O}):{target:{value:O}};P.current(z)}return O})},[]);return[E,F]})(),m=v.useMemo(()=>new Set(f.map(E=>E.id)),[f]),p=v.useCallback(E=>E.is_assignable?[E.id]:E.children.flatMap(T=>p(T)),[]),y=v.useCallback(E=>{const T=p(E);return T.length>0&&T.every(P=>m.has(P))},[m,p]),b=v.useCallback(E=>{const T=p(E),P=T.filter(L=>m.has(L)).length;return P>0&&P<T.length},[m,p]),_=v.useCallback(E=>p(E).filter(P=>m.has(P)).length,[m,p]),x=v.useCallback((E,T)=>{o||g(P=>T?[...P,{id:E,scope_type:null}]:P.filter(L=>L.id!==E))},[o,g]),M=v.useCallback((E,T)=>{if(o)return;const P=p(E),L=new Set(P);g(F=>{if(T){const A=new Set(F.map(O=>O.id)),D=P.filter(O=>!A.has(O)).map(O=>({id:O,scope_type:null}));return[...F,...D]}else return F.filter(A=>!L.has(A.id))})},[o,p,g]),S=v.useCallback((E,T)=>{o||g(P=>P.map(L=>L.id===E?{...L,scope_type:T}:L))},[o,g]),k=E=>{const T=m.has(E.id),P=!!E.resource_route_key,L=T&&P&&r.length>0,F=f.find(A=>A.id===E.id)?.scope_type??null;return h.jsxs(gn,{className:`flex items-start gap-3 p-3 rounded-lg border cursor-pointer transition-colors ${T?"border-blue-200 bg-blue-50 dark:border-blue-800 dark:bg-blue-900/20":"border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700/50"} ${o?"opacity-50 cursor-not-allowed":""}`,children:[h.jsx(Et,{type:"checkbox",checked:T,onChange:A=>{A.stopPropagation(),x(E.id,A.target.checked)},disabled:o,className:"w-4 h-4 mt-0.5 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600"}),h.jsxs(I,{className:"flex-1 min-w-0",children:[h.jsxs(I,{className:"flex items-center justify-between gap-2",children:[h.jsx(J,{className:"text-sm font-medium text-gray-900 dark:text-white",children:E.name}),L&&h.jsx(K_,{options:r,value:F,onChange:A=>S(E.id,A),disabled:o})]}),E.description&&h.jsx(J,{className:"block text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:E.description})]})]},E.id)},N=(E,T)=>{const P=y(E),L=b(E),F=_(E),A=E.children.filter(z=>z.is_assignable);if(A.length===0&&E.children.length===0)return null;const D=E.children.some(z=>!z.is_assignable),O=i===1?"grid-cols-1":i===3?"grid-cols-1 md:grid-cols-3":"grid-cols-1 md:grid-cols-2";return h.jsxs(Nc,{defaultOpen:!1,className:"border-0 rounded-none",children:[h.jsxs(I,{slot:"trigger",className:"flex items-center gap-3 w-full py-2",children:[h.jsx("input",{type:"checkbox",checked:P,ref:z=>{z&&(z.indeterminate=L)},onChange:z=>{z.stopPropagation(),M(E,z.target.checked)},onClick:z=>z.stopPropagation(),onMouseDown:z=>z.stopPropagation(),disabled:o,className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600"}),h.jsx(ae,{name:he.Folder,className:"w-4 h-4 text-gray-400 dark:text-gray-500"}),h.jsx(J,{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:E.name}),h.jsxs(J,{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300 ml-1",children:[F,"/",E.leaf_count]}),h.jsx(ae,{name:he.ChevronDown,className:"w-4 h-4 text-gray-400 dark:text-gray-500 ml-auto"})]}),h.jsx(I,{slot:"content",className:`pl-8 grid ${O} gap-2 py-2`,children:D?E.children.map(z=>z.is_assignable?k(z):N(z)):A.map(z=>k(z))})]},E.id)},C=E=>{if(E.extension_type==="core")return"core";if(E.extension_type==="module")return"module";if(E.extension_type==="plugin")return"plugin";const T=E.extension_identifier??E.module??"";return T==="core"||!T?"core":l?.some(L=>L.identifier===T)?"plugin":"module"},w=E=>{const T=y(E),P=b(E),L=_(E),F=C(E);return h.jsxs(Nc,{defaultOpen:!1,className:"mb-2",children:[h.jsxs(I,{slot:"trigger",className:"flex items-center gap-3 w-full py-2",children:[h.jsx("input",{type:"checkbox",checked:T,ref:A=>{A&&(A.indeterminate=P)},onChange:A=>{A.stopPropagation(),M(E,A.target.checked)},onClick:A=>A.stopPropagation(),onMouseDown:A=>A.stopPropagation(),disabled:o,className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600"}),h.jsx(ae,{name:F==="core"?he.Cog:he.Cube,className:"w-5 h-5 text-gray-400 dark:text-gray-500"}),h.jsx(J,{className:"font-medium text-gray-900 dark:text-white",children:E.name}),F!=="core"&&h.jsx(Uh,{type:F,identifier:E.extension_identifier??E.module,installedModules:a,installedPlugins:l}),h.jsxs(J,{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300 ml-2",children:[L,"/",E.leaf_count]}),h.jsx(ae,{name:he.ChevronDown,className:"w-4 h-4 text-gray-400 dark:text-gray-500 ml-auto"})]}),h.jsx(I,{slot:"content",className:"pl-8 space-y-2 pb-2",children:E.children.map(A=>A.is_assignable?k(A):N(A))})]},E.id)};return e.length===0?h.jsx(I,{className:`text-sm text-gray-400 dark:text-gray-500 py-4 text-center ${s}`,id:c,...d,children:zg("common.no_data")??"데이터가 없습니다."}):h.jsx(I,{className:`space-y-2 ${s}`,id:c,...d,children:e.map(E=>w(E))})};function Z_({text:e,keyword:t}){if(!t||!e)return h.jsx(h.Fragment,{children:e});const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=e.split(new RegExp(`(${n})`,"gi"));return h.jsx(h.Fragment,{children:r.map((s,o)=>s.toLowerCase()===t.toLowerCase()?h.jsx(J,{className:"bg-yellow-200 dark:bg-yellow-700 rounded px-0.5",children:s},o):s)})}const Q_=({data:e=[],expandedIds:t=[],selectedIds:n=[],searchKeyword:r="",showProductCount:s=!1,selectable:o=!1,className:i="",onToggle:a,onSelectionChange:l,id:c,editorAttrs:d})=>{const u=v.useCallback(y=>{if(!a)return;const b=t.includes(y)?t.filter(_=>_!==y):[...t,y];a(b)},[t,a]),f=v.useCallback((y,b)=>{if(!l)return;const _=b?[...n,y]:n.filter(x=>x!==y);l(_)},[n,l]),g=v.useMemo(()=>{if(!r)return null;const y=new Set,b=_=>{for(const x of _)(x.localized_name||x.name).toLowerCase().includes(r.toLowerCase())&&y.add(x.id),x.children&&b(x.children)};return b(e),y},[e,r]),m=v.useCallback(y=>!g||g.has(y.id)?!0:(y.children??[]).some(b=>m(b)),[g]),p=(y,b=0)=>{const _=(y.children??[]).length>0,x=t.includes(y.id),M=n.includes(y.id),S=y.localized_name||y.name;return r&&!m(y)?null:h.jsxs(I,{"data-testid":`category-node-${y.id}`,children:[h.jsxs(I,{className:`flex items-center gap-2 py-1.5 px-2 rounded cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700/50 transition-colors ${b>0?"ml-"+Math.min(b*5,20):""}`,style:b>0?{marginLeft:`${b*20}px`}:void 0,children:[_?h.jsx(I,{className:"flex-shrink-0 w-5 h-5 flex items-center justify-center text-gray-400 dark:text-gray-500",onClick:()=>u(y.id),"data-testid":`toggle-${y.id}`,children:h.jsx(ae,{name:x?he.CaretDown:he.CaretRight,className:"text-xs"})}):h.jsx(I,{className:"flex-shrink-0 w-5 h-5"}),o&&h.jsx(On,{checked:M,onChange:k=>{k.stopPropagation(),f(y.id,k.target.checked)},className:"flex-shrink-0","data-testid":`checkbox-${y.id}`}),h.jsx(ae,{name:he.Folder,className:`flex-shrink-0 text-sm ${_?"text-yellow-500 dark:text-yellow-400":"text-gray-400 dark:text-gray-500"}`}),h.jsx(J,{className:"text-sm text-gray-700 dark:text-gray-300 select-none",onClick:()=>_&&u(y.id),children:h.jsx(Z_,{text:S,keyword:r})}),s&&y.products_count!==void 0&&h.jsx(J,{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-500 dark:bg-gray-700 dark:text-gray-400 ml-1",children:y.products_count})]}),_&&x&&h.jsx(I,{"data-testid":`children-${y.id}`,children:(y.children??[]).map(k=>p(k,b+1))})]},y.id)};return e.length===0?h.jsx(I,{className:`text-sm text-gray-400 dark:text-gray-500 py-4 text-center ${i}`,id:c,...d,children:"데이터가 없습니다."}):h.jsx(I,{className:`border border-gray-200 dark:border-gray-700 rounded-lg p-2 max-h-80 overflow-y-auto ${i}`,id:c,...d,children:e.map(y=>p(y,0))})},Vg="carousel",vo="controller",J_="navigation",R_="no-scroll",Oc="portal",e2="root",Hg="toolbar",t2="counter",xo="fullscreen",Ug="slideshow",wo="thumbnails",Bg="zoom",bs="loading",Tc="playing",ko="error",Co="complete",n2="placeholder",So=e=>`active-slide-${e}`,r2=So(bs),s2=So(Tc),o2=So(ko),i2=So(Co),jg="fullsize",ys="flex_center",a2="no_scroll",Wg="no_scroll_padding",Ac="slide",Gg="slide_wrapper",l2="slide_wrapper_interactive",pr="prev",mr="next",Dc="swipe",vs="close",Yg="onPointerDown",Kg="onPointerMove",Xg="onPointerUp",qg="onPointerLeave",Zg="onPointerCancel",Ic="onKeyDown",c2="onKeyUp",Lc="onWheel",d2="Escape",u2="ArrowLeft",f2="ArrowRight",h2="button",Ji="icon",Qg="contain",Jg="cover",Rg="Unknown action type",ep="yarl__";function qt(...e){return[...e].filter(Boolean).join(" ")}function Ae(e){return`${ep}${e}`}function gt(e){return`--${ep}${e}`}function Nr(e,t){return`${e}${t?`_${t}`:""}`}function Or(e){return t=>Nr(e,t)}function Tr(e,t){var n;return(n=e?.[t])!==null&&n!==void 0?n:t}function tp(e,t,n){return Tr(e,"{index} of {total}").replace(/\{index}/g,`${zc(n,t.length)+1}`).replace(/\{total}/g,`${t.length}`)}function xs(...e){return()=>{e.forEach(t=>{t()})}}function xn(e,t,n){return()=>{const r=$.useContext(n);if(!r)throw new Error(`${e} must be used within a ${t}.Provider`);return r}}function Pc(){return typeof window<"u"}function $c(e,t=0){const n=10**t;return Math.round((e+Number.EPSILON)*n)/n}function Ar(e){return e.type===void 0||e.type==="image"}function Fc(e,t){return e.imageFit===Jg||e.imageFit!==Qg&&t===Jg}function Ri(e){return typeof e=="string"?Number.parseInt(e,10):e}function ea(e){if(typeof e=="number")return{pixel:e};if(typeof e=="string"){const t=Ri(e);return e.endsWith("%")?{percent:t}:{pixel:t}}return{pixel:0}}function g2(e,t){const n=ea(t),r=n.percent!==void 0?e.width/100*n.percent:n.pixel;return{width:Math.max(e.width-2*r,0),height:Math.max(e.height-2*r,0)}}function p2(){return(Pc()?window?.devicePixelRatio:void 0)||1}function zc(e,t){return t>0?(e%t+t)%t:0}function Vc(e){return e.length>0}function Hc(e,t){return e[zc(t,e.length)]}function Uc(e,t){return Vc(e)?Hc(e,t):void 0}function np(e){return Ar(e)?e.src:void 0}function ta(e,t,n){if(!n)return e;const{buttons:r,...s}=e,o=r.findIndex(a=>a===t),i=$.isValidElement(n)?$.cloneElement(n,{key:t},null):n;if(o>=0){const a=[...r];return a.splice(o,1,i),{buttons:a,...s}}return{buttons:[i,...r],...s}}function rp(e,t,n=0){return Math.min(e.preload,Math.max(e.finite?t.length-1:Math.floor(t.length/2),n))}const m2=Number($.version.split(".")[0])>=19;function b2(e){return{inert:m2?e:e?"":void 0}}function y2(e){e.scrollTop}const Bc={open:!1,close:()=>{},index:0,slides:[],render:{},plugins:[],toolbar:{buttons:[vs]},labels:{},animation:{fade:250,swipe:500,easing:{fade:"ease",swipe:"ease-out",navigation:"ease-in-out"}},carousel:{finite:!1,preload:2,padding:"16px",spacing:"30%",imageFit:Qg,imageProps:{}},controller:{ref:null,focus:!0,aria:!1,touchAction:"none",closeOnPullUp:!1,closeOnPullDown:!1,closeOnBackdropClick:!1,preventDefaultWheelX:!0,preventDefaultWheelY:!1,disableSwipeNavigation:!1},portal:{},noScroll:{disabled:!1},on:{},styles:{},className:""};function wn(e,t){return{name:e,component:t}}function Ft(e,t){return{module:e,children:t}}function sp(e,t,n){return e.module.name===t?n(e):e.children?[Ft(e.module,e.children.flatMap(r=>{var s;return(s=sp(r,t,n))!==null&&s!==void 0?s:[]}))]:[e]}function ws(e,t,n){return e.flatMap(r=>{var s;return(s=sp(r,t,n))!==null&&s!==void 0?s:[]})}function v2(e,t=[],n=[]){let r=e;const s=g=>{const m=[...r];for(;m.length>0;){const p=m.pop();if(p?.module.name===g)return!0;p?.children&&m.push(...p.children)}return!1},o=(g,m)=>{if(g===""){r=[Ft(m,r)];return}r=ws(r,g,p=>[Ft(m,[p])])},i=(g,m)=>{r=ws(r,g,p=>[Ft(p.module,[Ft(m,p.children)])])},a=(g,m,p)=>{r=ws(r,g,y=>{var b;return[Ft(y.module,[...p?[Ft(m)]:[],...(b=y.children)!==null&&b!==void 0?b:[],...p?[]:[Ft(m)]])]})},l=(g,m,p)=>{r=ws(r,g,y=>[...p?[Ft(m)]:[],y,...p?[]:[Ft(m)]])},c=g=>{i(vo,g)},d=(g,m)=>{r=ws(r,g,p=>[Ft(m,p.children)])},u=g=>{r=ws(r,g,m=>m.children)},f=g=>{n.push(g)};return t.forEach(g=>{g({contains:s,addParent:o,append:i,addChild:a,addSibling:l,addModule:c,replace:d,remove:u,augment:f})}),{config:r,augmentation:g=>n.reduce((m,p)=>p(m),g)}}const op=$.createContext(null),jc=xn("useA11yContext","A11yContext",op);function x2({children:e}){const[t,n]=$.useState(!1),[r,s]=$.useState(!1),o=$.useMemo(()=>({focusWithin:t,trackFocusWithin:(a,l)=>{const c=d=>u=>{var f;u.currentTarget.contains(u.relatedTarget)||n(d),(f=d?a:l)===null||f===void 0||f(u)};return{onFocus:c(!0),onBlur:c(!1)}},autoPlaying:r,setAutoPlaying:s}),[t,r]);return $.createElement(op.Provider,{value:o},e)}const ip=$.createContext(null),ks=xn("useDocument","DocumentContext",ip);function w2({nodeRef:e,children:t}){const n=$.useMemo(()=>{const r=o=>{var i;return((i=o||e.current)===null||i===void 0?void 0:i.ownerDocument)||document};return{getOwnerDocument:r,getOwnerWindow:o=>{var i;return((i=r(o))===null||i===void 0?void 0:i.defaultView)||window}}},[e]);return $.createElement(ip.Provider,{value:n},t)}const ap=$.createContext(null),Cs=xn("useEvents","EventsContext",ap);function k2({children:e}){const[t]=$.useState({});$.useEffect(()=>()=>{Object.keys(t).forEach(r=>delete t[r])},[t]);const n=$.useMemo(()=>{const r=(i,a)=>{var l;(l=t[i])===null||l===void 0||l.splice(0,t[i].length,...t[i].filter(c=>c!==a))};return{publish:(...[i,a])=>{var l;(l=t[i])===null||l===void 0||l.forEach(c=>c(a))},subscribe:(i,a)=>(t[i]||(t[i]=[]),t[i].push(a),()=>r(i,a)),unsubscribe:r}},[t]);return $.createElement(ap.Provider,{value:n},e)}const lp=$.createContext(null),zt=xn("useLightboxProps","LightboxPropsContext",lp);function cp({children:e,...t}){return $.createElement(lp.Provider,{value:t},e)}const dp=$.createContext(null),kn=xn("useLightboxState","LightboxStateContext",dp),up=$.createContext(null),C2=xn("useLightboxDispatch","LightboxDispatchContext",up);function S2(e,t){switch(t.type){case"swipe":{const{slides:n}=e,r=t?.increment||0,s=e.globalIndex+r,o=zc(s,n.length),i=Uc(n,o),a=r||t.duration!==void 0?{increment:r,duration:t.duration,easing:t.easing}:void 0;return{slides:n,currentIndex:o,globalIndex:s,currentSlide:i,animation:a}}case"update":return t.slides!==e.slides||t.index!==e.currentIndex?{slides:t.slides,currentIndex:t.index,globalIndex:t.index,currentSlide:Uc(t.slides,t.index)}:e;default:throw new Error(Rg)}}function _2({slides:e,index:t,children:n}){const[r,s]=$.useReducer(S2,{slides:e,currentIndex:t,globalIndex:t,currentSlide:Uc(e,t)});$.useEffect(()=>{s({type:"update",slides:e,index:t})},[e,t]);const o=$.useMemo(()=>({...r,state:r,dispatch:s}),[r,s]);return $.createElement(up.Provider,{value:s},$.createElement(dp.Provider,{value:o},n))}const fp=$.createContext(null),_o=xn("useTimeouts","TimeoutsContext",fp);function E2({children:e}){const[t]=$.useState([]);$.useEffect(()=>()=>{t.forEach(r=>window.clearTimeout(r)),t.splice(0,t.length)},[t]);const n=$.useMemo(()=>{const r=i=>{t.splice(0,t.length,...t.filter(a=>a!==i))};return{setTimeout:(i,a)=>{const l=window.setTimeout(()=>{r(l),i()},a);return t.push(l),l},clearTimeout:i=>{i!==void 0&&(r(i),window.clearTimeout(i))}}},[t]);return $.createElement(fp.Provider,{value:n},e)}const Ss=$.forwardRef(function({label:t,className:n,icon:r,renderIcon:s,onClick:o,style:i,...a},l){const{styles:c,labels:d}=zt(),u=Tr(d,t);return $.createElement("button",{ref:l,type:"button",title:u,"aria-label":u,className:qt(Ae(h2),n),onClick:o,style:{...i,...c.button},...a},s?s():$.createElement(r,{className:Ae(Ji),style:c.icon}))});function hp(e,t){const n=r=>$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false",...r},t);return n.displayName=e,n}function an(e,t){return hp(e,$.createElement("g",{fill:"currentColor"},$.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t))}function M2(e,t){return hp(e,$.createElement($.Fragment,null,$.createElement("defs",null,$.createElement("mask",{id:"strike"},$.createElement("path",{d:"M0 0h24v24H0z",fill:"white"}),$.createElement("path",{d:"M0 0L24 24",stroke:"black",strokeWidth:4}))),$.createElement("path",{d:"M0.70707 2.121320L21.878680 23.292883",stroke:"currentColor",strokeWidth:2}),$.createElement("g",{fill:"currentColor",mask:"url(#strike)"},$.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t)))}const N2=an("Close",$.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),O2=an("Previous",$.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})),T2=an("Next",$.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),A2=an("Loading",$.createElement($.Fragment,null,Array.from({length:8}).map((e,t,n)=>$.createElement("line",{key:t,x1:"12",y1:"6.5",x2:"12",y2:"1.8",strokeLinecap:"round",strokeWidth:"2.6",stroke:"currentColor",strokeOpacity:1/n.length*(t+1),transform:`rotate(${360/n.length*t}, 12, 12)`})))),D2=an("Error",$.createElement("path",{d:"M21.9,21.9l-8.49-8.49l0,0L3.59,3.59l0,0L2.1,2.1L0.69,3.51L3,5.83V19c0,1.1,0.9,2,2,2h13.17l2.31,2.31L21.9,21.9z M5,18 l3.5-4.5l2.5,3.01L12.17,15l3,3H5z M21,18.17L5.83,3H19c1.1,0,2,0.9,2,2V18.17z"})),In=Pc()?$.useLayoutEffect:$.useEffect;function Wc(){const[e,t]=$.useState(!1);return $.useEffect(()=>{var n,r;const s=(n=window.matchMedia)===null||n===void 0?void 0:n.call(window,"(prefers-reduced-motion: reduce)");t(s?.matches);const o=i=>t(i.matches);return(r=s?.addEventListener)===null||r===void 0||r.call(s,"change",o),()=>{var i;return(i=s?.removeEventListener)===null||i===void 0?void 0:i.call(s,"change",o)}},[]),e}function I2(e){let t=0,n=0,r=0;const o=window.getComputedStyle(e).transform.match(/matrix.*\((.+)\)/);if(o){const i=o[1].split(",").map(Ri);i.length===6?(t=i[4],n=i[5]):i.length===16&&(t=i[12],n=i[13],r=i[14])}return{x:t,y:n,z:r}}function Gc(e,t){const n=$.useRef(void 0),r=$.useRef(void 0),s=Wc();return In(()=>{var o,i,a;if(e.current&&n.current!==void 0&&!s){const{keyframes:l,duration:c,easing:d,onfinish:u}=t(n.current,e.current.getBoundingClientRect(),I2(e.current))||{};if(l&&c){(o=r.current)===null||o===void 0||o.cancel(),r.current=void 0;try{r.current=(a=(i=e.current).animate)===null||a===void 0?void 0:a.call(i,l,{duration:c,easing:d})}catch(f){console.error(f)}r.current&&(r.current.onfinish=()=>{r.current=void 0,u?.()})}}n.current=void 0}),{prepareAnimation:o=>{n.current=o},isAnimationPlaying:()=>{var o;return((o=r.current)===null||o===void 0?void 0:o.playState)==="running"}}}function gp(){const e=$.useRef(null),t=$.useRef(void 0),[n,r]=$.useState();return{setContainerRef:$.useCallback(o=>{e.current=o,t.current&&(t.current.disconnect(),t.current=void 0);const i=()=>{if(o){const a=window.getComputedStyle(o),l=c=>parseFloat(c)||0;r({width:Math.round(o.clientWidth-l(a.paddingLeft)-l(a.paddingRight)),height:Math.round(o.clientHeight-l(a.paddingTop)-l(a.paddingBottom))})}else r(void 0)};i(),o&&typeof ResizeObserver<"u"&&(t.current=new ResizeObserver(i),t.current.observe(o))},[]),containerRef:e,containerRect:n}}function na(){const e=$.useRef(void 0),{setTimeout:t,clearTimeout:n}=_o();return $.useCallback((r,s)=>{n(e.current),e.current=t(r,s>0?s:0)},[t,n])}function Ye(e){const t=$.useRef(e);return In(()=>{t.current=e}),$.useCallback((...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function pp(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function Yc(e,t){return $.useMemo(()=>e==null&&t==null?null:n=>{pp(e,n),pp(t,n)},[e,t])}function mp(e,t=!1){const n=$.useRef(!1);In(()=>{t&&n.current&&(n.current=!1,e())},[t,e]);const r=$.useCallback(()=>{n.current=!0},[]),s=$.useCallback(()=>{n.current=!1},[]);return{onFocus:r,onBlur:s}}function ra(){const[e,t]=$.useState(!1);return In(()=>{t(window.getComputedStyle(window.document.documentElement).direction==="rtl")},[]),e}function bp(){const[e]=$.useState({}),t=$.useCallback((s,o)=>{var i;(i=e[s])===null||i===void 0||i.forEach(a=>{o.isPropagationStopped()||a(o)})},[e]),n=$.useMemo(()=>({onPointerDown:s=>t(Yg,s),onPointerMove:s=>t(Kg,s),onPointerUp:s=>t(Xg,s),onPointerLeave:s=>t(qg,s),onPointerCancel:s=>t(Zg,s),onKeyDown:s=>t(Ic,s),onKeyUp:s=>t(c2,s),onWheel:s=>t(Lc,s)}),[t]),r=$.useCallback((s,o)=>(e[s]||(e[s]=[]),e[s].unshift(o),()=>{const i=e[s];i&&i.splice(0,i.length,...i.filter(a=>a!==o))}),[e]);return{registerSensors:n,subscribeSensors:r}}function yp(e,t){const n=$.useRef(0),r=na(),s=Ye((...o)=>{n.current=Date.now(),e(o)});return $.useCallback((...o)=>{r(()=>{s(o)},t-(Date.now()-n.current))},[t,s,r])}const Kc=Or("slide"),Xc=Or("slide_image");function Dr({slide:e,offset:t,render:n,rect:r,imageFit:s,imageProps:o,onClick:i,onLoad:a,onError:l,style:c}){var d,u,f,g,m,p,y,b;const[_,x]=$.useState(bs),{publish:M}=Cs(),{setTimeout:S}=_o(),k=$.useRef(null);$.useEffect(()=>{t===0&&M(So(_))},[t,_,M]);const N=Ye(B=>{("decode"in B?B.decode():Promise.resolve()).catch(()=>{}).then(()=>{B.parentNode&&(x(Co),S(()=>{a?.(B)},0))})}),C=$.useCallback(B=>{k.current=B,B?.complete&&N(B)},[N]),w=$.useCallback(B=>{N(B.currentTarget)},[N]),E=Ye(()=>{x(ko),l?.()}),T=Fc(e,s),P=(B,W)=>Number.isFinite(B)?B:W,L=P(Math.max(...((u=(d=e.srcSet)===null||d===void 0?void 0:d.map(B=>B.width))!==null&&u!==void 0?u:[]).concat(e.width?[e.width]:[]).filter(Boolean)),((f=k.current)===null||f===void 0?void 0:f.naturalWidth)||0),F=P(Math.max(...((m=(g=e.srcSet)===null||g===void 0?void 0:g.map(B=>B.height))!==null&&m!==void 0?m:[]).concat(e.height?[e.height]:[]).filter(Boolean)),((p=k.current)===null||p===void 0?void 0:p.naturalHeight)||0),A=L&&F?{maxWidth:`min(${L}px, 100%)`,maxHeight:`min(${F}px, 100%)`}:{maxWidth:"100%",maxHeight:"100%"},D=(y=e.srcSet)===null||y===void 0?void 0:y.sort((B,W)=>B.width-W.width).map(B=>`${B.src} ${B.width}w`).join(", "),O=()=>r&&!T&&e.width&&e.height?r.height/e.height*e.width:Number.MAX_VALUE,z=D&&r&&Pc()?`${Math.round(Math.min(O(),r.width))}px`:void 0,{style:U,className:j,...Y}=o||{};return $.createElement($.Fragment,null,$.createElement("img",{ref:C,onLoad:w,onError:E,onClick:i,draggable:!1,className:qt(Ae(Xc()),T&&Ae(Xc("cover")),_!==Co&&Ae(Xc("loading")),j),style:{...A,...c,...U},...Y,alt:(b=e.alt)!==null&&b!==void 0?b:"",sizes:z,srcSet:D,src:e.src}),_!==Co&&$.createElement("div",{className:Ae(Kc(n2))},_===bs&&(n?.iconLoading?n.iconLoading():$.createElement(A2,{className:qt(Ae(Ji),Ae(Kc(bs)))})),_===ko&&(n?.iconError?n.iconError():$.createElement(D2,{className:qt(Ae(Ji),Ae(Kc(ko)))}))))}const L2=$.forwardRef(function({className:t,children:n,onFocus:r,onBlur:s,...o},i){const a=$.useRef(null),{trackFocusWithin:l}=jc();return $.createElement(w2,{nodeRef:a},$.createElement("div",{ref:Yc(i,a),className:qt(Ae("root"),t),...l(r,s),...o},n))});var Zt;(function(e){e[e.NONE=0]="NONE",e[e.SWIPE=1]="SWIPE",e[e.PULL=2]="PULL",e[e.ANIMATION=3]="ANIMATION"})(Zt||(Zt={}));function vp(e,t,n,r,s){$.useEffect(()=>s?()=>{}:xs(e(Yg,t),e(Kg,n),e(Xg,r),e(qg,r),e(Zg,r)),[e,t,n,r,s])}var Ln;(function(e){e[e.NONE=0]="NONE",e[e.SWIPE=1]="SWIPE",e[e.PULL=2]="PULL"})(Ln||(Ln={}));const qc=30;function P2({disableSwipeNavigation:e,closeOnBackdropClick:t},n,r,s,o,i,a,l,c,d,u,f,g,m,p,y){const b=$.useRef(0),_=$.useRef([]),x=$.useRef(void 0),M=$.useRef(0),S=$.useRef(Ln.NONE),k=$.useCallback(L=>{x.current===L.pointerId&&(x.current=void 0,S.current=Ln.NONE);const F=_.current;F.splice(0,F.length,...F.filter(A=>A.pointerId!==L.pointerId))},[]),N=$.useCallback(L=>{k(L),L.persist(),_.current.push(L)},[k]),C=$.useCallback(L=>_.current.find(({pointerId:F})=>L.pointerId===F),[]),w=Ye(L=>{N(L)}),E=(L,F)=>u&&L>F||d&&L<-F,T=Ye(L=>{const F=C(L);if(F)if(x.current===L.pointerId){const A=Date.now()-M.current,D=b.current;S.current===Ln.SWIPE?Math.abs(D)>.3*s||Math.abs(D)>5&&A<o?l(D,A):c(D):S.current===Ln.PULL&&(E(D,2*qc)?m(D,A):p(D)),b.current=0,S.current=Ln.NONE}else{const{target:A}=L;t&&A instanceof HTMLElement&&A===F.target&&(A.classList.contains(Ae(Ac))||A.classList.contains(Ae(Gg)))&&y()}k(L)}),P=Ye(L=>{const F=C(L);if(F){const A=x.current===L.pointerId;if(L.buttons===0){A&&b.current!==0?T(L):k(F);return}const D=L.clientX-F.clientX,O=L.clientY-F.clientY;if(x.current===void 0){const z=U=>{N(L),x.current=L.pointerId,M.current=Date.now(),S.current=U};Math.abs(D)>Math.abs(O)&&Math.abs(D)>qc&&r(D)?e||(z(Ln.SWIPE),i()):Math.abs(O)>Math.abs(D)&&E(O,qc)&&(z(Ln.PULL),f())}else A&&(S.current===Ln.SWIPE?(b.current=D,a(D)):S.current===Ln.PULL&&(b.current=O,g(O)))}});vp(n,w,P,T)}function $2({preventDefaultWheelX:e,preventDefaultWheelY:t}){const n=$.useRef(null),r=Ye(s=>{const o=Math.abs(s.deltaX)>Math.abs(s.deltaY);(o&&e||!o&&t||s.ctrlKey)&&s.preventDefault()});return $.useCallback(s=>{var o;s?s.addEventListener("wheel",r,{passive:!1}):(o=n.current)===null||o===void 0||o.removeEventListener("wheel",r),n.current=s},[r])}function F2(e,t,n,r,s,o,i,a,l){const c=$.useRef(0),d=$.useRef(0),u=$.useRef(void 0),f=$.useRef(void 0),g=$.useRef(0),m=$.useRef(void 0),p=$.useRef(0),{setTimeout:y,clearTimeout:b}=_o(),_=$.useCallback(()=>{u.current&&(b(u.current),u.current=void 0)},[b]),x=$.useCallback(()=>{f.current&&(b(f.current),f.current=void 0)},[b]),M=Ye(()=>{e!==Zt.SWIPE&&(c.current=0,p.current=0,_(),x())});$.useEffect(M,[e,M]);const S=Ye(N=>{f.current=void 0,c.current===N&&l(c.current)}),k=Ye(N=>{if(N.ctrlKey||Math.abs(N.deltaY)>Math.abs(N.deltaX))return;const C=w=>{g.current=w,b(m.current),m.current=w>0?y(()=>{g.current=0,m.current=void 0},300):void 0};if(e===Zt.NONE){if(Math.abs(N.deltaX)<=1.2*Math.abs(g.current)){C(N.deltaX);return}if(!n(-N.deltaX))return;if(d.current+=N.deltaX,_(),Math.abs(d.current)>30)d.current=0,C(0),p.current=Date.now(),o();else{const w=d.current;u.current=y(()=>{u.current=void 0,w===d.current&&(d.current=0)},s)}}else if(e===Zt.SWIPE){let w=c.current-N.deltaX;if(w=Math.min(Math.abs(w),r)*Math.sign(w),c.current=w,i(w),x(),Math.abs(w)>.2*r){C(N.deltaX),a(w,Date.now()-p.current);return}f.current=y(()=>S(w),2*s)}else C(N.deltaX)});$.useEffect(()=>t(Lc,k),[t,k])}const xp=Or("container"),wp=$.createContext(null),Pn=xn("useController","ControllerContext",wp);function z2({children:e,...t}){var n;const{carousel:r,animation:s,controller:o,on:i,styles:a,render:l}=t,{closeOnPullUp:c,closeOnPullDown:d,preventDefaultWheelX:u,preventDefaultWheelY:f}=o,[g,m]=$.useState(),p=kn(),y=C2(),[b,_]=$.useState(Zt.NONE),x=$.useRef(0),M=$.useRef(0),S=$.useRef(1),{registerSensors:k,subscribeSensors:N}=bp(),{subscribe:C,publish:w}=Cs(),E=na(),T=na(),P=na(),{containerRef:L,setContainerRef:F,containerRect:A}=gp(),D=Yc($2({preventDefaultWheelX:u,preventDefaultWheelY:f}),F),O=$.useRef(null),z=Yc(O,void 0),{getOwnerDocument:U}=ks(),j=ra(),Y=oe=>(j?-1:1)*(typeof oe=="number"?oe:1),B=Ye(()=>{var oe;return(oe=L.current)===null||oe===void 0?void 0:oe.focus()}),W=Ye(()=>t),G=Ye(()=>p),V=$.useCallback(oe=>w(pr,oe),[w]),X=$.useCallback(oe=>w(mr,oe),[w]),K=$.useCallback(()=>w(vs),[w]),Q=oe=>!(r.finite&&(Y(oe)>0&&p.currentIndex===0||Y(oe)<0&&p.currentIndex===p.slides.length-1)),ne=oe=>{var Te;x.current=oe,(Te=L.current)===null||Te===void 0||Te.style.setProperty(gt("swipe_offset"),`${Math.round(oe)}px`)},se=oe=>{var Te,Pe;M.current=oe,S.current=(()=>{const nt=d&&oe>0?oe:c&&oe<0?-oe:0;return Math.min(Math.max($c(1-nt/60*(1-.5),2),.5),1)})(),(Te=L.current)===null||Te===void 0||Te.style.setProperty(gt("pull_offset"),`${Math.round(oe)}px`),(Pe=L.current)===null||Pe===void 0||Pe.style.setProperty(gt("pull_opacity"),`${S.current}`)},{prepareAnimation:ue}=Gc(O,(oe,Te,Pe)=>{if(O.current&&A)return{keyframes:[{transform:`translate(0, ${oe.rect.y-Te.y+Pe.y}px)`,opacity:oe.opacity},{transform:"translate(0, 0)",opacity:1}],duration:oe.duration,easing:s.easing.fade}}),ee=(oe,Te)=>{if(c||d){se(oe);let Pe=0;O.current&&(Pe=s.fade*(Te?2:1),ue({rect:O.current.getBoundingClientRect(),opacity:S.current,duration:Pe})),P(()=>{se(0),_(Zt.NONE)},Pe),_(Zt.ANIMATION),Te||K()}},{prepareAnimation:me,isAnimationPlaying:ie}=Gc(O,(oe,Te,Pe)=>{var Fe;if(O.current&&A&&(!((Fe=p.animation)===null||Fe===void 0)&&Fe.duration)){const Ke=ea(r.spacing),nt=(Ke.percent?Ke.percent*A.width/100:Ke.pixel)||0;return{keyframes:[{transform:`translate(${Y(p.globalIndex-oe.index)*(A.width+nt)+oe.rect.x-Te.x+Pe.x}px, 0)`},{transform:"translate(0, 0)"}],duration:p.animation.duration,easing:p.animation.easing}}}),de=Ye(oe=>{var Te,Pe;const Fe=oe.offset||0,Ke=Fe?s.swipe:(Te=s.navigation)!==null&&Te!==void 0?Te:s.swipe,nt=!Fe&&!ie()?s.easing.navigation:s.easing.swipe;let{direction:dt}=oe;const We=(Pe=oe.count)!==null&&Pe!==void 0?Pe:1;let pt=Zt.ANIMATION,Ge=Ke*We;if(!dt){const pe=A?.width,we=oe.duration||0,xe=pe?Ke/pe*Math.abs(Fe):Ke;We!==0?(we<xe?Ge=Ge/xe*Math.max(we,xe/5):pe&&(Ge=Ke/pe*(pe-Math.abs(Fe))),dt=Y(Fe)>0?pr:mr):Ge=Ke/2}let te=0;dt===pr?Q(Y(1))?te=-We:(pt=Zt.NONE,Ge=Ke):dt===mr&&(Q(Y(-1))?te=We:(pt=Zt.NONE,Ge=Ke)),Ge=Math.round(Ge),T(()=>{ne(0),_(Zt.NONE)},Ge),O.current&&me({rect:O.current.getBoundingClientRect(),index:p.globalIndex}),_(pt),w(Dc,{type:"swipe",increment:te,duration:Ge,easing:nt})});$.useEffect(()=>{var oe,Te;!((oe=p.animation)===null||oe===void 0)&&oe.increment&&(!((Te=p.animation)===null||Te===void 0)&&Te.duration)&&E(()=>y({type:"swipe",increment:0}),p.animation.duration)},[p.animation,y,E]);const fe=[N,Q,A?.width||0,s.swipe,()=>_(Zt.SWIPE),oe=>ne(oe),(oe,Te)=>de({offset:oe,duration:Te,count:1}),oe=>de({offset:oe,count:0})],be=[()=>{d&&_(Zt.PULL)},oe=>se(oe),oe=>ee(oe),oe=>ee(oe,!0)];P2(o,...fe,c,d,...be,K),F2(b,...fe);const ge=Ye(()=>{o.focus&&U().querySelector(`.${Ae(Oc)} .${Ae(xp())}`)&&B()});$.useEffect(ge,[ge]);const Ce=Ye(()=>{var oe;(oe=i.view)===null||oe===void 0||oe.call(i,{index:p.currentIndex})});$.useEffect(Ce,[p.globalIndex,Ce]),$.useEffect(()=>xs(C(pr,oe=>de({direction:pr,...oe})),C(mr,oe=>de({direction:mr,...oe})),C(Dc,oe=>y(oe))),[C,de,y]);const je=$.useMemo(()=>({prev:V,next:X,close:K,focus:B,slideRect:A?g2(A,r.padding):{width:0,height:0},containerRect:A||{width:0,height:0},subscribeSensors:N,containerRef:L,setCarouselRef:z,toolbarWidth:g,setToolbarWidth:m}),[V,X,K,B,N,A,L,z,g,m,r.padding]);return $.useImperativeHandle(o.ref,()=>({prev:V,next:X,close:K,focus:B,getLightboxProps:W,getLightboxState:G}),[V,X,K,B,W,G]),$.createElement("div",{ref:D,className:qt(Ae(xp()),Ae(ys)),style:{...b===Zt.SWIPE?{[gt("swipe_offset")]:`${Math.round(x.current)}px`}:null,...b===Zt.PULL?{[gt("pull_offset")]:`${Math.round(M.current)}px`,[gt("pull_opacity")]:`${S.current}`}:null,...o.touchAction!=="none"?{[gt("controller_touch_action")]:o.touchAction}:null,...a.container},tabIndex:-1,...k},A&&$.createElement(wp.Provider,{value:je},e,(n=l.controls)===null||n===void 0?void 0:n.call(l)))}const V2=wn(vo,z2);function Ir(e){return Nr(Vg,e)}function kp(e){return Nr(Ac,e)}function H2({slide:e,offset:t}){const n=$.useRef(null),{currentIndex:r,slides:s}=kn(),{slideRect:o,focus:i}=Pn(),{render:a,carousel:{imageFit:l,imageProps:c},on:{click:d},styles:{slide:u},labels:f}=zt(),{getOwnerDocument:g}=ks(),m=t!==0;$.useEffect(()=>{var y;m&&(!((y=n.current)===null||y===void 0)&&y.contains(g().activeElement))&&i()},[m,i,g]);const p=()=>{var y,b,_,x;let M=(y=a.slide)===null||y===void 0?void 0:y.call(a,{slide:e,offset:t,rect:o});return!M&&Ar(e)&&(M=$.createElement(Dr,{slide:e,offset:t,render:a,rect:o,imageFit:l,imageProps:c,onClick:m?void 0:()=>d?.({index:r})})),M?$.createElement($.Fragment,null,(b=a.slideHeader)===null||b===void 0?void 0:b.call(a,{slide:e}),((_=a.slideContainer)!==null&&_!==void 0?_:(({children:S})=>S))({slide:e,children:M}),(x=a.slideFooter)===null||x===void 0?void 0:x.call(a,{slide:e})):null};return $.createElement("div",{ref:n,className:qt(Ae(kp()),!m&&Ae(kp("current")),Ae(ys)),...b2(m),style:u,role:"group","aria-roledescription":Tr(f,"Slide"),"aria-label":tp(f,s,r+t)},p())}function U2(){const e=zt().styles.slide;return $.createElement("div",{className:Ae(Ac),style:e})}function B2({carousel:e,labels:t}){const{slides:n,currentIndex:r,globalIndex:s}=kn(),{setCarouselRef:o}=Pn(),{autoPlaying:i,focusWithin:a}=jc(),l=ea(e.spacing),c=ea(e.padding),d=rp(e,n,1),u=[];if(Vc(n))for(let f=r-d;f<=r+d;f+=1){const g=Hc(n,f),m=s-r+f,p=e.finite&&(f<0||f>n.length-1);u.push(p?{key:m}:{key:[`${m}`,np(g)].filter(Boolean).join("|"),offset:f-r,slide:g})}return $.createElement("div",{ref:o,className:qt(Ae(Ir()),u.length>0&&Ae(Ir("with_slides"))),style:{[`${gt(Ir("slides_count"))}`]:u.length,[`${gt(Ir("spacing_px"))}`]:l.pixel||0,[`${gt(Ir("spacing_percent"))}`]:l.percent||0,[`${gt(Ir("padding_px"))}`]:c.pixel||0,[`${gt(Ir("padding_percent"))}`]:c.percent||0},role:"region","aria-live":i&&!a?"off":"polite","aria-roledescription":Tr(t,"Carousel"),"aria-label":Tr(t,"Photo gallery")},u.map(({key:f,slide:g,offset:m})=>g?$.createElement(H2,{key:f,slide:g,offset:m}):$.createElement(U2,{key:f})))}const j2=wn(Vg,B2);function Cp(){const{carousel:e}=zt(),{slides:t,currentIndex:n}=kn(),r=t.length===0||e.finite&&n===0,s=t.length===0||e.finite&&n===t.length-1;return{prevDisabled:r,nextDisabled:s}}function Sp(e){var t;const n=ra(),{publish:r}=Cs(),{animation:s}=zt(),{prevDisabled:o,nextDisabled:i}=Cp(),a=((t=s.navigation)!==null&&t!==void 0?t:s.swipe)/2,l=yp(()=>r(pr),a),c=yp(()=>r(mr),a),d=Ye(u=>{switch(u.key){case d2:r(vs);break;case u2:(n?i:o)||(n?c:l)();break;case f2:(n?o:i)||(n?l:c)();break}});$.useEffect(()=>e(Ic,d),[e,d])}function _p({label:e,icon:t,renderIcon:n,action:r,onClick:s,disabled:o,style:i}){return $.createElement(Ss,{label:e,icon:t,renderIcon:n,className:Ae(`navigation_${r}`),disabled:o,onClick:s,style:i,...mp(Pn().focus,o)})}function W2({render:{buttonPrev:e,buttonNext:t,iconPrev:n,iconNext:r},styles:s}){const{prev:o,next:i,subscribeSensors:a}=Pn(),{prevDisabled:l,nextDisabled:c}=Cp();return Sp(a),$.createElement($.Fragment,null,e?e():$.createElement(_p,{label:"Previous",action:pr,icon:O2,renderIcon:n,style:s.navigationPrev,disabled:l,onClick:o}),t?t():$.createElement(_p,{label:"Next",action:mr,icon:T2,renderIcon:r,style:s.navigationNext,disabled:c,onClick:i}))}const G2=wn(J_,W2),Ep=Ae(a2),Y2=Ae(Wg);function K2(e){return"style"in e}function Mp(e,t,n){const r=window.getComputedStyle(e),s=n?"padding-left":"padding-right",o=n?r.paddingLeft:r.paddingRight,i=e.style.getPropertyValue(s);return e.style.setProperty(s,`${(Ri(o)||0)+t}px`),()=>{i?e.style.setProperty(s,i):e.style.removeProperty(s)}}function X2({noScroll:{disabled:e},children:t}){const n=ra(),{getOwnerDocument:r,getOwnerWindow:s}=ks();return $.useEffect(()=>{if(e)return()=>{};const o=[],i=s(),{body:a,documentElement:l}=r(),c=Math.round(i.innerWidth-l.clientWidth);if(c>0){o.push(Mp(a,c,n));const d=a.getElementsByTagName("*");for(let u=0;u<d.length;u+=1){const f=d[u];K2(f)&&i.getComputedStyle(f).getPropertyValue("position")==="fixed"&&!f.classList.contains(Y2)&&o.push(Mp(f,c,n))}}return a.classList.add(Ep),()=>{a.classList.remove(Ep),o.forEach(d=>d())}},[n,e,r,s]),$.createElement($.Fragment,null,t)}const q2=wn(R_,X2);function Np(e){return Nr(Oc,e)}function Op(e,t,n){const r=e.getAttribute(t);return e.setAttribute(t,n),()=>{r?e.setAttribute(t,r):e.removeAttribute(t)}}function Z2({children:e,animation:t,styles:n,className:r,on:s,portal:o,close:i,labels:a}){const[l,c]=$.useState(!1),[d,u]=$.useState(!1),f=$.useRef([]),g=$.useRef(null),{setTimeout:m}=_o(),{subscribe:p}=Cs(),b=Wc()?0:t.fade;$.useEffect(()=>(c(!0),()=>{c(!1),u(!1)}),[]);const _=Ye(()=>{f.current.forEach(k=>k()),f.current=[]}),x=Ye(()=>{var k;u(!1),_(),(k=s.exiting)===null||k===void 0||k.call(s),m(()=>{var N;(N=s.exited)===null||N===void 0||N.call(s),i()},b)});$.useEffect(()=>p(vs,x),[p,x]);const M=Ye(k=>{var N,C,w;y2(k),u(!0),(N=s.entering)===null||N===void 0||N.call(s);const E=(w=(C=k.parentNode)===null||C===void 0?void 0:C.children)!==null&&w!==void 0?w:[];for(let T=0;T<E.length;T+=1){const P=E[T];["TEMPLATE","SCRIPT","STYLE"].indexOf(P.tagName)===-1&&P!==k&&(f.current.push(Op(P,"inert","")),f.current.push(Op(P,"aria-hidden","true")))}f.current.push(()=>{var T,P;(P=(T=g.current)===null||T===void 0?void 0:T.focus)===null||P===void 0||P.call(T)}),m(()=>{var T;(T=s.entered)===null||T===void 0||T.call(s)},b)}),S=$.useCallback(k=>{k?M(k):_()},[M,_]);return l?Vn.createPortal($.createElement(L2,{ref:S,className:qt(r,Ae(Np()),Ae(Wg),d&&Ae(Np("open"))),"aria-modal":!0,role:"dialog","aria-label":Tr(a,"Lightbox"),style:{...t.fade!==Bc.animation.fade?{[gt("fade_animation_duration")]:`${b}ms`}:null,...t.easing.fade!==Bc.animation.easing.fade?{[gt("fade_animation_timing_function")]:t.easing.fade}:null,...n.root},onFocus:k=>{g.current||(g.current=k.relatedTarget)}},e),o.root||document.body):null}const Q2=wn(Oc,Z2);function J2({children:e}){return $.createElement($.Fragment,null,e)}const R2=wn(e2,J2);function eE(e){return Nr(Hg,e)}function tE({toolbar:{buttons:e},render:{buttonClose:t,iconClose:n},styles:r}){const{close:s,setToolbarWidth:o}=Pn(),{setContainerRef:i,containerRect:a}=gp();In(()=>{o(a?.width)},[o,a?.width]);const l=()=>t?t():$.createElement(Ss,{key:vs,label:"Close",icon:N2,renderIcon:n,onClick:s});return $.createElement("div",{ref:i,style:r.toolbar,className:Ae(eE())},e?.map(c=>c===vs?l():c))}const nE=wn(Hg,tE);function Tp(e,t){var n;return $.createElement(e.module.component,{key:e.module.name,...t},(n=e.children)===null||n===void 0?void 0:n.map(r=>Tp(r,t)))}function rE(e,t={}){const{easing:n,...r}=e,{easing:s,...o}=t;return{easing:{...n,...s},...r,...o}}function sE({carousel:e,animation:t,render:n,toolbar:r,controller:s,noScroll:o,on:i,plugins:a,slides:l,index:c,...d}){const{animation:u,carousel:f,render:g,toolbar:m,controller:p,noScroll:y,on:b,slides:_,index:x,plugins:M,...S}=Bc,{config:k,augmentation:N}=v2([Ft(Q2,[Ft(q2,[Ft(V2,[Ft(j2),Ft(nE),Ft(G2)])])])],a||M),C=N({animation:rE(u,t),carousel:{...f,...e},render:{...g,...n},toolbar:{...m,...r},controller:{...p,...s},noScroll:{...y,...o},on:{...b,...i},...S,...d});return C.open?$.createElement(cp,{...C},$.createElement(_2,{slides:l||_,index:Ri(c||x)},$.createElement(E2,null,$.createElement(k2,null,$.createElement(x2,null,Tp(Ft(R2,k),C)))))):null}const oE={minZoom:1,maxZoomPixelRatio:1,zoomInMultiplier:2,doubleTapDelay:300,doubleClickDelay:500,doubleClickMaxStops:2,keyboardMoveDistance:50,wheelZoomDistanceFactor:100,pinchZoomDistanceFactor:100,pinchZoomV4:!1,scrollToZoom:!1};function iE(e){return Math.min(Math.max(e,Number.EPSILON),1)}function Ap(e){const{minZoom:t,...n}={...oE,...e};return{minZoom:iE(t),...n}}function aE(e,t,n,r){const s=$.useRef(void 0),o=$.useRef(void 0),{zoom:i}=zt().animation,a=Wc(),l=Ye(()=>{var c,d,u;if((c=s.current)===null||c===void 0||c.cancel(),s.current=void 0,o.current&&r?.current){try{s.current=(u=(d=r.current).animate)===null||u===void 0?void 0:u.call(d,[{transform:o.current},{transform:`scale(${e}) translateX(${t}px) translateY(${n}px)`}],{duration:a?0:i??500,easing:s.current?"ease-out":"ease-in-out"})}catch(f){console.error(f)}o.current=void 0,s.current&&(s.current.onfinish=()=>{s.current=void 0})}});return In(l,[e,t,n,l]),$.useCallback(()=>{o.current=r?.current?window.getComputedStyle(r.current).transform:void 0},[r])}function lE(e,t){const{on:n}=zt(),r=Ye(()=>{var s;t||(s=n.zoom)===null||s===void 0||s.call(n,{zoom:e})});$.useEffect(r,[e,r])}function sa(){const{zoom:e}=zt();return Ap(e)}function cE(e,t){var n,r;let s={width:0,height:0},o={width:0,height:0};const{currentSlide:i}=kn(),{imageFit:a}=zt().carousel,{maxZoomPixelRatio:l}=sa();if(e&&i){const d={...i,...t};if(Ar(d)){const u=Fc(d,a),f=Math.max(...(((n=d.srcSet)===null||n===void 0?void 0:n.map(m=>m.width))||[]).concat(d.width?[d.width]:[])),g=Math.max(...(((r=d.srcSet)===null||r===void 0?void 0:r.map(m=>m.height))||[]).concat(d.height?[d.height]:[]));f>0&&g>0&&e.width>0&&e.height>0&&(o=u?{width:Math.round(Math.min(f,e.width/e.height*g)),height:Math.round(Math.min(g,e.height/e.width*f))}:{width:f,height:g},o={width:o.width*l,height:o.height*l},s=u?{width:Math.min(e.width,o.width,f),height:Math.min(e.height,o.height,g)}:{width:Math.round(Math.min(e.width,e.height/g*f,f)),height:Math.round(Math.min(e.height,e.width/f*g,g))})}}const c=s.width?Math.max($c(o.width/s.width,5),1):1;return{imageRect:s,maxZoom:c}}function Dp(e,t){return Math.hypot(e.clientX-t.clientX,e.clientY-t.clientY)}function Ip(e,t,n=100,r=2){return e*Math.min(1+Math.abs(t/n),r)**Math.sign(t)}function dE(e,t,n,r,s,o,i,a,l){const c=$.useRef([]),d=$.useRef(0),u=$.useRef(void 0),{globalIndex:f}=kn(),{getOwnerWindow:g}=ks(),{containerRef:m,subscribeSensors:p}=Pn(),{keyboardMoveDistance:y,zoomInMultiplier:b,wheelZoomDistanceFactor:_,scrollToZoom:x,doubleTapDelay:M,doubleClickDelay:S,doubleClickMaxStops:k,pinchZoomDistanceFactor:N,pinchZoomV4:C}=sa(),w=$.useCallback(z=>{if(m.current){const{pageX:U,pageY:j}=z,{scrollX:Y,scrollY:B}=g(),{left:W,top:G,width:V,height:X}=m.current.getBoundingClientRect();return[U-W-Y-V/2,j-G-B-X/2]}return[]},[m,g]),E=Ye(z=>{const{key:U,metaKey:j,ctrlKey:Y}=z,B=j||Y,W=()=>{z.preventDefault(),z.stopPropagation()};if(e>1){const G=(V,X)=>{W(),a(V,X)};U==="ArrowDown"?G(0,y):U==="ArrowUp"?G(0,-y):U==="ArrowLeft"?G(-y,0):U==="ArrowRight"&&G(y,0)}U==="+"||B&&U==="="?(W(),s()):U==="-"||B&&U==="_"?(W(),o()):B&&U==="0"&&(W(),i(1))}),T=Ye(z=>{if((z.ctrlKey||x)&&Math.abs(z.deltaY)>Math.abs(z.deltaX)){z.stopPropagation(),i(Ip(e,-z.deltaY,_),!0,...w(z));return}e>1&&(z.stopPropagation(),x||a(z.deltaX,z.deltaY))}),P=$.useCallback(z=>{const U=c.current;U.splice(0,U.length,...U.filter(j=>j.pointerId!==z.pointerId))},[]),L=$.useCallback(z=>{P(z),z.persist(),c.current.push(z)},[P]),F=Ye(z=>{var U;const j=c.current;if(z.pointerType==="mouse"&&z.buttons>1||!(!((U=l?.current)===null||U===void 0)&&U.contains(z.target)))return;e>1&&z.stopPropagation();const{timeStamp:Y}=z;if(j.length===0&&Y-d.current<(z.pointerType==="touch"?M:S)){d.current=0;const B=e>=1?e!==n?e*Math.max(n**(1/k),b):1:e!==t?e/Math.max(t**(-1/k),b):1;i(B,!1,...w(z))}else d.current=Y;if(L(z),j.length===2){const B=Dp(j[0],j[1]);u.current={previousDistance:B,initialDistance:Math.max(B,1),initialZoom:e}}}),A=Ye(z=>{const U=c.current,j=U.find(Y=>Y.pointerId===z.pointerId);if(U.length===2&&u.current){z.stopPropagation(),L(z);const Y=Dp(U[0],U[1]),B=C?u.current.initialZoom/u.current.initialDistance*Y:Ip(e,Y-u.current.previousDistance,N);i(B,!0,...U.map(W=>w(W)).reduce((W,G)=>G.map((V,X)=>W[X]+V/2))),u.current.previousDistance=Y;return}e>1&&(z.stopPropagation(),j&&(U.length===1&&a((j.clientX-z.clientX)/e,(j.clientY-z.clientY)/e),L(z)))}),D=$.useCallback(z=>{const U=c.current;U.length===2&&U.find(j=>j.pointerId===z.pointerId)&&(u.current=void 0),P(z)},[P]),O=$.useCallback(()=>{const z=c.current;z.splice(0,z.length),d.current=0,u.current=void 0},[]);vp(p,F,A,D,r),$.useEffect(O,[f,O]),$.useEffect(()=>r?()=>{}:xs(O,p(Ic,E),p(Lc,T)),[r,p,O,E,T])}function uE(e,t,n){const[r,s]=$.useState(1),[o,i]=$.useState(0),[a,l]=$.useState(0),c=aE(r,o,a,n),{currentSlide:d,globalIndex:u}=kn(),{containerRect:f,slideRect:g}=Pn(),{minZoom:m,zoomInMultiplier:p}=sa(),y=d&&Ar(d)?d.src:void 0,b=!y||!n?.current;In(()=>{s(1),i(0),l(0)},[u,y]);const _=$.useCallback((N,C,w)=>{const E=w||r,T=o-(N||0),P=a-(C||0),L=(e.width*E-g.width)/2/E,F=(e.height*E-g.height)/2/E;i(Math.min(Math.abs(T),Math.max(L,0))*Math.sign(T)),l(Math.min(Math.abs(P),Math.max(F,0))*Math.sign(P))},[r,o,a,g,e.width,e.height]),x=$.useCallback((N,C,w,E)=>{const T=$c(N+.01<t?N-.01>m?N:m:t,5);C||c(),_(w?w*(1/r-1/T):0,E?E*(1/r-1/T):0,T),s(T)},[r,m,t,_,c]),M=Ye(()=>{r>1&&(r>t&&x(t,!0),_())});In(M,[f.width,f.height,M]);const S=$.useCallback(()=>{const N=r*p;x(r<1&&N>1?1:N)},[r,p,x]),k=$.useCallback(()=>{const N=r/p;x(r>1&&N<1?1:N)},[r,p,x]);return{zoom:r,offsetX:o,offsetY:a,disabled:b,changeOffsets:_,changeZoom:x,zoomIn:S,zoomOut:k}}const Lp=$.createContext(null),Zc=xn("useZoom","ZoomControllerContext",Lp);function fE({children:e}){const[t,n]=$.useState(),{slideRect:r}=Pn(),{ref:s,minZoom:o}=sa(),{imageRect:i,maxZoom:a}=cE(r,t?.imageDimensions),{zoom:l,offsetX:c,offsetY:d,disabled:u,changeZoom:f,changeOffsets:g,zoomIn:m,zoomOut:p}=uE(i,a,t?.zoomWrapperRef);lE(l,u),dE(l,o,a,u,m,p,f,g,t?.zoomWrapperRef);const y=$.useMemo(()=>({zoom:l,minZoom:o,maxZoom:a,offsetX:c,offsetY:d,disabled:u,zoomIn:m,zoomOut:p,changeZoom:f}),[l,o,a,c,d,u,m,p,f]);$.useImperativeHandle(s,()=>y,[y]);const b=$.useMemo(()=>({...y,setZoomWrapper:n}),[y,n]);return $.createElement(Lp.Provider,{value:b},e)}const hE=an("ZoomIn",$.createElement($.Fragment,null,$.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),$.createElement("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"}))),gE=an("ZoomOut",$.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"})),Pp=$.forwardRef(function({zoomIn:t,onLoseFocus:n},r){const s=$.useRef(!1),o=$.useRef(!1),{zoom:i,minZoom:a,maxZoom:l,zoomIn:c,zoomOut:d,disabled:u}=Zc(),{render:f}=zt(),g=u||(t?i>=l:i<=a);return $.useEffect(()=>{g&&s.current&&o.current&&n(),g||(s.current=!0)},[g,n]),$.createElement(Ss,{ref:r,disabled:g,label:t?"Zoom in":"Zoom out",icon:t?hE:gE,renderIcon:t?f.iconZoomIn:f.iconZoomOut,onClick:t?c:d,onFocus:()=>{o.current=!0},onBlur:()=>{o.current=!1}})});function pE(){const e=$.useRef(null),t=$.useRef(null),{focus:n}=Pn(),r=$.useCallback(i=>{var a,l;!((a=i.current)===null||a===void 0)&&a.disabled?n():(l=i.current)===null||l===void 0||l.focus()},[n]),s=$.useCallback(()=>r(e),[r]),o=$.useCallback(()=>r(t),[r]);return $.createElement($.Fragment,null,$.createElement(Pp,{zoomIn:!0,ref:e,onLoseFocus:o}),$.createElement(Pp,{ref:t,onLoseFocus:s}))}function mE(){const{render:e}=zt(),t=Zc();return e.buttonZoom?$.createElement($.Fragment,null,e.buttonZoom(t)):$.createElement(pE,null)}function bE(e){var t;return(((t=e.srcSet)===null||t===void 0?void 0:t.length)||0)>0}function yE({current:e,preload:t},{type:n,source:r}){switch(n){case"fetch":return e?{current:e,preload:r}:{current:r};case"done":return r===t?{current:r}:{current:e,preload:t};default:throw new Error(Rg)}}function vE(e){var t,n;const[{current:r,preload:s},o]=$.useReducer(yE,{}),{slide:i,rect:a,imageFit:l,render:c,interactive:d}=e,u=i.srcSet.sort((S,k)=>S.width-k.width),f=(t=i.width)!==null&&t!==void 0?t:u[u.length-1].width,g=(n=i.height)!==null&&n!==void 0?n:u[u.length-1].height,m=Fc(i,l),p=Math.max(...u.map(S=>S.width)),y=Math.min((m?Math.max:Math.min)(a.width,f*(a.height/g)),p),b=p2(),_=Ye(()=>{var S;const k=(S=u.find(N=>N.width>=y*b))!==null&&S!==void 0?S:u[u.length-1];(!r||u.findIndex(N=>N.src===r)<u.findIndex(N=>N===k))&&o({type:"fetch",source:k.src})});In(_,[a.width,a.height,b,_]);const x=Ye(S=>o({type:"done",source:S})),M={WebkitTransform:d?"initial":"translateZ(0)"};return m||Object.assign(M,a.width/a.height<f/g?{width:"100%",height:"auto"}:{width:"auto",height:"100%"}),$.createElement($.Fragment,null,s&&s!==r&&$.createElement(Dr,{key:"preload",...e,offset:void 0,slide:{...i,src:s,srcSet:void 0},style:{position:"absolute",visibility:"hidden",...M},onLoad:()=>x(s),render:{...c,iconLoading:()=>null,iconError:()=>null}}),r&&$.createElement(Dr,{key:"current",...e,slide:{...i,src:r,srcSet:void 0},style:M}))}function xE({render:e,slide:t,offset:n,rect:r}){var s;const[o,i]=$.useState(),a=$.useRef(null),{zoom:l,maxZoom:c,offsetX:d,offsetY:u,setZoomWrapper:f}=Zc(),g=l>1,{carousel:m,on:p}=zt(),{currentIndex:y}=kn();In(()=>n===0?(f({zoomWrapperRef:a,imageDimensions:o}),()=>f(void 0)):()=>{},[n,o,f]);let b=(s=e.slide)===null||s===void 0?void 0:s.call(e,{slide:t,offset:n,rect:r,zoom:l,maxZoom:c});if(!b&&Ar(t)){const _={slide:t,offset:n,rect:r,render:e,imageFit:m.imageFit,imageProps:m.imageProps,onClick:n===0?()=>{var x;return(x=p.click)===null||x===void 0?void 0:x.call(p,{index:y})}:void 0};b=bE(t)?$.createElement(vE,{..._,slide:t,interactive:g,rect:n===0?{width:r.width*l,height:r.height*l}:r}):$.createElement(Dr,{onLoad:x=>i({width:x.naturalWidth,height:x.naturalHeight}),..._})}return b?$.createElement("div",{ref:a,className:qt(Ae(jg),Ae(ys),Ae(Gg),g&&Ae(l2)),style:n===0?{transform:`scale(${l}) translateX(${d}px) translateY(${u}px)`}:void 0},b):null}const wE=({augment:e,addModule:t})=>{e(({zoom:n,toolbar:r,render:s,controller:o,...i})=>{const a=Ap(n);return{zoom:a,toolbar:ta(r,Bg,$.createElement(mE,null)),render:{...s,slide:l=>{var c;return Ar(l.slide)?$.createElement(xE,{render:s,...l}):(c=s.slide)===null||c===void 0?void 0:c.call(s,l)}},controller:{...o,preventDefaultWheelY:a.scrollToZoom},...i}}),t(wn(Bg,fE))},kE={separator:"/",container:{}},$p=e=>({...kE,...e});function CE({counter:e}){const{slides:t,currentIndex:n}=kn(),{separator:r,container:{className:s,...o},className:i,...a}=$p(e);return t.length===0?null:$.createElement("div",{className:qt(Ae("counter"),s||i),...a,...o,"aria-hidden":!0},n+1," ",r," ",t.length)}function SE({augment:e,addChild:t}){e(({counter:n,...r})=>({counter:$p(n),...r})),t(vo,wn(t2,CE))}const _E={autoplay:!1,delay:3e3,ref:null},Fp=e=>({..._E,...e}),zp=$.createContext(null),EE=xn("useSlideshow","SlideshowContext",zp);function ME({slideshow:e,carousel:{finite:t},on:n,children:r}){const{autoplay:s,delay:o,ref:i}=Fp(e),a=$.useRef(s),[l,c]=$.useState(s),d=$.useRef(void 0),u=$.useRef(void 0),{slides:f,currentIndex:g}=kn(),{setTimeout:m,clearTimeout:p}=_o(),{subscribe:y}=Cs(),{next:b}=Pn(),{setAutoPlaying:_}=jc();$.useEffect(()=>_(l),[l,_]);const x=f.length===0||t&&g===f.length-1,M=$.useCallback(()=>{!l&&!x&&c(!0)},[l,x]),S=$.useCallback(()=>{l&&c(!1)},[l]),k=$.useCallback(()=>{p(d.current),d.current=void 0},[p]),N=Ye(()=>{k(),!(!l||x||u.current===bs||u.current===Tc)&&(d.current=m(()=>{l&&(u.current=void 0,b())},o))});$.useEffect(N,[g,l,N]),$.useEffect(()=>{l&&x&&c(!1)},[g,l,x]);const C=Ye(()=>{var T;return(T=n.slideshowStart)===null||T===void 0?void 0:T.call(n)}),w=Ye(()=>{var T;return(T=n.slideshowStop)===null||T===void 0?void 0:T.call(n)});$.useEffect(()=>{l?C():a.current&&w(),a.current=l},[l,C,w]),$.useEffect(()=>xs(k,y(r2,()=>{u.current=bs,k()}),y(s2,()=>{u.current=Tc,k()}),y(o2,()=>{u.current=ko,N()}),y(i2,()=>{u.current=Co,N()})),[y,k,N]);const E=$.useMemo(()=>({playing:l,disabled:x,play:M,pause:S}),[l,x,M,S]);return $.useImperativeHandle(i,()=>E,[E]),$.createElement(zp.Provider,{value:E},r)}const NE=an("Play",$.createElement("path",{d:"M8 5v14l11-7z"})),OE=an("Pause",$.createElement("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"}));function TE(){const{playing:e,disabled:t,play:n,pause:r}=EE(),{render:s}=zt(),o=mp(Pn().focus,t);return s.buttonSlideshow?$.createElement($.Fragment,null,s.buttonSlideshow({playing:e,disabled:t,play:n,pause:r})):$.createElement(Ss,{label:e?"Pause":"Play",icon:e?OE:NE,renderIcon:e?s.iconSlideshowPause:s.iconSlideshowPlay,onClick:e?r:n,disabled:t,...o})}function AE({augment:e,addModule:t}){e(({slideshow:n,toolbar:r,...s})=>({toolbar:ta(r,Ug,$.createElement(TE,null)),slideshow:Fp(n),...s})),t(wn(Ug,ME))}const DE={auto:!1,ref:null},Vp=e=>({...DE,...e}),Hp=$.createContext(null),IE=xn("useFullscreen","FullscreenContext",Hp);function LE({fullscreen:e,on:t,children:n}){const{auto:r,ref:s}=Vp(e),o=$.useRef(null),[i,a]=$.useState(),[l,c]=$.useState(!1),d=$.useRef(!1),{getOwnerDocument:u}=ks();In(()=>{var x,M,S,k;const N=u();a(!((k=(S=(M=(x=N.fullscreenEnabled)!==null&&x!==void 0?x:N.webkitFullscreenEnabled)!==null&&M!==void 0?M:N.mozFullScreenEnabled)!==null&&S!==void 0?S:N.msFullscreenEnabled)!==null&&k!==void 0&&k))},[u]);const f=$.useCallback(()=>{var x;const M=u(),S=M.fullscreenElement||M.webkitFullscreenElement||M.mozFullScreenElement||M.msFullscreenElement;return((x=S?.shadowRoot)===null||x===void 0?void 0:x.fullscreenElement)||S},[u]),g=$.useCallback(()=>{const x=o.current;try{x.requestFullscreen?x.requestFullscreen().catch(()=>{}):x.webkitRequestFullscreen?x.webkitRequestFullscreen():x.mozRequestFullScreen?x.mozRequestFullScreen():x.msRequestFullscreen&&x.msRequestFullscreen()}catch{}},[]),m=$.useCallback(()=>{if(!f())return;const x=u();try{x.exitFullscreen?x.exitFullscreen().catch(()=>{}):x.webkitExitFullscreen?x.webkitExitFullscreen():x.mozCancelFullScreen?x.mozCancelFullScreen():x.msExitFullscreen&&x.msExitFullscreen()}catch{}},[f,u]);$.useEffect(()=>{const x=u(),M=()=>{c(f()===o.current)};return xs(...["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"].map(S=>(x.addEventListener(S,M),()=>x.removeEventListener(S,M))))},[f,u]);const p=Ye(()=>{var x;return(x=t.enterFullscreen)===null||x===void 0?void 0:x.call(t)}),y=Ye(()=>{var x;return(x=t.exitFullscreen)===null||x===void 0?void 0:x.call(t)});$.useEffect(()=>{l&&(d.current=!0),d.current&&(l?p:y)()},[l,p,y]);const b=Ye(()=>{var x;return(x=r?g:null)===null||x===void 0||x(),m});$.useEffect(b,[b]);const _=$.useMemo(()=>({fullscreen:l,disabled:i,enter:g,exit:m}),[l,i,g,m]);return $.useImperativeHandle(s,()=>_,[_]),$.createElement("div",{ref:o,className:qt(Ae(xo),Ae(jg))},$.createElement(Hp.Provider,{value:_},n))}const PE=an("EnterFullscreen",$.createElement("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})),$E=an("ExitFullscreen",$.createElement("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}));function FE(){var e;const{fullscreen:t,disabled:n,enter:r,exit:s}=IE(),{render:o}=zt();return n?null:o.buttonFullscreen?$.createElement($.Fragment,null,(e=o.buttonFullscreen)===null||e===void 0?void 0:e.call(o,{fullscreen:t,disabled:n,enter:r,exit:s})):$.createElement(Ss,{disabled:n,label:t?"Exit Fullscreen":"Enter Fullscreen",icon:t?$E:PE,renderIcon:t?o.iconExitFullscreen:o.iconEnterFullscreen,onClick:t?s:r})}function zE({augment:e,contains:t,addParent:n}){e(({fullscreen:r,toolbar:s,...o})=>({toolbar:ta(s,xo,$.createElement(FE,null)),fullscreen:Vp(r),...o})),n(t(wo)?wo:vo,wn(xo,LE))}const Lr={ref:null,position:"bottom",width:120,height:80,border:1,borderRadius:4,padding:4,gap:16,imageFit:"contain",vignette:!0,hidden:!1,showToggle:!1},Qc=e=>({...Lr,...e});function Up(){const{thumbnails:e}=zt();return Qc(e)}const Pr=e=>Nr(wo,e),Vt=e=>Pr(Nr("thumbnail",e)),VE=an("VideoThumbnail",$.createElement("path",{d:"M10 16.5l6-4.5-6-4.5v9zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"})),HE=an("UnknownThumbnail",$.createElement("path",{d:"M23 18V6c0-1.1-.9-2-2-2H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zM8.5 12.5l2.5 3.01L14.5 11l4.5 6H5l3.5-4.5z"}));function UE({slide:e,render:t,rect:n,imageFit:r}){var s;const o=(s=t.thumbnail)===null||s===void 0?void 0:s.call(t,{slide:e,render:t,rect:n,imageFit:r});if(o)return o;const i={render:t,rect:n,imageFit:r};if(e.thumbnail)return $.createElement(Dr,{slide:{src:e.thumbnail},...i});if(Ar(e))return $.createElement(Dr,{slide:e,...i});const a=Ae(Vt(Ji));return e.type==="video"?$.createElement($.Fragment,null,e.poster&&$.createElement(Dr,{slide:{src:e.poster},...i}),$.createElement(VE,{className:a})):$.createElement(HE,{className:a})}const BE=Or("active"),Jc=Or("fadein"),Rc=Or("fadeout"),jE=Or("placeholder"),Bp="delay",jp="duration";function WE({slide:e,index:t,onClick:n,fadeIn:r,fadeOut:s,placeholder:o,onLoseFocus:i}){const a=$.useRef(null),{render:l,styles:c,labels:d}=zt(),{slides:u,globalIndex:f}=kn(),{getOwnerDocument:g}=ks(),{width:m,height:p,imageFit:y}=Up(),b={width:m,height:p},_=t===f,x=Ye(i);return $.useEffect(()=>{s&&g().activeElement===a.current&&x()},[s,x,g]),$.createElement("button",{ref:a,type:"button",className:qt(Ae(ys),Ae(Vt()),_&&Ae(Vt(BE())),r&&Ae(Vt(Jc())),s&&Ae(Vt(Rc())),o&&Ae(Vt(jE()))),style:{...r?{[gt(Vt(Jc(jp)))]:`${r.duration}ms`,[gt(Vt(Jc(Bp)))]:`${r.delay}ms`}:null,...s?{[gt(Vt(Rc(jp)))]:`${s.duration}ms`,[gt(Vt(Rc(Bp)))]:`${s.delay}ms`}:null,...c.thumbnail},onClick:n,"aria-current":_?!0:void 0,"aria-label":tp(d,u,t)},e&&UE({slide:e,render:l,rect:b,imageFit:y}))}function Wp(e){return["top","bottom"].includes(e)}function Gp(e,t){return t+2*(e.border+e.padding)+e.gap}function GE(e){const{thumbnail:t,poster:n}=e||{thumbnail:"placeholder"};return typeof t=="string"&&t||typeof n=="string"&&n||e&&np(e)||void 0}function Yp({visible:e,containerRef:t}){const n=$.useRef(null),r=ra(),{publish:s,subscribe:o}=Cs(),{carousel:i,styles:a,labels:l}=zt(),{slides:c,globalIndex:d,animation:u}=kn(),{registerSensors:f,subscribeSensors:g}=bp();Sp(g);const m=Up(),{position:p,width:y,height:b,border:_,borderStyle:x,borderColor:M,borderRadius:S,padding:k,gap:N,vignette:C}=m,w=u?.duration!==void 0&&u?.increment||0,E=u?.duration||0,{prepareAnimation:T}=Gc(n,D=>({keyframes:Wp(p)?[{transform:`translateX(${(r?-1:1)*Gp(m,y)*w+D}px)`},{transform:"translateX(0)"}]:[{transform:`translateY(${Gp(m,b)*w+D}px)`},{transform:"translateY(0)"}],duration:E,easing:u?.easing})),P=Ye(()=>{let D=0;if(t.current&&n.current){const O=t.current.getBoundingClientRect(),z=n.current.getBoundingClientRect();D=Wp(p)?z.left-O.left-(O.width-z.width)/2:z.top-O.top-(O.height-z.height)/2}T(D)});$.useEffect(()=>xs(o(Dc,P)),[o,P]);const L=rp(i,c),F=[];if(Vc(c))for(let D=d-L-Math.abs(w);D<=d+L+Math.abs(w);D+=1){const z=i.finite&&(D<0||D>c.length-1)||w<0&&D<d-L||w>0&&D>d+L?null:Hc(c,D),U=[`${D}`,GE(z)].filter(Boolean).join("|");F.push({key:U,index:D,slide:z})}const A=D=>()=>{D>d?s(mr,{count:D-d}):D<d&&s(pr,{count:d-D})};return $.createElement("div",{className:qt(Ae(Pr("container")),Ae(ys)),style:{...e?null:{display:"none"},...y!==Lr.width?{[gt(Vt("width"))]:`${y}px`}:null,...b!==Lr.height?{[gt(Vt("height"))]:`${b}px`}:null,..._!==Lr.border?{[gt(Vt("border"))]:`${_}px`}:null,...x?{[gt(Vt("border_style"))]:x}:null,...M?{[gt(Vt("border_color"))]:M}:null,...S!==Lr.borderRadius?{[gt(Vt("border_radius"))]:`${S}px`}:null,...k!==Lr.padding?{[gt(Vt("padding"))]:`${k}px`}:null,...N!==Lr.gap?{[gt(Vt("gap"))]:`${N}px`}:null,...a.thumbnailsContainer}},$.createElement("nav",{ref:n,style:a.thumbnailsTrack,className:qt(Ae(Pr("track")),Ae(ys)),"aria-label":Tr(l,"Thumbnails"),tabIndex:-1,...f},F.map(({key:D,index:O,slide:z})=>{const U=E/Math.abs(w||1),j=w>0&&O>d+L-w&&O<=d+L||w<0&&O<d-L-w&&O>=d-L?{duration:U,delay:((w>0?O-(d+L-w):d-L-w-O)-1)*U}:void 0,Y=w>0&&O<d-L||w<0&&O>d+L?{duration:U,delay:(w>0?w-(d-L-O):-w-(O-(d+L)))*U}:void 0;return $.createElement(WE,{key:D,index:O,slide:z,fadeIn:j,fadeOut:Y,placeholder:!z,onClick:A(O),onLoseFocus:()=>{var B;return(B=n.current)===null||B===void 0?void 0:B.focus()}})})),C&&$.createElement("div",{className:Ae(Pr("vignette"))}))}const Kp=$.createContext(null),YE=xn("useThumbnails","ThumbnailsContext",Kp);function KE({children:e,...t}){const{ref:n,position:r,hidden:s}=Qc(t.thumbnails),[o,i]=$.useState(!s),a=$.useRef(null),l=$.useMemo(()=>({visible:o,show:()=>i(!0),hide:()=>i(!1)}),[o]);return $.useImperativeHandle(n,()=>l,[l]),$.createElement(cp,{...t},$.createElement(Kp.Provider,{value:l},$.createElement("div",{ref:a,className:qt(Ae(Pr()),Ae(Pr(`${r}`)))},["start","top"].includes(r)&&$.createElement(Yp,{containerRef:a,visible:o}),$.createElement("div",{className:Ae(Pr("wrapper"))},e),["end","bottom"].includes(r)&&$.createElement(Yp,{containerRef:a,visible:o}))))}const Xp=()=>$.createElement($.Fragment,null,$.createElement("path",{strokeWidth:2,stroke:"currentColor",strokeLinejoin:"round",fill:"none",d:"M3 5l18 0l0 14l-18 0l0-14z"}),$.createElement("path",{d:"M5 14h4v3h-4zM10 14h4v3h-4zM15 14h4v3h-4z"})),XE=an("ThumbnailsVisible",Xp()),qE=M2("ThumbnailsHidden",Xp());function ZE(){const{visible:e,show:t,hide:n}=YE(),{render:r}=zt();return r.buttonThumbnails?$.createElement($.Fragment,null,r.buttonThumbnails({visible:e,show:t,hide:n})):$.createElement(Ss,{label:e?"Hide thumbnails":"Show thumbnails",icon:e?XE:qE,renderIcon:e?r.iconThumbnailsVisible:r.iconThumbnailsHidden,onClick:e?n:t})}function QE({augment:e,contains:t,append:n,addParent:r}){e(({thumbnails:o,toolbar:i,...a})=>{const l=Qc(o);return{toolbar:ta(i,wo,l.showToggle?$.createElement(ZE,null):null),thumbnails:l,...a}});const s=wn(wo,KE);t(xo)?n(xo,s):r(vo,s)}const ed=e=>{if(!e||typeof window>"u"||!window.location||!/^(https?:)?\/\//i.test(e))return!1;try{return new URL(e,window.location.href).origin!==window.location.origin}catch{return!1}},JE=window.G7Core?.createLogger?.("Comp:ImageGallery")??{log:(...e)=>console.log("[Comp:ImageGallery]",...e),warn:(...e)=>console.warn("[Comp:ImageGallery]",...e),error:(...e)=>console.error("[Comp:ImageGallery]",...e)},td=window.G7Core,oa=(e,t)=>td?.t?.(e,t)??e,RE=async(e,t)=>{try{const n=await td.api.get(e,{responseType:"blob"});if(n){const r=URL.createObjectURL(n),s=document.createElement("a");s.href=r,s.download=t,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(r)}}catch(n){JE.error("Failed to download file:",n),td?.toast?.error?.(oa("common.download_failed"))}},eM=(e,t)=>{const n=document.createElement("a");n.href=e,n.download=t,n.target="_blank",document.body.appendChild(n),n.click(),document.body.removeChild(n)},nd=async e=>{const t=e.downloadUrl||e.src,n=e.filename||e.title||"image";e.downloadRequiresAuth&&!ed(t)?await RE(t,n):eM(t,n)},tM=({image:e,index:t,onDownload:n})=>{const[r,s]=v.useState(!1),o=async i=>{if(i.stopPropagation(),n){n(e,t);return}s(!0);try{await nd(e)}finally{s(!1)}};return h.jsx(le,{type:"button",onClick:o,disabled:r,className:"yarl__button flex items-center justify-center","aria-label":oa("common.download"),title:oa("common.download"),children:r?h.jsx(yt,{className:"fa-solid fa-spinner fa-spin text-white"}):h.jsx(yt,{className:"fa-solid fa-download text-white"})})},ia=({images:e,isOpen:t,onClose:n,startIndex:r=0,enableZoom:s=!0,enableSlideshow:o=!1,enableFullscreen:i=!0,showCounter:a=!0,showDownload:l=!0,showThumbnails:c=!0,onDownload:d,editorAttrs:u,id:f})=>{const[g,m]=v.useState(r),p=v.useRef(r),y=e.map(x=>({src:x.src,title:x.title,description:x.description})),b=[];s&&b.push(wE),o&&b.push(AE),i&&b.push(zE),a&&b.push(SE),c&&b.push(QE);const _=e[g];if(v.useEffect(()=>{p.current=g},[g]),u){const x=(e??[]).slice(0,4);return h.jsx(I,{id:f,className:"grid grid-cols-2 gap-2 p-3 rounded-lg border border-dashed border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800",...u,children:x.length>0?x.map((M,S)=>h.jsx(Nn,{src:M.thumbnail||M.src,alt:M.title||"",className:"w-full aspect-square object-cover rounded bg-gray-200 dark:bg-gray-700"},S)):h.jsxs(I,{className:"col-span-2 flex items-center justify-center py-6 text-sm text-gray-400 dark:text-gray-500",children:[h.jsx(yt,{className:"fa-regular fa-images mr-2"}),oa("editor.component.image_gallery")]})})}return h.jsx(sE,{open:t,close:n,slides:y,index:g,plugins:b,on:{view:({index:x})=>{x!==p.current&&m(x)}},zoom:{maxZoomPixelRatio:3,zoomInMultiplier:2,doubleTapDelay:300,doubleClickDelay:300,doubleClickMaxStops:2,keyboardMoveDistance:50,wheelZoomDistanceFactor:100,pinchZoomDistanceFactor:100,scrollToZoom:!0},carousel:{finite:!0,preload:2,padding:"16px",spacing:"30%"},animation:{fade:250,swipe:500,easing:{fade:"ease",swipe:"ease-out",navigation:"ease-in-out"}},controller:{closeOnBackdropClick:!0,closeOnPullDown:!0,closeOnPullUp:!0},thumbnails:{position:"bottom",width:120,height:80,border:2,borderRadius:4,padding:4,gap:16,showToggle:!1,vignette:!0},toolbar:{buttons:[l&&_&&h.jsx(tM,{image:_,index:g,onDownload:d},"download"),"close"].filter(Boolean)},styles:{container:{backgroundColor:"rgba(0, 0, 0, 0.9)"}}})},qp=()=>{const[e,t]=v.useState(!1),[n,r]=v.useState([]),[s,o]=v.useState(0),i=v.useCallback((l,c=0)=>{r(l),o(c),t(!0)},[]),a=v.useCallback(()=>{t(!1)},[]);return{isOpen:e,openGallery:i,closeGallery:a,galleryProps:{images:n,isOpen:e,onClose:a,startIndex:s}}};ia.displayName="ImageGallery";const nM=Object.freeze(Object.defineProperty({__proto__:null,ImageGallery:ia,executeImageDownload:nd,useImageGallery:qp},Symbol.toStringTag,{value:"Module"})),rM=v.createContext(null),sM=({value:e,children:t})=>h.jsx(rM.Provider,{value:e,children:t});function oM(e,t){return t.forEach((function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach((function(r){if(r!=="default"&&!(r in e)){var s=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(e,r,s.get?s:{enumerable:!0,get:function(){return n[r]}})}}))})),Object.freeze(e)}function Zp(e,t){return new Promise((function(n,r){let s;return iM(e).then((function(o){try{return s=o,n(new Blob([t.slice(0,2),s,t.slice(2)],{type:"image/jpeg"}))}catch(i){return r(i)}}),r)}))}const iM=e=>new Promise(((t,n)=>{const r=new FileReader;r.addEventListener("load",(({target:{result:s}})=>{const o=new DataView(s);let i=0;if(o.getUint16(i)!==65496)return n("not a valid JPEG");for(i+=2;;){const a=o.getUint16(i);if(a===65498)break;const l=o.getUint16(i+2);if(a===65505&&o.getUint32(i+4)===1165519206){const c=i+10;let d;switch(o.getUint16(c)){case 18761:d=!0;break;case 19789:d=!1;break;default:return n("TIFF header contains invalid endian")}if(o.getUint16(c+2,d)!==42)return n("TIFF header contains invalid version");const u=o.getUint32(c+4,d),f=c+u+2+12*o.getUint16(c+u,d);for(let g=c+u+2;g<f;g+=12)if(o.getUint16(g,d)==274){if(o.getUint16(g+2,d)!==3)return n("Orientation data type is invalid");if(o.getUint32(g+4,d)!==1)return n("Orientation data count is invalid");o.setUint16(g+8,1,d);break}return t(s.slice(i,i+2+l))}i+=2+l}return t(new Blob)})),r.readAsArrayBuffer(e)}));var aa={},aM={get exports(){return aa},set exports(e){aa=e}};(function(e){var t,n,r={};aM.exports=r,r.parse=function(s,o){for(var i=r.bin.readUshort,a=r.bin.readUint,l=0,c={},d=new Uint8Array(s),u=d.length-4;a(d,u)!=101010256;)u--;l=u,l+=4;var f=i(d,l+=4);i(d,l+=2);var g=a(d,l+=2),m=a(d,l+=4);l+=4,l=m;for(var p=0;p<f;p++){a(d,l),l+=4,l+=4,l+=4,a(d,l+=4),g=a(d,l+=4);var y=a(d,l+=4),b=i(d,l+=4),_=i(d,l+2),x=i(d,l+4);l+=6;var M=a(d,l+=8);l+=4,l+=b+_+x,r._readLocal(d,M,c,g,y,o)}return c},r._readLocal=function(s,o,i,a,l,c){var d=r.bin.readUshort,u=r.bin.readUint;u(s,o),d(s,o+=4),d(s,o+=2);var f=d(s,o+=2);u(s,o+=2),u(s,o+=4),o+=4;var g=d(s,o+=8),m=d(s,o+=2);o+=2;var p=r.bin.readUTF8(s,o,g);if(o+=g,o+=m,c)i[p]={size:l,csize:a};else{var y=new Uint8Array(s.buffer,o);if(f==0)i[p]=new Uint8Array(y.buffer.slice(o,o+a));else{if(f!=8)throw"unknown compression method: "+f;var b=new Uint8Array(l);r.inflateRaw(y,b),i[p]=b}}},r.inflateRaw=function(s,o){return r.F.inflate(s,o)},r.inflate=function(s,o){return s[0],s[1],r.inflateRaw(new Uint8Array(s.buffer,s.byteOffset+2,s.length-6),o)},r.deflate=function(s,o){o==null&&(o={level:6});var i=0,a=new Uint8Array(50+Math.floor(1.1*s.length));a[i]=120,a[i+1]=156,i+=2,i=r.F.deflateRaw(s,a,i,o.level);var l=r.adler(s,0,s.length);return a[i+0]=l>>>24&255,a[i+1]=l>>>16&255,a[i+2]=l>>>8&255,a[i+3]=l>>>0&255,new Uint8Array(a.buffer,0,i+4)},r.deflateRaw=function(s,o){o==null&&(o={level:6});var i=new Uint8Array(50+Math.floor(1.1*s.length)),a=r.F.deflateRaw(s,i,a,o.level);return new Uint8Array(i.buffer,0,a)},r.encode=function(s,o){o==null&&(o=!1);var i=0,a=r.bin.writeUint,l=r.bin.writeUshort,c={};for(var d in s){var u=!r._noNeed(d)&&!o,f=s[d],g=r.crc.crc(f,0,f.length);c[d]={cpr:u,usize:f.length,crc:g,file:u?r.deflateRaw(f):f}}for(var d in c)i+=c[d].file.length+30+46+2*r.bin.sizeUTF8(d);i+=22;var m=new Uint8Array(i),p=0,y=[];for(var d in c){var b=c[d];y.push(p),p=r._writeHeader(m,p,d,b,0)}var _=0,x=p;for(var d in c)b=c[d],y.push(p),p=r._writeHeader(m,p,d,b,1,y[_++]);var M=p-x;return a(m,p,101010256),p+=4,l(m,p+=4,_),l(m,p+=2,_),a(m,p+=2,M),a(m,p+=4,x),p+=4,p+=2,m.buffer},r._noNeed=function(s){var o=s.split(".").pop().toLowerCase();return"png,jpg,jpeg,zip".indexOf(o)!=-1},r._writeHeader=function(s,o,i,a,l,c){var d=r.bin.writeUint,u=r.bin.writeUshort,f=a.file;return d(s,o,l==0?67324752:33639248),o+=4,l==1&&(o+=2),u(s,o,20),u(s,o+=2,0),u(s,o+=2,a.cpr?8:0),d(s,o+=2,0),d(s,o+=4,a.crc),d(s,o+=4,f.length),d(s,o+=4,a.usize),u(s,o+=4,r.bin.sizeUTF8(i)),u(s,o+=2,0),o+=2,l==1&&(o+=2,o+=2,d(s,o+=6,c),o+=4),o+=r.bin.writeUTF8(s,o,i),l==0&&(s.set(f,o),o+=f.length),o},r.crc={table:(function(){for(var s=new Uint32Array(256),o=0;o<256;o++){for(var i=o,a=0;a<8;a++)1&i?i=3988292384^i>>>1:i>>>=1;s[o]=i}return s})(),update:function(s,o,i,a){for(var l=0;l<a;l++)s=r.crc.table[255&(s^o[i+l])]^s>>>8;return s},crc:function(s,o,i){return 4294967295^r.crc.update(4294967295,s,o,i)}},r.adler=function(s,o,i){for(var a=1,l=0,c=o,d=o+i;c<d;){for(var u=Math.min(c+5552,d);c<u;)l+=a+=s[c++];a%=65521,l%=65521}return l<<16|a},r.bin={readUshort:function(s,o){return s[o]|s[o+1]<<8},writeUshort:function(s,o,i){s[o]=255&i,s[o+1]=i>>8&255},readUint:function(s,o){return 16777216*s[o+3]+(s[o+2]<<16|s[o+1]<<8|s[o])},writeUint:function(s,o,i){s[o]=255&i,s[o+1]=i>>8&255,s[o+2]=i>>16&255,s[o+3]=i>>24&255},readASCII:function(s,o,i){for(var a="",l=0;l<i;l++)a+=String.fromCharCode(s[o+l]);return a},writeASCII:function(s,o,i){for(var a=0;a<i.length;a++)s[o+a]=i.charCodeAt(a)},pad:function(s){return s.length<2?"0"+s:s},readUTF8:function(s,o,i){for(var a,l="",c=0;c<i;c++)l+="%"+r.bin.pad(s[o+c].toString(16));try{a=decodeURIComponent(l)}catch{return r.bin.readASCII(s,o,i)}return a},writeUTF8:function(s,o,i){for(var a=i.length,l=0,c=0;c<a;c++){var d=i.charCodeAt(c);if((4294967168&d)==0)s[o+l]=d,l++;else if((4294965248&d)==0)s[o+l]=192|d>>6,s[o+l+1]=128|d>>0&63,l+=2;else if((4294901760&d)==0)s[o+l]=224|d>>12,s[o+l+1]=128|d>>6&63,s[o+l+2]=128|d>>0&63,l+=3;else{if((4292870144&d)!=0)throw"e";s[o+l]=240|d>>18,s[o+l+1]=128|d>>12&63,s[o+l+2]=128|d>>6&63,s[o+l+3]=128|d>>0&63,l+=4}}return l},sizeUTF8:function(s){for(var o=s.length,i=0,a=0;a<o;a++){var l=s.charCodeAt(a);if((4294967168&l)==0)i++;else if((4294965248&l)==0)i+=2;else if((4294901760&l)==0)i+=3;else{if((4292870144&l)!=0)throw"e";i+=4}}return i}},r.F={},r.F.deflateRaw=function(s,o,i,a){var l=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][a],c=r.F.U,d=r.F._goodIndex;r.F._hash;var u=r.F._putsE,f=0,g=i<<3,m=0,p=s.length;if(a==0){for(;f<p;)u(o,g,f+(T=Math.min(65535,p-f))==p?1:0),g=r.F._copyExact(s,f,T,o,g+8),f+=T;return g>>>3}var y=c.lits,b=c.strt,_=c.prev,x=0,M=0,S=0,k=0,N=0,C=0;for(p>2&&(b[C=r.F._hash(s,0)]=0),f=0;f<p;f++){if(N=C,f+1<p-2){C=r.F._hash(s,f+1);var w=f+1&32767;_[w]=b[C],b[C]=w}if(m<=f){(x>14e3||M>26697)&&p-f>100&&(m<f&&(y[x]=f-m,x+=2,m=f),g=r.F._writeBlock(f==p-1||m==p?1:0,y,x,k,s,S,f-S,o,g),x=M=k=0,S=f);var E=0;f<p-2&&(E=r.F._bestMatch(s,f,_,N,Math.min(l[2],p-f),l[3]));var T=E>>>16,P=65535&E;if(E!=0){P=65535&E;var L=d(T=E>>>16,c.of0);c.lhst[257+L]++;var F=d(P,c.df0);c.dhst[F]++,k+=c.exb[L]+c.dxb[F],y[x]=T<<23|f-m,y[x+1]=P<<16|L<<8|F,x+=2,m=f+T}else c.lhst[s[f]]++;M++}}for(S==f&&s.length!=0||(m<f&&(y[x]=f-m,x+=2,m=f),g=r.F._writeBlock(1,y,x,k,s,S,f-S,o,g),x=0,M=0,x=M=k=0,S=f);(7&g)!=0;)g++;return g>>>3},r.F._bestMatch=function(s,o,i,a,l,c){var d=32767&o,u=i[d],f=d-u+32768&32767;if(u==d||a!=r.F._hash(s,o-f))return 0;for(var g=0,m=0,p=Math.min(32767,o);f<=p&&--c!=0&&u!=d;){if(g==0||s[o+g]==s[o+g-f]){var y=r.F._howLong(s,o,f);if(y>g){if(m=f,(g=y)>=l)break;f+2<y&&(y=f+2);for(var b=0,_=0;_<y-2;_++){var x=o-f+_+32768&32767,M=x-i[x]+32768&32767;M>b&&(b=M,u=x)}}}f+=(d=u)-(u=i[d])+32768&32767}return g<<16|m},r.F._howLong=function(s,o,i){if(s[o]!=s[o-i]||s[o+1]!=s[o+1-i]||s[o+2]!=s[o+2-i])return 0;var a=o,l=Math.min(s.length,o+258);for(o+=3;o<l&&s[o]==s[o-i];)o++;return o-a},r.F._hash=function(s,o){return(s[o]<<8|s[o+1])+(s[o+2]<<4)&65535},r.saved=0,r.F._writeBlock=function(s,o,i,a,l,c,d,u,f){var g,m,p,y,b,_,x,M,S,k=r.F.U,N=r.F._putsF,C=r.F._putsE;k.lhst[256]++,m=(g=r.F.getTrees())[0],p=g[1],y=g[2],b=g[3],_=g[4],x=g[5],M=g[6],S=g[7];var w=32+((f+3&7)==0?0:8-(f+3&7))+(d<<3),E=a+r.F.contSize(k.fltree,k.lhst)+r.F.contSize(k.fdtree,k.dhst),T=a+r.F.contSize(k.ltree,k.lhst)+r.F.contSize(k.dtree,k.dhst);T+=14+3*x+r.F.contSize(k.itree,k.ihst)+(2*k.ihst[16]+3*k.ihst[17]+7*k.ihst[18]);for(var P=0;P<286;P++)k.lhst[P]=0;for(P=0;P<30;P++)k.dhst[P]=0;for(P=0;P<19;P++)k.ihst[P]=0;var L=w<E&&w<T?0:E<T?1:2;if(N(u,f,s),N(u,f+1,L),f+=3,L==0){for(;(7&f)!=0;)f++;f=r.F._copyExact(l,c,d,u,f)}else{var F,A;if(L==1&&(F=k.fltree,A=k.fdtree),L==2){r.F.makeCodes(k.ltree,m),r.F.revCodes(k.ltree,m),r.F.makeCodes(k.dtree,p),r.F.revCodes(k.dtree,p),r.F.makeCodes(k.itree,y),r.F.revCodes(k.itree,y),F=k.ltree,A=k.dtree,C(u,f,b-257),C(u,f+=5,_-1),C(u,f+=5,x-4),f+=4;for(var D=0;D<x;D++)C(u,f+3*D,k.itree[1+(k.ordr[D]<<1)]);f+=3*x,f=r.F._codeTiny(M,k.itree,u,f),f=r.F._codeTiny(S,k.itree,u,f)}for(var O=c,z=0;z<i;z+=2){for(var U=o[z],j=U>>>23,Y=O+(8388607&U);O<Y;)f=r.F._writeLit(l[O++],F,u,f);if(j!=0){var B=o[z+1],W=B>>16,G=B>>8&255,V=255&B;C(u,f=r.F._writeLit(257+G,F,u,f),j-k.of0[G]),f+=k.exb[G],N(u,f=r.F._writeLit(V,A,u,f),W-k.df0[V]),f+=k.dxb[V],O+=j}}f=r.F._writeLit(256,F,u,f)}return f},r.F._copyExact=function(s,o,i,a,l){var c=l>>>3;return a[c]=i,a[c+1]=i>>>8,a[c+2]=255-a[c],a[c+3]=255-a[c+1],c+=4,a.set(new Uint8Array(s.buffer,o,i),c),l+(i+4<<3)},r.F.getTrees=function(){for(var s=r.F.U,o=r.F._hufTree(s.lhst,s.ltree,15),i=r.F._hufTree(s.dhst,s.dtree,15),a=[],l=r.F._lenCodes(s.ltree,a),c=[],d=r.F._lenCodes(s.dtree,c),u=0;u<a.length;u+=2)s.ihst[a[u]]++;for(u=0;u<c.length;u+=2)s.ihst[c[u]]++;for(var f=r.F._hufTree(s.ihst,s.itree,7),g=19;g>4&&s.itree[1+(s.ordr[g-1]<<1)]==0;)g--;return[o,i,f,l,d,g,a,c]},r.F.getSecond=function(s){for(var o=[],i=0;i<s.length;i+=2)o.push(s[i+1]);return o},r.F.nonZero=function(s){for(var o="",i=0;i<s.length;i+=2)s[i+1]!=0&&(o+=(i>>1)+",");return o},r.F.contSize=function(s,o){for(var i=0,a=0;a<o.length;a++)i+=o[a]*s[1+(a<<1)];return i},r.F._codeTiny=function(s,o,i,a){for(var l=0;l<s.length;l+=2){var c=s[l],d=s[l+1];a=r.F._writeLit(c,o,i,a);var u=c==16?2:c==17?3:7;c>15&&(r.F._putsE(i,a,d,u),a+=u)}return a},r.F._lenCodes=function(s,o){for(var i=s.length;i!=2&&s[i-1]==0;)i-=2;for(var a=0;a<i;a+=2){var l=s[a+1],c=a+3<i?s[a+3]:-1,d=a+5<i?s[a+5]:-1,u=a==0?-1:s[a-1];if(l==0&&c==l&&d==l){for(var f=a+5;f+2<i&&s[f+2]==l;)f+=2;(g=Math.min(f+1-a>>>1,138))<11?o.push(17,g-3):o.push(18,g-11),a+=2*g-2}else if(l==u&&c==l&&d==l){for(f=a+5;f+2<i&&s[f+2]==l;)f+=2;var g=Math.min(f+1-a>>>1,6);o.push(16,g-3),a+=2*g-2}else o.push(l,0)}return i>>>1},r.F._hufTree=function(s,o,i){var a=[],l=s.length,c=o.length,d=0;for(d=0;d<c;d+=2)o[d]=0,o[d+1]=0;for(d=0;d<l;d++)s[d]!=0&&a.push({lit:d,f:s[d]});var u=a.length,f=a.slice(0);if(u==0)return 0;if(u==1){var g=a[0].lit;return f=g==0?1:0,o[1+(g<<1)]=1,o[1+(f<<1)]=1,1}a.sort((function(M,S){return M.f-S.f}));var m=a[0],p=a[1],y=0,b=1,_=2;for(a[0]={lit:-1,f:m.f+p.f,l:m,r:p,d:0};b!=u-1;)m=y!=b&&(_==u||a[y].f<a[_].f)?a[y++]:a[_++],p=y!=b&&(_==u||a[y].f<a[_].f)?a[y++]:a[_++],a[b++]={lit:-1,f:m.f+p.f,l:m,r:p};var x=r.F.setDepth(a[b-1],0);for(x>i&&(r.F.restrictDepth(f,i,x),x=i),d=0;d<u;d++)o[1+(f[d].lit<<1)]=f[d].d;return x},r.F.setDepth=function(s,o){return s.lit!=-1?(s.d=o,o):Math.max(r.F.setDepth(s.l,o+1),r.F.setDepth(s.r,o+1))},r.F.restrictDepth=function(s,o,i){var a=0,l=1<<i-o,c=0;for(s.sort((function(u,f){return f.d==u.d?u.f-f.f:f.d-u.d})),a=0;a<s.length&&s[a].d>o;a++){var d=s[a].d;s[a].d=o,c+=l-(1<<i-d)}for(c>>>=i-o;c>0;)(d=s[a].d)<o?(s[a].d++,c-=1<<o-d-1):a++;for(;a>=0;a--)s[a].d==o&&c<0&&(s[a].d--,c++);c!=0&&console.log("debt left")},r.F._goodIndex=function(s,o){var i=0;return o[16|i]<=s&&(i|=16),o[8|i]<=s&&(i|=8),o[4|i]<=s&&(i|=4),o[2|i]<=s&&(i|=2),o[1|i]<=s&&(i|=1),i},r.F._writeLit=function(s,o,i,a){return r.F._putsF(i,a,o[s<<1]),a+o[1+(s<<1)]},r.F.inflate=function(s,o){var i=Uint8Array;if(s[0]==3&&s[1]==0)return o||new i(0);var a=r.F,l=a._bitsF,c=a._bitsE,d=a._decodeTiny,u=a.makeCodes,f=a.codes2map,g=a._get17,m=a.U,p=o==null;p&&(o=new i(s.length>>>2<<3));for(var y,b,_=0,x=0,M=0,S=0,k=0,N=0,C=0,w=0,E=0;_==0;)if(_=l(s,E,1),x=l(s,E+1,2),E+=3,x!=0){if(p&&(o=r.F._check(o,w+131072)),x==1&&(y=m.flmap,b=m.fdmap,N=511,C=31),x==2){M=c(s,E,5)+257,S=c(s,E+5,5)+1,k=c(s,E+10,4)+4,E+=14;for(var T=0;T<38;T+=2)m.itree[T]=0,m.itree[T+1]=0;var P=1;for(T=0;T<k;T++){var L=c(s,E+3*T,3);m.itree[1+(m.ordr[T]<<1)]=L,L>P&&(P=L)}E+=3*k,u(m.itree,P),f(m.itree,P,m.imap),y=m.lmap,b=m.dmap,E=d(m.imap,(1<<P)-1,M+S,s,E,m.ttree);var F=a._copyOut(m.ttree,0,M,m.ltree);N=(1<<F)-1;var A=a._copyOut(m.ttree,M,S,m.dtree);C=(1<<A)-1,u(m.ltree,F),f(m.ltree,F,y),u(m.dtree,A),f(m.dtree,A,b)}for(;;){var D=y[g(s,E)&N];E+=15&D;var O=D>>>4;if(!(O>>>8))o[w++]=O;else{if(O==256)break;var z=w+O-254;if(O>264){var U=m.ldef[O-257];z=w+(U>>>3)+c(s,E,7&U),E+=7&U}var j=b[g(s,E)&C];E+=15&j;var Y=j>>>4,B=m.ddef[Y],W=(B>>>4)+l(s,E,15&B);for(E+=15&B,p&&(o=r.F._check(o,w+131072));w<z;)o[w]=o[w++-W],o[w]=o[w++-W],o[w]=o[w++-W],o[w]=o[w++-W];w=z}}}else{(7&E)!=0&&(E+=8-(7&E));var G=4+(E>>>3),V=s[G-4]|s[G-3]<<8;p&&(o=r.F._check(o,w+V)),o.set(new i(s.buffer,s.byteOffset+G,V),w),E=G+V<<3,w+=V}return o.length==w?o:o.slice(0,w)},r.F._check=function(s,o){var i=s.length;if(o<=i)return s;var a=new Uint8Array(Math.max(i<<1,o));return a.set(s,0),a},r.F._decodeTiny=function(s,o,i,a,l,c){for(var d=r.F._bitsE,u=r.F._get17,f=0;f<i;){var g=s[u(a,l)&o];l+=15&g;var m=g>>>4;if(m<=15)c[f]=m,f++;else{var p=0,y=0;m==16?(y=3+d(a,l,2),l+=2,p=c[f-1]):m==17?(y=3+d(a,l,3),l+=3):m==18&&(y=11+d(a,l,7),l+=7);for(var b=f+y;f<b;)c[f]=p,f++}}return l},r.F._copyOut=function(s,o,i,a){for(var l=0,c=0,d=a.length>>>1;c<i;){var u=s[c+o];a[c<<1]=0,a[1+(c<<1)]=u,u>l&&(l=u),c++}for(;c<d;)a[c<<1]=0,a[1+(c<<1)]=0,c++;return l},r.F.makeCodes=function(s,o){for(var i,a,l,c,d=r.F.U,u=s.length,f=d.bl_count,g=0;g<=o;g++)f[g]=0;for(g=1;g<u;g+=2)f[s[g]]++;var m=d.next_code;for(i=0,f[0]=0,a=1;a<=o;a++)i=i+f[a-1]<<1,m[a]=i;for(l=0;l<u;l+=2)(c=s[l+1])!=0&&(s[l]=m[c],m[c]++)},r.F.codes2map=function(s,o,i){for(var a=s.length,l=r.F.U.rev15,c=0;c<a;c+=2)if(s[c+1]!=0)for(var d=c>>1,u=s[c+1],f=d<<4|u,g=o-u,m=s[c]<<g,p=m+(1<<g);m!=p;)i[l[m]>>>15-o]=f,m++},r.F.revCodes=function(s,o){for(var i=r.F.U.rev15,a=15-o,l=0;l<s.length;l+=2){var c=s[l]<<o-s[l+1];s[l]=i[c]>>>a}},r.F._putsE=function(s,o,i){i<<=7&o;var a=o>>>3;s[a]|=i,s[a+1]|=i>>>8},r.F._putsF=function(s,o,i){i<<=7&o;var a=o>>>3;s[a]|=i,s[a+1]|=i>>>8,s[a+2]|=i>>>16},r.F._bitsE=function(s,o,i){return(s[o>>>3]|s[1+(o>>>3)]<<8)>>>(7&o)&(1<<i)-1},r.F._bitsF=function(s,o,i){return(s[o>>>3]|s[1+(o>>>3)]<<8|s[2+(o>>>3)]<<16)>>>(7&o)&(1<<i)-1},r.F._get17=function(s,o){return(s[o>>>3]|s[1+(o>>>3)]<<8|s[2+(o>>>3)]<<16)>>>(7&o)},r.F._get25=function(s,o){return(s[o>>>3]|s[1+(o>>>3)]<<8|s[2+(o>>>3)]<<16|s[3+(o>>>3)]<<24)>>>(7&o)},r.F.U=(t=Uint16Array,n=Uint32Array,{next_code:new t(16),bl_count:new t(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[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,999,999,999],exb:[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,0,0,0],ldef:new t(32),df0:[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,65535,65535],dxb:[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,0,0],ddef:new n(32),flmap:new t(512),fltree:[],fdmap:new t(32),fdtree:[],lmap:new t(32768),ltree:[],ttree:[],dmap:new t(32768),dtree:[],imap:new t(512),itree:[],rev15:new t(32768),lhst:new n(286),dhst:new n(30),ihst:new n(19),lits:new n(15e3),strt:new t(65536),prev:new t(32768)}),(function(){for(var s=r.F.U,o=0;o<32768;o++){var i=o;i=(4278255360&(i=(4042322160&(i=(3435973836&(i=(2863311530&i)>>>1|(1431655765&i)<<1))>>>2|(858993459&i)<<2))>>>4|(252645135&i)<<4))>>>8|(16711935&i)<<8,s.rev15[o]=(i>>>16|i<<16)>>>17}function a(l,c,d){for(;c--!=0;)l.push(0,d)}for(o=0;o<32;o++)s.ldef[o]=s.of0[o]<<3|s.exb[o],s.ddef[o]=s.df0[o]<<4|s.dxb[o];a(s.fltree,144,8),a(s.fltree,112,9),a(s.fltree,24,7),a(s.fltree,8,8),r.F.makeCodes(s.fltree,9),r.F.codes2map(s.fltree,9,s.flmap),r.F.revCodes(s.fltree,9),a(s.fdtree,32,5),r.F.makeCodes(s.fdtree,5),r.F.codes2map(s.fdtree,5,s.fdmap),r.F.revCodes(s.fdtree,5),a(s.itree,19,0),a(s.ltree,286,0),a(s.dtree,30,0),a(s.ttree,320,0)})()})();var lM=oM({__proto__:null,default:aa},[aa]);const $n=(function(){var e={nextZero(d,u){for(;d[u]!=0;)u++;return u},readUshort:(d,u)=>d[u]<<8|d[u+1],writeUshort(d,u,f){d[u]=f>>8&255,d[u+1]=255&f},readUint:(d,u)=>16777216*d[u]+(d[u+1]<<16|d[u+2]<<8|d[u+3]),writeUint(d,u,f){d[u]=f>>24&255,d[u+1]=f>>16&255,d[u+2]=f>>8&255,d[u+3]=255&f},readASCII(d,u,f){let g="";for(let m=0;m<f;m++)g+=String.fromCharCode(d[u+m]);return g},writeASCII(d,u,f){for(let g=0;g<f.length;g++)d[u+g]=f.charCodeAt(g)},readBytes(d,u,f){const g=[];for(let m=0;m<f;m++)g.push(d[u+m]);return g},pad:d=>d.length<2?`0${d}`:d,readUTF8(d,u,f){let g,m="";for(let p=0;p<f;p++)m+=`%${e.pad(d[u+p].toString(16))}`;try{g=decodeURIComponent(m)}catch{return e.readASCII(d,u,f)}return g}};function t(d,u,f,g){const m=u*f,p=o(g),y=Math.ceil(u*p/8),b=new Uint8Array(4*m),_=new Uint32Array(b.buffer),{ctype:x}=g,{depth:M}=g,S=e.readUshort;if(x==6){const U=m<<2;if(M==8)for(var k=0;k<U;k+=4)b[k]=d[k],b[k+1]=d[k+1],b[k+2]=d[k+2],b[k+3]=d[k+3];if(M==16)for(k=0;k<U;k++)b[k]=d[k<<1]}else if(x==2){const U=g.tabs.tRNS;if(U==null){if(M==8)for(k=0;k<m;k++){var N=3*k;_[k]=255<<24|d[N+2]<<16|d[N+1]<<8|d[N]}if(M==16)for(k=0;k<m;k++)N=6*k,_[k]=255<<24|d[N+4]<<16|d[N+2]<<8|d[N]}else{var C=U[0];const j=U[1],Y=U[2];if(M==8)for(k=0;k<m;k++){var w=k<<2;N=3*k,_[k]=255<<24|d[N+2]<<16|d[N+1]<<8|d[N],d[N]==C&&d[N+1]==j&&d[N+2]==Y&&(b[w+3]=0)}if(M==16)for(k=0;k<m;k++)w=k<<2,N=6*k,_[k]=255<<24|d[N+4]<<16|d[N+2]<<8|d[N],S(d,N)==C&&S(d,N+2)==j&&S(d,N+4)==Y&&(b[w+3]=0)}}else if(x==3){const U=g.tabs.PLTE,j=g.tabs.tRNS,Y=j?j.length:0;if(M==1)for(var E=0;E<f;E++){var T=E*y,P=E*u;for(k=0;k<u;k++){w=P+k<<2;var L=3*(F=d[T+(k>>3)]>>7-((7&k)<<0)&1);b[w]=U[L],b[w+1]=U[L+1],b[w+2]=U[L+2],b[w+3]=F<Y?j[F]:255}}if(M==2)for(E=0;E<f;E++)for(T=E*y,P=E*u,k=0;k<u;k++)w=P+k<<2,L=3*(F=d[T+(k>>2)]>>6-((3&k)<<1)&3),b[w]=U[L],b[w+1]=U[L+1],b[w+2]=U[L+2],b[w+3]=F<Y?j[F]:255;if(M==4)for(E=0;E<f;E++)for(T=E*y,P=E*u,k=0;k<u;k++)w=P+k<<2,L=3*(F=d[T+(k>>1)]>>4-((1&k)<<2)&15),b[w]=U[L],b[w+1]=U[L+1],b[w+2]=U[L+2],b[w+3]=F<Y?j[F]:255;if(M==8)for(k=0;k<m;k++){var F;w=k<<2,L=3*(F=d[k]),b[w]=U[L],b[w+1]=U[L+1],b[w+2]=U[L+2],b[w+3]=F<Y?j[F]:255}}else if(x==4){if(M==8)for(k=0;k<m;k++){w=k<<2;var A=d[D=k<<1];b[w]=A,b[w+1]=A,b[w+2]=A,b[w+3]=d[D+1]}if(M==16)for(k=0;k<m;k++){var D;w=k<<2,A=d[D=k<<2],b[w]=A,b[w+1]=A,b[w+2]=A,b[w+3]=d[D+2]}}else if(x==0)for(C=g.tabs.tRNS?g.tabs.tRNS:-1,E=0;E<f;E++){const U=E*y,j=E*u;if(M==1)for(var O=0;O<u;O++){var z=(A=255*(d[U+(O>>>3)]>>>7-(7&O)&1))==255*C?0:255;_[j+O]=z<<24|A<<16|A<<8|A}else if(M==2)for(O=0;O<u;O++)z=(A=85*(d[U+(O>>>2)]>>>6-((3&O)<<1)&3))==85*C?0:255,_[j+O]=z<<24|A<<16|A<<8|A;else if(M==4)for(O=0;O<u;O++)z=(A=17*(d[U+(O>>>1)]>>>4-((1&O)<<2)&15))==17*C?0:255,_[j+O]=z<<24|A<<16|A<<8|A;else if(M==8)for(O=0;O<u;O++)z=(A=d[U+O])==C?0:255,_[j+O]=z<<24|A<<16|A<<8|A;else if(M==16)for(O=0;O<u;O++)A=d[U+(O<<1)],z=S(d,U+(O<<1))==C?0:255,_[j+O]=z<<24|A<<16|A<<8|A}return b}function n(d,u,f,g){const m=o(d),p=Math.ceil(f*m/8),y=new Uint8Array((p+1+d.interlace)*g);return u=d.tabs.CgBI?s(u,y):r(u,y),d.interlace==0?u=i(u,d,0,f,g):d.interlace==1&&(u=(function(_,x){const M=x.width,S=x.height,k=o(x),N=k>>3,C=Math.ceil(M*k/8),w=new Uint8Array(S*C);let E=0;const T=[0,0,4,0,2,0,1],P=[0,4,0,2,0,1,0],L=[8,8,8,4,4,2,2],F=[8,8,4,4,2,2,1];let A=0;for(;A<7;){const O=L[A],z=F[A];let U=0,j=0,Y=T[A];for(;Y<S;)Y+=O,j++;let B=P[A];for(;B<M;)B+=z,U++;const W=Math.ceil(U*k/8);i(_,x,E,U,j);let G=0,V=T[A];for(;V<S;){let X=P[A],K=E+G*W<<3;for(;X<M;){var D;if(k==1&&(D=(D=_[K>>3])>>7-(7&K)&1,w[V*C+(X>>3)]|=D<<7-((7&X)<<0)),k==2&&(D=(D=_[K>>3])>>6-(7&K)&3,w[V*C+(X>>2)]|=D<<6-((3&X)<<1)),k==4&&(D=(D=_[K>>3])>>4-(7&K)&15,w[V*C+(X>>1)]|=D<<4-((1&X)<<2)),k>=8){const Q=V*C+X*N;for(let ne=0;ne<N;ne++)w[Q+ne]=_[(K>>3)+ne]}K+=k,X+=z}G++,V+=O}U*j!=0&&(E+=j*(1+W)),A+=1}return w})(u,d)),u}function r(d,u){return s(new Uint8Array(d.buffer,2,d.length-6),u)}var s=(function(){const d={H:{}};return d.H.N=function(u,f){const g=Uint8Array;let m,p,y=0,b=0,_=0,x=0,M=0,S=0,k=0,N=0,C=0;if(u[0]==3&&u[1]==0)return f||new g(0);const w=d.H,E=w.b,T=w.e,P=w.R,L=w.n,F=w.A,A=w.Z,D=w.m,O=f==null;for(O&&(f=new g(u.length>>>2<<5));y==0;)if(y=E(u,C,1),b=E(u,C+1,2),C+=3,b!=0){if(O&&(f=d.H.W(f,N+(1<<17))),b==1&&(m=D.J,p=D.h,S=511,k=31),b==2){_=T(u,C,5)+257,x=T(u,C+5,5)+1,M=T(u,C+10,4)+4,C+=14;let U=1;for(var z=0;z<38;z+=2)D.Q[z]=0,D.Q[z+1]=0;for(z=0;z<M;z++){const B=T(u,C+3*z,3);D.Q[1+(D.X[z]<<1)]=B,B>U&&(U=B)}C+=3*M,L(D.Q,U),F(D.Q,U,D.u),m=D.w,p=D.d,C=P(D.u,(1<<U)-1,_+x,u,C,D.v);const j=w.V(D.v,0,_,D.C);S=(1<<j)-1;const Y=w.V(D.v,_,x,D.D);k=(1<<Y)-1,L(D.C,j),F(D.C,j,m),L(D.D,Y),F(D.D,Y,p)}for(;;){const U=m[A(u,C)&S];C+=15&U;const j=U>>>4;if(!(j>>>8))f[N++]=j;else{if(j==256)break;{let Y=N+j-254;if(j>264){const X=D.q[j-257];Y=N+(X>>>3)+T(u,C,7&X),C+=7&X}const B=p[A(u,C)&k];C+=15&B;const W=B>>>4,G=D.c[W],V=(G>>>4)+E(u,C,15&G);for(C+=15&G;N<Y;)f[N]=f[N++-V],f[N]=f[N++-V],f[N]=f[N++-V],f[N]=f[N++-V];N=Y}}}}else{(7&C)!=0&&(C+=8-(7&C));const U=4+(C>>>3),j=u[U-4]|u[U-3]<<8;O&&(f=d.H.W(f,N+j)),f.set(new g(u.buffer,u.byteOffset+U,j),N),C=U+j<<3,N+=j}return f.length==N?f:f.slice(0,N)},d.H.W=function(u,f){const g=u.length;if(f<=g)return u;const m=new Uint8Array(g<<1);return m.set(u,0),m},d.H.R=function(u,f,g,m,p,y){const b=d.H.e,_=d.H.Z;let x=0;for(;x<g;){const M=u[_(m,p)&f];p+=15&M;const S=M>>>4;if(S<=15)y[x]=S,x++;else{let k=0,N=0;S==16?(N=3+b(m,p,2),p+=2,k=y[x-1]):S==17?(N=3+b(m,p,3),p+=3):S==18&&(N=11+b(m,p,7),p+=7);const C=x+N;for(;x<C;)y[x]=k,x++}}return p},d.H.V=function(u,f,g,m){let p=0,y=0;const b=m.length>>>1;for(;y<g;){const _=u[y+f];m[y<<1]=0,m[1+(y<<1)]=_,_>p&&(p=_),y++}for(;y<b;)m[y<<1]=0,m[1+(y<<1)]=0,y++;return p},d.H.n=function(u,f){const g=d.H.m,m=u.length;let p,y,b,_;const x=g.j;for(var M=0;M<=f;M++)x[M]=0;for(M=1;M<m;M+=2)x[u[M]]++;const S=g.K;for(p=0,x[0]=0,y=1;y<=f;y++)p=p+x[y-1]<<1,S[y]=p;for(b=0;b<m;b+=2)_=u[b+1],_!=0&&(u[b]=S[_],S[_]++)},d.H.A=function(u,f,g){const m=u.length,p=d.H.m.r;for(let y=0;y<m;y+=2)if(u[y+1]!=0){const b=y>>1,_=u[y+1],x=b<<4|_,M=f-_;let S=u[y]<<M;const k=S+(1<<M);for(;S!=k;)g[p[S]>>>15-f]=x,S++}},d.H.l=function(u,f){const g=d.H.m.r,m=15-f;for(let p=0;p<u.length;p+=2){const y=u[p]<<f-u[p+1];u[p]=g[y]>>>m}},d.H.M=function(u,f,g){g<<=7&f;const m=f>>>3;u[m]|=g,u[m+1]|=g>>>8},d.H.I=function(u,f,g){g<<=7&f;const m=f>>>3;u[m]|=g,u[m+1]|=g>>>8,u[m+2]|=g>>>16},d.H.e=function(u,f,g){return(u[f>>>3]|u[1+(f>>>3)]<<8)>>>(7&f)&(1<<g)-1},d.H.b=function(u,f,g){return(u[f>>>3]|u[1+(f>>>3)]<<8|u[2+(f>>>3)]<<16)>>>(7&f)&(1<<g)-1},d.H.Z=function(u,f){return(u[f>>>3]|u[1+(f>>>3)]<<8|u[2+(f>>>3)]<<16)>>>(7&f)},d.H.i=function(u,f){return(u[f>>>3]|u[1+(f>>>3)]<<8|u[2+(f>>>3)]<<16|u[3+(f>>>3)]<<24)>>>(7&f)},d.H.m=(function(){const u=Uint16Array,f=Uint32Array;return{K:new u(16),j:new u(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[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,999,999,999],T:[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,0,0,0],q:new u(32),p:[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,65535,65535],z:[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,0,0],c:new f(32),J:new u(512),_:[],h:new u(32),$:[],w:new u(32768),C:[],v:[],d:new u(32768),D:[],u:new u(512),Q:[],r:new u(32768),s:new f(286),Y:new f(30),a:new f(19),t:new f(15e3),k:new u(65536),g:new u(32768)}})(),(function(){const u=d.H.m;for(var f=0;f<32768;f++){let m=f;m=(2863311530&m)>>>1|(1431655765&m)<<1,m=(3435973836&m)>>>2|(858993459&m)<<2,m=(4042322160&m)>>>4|(252645135&m)<<4,m=(4278255360&m)>>>8|(16711935&m)<<8,u.r[f]=(m>>>16|m<<16)>>>17}function g(m,p,y){for(;p--!=0;)m.push(0,y)}for(f=0;f<32;f++)u.q[f]=u.S[f]<<3|u.T[f],u.c[f]=u.p[f]<<4|u.z[f];g(u._,144,8),g(u._,112,9),g(u._,24,7),g(u._,8,8),d.H.n(u._,9),d.H.A(u._,9,u.J),d.H.l(u._,9),g(u.$,32,5),d.H.n(u.$,5),d.H.A(u.$,5,u.h),d.H.l(u.$,5),g(u.Q,19,0),g(u.C,286,0),g(u.D,30,0),g(u.v,320,0)})(),d.H.N})();function o(d){return[1,null,3,1,2,null,4][d.ctype]*d.depth}function i(d,u,f,g,m){let p=o(u);const y=Math.ceil(g*p/8);let b,_;p=Math.ceil(p/8);let x=d[f],M=0;if(x>1&&(d[f]=[0,0,1][x-2]),x==3)for(M=p;M<y;M++)d[M+1]=d[M+1]+(d[M+1-p]>>>1)&255;for(let S=0;S<m;S++)if(b=f+S*y,_=b+S+1,x=d[_-1],M=0,x==0)for(;M<y;M++)d[b+M]=d[_+M];else if(x==1){for(;M<p;M++)d[b+M]=d[_+M];for(;M<y;M++)d[b+M]=d[_+M]+d[b+M-p]}else if(x==2)for(;M<y;M++)d[b+M]=d[_+M]+d[b+M-y];else if(x==3){for(;M<p;M++)d[b+M]=d[_+M]+(d[b+M-y]>>>1);for(;M<y;M++)d[b+M]=d[_+M]+(d[b+M-y]+d[b+M-p]>>>1)}else{for(;M<p;M++)d[b+M]=d[_+M]+a(0,d[b+M-y],0);for(;M<y;M++)d[b+M]=d[_+M]+a(d[b+M-p],d[b+M-y],d[b+M-p-y])}return d}function a(d,u,f){const g=d+u-f,m=g-d,p=g-u,y=g-f;return m*m<=p*p&&m*m<=y*y?d:p*p<=y*y?u:f}function l(d,u,f){f.width=e.readUint(d,u),u+=4,f.height=e.readUint(d,u),u+=4,f.depth=d[u],u++,f.ctype=d[u],u++,f.compress=d[u],u++,f.filter=d[u],u++,f.interlace=d[u],u++}function c(d,u,f,g,m,p,y,b,_){const x=Math.min(u,m),M=Math.min(f,p);let S=0,k=0;for(let A=0;A<M;A++)for(let D=0;D<x;D++)if(y>=0&&b>=0?(S=A*u+D<<2,k=(b+A)*m+y+D<<2):(S=(-b+A)*u-y+D<<2,k=A*m+D<<2),_==0)g[k]=d[S],g[k+1]=d[S+1],g[k+2]=d[S+2],g[k+3]=d[S+3];else if(_==1){var N=d[S+3]*.00392156862745098,C=d[S]*N,w=d[S+1]*N,E=d[S+2]*N,T=g[k+3]*(1/255),P=g[k]*T,L=g[k+1]*T,F=g[k+2]*T;const O=1-N,z=N+T*O,U=z==0?0:1/z;g[k+3]=255*z,g[k+0]=(C+P*O)*U,g[k+1]=(w+L*O)*U,g[k+2]=(E+F*O)*U}else if(_==2)N=d[S+3],C=d[S],w=d[S+1],E=d[S+2],T=g[k+3],P=g[k],L=g[k+1],F=g[k+2],N==T&&C==P&&w==L&&E==F?(g[k]=0,g[k+1]=0,g[k+2]=0,g[k+3]=0):(g[k]=C,g[k+1]=w,g[k+2]=E,g[k+3]=N);else if(_==3){if(N=d[S+3],C=d[S],w=d[S+1],E=d[S+2],T=g[k+3],P=g[k],L=g[k+1],F=g[k+2],N==T&&C==P&&w==L&&E==F)continue;if(N<220&&T>20)return!1}return!0}return{decode:function(u){const f=new Uint8Array(u);let g=8;const m=e,p=m.readUshort,y=m.readUint,b={tabs:{},frames:[]},_=new Uint8Array(f.length);let x,M=0,S=0;const k=[137,80,78,71,13,10,26,10];for(var N=0;N<8;N++)if(f[N]!=k[N])throw"The input is not a PNG file!";for(;g<f.length;){const A=m.readUint(f,g);g+=4;const D=m.readASCII(f,g,4);if(g+=4,D=="IHDR")l(f,g,b);else if(D=="iCCP"){for(var C=g;f[C]!=0;)C++;m.readASCII(f,g,C-g),f[C+1];const O=f.slice(C+2,g+A);let z=null;try{z=r(O)}catch{z=s(O)}b.tabs[D]=z}else if(D=="CgBI")b.tabs[D]=f.slice(g,g+4);else if(D=="IDAT"){for(N=0;N<A;N++)_[M+N]=f[g+N];M+=A}else if(D=="acTL")b.tabs[D]={num_frames:y(f,g),num_plays:y(f,g+4)},x=new Uint8Array(f.length);else if(D=="fcTL"){S!=0&&((F=b.frames[b.frames.length-1]).data=n(b,x.slice(0,S),F.rect.width,F.rect.height),S=0);const O={x:y(f,g+12),y:y(f,g+16),width:y(f,g+4),height:y(f,g+8)};let z=p(f,g+22);z=p(f,g+20)/(z==0?100:z);const U={rect:O,delay:Math.round(1e3*z),dispose:f[g+24],blend:f[g+25]};b.frames.push(U)}else if(D=="fdAT"){for(N=0;N<A-4;N++)x[S+N]=f[g+N+4];S+=A-4}else if(D=="pHYs")b.tabs[D]=[m.readUint(f,g),m.readUint(f,g+4),f[g+8]];else if(D=="cHRM")for(b.tabs[D]=[],N=0;N<8;N++)b.tabs[D].push(m.readUint(f,g+4*N));else if(D=="tEXt"||D=="zTXt"){b.tabs[D]==null&&(b.tabs[D]={});var w=m.nextZero(f,g),E=m.readASCII(f,g,w-g),T=g+A-w-1;if(D=="tEXt")L=m.readASCII(f,w+1,T);else{var P=r(f.slice(w+2,w+2+T));L=m.readUTF8(P,0,P.length)}b.tabs[D][E]=L}else if(D=="iTXt"){b.tabs[D]==null&&(b.tabs[D]={}),w=0,C=g,w=m.nextZero(f,C),E=m.readASCII(f,C,w-C);const O=f[C=w+1];var L;f[C+1],C+=2,w=m.nextZero(f,C),m.readASCII(f,C,w-C),C=w+1,w=m.nextZero(f,C),m.readUTF8(f,C,w-C),T=A-((C=w+1)-g),O==0?L=m.readUTF8(f,C,T):(P=r(f.slice(C,C+T)),L=m.readUTF8(P,0,P.length)),b.tabs[D][E]=L}else if(D=="PLTE")b.tabs[D]=m.readBytes(f,g,A);else if(D=="hIST"){const O=b.tabs.PLTE.length/3;for(b.tabs[D]=[],N=0;N<O;N++)b.tabs[D].push(p(f,g+2*N))}else if(D=="tRNS")b.ctype==3?b.tabs[D]=m.readBytes(f,g,A):b.ctype==0?b.tabs[D]=p(f,g):b.ctype==2&&(b.tabs[D]=[p(f,g),p(f,g+2),p(f,g+4)]);else if(D=="gAMA")b.tabs[D]=m.readUint(f,g)/1e5;else if(D=="sRGB")b.tabs[D]=f[g];else if(D=="bKGD")b.ctype==0||b.ctype==4?b.tabs[D]=[p(f,g)]:b.ctype==2||b.ctype==6?b.tabs[D]=[p(f,g),p(f,g+2),p(f,g+4)]:b.ctype==3&&(b.tabs[D]=f[g]);else if(D=="IEND")break;g+=A,m.readUint(f,g),g+=4}var F;return S!=0&&((F=b.frames[b.frames.length-1]).data=n(b,x.slice(0,S),F.rect.width,F.rect.height)),b.data=n(b,_,b.width,b.height),delete b.compress,delete b.interlace,delete b.filter,b},toRGBA8:function(u){const f=u.width,g=u.height;if(u.tabs.acTL==null)return[t(u.data,f,g,u).buffer];const m=[];u.frames[0].data==null&&(u.frames[0].data=u.data);const p=f*g*4,y=new Uint8Array(p),b=new Uint8Array(p),_=new Uint8Array(p);for(let M=0;M<u.frames.length;M++){const S=u.frames[M],k=S.rect.x,N=S.rect.y,C=S.rect.width,w=S.rect.height,E=t(S.data,C,w,u);if(M!=0)for(var x=0;x<p;x++)_[x]=y[x];if(S.blend==0?c(E,C,w,y,f,g,k,N,0):S.blend==1&&c(E,C,w,y,f,g,k,N,1),m.push(y.buffer.slice(0)),S.dispose!=0){if(S.dispose==1)c(b,C,w,y,f,g,k,N,0);else if(S.dispose==2)for(x=0;x<p;x++)y[x]=_[x]}}return m},_paeth:a,_copyTile:c,_bin:e}})();(function(){const{_copyTile:e}=$n,{_bin:t}=$n,n=$n._paeth;var r={table:(function(){const C=new Uint32Array(256);for(let w=0;w<256;w++){let E=w;for(let T=0;T<8;T++)1&E?E=3988292384^E>>>1:E>>>=1;C[w]=E}return C})(),update(C,w,E,T){for(let P=0;P<T;P++)C=r.table[255&(C^w[E+P])]^C>>>8;return C},crc:(C,w,E)=>4294967295^r.update(4294967295,C,w,E)};function s(C,w,E,T){w[E]+=C[0]*T>>4,w[E+1]+=C[1]*T>>4,w[E+2]+=C[2]*T>>4,w[E+3]+=C[3]*T>>4}function o(C){return Math.max(0,Math.min(255,C))}function i(C,w){const E=C[0]-w[0],T=C[1]-w[1],P=C[2]-w[2],L=C[3]-w[3];return E*E+T*T+P*P+L*L}function a(C,w,E,T,P,L,F){F==null&&(F=1);const A=T.length,D=[];for(var O=0;O<A;O++){const V=T[O];D.push([V>>>0&255,V>>>8&255,V>>>16&255,V>>>24&255])}for(O=0;O<A;O++){let V=4294967295;for(var z=0,U=0;U<A;U++){var j=i(D[O],D[U]);U!=O&&j<V&&(V=j,z=U)}}const Y=new Uint32Array(P.buffer),B=new Int16Array(w*E*4),W=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(O=0;O<W.length;O++)W[O]=255*((W[O]+.5)/16-.5);for(let V=0;V<E;V++)for(let X=0;X<w;X++){var G;O=4*(V*w+X),F!=2?G=[o(C[O]+B[O]),o(C[O+1]+B[O+1]),o(C[O+2]+B[O+2]),o(C[O+3]+B[O+3])]:(j=W[4*(3&V)+(3&X)],G=[o(C[O]+j),o(C[O+1]+j),o(C[O+2]+j),o(C[O+3]+j)]),z=0;let K=16777215;for(U=0;U<A;U++){const se=i(G,D[U]);se<K&&(K=se,z=U)}const Q=D[z],ne=[G[0]-Q[0],G[1]-Q[1],G[2]-Q[2],G[3]-Q[3]];F==1&&(X!=w-1&&s(ne,B,O+4,7),V!=E-1&&(X!=0&&s(ne,B,O+4*w-4,3),s(ne,B,O+4*w,5),X!=w-1&&s(ne,B,O+4*w+4,1))),L[O>>2]=z,Y[O>>2]=T[z]}}function l(C,w,E,T,P){P==null&&(P={});const{crc:L}=r,F=t.writeUint,A=t.writeUshort,D=t.writeASCII;let O=8;const z=C.frames.length>1;let U,j=!1,Y=33+(z?20:0);if(P.sRGB!=null&&(Y+=13),P.pHYs!=null&&(Y+=21),P.iCCP!=null&&(U=pako.deflate(P.iCCP),Y+=21+U.length+4),C.ctype==3){for(var B=C.plte.length,W=0;W<B;W++)C.plte[W]>>>24!=255&&(j=!0);Y+=8+3*B+4+(j?8+1*B+4:0)}for(var G=0;G<C.frames.length;G++)z&&(Y+=38),Y+=(Q=C.frames[G]).cimg.length+12,G!=0&&(Y+=4);Y+=12;const V=new Uint8Array(Y),X=[137,80,78,71,13,10,26,10];for(W=0;W<8;W++)V[W]=X[W];if(F(V,O,13),O+=4,D(V,O,"IHDR"),O+=4,F(V,O,w),O+=4,F(V,O,E),O+=4,V[O]=C.depth,O++,V[O]=C.ctype,O++,V[O]=0,O++,V[O]=0,O++,V[O]=0,O++,F(V,O,L(V,O-17,17)),O+=4,P.sRGB!=null&&(F(V,O,1),O+=4,D(V,O,"sRGB"),O+=4,V[O]=P.sRGB,O++,F(V,O,L(V,O-5,5)),O+=4),P.iCCP!=null){const ne=13+U.length;F(V,O,ne),O+=4,D(V,O,"iCCP"),O+=4,D(V,O,"ICC profile"),O+=11,O+=2,V.set(U,O),O+=U.length,F(V,O,L(V,O-(ne+4),ne+4)),O+=4}if(P.pHYs!=null&&(F(V,O,9),O+=4,D(V,O,"pHYs"),O+=4,F(V,O,P.pHYs[0]),O+=4,F(V,O,P.pHYs[1]),O+=4,V[O]=P.pHYs[2],O++,F(V,O,L(V,O-13,13)),O+=4),z&&(F(V,O,8),O+=4,D(V,O,"acTL"),O+=4,F(V,O,C.frames.length),O+=4,F(V,O,P.loop!=null?P.loop:0),O+=4,F(V,O,L(V,O-12,12)),O+=4),C.ctype==3){for(F(V,O,3*(B=C.plte.length)),O+=4,D(V,O,"PLTE"),O+=4,W=0;W<B;W++){const ne=3*W,se=C.plte[W],ue=255&se,ee=se>>>8&255,me=se>>>16&255;V[O+ne+0]=ue,V[O+ne+1]=ee,V[O+ne+2]=me}if(O+=3*B,F(V,O,L(V,O-3*B-4,3*B+4)),O+=4,j){for(F(V,O,B),O+=4,D(V,O,"tRNS"),O+=4,W=0;W<B;W++)V[O+W]=C.plte[W]>>>24&255;O+=B,F(V,O,L(V,O-B-4,B+4)),O+=4}}let K=0;for(G=0;G<C.frames.length;G++){var Q=C.frames[G];z&&(F(V,O,26),O+=4,D(V,O,"fcTL"),O+=4,F(V,O,K++),O+=4,F(V,O,Q.rect.width),O+=4,F(V,O,Q.rect.height),O+=4,F(V,O,Q.rect.x),O+=4,F(V,O,Q.rect.y),O+=4,A(V,O,T[G]),O+=2,A(V,O,1e3),O+=2,V[O]=Q.dispose,O++,V[O]=Q.blend,O++,F(V,O,L(V,O-30,30)),O+=4);const ne=Q.cimg;F(V,O,(B=ne.length)+(G==0?0:4)),O+=4;const se=O;D(V,O,G==0?"IDAT":"fdAT"),O+=4,G!=0&&(F(V,O,K++),O+=4),V.set(ne,O),O+=B,F(V,O,L(V,se,O-se)),O+=4}return F(V,O,0),O+=4,D(V,O,"IEND"),O+=4,F(V,O,L(V,O-4,4)),O+=4,V.buffer}function c(C,w,E){for(let T=0;T<C.frames.length;T++){const P=C.frames[T];P.rect.width;const L=P.rect.height,F=new Uint8Array(L*P.bpl+L);P.cimg=g(P.img,L,P.bpp,P.bpl,F,w,E)}}function d(C,w,E,T,P){const L=P[0],F=P[1],A=P[2],D=P[3],O=P[4],z=P[5];let U=6,j=8,Y=255;for(var B=0;B<C.length;B++){const fe=new Uint8Array(C[B]);for(var W=fe.length,G=0;G<W;G+=4)Y&=fe[G+3]}const V=Y!=255,X=(function(be,ge,Ce,je,oe,Te){const Pe=[];for(var Fe=0;Fe<be.length;Fe++){const Ge=new Uint8Array(be[Fe]),te=new Uint32Array(Ge.buffer);var Ke;let pe=0,we=0,xe=ge,ke=Ce,Be=je?1:0;if(Fe!=0){const Le=Te||je||Fe==1||Pe[Fe-2].dispose!=0?1:2;let ze=0,Ie=1e9;for(let qe=0;qe<Le;qe++){var nt=new Uint8Array(be[Fe-1-qe]);const Re=new Uint32Array(be[Fe-1-qe]);let Ne=ge,Oe=Ce,Ue=-1,lt=-1;for(let ut=0;ut<Ce;ut++)for(let ot=0;ot<ge;ot++)te[We=ut*ge+ot]!=Re[We]&&(ot<Ne&&(Ne=ot),ot>Ue&&(Ue=ot),ut<Oe&&(Oe=ut),ut>lt&&(lt=ut));Ue==-1&&(Ne=Oe=Ue=lt=0),oe&&((1&Ne)==1&&Ne--,(1&Oe)==1&&Oe--);const vt=(Ue-Ne+1)*(lt-Oe+1);vt<Ie&&(Ie=vt,ze=qe,pe=Ne,we=Oe,xe=Ue-Ne+1,ke=lt-Oe+1)}nt=new Uint8Array(be[Fe-1-ze]),ze==1&&(Pe[Fe-1].dispose=2),Ke=new Uint8Array(xe*ke*4),e(nt,ge,Ce,Ke,xe,ke,-pe,-we,0),Be=e(Ge,ge,Ce,Ke,xe,ke,-pe,-we,3)?1:0,Be==1?f(Ge,ge,Ce,Ke,{x:pe,y:we,width:xe,height:ke}):e(Ge,ge,Ce,Ke,xe,ke,-pe,-we,0)}else Ke=Ge.slice(0);Pe.push({rect:{x:pe,y:we,width:xe,height:ke},img:Ke,blend:Be,dispose:0})}if(je)for(Fe=0;Fe<Pe.length;Fe++){if((pt=Pe[Fe]).blend==1)continue;const Ge=pt.rect,te=Pe[Fe-1].rect,pe=Math.min(Ge.x,te.x),we=Math.min(Ge.y,te.y),xe={x:pe,y:we,width:Math.max(Ge.x+Ge.width,te.x+te.width)-pe,height:Math.max(Ge.y+Ge.height,te.y+te.height)-we};Pe[Fe-1].dispose=1,Fe-1!=0&&u(be,ge,Ce,Pe,Fe-1,xe,oe),u(be,ge,Ce,Pe,Fe,xe,oe)}let dt=0;if(be.length!=1)for(var We=0;We<Pe.length;We++){var pt;dt+=(pt=Pe[We]).rect.width*pt.rect.height}return Pe})(C,w,E,L,F,A),K={},Q=[],ne=[];if(T!=0){const fe=[];for(G=0;G<X.length;G++)fe.push(X[G].img.buffer);const be=(function(oe){let Te=0;for(var Pe=0;Pe<oe.length;Pe++)Te+=oe[Pe].byteLength;const Fe=new Uint8Array(Te);let Ke=0;for(Pe=0;Pe<oe.length;Pe++){const nt=new Uint8Array(oe[Pe]),dt=nt.length;for(let We=0;We<dt;We+=4){let pt=nt[We],Ge=nt[We+1],te=nt[We+2];const pe=nt[We+3];pe==0&&(pt=Ge=te=0),Fe[Ke+We]=pt,Fe[Ke+We+1]=Ge,Fe[Ke+We+2]=te,Fe[Ke+We+3]=pe}Ke+=dt}return Fe.buffer})(fe),ge=p(be,T);for(G=0;G<ge.plte.length;G++)Q.push(ge.plte[G].est.rgba);let Ce=0;for(G=0;G<X.length;G++){const je=(ue=X[G]).img.length;var se=new Uint8Array(ge.inds.buffer,Ce>>2,je>>2);ne.push(se);const oe=new Uint8Array(ge.abuf,Ce,je);z&&a(ue.img,ue.rect.width,ue.rect.height,Q,oe,se),ue.img.set(oe),Ce+=je}}else for(B=0;B<X.length;B++){var ue=X[B];const fe=new Uint32Array(ue.img.buffer);var ee=ue.rect.width;for(W=fe.length,se=new Uint8Array(W),ne.push(se),G=0;G<W;G++){const be=fe[G];if(G!=0&&be==fe[G-1])se[G]=se[G-1];else if(G>ee&&be==fe[G-ee])se[G]=se[G-ee];else{let ge=K[be];if(ge==null&&(K[be]=ge=Q.length,Q.push(be),Q.length>=300))break;se[G]=ge}}}const me=Q.length;for(me<=256&&O==0&&(j=me<=2?1:me<=4?2:me<=16?4:8,j=Math.max(j,D)),B=0;B<X.length;B++){(ue=X[B]).rect.x,ue.rect.y,ee=ue.rect.width;const fe=ue.rect.height;let be=ue.img;new Uint32Array(be.buffer);let ge=4*ee,Ce=4;if(me<=256&&O==0){ge=Math.ceil(j*ee/8);var ie=new Uint8Array(ge*fe);const je=ne[B];for(let oe=0;oe<fe;oe++){G=oe*ge;const Te=oe*ee;if(j==8)for(var de=0;de<ee;de++)ie[G+de]=je[Te+de];else if(j==4)for(de=0;de<ee;de++)ie[G+(de>>1)]|=je[Te+de]<<4-4*(1&de);else if(j==2)for(de=0;de<ee;de++)ie[G+(de>>2)]|=je[Te+de]<<6-2*(3&de);else if(j==1)for(de=0;de<ee;de++)ie[G+(de>>3)]|=je[Te+de]<<7-1*(7&de)}be=ie,U=3,Ce=1}else if(V==0&&X.length==1){ie=new Uint8Array(ee*fe*3);const je=ee*fe;for(G=0;G<je;G++){const oe=3*G,Te=4*G;ie[oe]=be[Te],ie[oe+1]=be[Te+1],ie[oe+2]=be[Te+2]}be=ie,U=2,Ce=3,ge=3*ee}ue.img=be,ue.bpl=ge,ue.bpp=Ce}return{ctype:U,depth:j,plte:Q,frames:X}}function u(C,w,E,T,P,L,F){const A=Uint8Array,D=Uint32Array,O=new A(C[P-1]),z=new D(C[P-1]),U=P+1<C.length?new A(C[P+1]):null,j=new A(C[P]),Y=new D(j.buffer);let B=w,W=E,G=-1,V=-1;for(let K=0;K<L.height;K++)for(let Q=0;Q<L.width;Q++){const ne=L.x+Q,se=L.y+K,ue=se*w+ne,ee=Y[ue];ee==0||T[P-1].dispose==0&&z[ue]==ee&&(U==null||U[4*ue+3]!=0)||(ne<B&&(B=ne),ne>G&&(G=ne),se<W&&(W=se),se>V&&(V=se))}G==-1&&(B=W=G=V=0),F&&((1&B)==1&&B--,(1&W)==1&&W--),L={x:B,y:W,width:G-B+1,height:V-W+1};const X=T[P];X.rect=L,X.blend=1,X.img=new Uint8Array(L.width*L.height*4),T[P-1].dispose==0?(e(O,w,E,X.img,L.width,L.height,-L.x,-L.y,0),f(j,w,E,X.img,L)):e(j,w,E,X.img,L.width,L.height,-L.x,-L.y,0)}function f(C,w,E,T,P){e(C,w,E,T,P.width,P.height,-P.x,-P.y,2)}function g(C,w,E,T,P,L,F){const A=[];let D,O=[0,1,2,3,4];L!=-1?O=[L]:(w*T>5e5||E==1)&&(O=[0]),F&&(D={level:0});const z=lM;for(var U=0;U<O.length;U++){for(let B=0;B<w;B++)m(P,C,B,T,E,O[U]);A.push(z.deflate(P,D))}let j,Y=1e9;for(U=0;U<A.length;U++)A[U].length<Y&&(j=U,Y=A[U].length);return A[j]}function m(C,w,E,T,P,L){const F=E*T;let A=F+E;if(C[A]=L,A++,L==0)if(T<500)for(var D=0;D<T;D++)C[A+D]=w[F+D];else C.set(new Uint8Array(w.buffer,F,T),A);else if(L==1){for(D=0;D<P;D++)C[A+D]=w[F+D];for(D=P;D<T;D++)C[A+D]=w[F+D]-w[F+D-P]+256&255}else if(E==0){for(D=0;D<P;D++)C[A+D]=w[F+D];if(L==2)for(D=P;D<T;D++)C[A+D]=w[F+D];if(L==3)for(D=P;D<T;D++)C[A+D]=w[F+D]-(w[F+D-P]>>1)+256&255;if(L==4)for(D=P;D<T;D++)C[A+D]=w[F+D]-n(w[F+D-P],0,0)+256&255}else{if(L==2)for(D=0;D<T;D++)C[A+D]=w[F+D]+256-w[F+D-T]&255;if(L==3){for(D=0;D<P;D++)C[A+D]=w[F+D]+256-(w[F+D-T]>>1)&255;for(D=P;D<T;D++)C[A+D]=w[F+D]+256-(w[F+D-T]+w[F+D-P]>>1)&255}if(L==4){for(D=0;D<P;D++)C[A+D]=w[F+D]+256-n(0,w[F+D-T],0)&255;for(D=P;D<T;D++)C[A+D]=w[F+D]+256-n(w[F+D-P],w[F+D-T],w[F+D-P-T])&255}}}function p(C,w){const E=new Uint8Array(C),T=E.slice(0),P=new Uint32Array(T.buffer),L=y(T,w),F=L[0],A=L[1],D=E.length,O=new Uint8Array(D>>2);let z;if(E.length<2e7)for(var U=0;U<D;U+=4)z=b(F,j=E[U]*.00392156862745098,Y=E[U+1]*.00392156862745098,B=E[U+2]*.00392156862745098,W=E[U+3]*.00392156862745098),O[U>>2]=z.ind,P[U>>2]=z.est.rgba;else for(U=0;U<D;U+=4){var j=E[U]*.00392156862745098,Y=E[U+1]*(1/255),B=E[U+2]*(1/255),W=E[U+3]*(1/255);for(z=F;z.left;)z=_(z.est,j,Y,B,W)<=0?z.left:z.right;O[U>>2]=z.ind,P[U>>2]=z.est.rgba}return{abuf:T.buffer,inds:O,plte:A}}function y(C,w,E){E==null&&(E=1e-4);const T=new Uint32Array(C.buffer),P={i0:0,i1:C.length,bst:null,est:null,tdst:0,left:null,right:null};P.bst=S(C,P.i0,P.i1),P.est=k(P.bst);const L=[P];for(;L.length<w;){let A=0,D=0;for(var F=0;F<L.length;F++)L[F].est.L>A&&(A=L[F].est.L,D=F);if(A<E)break;const O=L[D],z=x(C,T,O.i0,O.i1,O.est.e,O.est.eMq255);if(O.i0>=z||O.i1<=z){O.est.L=0;continue}const U={i0:O.i0,i1:z,bst:null,est:null,tdst:0,left:null,right:null};U.bst=S(C,U.i0,U.i1),U.est=k(U.bst);const j={i0:z,i1:O.i1,bst:null,est:null,tdst:0,left:null,right:null};for(j.bst={R:[],m:[],N:O.bst.N-U.bst.N},F=0;F<16;F++)j.bst.R[F]=O.bst.R[F]-U.bst.R[F];for(F=0;F<4;F++)j.bst.m[F]=O.bst.m[F]-U.bst.m[F];j.est=k(j.bst),O.left=U,O.right=j,L[D]=U,L.push(j)}for(L.sort(((A,D)=>D.bst.N-A.bst.N)),F=0;F<L.length;F++)L[F].ind=F;return[P,L]}function b(C,w,E,T,P){if(C.left==null)return C.tdst=(function(U,j,Y,B,W){const G=j-U[0],V=Y-U[1],X=B-U[2],K=W-U[3];return G*G+V*V+X*X+K*K})(C.est.q,w,E,T,P),C;const L=_(C.est,w,E,T,P);let F=C.left,A=C.right;L>0&&(F=C.right,A=C.left);const D=b(F,w,E,T,P);if(D.tdst<=L*L)return D;const O=b(A,w,E,T,P);return O.tdst<D.tdst?O:D}function _(C,w,E,T,P){const{e:L}=C;return L[0]*w+L[1]*E+L[2]*T+L[3]*P-C.eMq}function x(C,w,E,T,P,L){for(T-=4;E<T;){for(;M(C,E,P)<=L;)E+=4;for(;M(C,T,P)>L;)T-=4;if(E>=T)break;const F=w[E>>2];w[E>>2]=w[T>>2],w[T>>2]=F,E+=4,T-=4}for(;M(C,E,P)>L;)E-=4;return E+4}function M(C,w,E){return C[w]*E[0]+C[w+1]*E[1]+C[w+2]*E[2]+C[w+3]*E[3]}function S(C,w,E){const T=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],P=[0,0,0,0],L=E-w>>2;for(let F=w;F<E;F+=4){const A=C[F]*.00392156862745098,D=C[F+1]*(1/255),O=C[F+2]*(1/255),z=C[F+3]*(1/255);P[0]+=A,P[1]+=D,P[2]+=O,P[3]+=z,T[0]+=A*A,T[1]+=A*D,T[2]+=A*O,T[3]+=A*z,T[5]+=D*D,T[6]+=D*O,T[7]+=D*z,T[10]+=O*O,T[11]+=O*z,T[15]+=z*z}return T[4]=T[1],T[8]=T[2],T[9]=T[6],T[12]=T[3],T[13]=T[7],T[14]=T[11],{R:T,m:P,N:L}}function k(C){const{R:w}=C,{m:E}=C,{N:T}=C,P=E[0],L=E[1],F=E[2],A=E[3],D=T==0?0:1/T,O=[w[0]-P*P*D,w[1]-P*L*D,w[2]-P*F*D,w[3]-P*A*D,w[4]-L*P*D,w[5]-L*L*D,w[6]-L*F*D,w[7]-L*A*D,w[8]-F*P*D,w[9]-F*L*D,w[10]-F*F*D,w[11]-F*A*D,w[12]-A*P*D,w[13]-A*L*D,w[14]-A*F*D,w[15]-A*A*D],z=O,U=N;let j=[Math.random(),Math.random(),Math.random(),Math.random()],Y=0,B=0;if(T!=0)for(let G=0;G<16&&(j=U.multVec(z,j),B=Math.sqrt(U.dot(j,j)),j=U.sml(1/B,j),!(G!=0&&Math.abs(B-Y)<1e-9));G++)Y=B;const W=[P*D,L*D,F*D,A*D];return{Cov:O,q:W,e:j,L:Y,eMq255:U.dot(U.sml(255,W),j),eMq:U.dot(j,W),rgba:(Math.round(255*W[3])<<24|Math.round(255*W[2])<<16|Math.round(255*W[1])<<8|Math.round(255*W[0])<<0)>>>0}}var N={multVec:(C,w)=>[C[0]*w[0]+C[1]*w[1]+C[2]*w[2]+C[3]*w[3],C[4]*w[0]+C[5]*w[1]+C[6]*w[2]+C[7]*w[3],C[8]*w[0]+C[9]*w[1]+C[10]*w[2]+C[11]*w[3],C[12]*w[0]+C[13]*w[1]+C[14]*w[2]+C[15]*w[3]],dot:(C,w)=>C[0]*w[0]+C[1]*w[1]+C[2]*w[2]+C[3]*w[3],sml:(C,w)=>[C*w[0],C*w[1],C*w[2],C*w[3]]};$n.encode=function(w,E,T,P,L,F,A){P==null&&(P=0),A==null&&(A=!1);const D=d(w,E,T,P,[!1,!1,!1,0,A,!1]);return c(D,-1),l(D,E,T,L,F)},$n.encodeLL=function(w,E,T,P,L,F,A,D){const O={ctype:0+(P==1?0:2)+(L==0?0:4),depth:F,frames:[]},z=(P+L)*F,U=z*E;for(let j=0;j<w.length;j++)O.frames.push({rect:{x:0,y:0,width:E,height:T},img:new Uint8Array(w[j]),blend:0,dispose:1,bpp:Math.ceil(z/8),bpl:Math.ceil(U/8)});return c(O,0,!0),l(O,E,T,A,D)},$n.encode.compress=d,$n.encode.dither=a,$n.quantize=p,$n.quantize.getKDtree=y,$n.quantize.getNearest=b})();const Qp={toArrayBuffer(e,t){const n=e.width,r=e.height,s=n<<2,o=e.getContext("2d").getImageData(0,0,n,r),i=new Uint32Array(o.data.buffer),a=(32*n+31)/32<<2,l=a*r,c=122+l,d=new ArrayBuffer(c),u=new DataView(d),f=1<<20;let g,m,p,y,b=f,_=0,x=0,M=0;function S(C){u.setUint16(x,C,!0),x+=2}function k(C){u.setUint32(x,C,!0),x+=4}function N(C){x+=C}S(19778),k(c),N(4),k(122),k(108),k(n),k(-r>>>0),S(1),S(32),k(3),k(l),k(2835),k(2835),N(8),k(16711680),k(65280),k(255),k(4278190080),k(1466527264),(function C(){for(;_<r&&b>0;){for(y=122+_*a,g=0;g<s;)b--,m=i[M++],p=m>>>24,u.setUint32(y+g,m<<8|p),g+=4;_++}M<i.length?(b=f,setTimeout(C,Qp._dly)):t(d)})()},toBlob(e,t){this.toArrayBuffer(e,(n=>{t(new Blob([n],{type:"image/bmp"}))}))},_dly:9};var ln={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},cM={[ln.CHROME]:16384,[ln.FIREFOX]:11180,[ln.DESKTOP_SAFARI]:16384,[ln.IE]:8192,[ln.IOS]:4096,[ln.ETC]:8192};const rd=typeof window<"u",Jp=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,la=rd&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),dM=(rd||Jp)&&(la&&la.getOriginalSymbol(window,"File")||typeof File<"u"&&File),Rp=(rd||Jp)&&(la&&la.getOriginalSymbol(window,"FileReader")||typeof FileReader<"u"&&FileReader);function sd(e,t,n=Date.now()){return new Promise((r=>{const s=e.split(","),o=s[0].match(/:(.*?);/)[1],i=globalThis.atob(s[1]);let a=i.length;const l=new Uint8Array(a);for(;a--;)l[a]=i.charCodeAt(a);const c=new Blob([l],{type:o});c.name=t,c.lastModified=n,r(c)}))}function e0(e){return new Promise(((t,n)=>{const r=new Rp;r.onload=()=>t(r.result),r.onerror=s=>n(s),r.readAsDataURL(e)}))}function t0(e){return new Promise(((t,n)=>{const r=new Image;r.onload=()=>t(r),r.onerror=s=>n(s),r.src=e}))}function $r(){if($r.cachedResult!==void 0)return $r.cachedResult;let e=ln.ETC;const{userAgent:t}=navigator;return/Chrom(e|ium)/i.test(t)?e=ln.CHROME:/iP(ad|od|hone)/i.test(t)&&/WebKit/i.test(t)?e=ln.IOS:/Safari/i.test(t)?e=ln.DESKTOP_SAFARI:/Firefox/i.test(t)?e=ln.FIREFOX:(/MSIE/i.test(t)||document.documentMode)&&(e=ln.IE),$r.cachedResult=e,$r.cachedResult}function n0(e,t){const n=$r(),r=cM[n];let s=e,o=t,i=s*o;const a=s>o?o/s:s/o;for(;i>r*r;){const l=(r+s)/2,c=(r+o)/2;l<c?(o=c,s=c*a):(o=l*a,s=l),i=s*o}return{width:s,height:o}}function ca(e,t){let n,r;try{if(n=new OffscreenCanvas(e,t),r=n.getContext("2d"),r===null)throw new Error("getContext of OffscreenCanvas returns null")}catch{n=document.createElement("canvas"),r=n.getContext("2d")}return n.width=e,n.height=t,[n,r]}function r0(e,t){const{width:n,height:r}=n0(e.width,e.height),[s,o]=ca(n,r);return t&&/jpe?g/.test(t)&&(o.fillStyle="white",o.fillRect(0,0,s.width,s.height)),o.drawImage(e,0,0,s.width,s.height),s}function da(){return da.cachedResult!==void 0||(da.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&typeof document<"u"&&"ontouchend"in document),da.cachedResult}function ua(e,t={}){return new Promise((function(n,r){let s,o;var i=function(){try{return o=r0(s,t.fileType||e.type),n([s,o])}catch(l){return r(l)}},a=function(l){try{var c=function(d){try{throw d}catch(u){return r(u)}};try{let d;return e0(e).then((function(u){try{return d=u,t0(d).then((function(f){try{return s=f,(function(){try{return i()}catch(g){return r(g)}})()}catch(g){return c(g)}}),c)}catch(f){return c(f)}}),c)}catch(d){c(d)}}catch(d){return r(d)}};try{if(da()||[ln.DESKTOP_SAFARI,ln.MOBILE_SAFARI].includes($r()))throw new Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(e).then((function(l){try{return s=l,i()}catch{return a()}}),a)}catch{a()}}))}function fa(e,t,n,r,s=1){return new Promise((function(o,i){let a;if(t==="image/png"){let c,d,u;return c=e.getContext("2d"),{data:d}=c.getImageData(0,0,e.width,e.height),u=$n.encode([d.buffer],e.width,e.height,4096*s),a=new Blob([u],{type:t}),a.name=n,a.lastModified=r,l.call(this)}{let c=function(){return l.call(this)};if(t==="image/bmp")return new Promise((d=>Qp.toBlob(e,d))).then(function(d){try{return a=d,a.name=n,a.lastModified=r,c.call(this)}catch(u){return i(u)}}.bind(this),i);{let d=function(){return c.call(this)};if(typeof OffscreenCanvas=="function"&&e instanceof OffscreenCanvas)return e.convertToBlob({type:t,quality:s}).then(function(u){try{return a=u,a.name=n,a.lastModified=r,d.call(this)}catch(f){return i(f)}}.bind(this),i);{let u;return u=e.toDataURL(t,s),sd(u,n,r).then(function(f){try{return a=f,d.call(this)}catch(g){return i(g)}}.bind(this),i)}}}function l(){return o(a)}}))}function Gn(e){e.width=0,e.height=0}function _s(){return new Promise((function(e,t){let n,r,s,o;return _s.cachedResult!==void 0?e(_s.cachedResult):sd("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then((function(i){try{return n=i,ua(n).then((function(a){try{return r=a[1],fa(r,n.type,n.name,n.lastModified).then((function(l){try{return s=l,Gn(r),ua(s).then((function(c){try{return o=c[0],_s.cachedResult=o.width===1&&o.height===2,e(_s.cachedResult)}catch(d){return t(d)}}),t)}catch(c){return t(c)}}),t)}catch(l){return t(l)}}),t)}catch(a){return t(a)}}),t)}))}function s0(e){return new Promise(((t,n)=>{const r=new Rp;r.onload=s=>{const o=new DataView(s.target.result);if(o.getUint16(0,!1)!=65496)return t(-2);const i=o.byteLength;let a=2;for(;a<i;){if(o.getUint16(a+2,!1)<=8)return t(-1);const l=o.getUint16(a,!1);if(a+=2,l==65505){if(o.getUint32(a+=2,!1)!=1165519206)return t(-1);const c=o.getUint16(a+=6,!1)==18761;a+=o.getUint32(a+4,c);const d=o.getUint16(a,c);a+=2;for(let u=0;u<d;u++)if(o.getUint16(a+12*u,c)==274)return t(o.getUint16(a+12*u+8,c))}else{if((65280&l)!=65280)break;a+=o.getUint16(a,!1)}}return t(-1)},r.onerror=s=>n(s),r.readAsArrayBuffer(e)}))}function o0(e,t){const{width:n}=e,{height:r}=e,{maxWidthOrHeight:s}=t;let o,i=e;return isFinite(s)&&(n>s||r>s)&&([i,o]=ca(n,r),n>r?(i.width=s,i.height=r/n*s):(i.width=n/r*s,i.height=s),o.drawImage(e,0,0,i.width,i.height),Gn(e)),i}function i0(e,t){const{width:n}=e,{height:r}=e,[s,o]=ca(n,r);switch(t>4&&t<9?(s.width=r,s.height=n):(s.width=n,s.height=r),t){case 2:o.transform(-1,0,0,1,n,0);break;case 3:o.transform(-1,0,0,-1,n,r);break;case 4:o.transform(1,0,0,-1,0,r);break;case 5:o.transform(0,1,1,0,0,0);break;case 6:o.transform(0,1,-1,0,r,0);break;case 7:o.transform(0,-1,-1,0,r,n);break;case 8:o.transform(0,-1,1,0,0,n)}return o.drawImage(e,0,0,n,r),Gn(e),s}function a0(e,t,n=0){return new Promise((function(r,s){let o,i,a,l,c,d,u,f,g,m,p,y,b,_,x,M,S,k,N,C;function w(T=5){if(t.signal&&t.signal.aborted)throw t.signal.reason;o+=T,t.onProgress(Math.min(o,100))}function E(T){if(t.signal&&t.signal.aborted)throw t.signal.reason;o=Math.min(Math.max(T,o),100),t.onProgress(o)}return o=n,i=t.maxIteration||10,a=1024*t.maxSizeMB*1024,w(),ua(e,t).then(function(T){try{return[,l]=T,w(),c=o0(l,t),w(),new Promise((function(P,L){var F;if(!(F=t.exifOrientation))return s0(e).then(function(D){try{return F=D,A.call(this)}catch(O){return L(O)}}.bind(this),L);function A(){return P(F)}return A.call(this)})).then(function(P){try{return d=P,w(),_s().then(function(L){try{return u=L?c:i0(c,d),w(),f=t.initialQuality||1,g=t.fileType||e.type,fa(u,g,e.name,e.lastModified,f).then(function(F){try{{let D=function(){if(i--&&(x>a||x>b)){let z,U;return z=C?.95*N.width:N.width,U=C?.95*N.height:N.height,[S,k]=ca(z,U),k.drawImage(N,0,0,z,U),f*=g==="image/png"?.85:.95,fa(S,g,e.name,e.lastModified,f).then((function(j){try{return M=j,Gn(N),N=S,x=M.size,E(Math.min(99,Math.floor((_-x)/(_-a)*100))),D}catch(Y){return s(Y)}}),s)}return[1]},O=function(){return Gn(N),Gn(S),Gn(c),Gn(u),Gn(l),E(100),r(M)};if(m=F,w(),p=m.size>a,y=m.size>e.size,!p&&!y)return E(100),r(m);var A;return b=e.size,_=m.size,x=_,N=u,C=!t.alwaysKeepResolution&&p,(A=function(z){for(;z;){if(z.then)return void z.then(A,s);try{if(z.pop){if(z.length)return z.pop()?O.call(this):z;z=D}else z=z.call(this)}catch(U){return s(U)}}}.bind(this))(D)}}catch(D){return s(D)}}.bind(this),s)}catch(F){return s(F)}}.bind(this),s)}catch(L){return s(L)}}.bind(this),s)}catch(P){return s(P)}}.bind(this),s)}))}const uM=`
|
||
let scriptImported = false
|
||
self.addEventListener('message', async (e) => {
|
||
const { file, id, imageCompressionLibUrl, options } = e.data
|
||
options.onProgress = (progress) => self.postMessage({ progress, id })
|
||
try {
|
||
if (!scriptImported) {
|
||
// console.log('[worker] importScripts', imageCompressionLibUrl)
|
||
self.importScripts(imageCompressionLibUrl)
|
||
scriptImported = true
|
||
}
|
||
// console.log('[worker] self', self)
|
||
const compressedFile = await imageCompression(file, options)
|
||
self.postMessage({ file: compressedFile, id })
|
||
} catch (e) {
|
||
// console.error('[worker] error', e)
|
||
self.postMessage({ error: e.message + '\\n' + e.stack, id })
|
||
}
|
||
})
|
||
`;let od;function fM(e,t){return new Promise(((n,r)=>{od||(od=(function(i){const a=[];return a.push(i),URL.createObjectURL(new Blob(a))})(uM));const s=new Worker(od);s.addEventListener("message",(function(i){if(t.signal&&t.signal.aborted)s.terminate();else if(i.data.progress===void 0){if(i.data.error)return r(new Error(i.data.error)),void s.terminate();n(i.data.file),s.terminate()}else t.onProgress(i.data.progress)})),s.addEventListener("error",r),t.signal&&t.signal.addEventListener("abort",(()=>{r(t.signal.reason),s.terminate()})),s.postMessage({file:e,imageCompressionLibUrl:t.libURL,options:{...t,onProgress:void 0,signal:void 0}})}))}function Qt(e,t){return new Promise((function(n,r){let s,o,i,a,l,c;if(s={...t},i=0,{onProgress:a}=s,s.maxSizeMB=s.maxSizeMB||Number.POSITIVE_INFINITY,l=typeof s.useWebWorker!="boolean"||s.useWebWorker,delete s.useWebWorker,s.onProgress=g=>{i=g,typeof a=="function"&&a(i)},!(e instanceof Blob||e instanceof dM))return r(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(e.type))return r(new Error("The file given is not an image"));if(c=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,!l||typeof Worker!="function"||c)return a0(e,s).then(function(g){try{return o=g,f.call(this)}catch(m){return r(m)}}.bind(this),r);var d=function(){try{return f.call(this)}catch(g){return r(g)}}.bind(this),u=function(g){try{return a0(e,s).then((function(m){try{return o=m,d()}catch(p){return r(p)}}),r)}catch(m){return r(m)}};try{return s.libURL=s.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",fM(e,s).then((function(g){try{return o=g,d()}catch{return u()}}),u)}catch{u()}function f(){try{o.name=e.name,o.lastModified=e.lastModified}catch{}try{s.preserveExif&&e.type==="image/jpeg"&&(!s.fileType||s.fileType&&s.fileType===e.type)&&(o=Zp(e,o))}catch{}return n(o)}}))}Qt.getDataUrlFromFile=e0,Qt.getFilefromDataUrl=sd,Qt.loadImage=t0,Qt.drawImageInCanvas=r0,Qt.drawFileInCanvas=ua,Qt.canvasToFile=fa,Qt.getExifOrientation=s0,Qt.handleMaxWidthOrHeight=o0,Qt.followExifOrientation=i0,Qt.cleanupCanvasMemory=Gn,Qt.isAutoOrientationInBrowser=_s,Qt.approximateBelowMaximumCanvasSizeOfBrowser=n0,Qt.copyExifWithoutOrientation=Zp,Qt.getBrowserName=$r,Qt.version="2.0.2";const hM=window.G7Core,id=e=>{const t=["B","KB","MB","GB"];let n=0,r=e;for(;r>=1024&&n<t.length-1;)r/=1024,n++;return`${r.toFixed(2)} ${t[n]}`},gM=e=>{if(e&&typeof e=="object"){const t=e;if(t.response?.data?.message)return t.response.data.message;if(t.response?.data?.errors){const n=Object.values(t.response.data.errors)[0];if(Array.isArray(n)&&n[0])return n[0]}if(t.message)return t.message}return e instanceof Error?e.message:"업로드 실패"},pM=e=>e?e.startsWith("image/")?"fa-file-image":e.startsWith("video/")?"fa-file-video":e.startsWith("audio/")?"fa-file-audio":e==="application/pdf"?"fa-file-pdf":e.includes("word")||e.includes("document")?"fa-file-word":e.includes("excel")||e.includes("spreadsheet")?"fa-file-excel":e.includes("zip")||e.includes("compressed")?"fa-file-zipper":"fa-file":"fa-file",Ht=(e,t)=>hM?.t?.(e,t)??e,l0=window.G7Core?.createLogger?.("Comp:FileUploader")??{log:(...e)=>console.log("[Comp:FileUploader]",...e),warn:(...e)=>console.warn("[Comp:FileUploader]",...e),error:(...e)=>console.error("[Comp:FileUploader]",...e)},mM="2.0.2";function bM(){const e=window?.G7Core?.asset;if(typeof e?.template=="function")return e.template("sirsoft-admin_basic",`vendor/browser-image-compression/${mM}/browser-image-compression.js`)}const Fr=window.G7Core;function yM(e){const{attachmentableType:t,attachmentableId:n,collection:r,maxFiles:s,maxSize:o,maxConcurrentUploads:i,accept:a,imageCompression:l,roleIds:c,autoUpload:d,initialFiles:u,endpoints:f,onFilesChange:g,onUploadComplete:m,onUploadError:p,onRemove:y,onReorder:b,uploadTriggerEvent:_,confirmBeforeRemove:x,uploadParams:M}=e,[S,k]=v.useState(u),[N,C]=v.useState([]),[w,E]=v.useState(!1),T=v.useRef(null),P=v.useRef(0),L=v.useRef(new Set),F=v.useRef(new Map),A=v.useRef(null),[D,O]=v.useState(!1),[z,U]=v.useState(null),[j,Y]=v.useState(!1),B=v.useRef(!1),[W,G]=v.useState([]),[V,X]=v.useState(!1),[K,Q]=v.useState(0),ne=v.useRef(0),[se,ue]=v.useState(new Map),ee=v.useRef(new Map),me=v.useRef(g);me.current=g,v.useEffect(()=>{me.current?.(N)},[N]),v.useEffect(()=>{if(B.current)return;const te=u.filter(xe=>!L.current.has(xe.id)&&(!xe.hash||!L.current.has(xe.hash))),pe=new Set(te.map(xe=>xe.id)),we=Array.from(F.current.values()).filter(xe=>!pe.has(xe.id)&&!L.current.has(xe.id));k([...te,...we])},[u]);const ie=v.useCallback(async te=>{const pe={maxSizeMB:l?.maxSizeMB??1,maxWidthOrHeight:l?.maxWidthOrHeight??1920,useWebWorker:!0,libURL:bM()};return await Qt(te,pe)},[l]),de=v.useCallback(async te=>{const pe=S.length+N.length,we=Math.max(0,s-pe),xe=Array.from(te).slice(0,we);if(te.length>we){const ke=Array.from(te).slice(we),Be=Ht("attachment.upload_limit_exceeded",{max:s});p?.(Be,ke[0]??te[0])}for(const ke of xe){if(ke.size>o*1024*1024){p?.(`[${ke.name}] 파일 크기(${id(ke.size)})가 최대 허용 크기(${o}MB)를 초과합니다.`,ke);continue}if(a){const Le="."+ke.name.split(".").pop()?.toLowerCase();if(!a.split(",").map(Ie=>Ie.trim().toLowerCase()).includes(Le)){p?.(`[${ke.name}] 허용되지 않는 파일 형식입니다. (허용: ${a})`,ke);continue}}const Be={id:`pending-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,file:ke,original_filename:ke.name,mime_type:ke.type,size:ke.size,size_formatted:id(ke.size),status:"pending",progress:0};if(ke.type.startsWith("image/")&&(Be.preview=URL.createObjectURL(ke)),C(Le=>[...Le,Be]),ke.type.startsWith("image/")&&l){C(Le=>Le.map(ze=>ze.id===Be.id?{...ze,status:"compressing"}:ze));try{const Le=await ie(ke);C(ze=>ze.map(Ie=>Ie.id===Be.id?{...Ie,compressedBlob:Le,size:Le.size,size_formatted:id(Le.size),status:"pending",progress:0}:Ie))}catch{C(Le=>Le.map(ze=>ze.id===Be.id?{...ze,status:"error",error:"이미지 압축 실패"}:ze))}}}},[S.length,N.length,s,o,a,l,ie,p]),fe=v.useCallback(async te=>{const pe=new FormData,we=te.compressedBlob?new File([te.compressedBlob],te.original_filename,{type:te.mime_type}):te.file;pe.append("file",we),t&&pe.append("attachmentable_type",t),n&&pe.append("attachmentable_id",String(n)),pe.append("collection",r),c.forEach(xe=>{pe.append("role_ids[]",String(xe))}),M&&Object.entries(M).forEach(([xe,ke])=>{pe.append(xe,ke)});try{const xe=await Fr.api.post(f.upload,pe,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:Be=>{const Le=Math.round(Be.loaded*100/(Be.total??1));C(ze=>ze.map(Ie=>Ie.id===te.id?{...Ie,progress:Le}:Ie))}});return xe?.data?.data??xe?.data}catch(xe){const ke=gM(xe);throw new Error(ke)}},[t,n,r,c,f.upload]),be=v.useCallback(async()=>{const te=N.filter(Le=>Le.status==="pending"||Le.status==="error");if(te.length===0)return A.current=S,[];const pe=[],we=new Map,xe=[...te],ke=async()=>{for(;xe.length>0&&P.current<i;){const Le=xe.shift();P.current++,C(ze=>ze.map(Ie=>Ie.id===Le.id?{...Ie,status:"uploading",progress:0}:Ie));try{const ze=await fe(Le);if(ze)pe.push(ze),we.set(String(Le.id),String(ze.hash)),F.current.set(ze.id,ze),C(Ie=>Ie.filter(qe=>qe.id!==Le.id)),k(Ie=>[...Ie,ze]),G(Ie=>{if(Ie.length===0)return Ie;const qe=String(Le.id);return Ie.some(Ne=>String(Ne)===qe)?Ie.map(Ne=>String(Ne)===qe?String(ze.hash):Ne):Ie}),Le.preview&&URL.revokeObjectURL(Le.preview);else{const Ie=Ht("attachment.upload_response_invalid");C(qe=>qe.map(Re=>Re.id===Le.id?{...Re,status:"error",error:Ie}:Re)),p?.(`[${Le.original_filename}] ${Ie}`,Le.file)}}catch(ze){const Ie=ze instanceof Error?ze.message:"업로드 실패";C(qe=>qe.map(Re=>Re.id===Le.id?{...Re,status:"error",error:Ie}:Re)),p?.(`[${Le.original_filename}] ${Ie}`,Le.file)}finally{P.current--}}},Be=Array(Math.min(i,te.length)).fill(null).map(()=>ke());if(await Promise.all(Be),pe.length>0){m?.(pe);const Le=[...S,...pe];if(W.length>0){const ze=W.map(Re=>we.get(String(Re))??Re),Ie=new Map(ze.map((Re,Ne)=>[String(Re),Ne])),qe=[...Le].sort((Re,Ne)=>{const Oe=Ie.get(String(Re.hash))??Le.length,Ue=Ie.get(String(Ne.hash))??Le.length;return Oe-Ue}).map((Re,Ne)=>({...Re,sort_order:Ne,order:Ne+1}));A.current=qe,f.reorder&&b&&b(qe)}else A.current=Le.map((ze,Ie)=>({...ze,sort_order:Ie,order:Ie+1}))}else A.current=S;return pe},[N,i,fe,m,p,W,S,b,f.reorder]);v.useEffect(()=>{if(!_)return;const te=Fr.componentEvent.on(_,async()=>{const pe=await be(),we=A.current??[...S,...pe];return{uploadedAttachments:pe,existingFiles:S,allFiles:we}});return()=>{te()}},[_,be,S]),v.useEffect(()=>{d&&N.some(te=>te.status==="pending")&&be()},[d,N,be]);const ge=v.useCallback(async te=>{Y(!0);try{if(te.id&&f.delete){const we=f.delete.replace(":id",String(te.id));await Fr.api.delete(we)}const pe=te.hash||te.id;te.id&&(L.current.add(te.id),F.current.delete(te.id)),te.hash&&L.current.add(te.hash),k(we=>we.filter(xe=>(xe.hash||xe.id)!==pe)),y?.(te.hash||te.id),O(!1),U(null)}catch{l0.error("첨부파일 삭제 실패")}finally{Y(!1)}},[y,f.delete]),Ce=v.useCallback(async te=>{"hash"in te?x?(U(te),O(!0)):await ge(te):(te.preview&&URL.revokeObjectURL(te.preview),C(pe=>pe.filter(we=>we.id!==te.id)))},[x,ge]),je=v.useCallback(te=>{C(pe=>pe.map(we=>we.id===te.id?{...we,status:"pending",error:void 0}:we))},[]),oe=v.useCallback(async te=>{const{arrayMove:pe}=await Promise.resolve().then(()=>H_),{active:we,over:xe}=te;if(!xe||we.id===xe.id)return;const ke=[...S,...N];let Be;if(W.length===0)Be=ke;else{const Oe=new Map(W.map((Ue,lt)=>[String(Ue),lt]));Be=[...ke].sort((Ue,lt)=>{const vt="hash"in Ue?String(Ue.hash):String(Ue.id),ut="hash"in lt?String(lt.hash):String(lt.id);return(Oe.get(vt)??ke.length)-(Oe.get(ut)??ke.length)})}const Le=Be.findIndex(Oe=>"hash"in Oe?Oe.hash===we.id:Oe.id===we.id),ze=Be.findIndex(Oe=>"hash"in Oe?Oe.hash===xe.id:Oe.id===xe.id),Ie=pe(Be,Le,ze);G(Ie.map(Oe=>"hash"in Oe?Oe.hash:Oe.id));const qe=Ie.filter(Oe=>"hash"in Oe),Re=Ie.filter(Oe=>!("hash"in Oe));B.current=!0,k(qe),C(Re);const Ne=qe.map((Oe,Ue)=>({...Oe,sort_order:Ue,order:Ue+1}));if(qe.length>0&&f.reorder){const Oe=qe.map((Ue,lt)=>({id:Ue.id,order:lt+1}));try{const Ue=await Fr.api.patch(f.reorder,{order:Oe});Fr.toast.success(Ue.message)}catch(Ue){const lt=Ue instanceof Error?Ue.message:Ht("attachment.reorder_failed");Fr.toast.error(lt)}}b?.(Ne)},[S,N,W,f.reorder,b]),Te=v.useMemo(()=>[...S,...N].filter(te=>"is_image"in te?te.is_image:te.mime_type?.startsWith("image/")??!1),[S,N]),Pe=v.useCallback(te=>{const pe=Te.findIndex(we=>"hash"in te&&"hash"in we?we.hash===te.hash:"id"in te&&"id"in we&&!("hash"in te)&&!("hash"in we)?we.id===te.id:!1);pe!==-1&&(ne.current+=1,Q(pe),X(!0))},[Te]);v.useEffect(()=>{let te=!1;return(async()=>{const we=S.filter(ke=>ke.is_image),xe=new Set(we.map(ke=>ke.id));for(const[ke,Be]of ee.current)xe.has(ke)||(URL.revokeObjectURL(Be),ee.current.delete(ke));for(const ke of we){if(te)break;if(!ee.current.has(ke.id)){if(ed(ke.download_url)){ee.current.set(ke.id,ke.download_url),ue(new Map(ee.current));continue}try{const Be=await Fr.api.get(ke.download_url,{responseType:"blob"});if(!te&&Be){const Le=URL.createObjectURL(Be);ee.current.set(ke.id,Le),ue(new Map(ee.current))}}catch(Be){l0.error("Failed to load authenticated image:",Be)}}}})(),()=>{te=!0}},[S]),v.useEffect(()=>()=>{ee.current.forEach(te=>URL.revokeObjectURL(te)),ee.current.clear()},[]);const Fe=v.useCallback(async te=>{const{executeImageDownload:pe}=await Promise.resolve().then(()=>nM);await pe({src:te.download_url,downloadUrl:te.download_url,filename:te.original_filename,downloadRequiresAuth:!0})},[]),Ke=v.useMemo(()=>{const te=[...S,...N];if(W.length===0)return te;const pe=new Map(W.map((we,xe)=>[String(we),xe]));return[...te].sort((we,xe)=>{const ke="hash"in we?String(we.hash):String(we.id),Be="hash"in xe?String(xe.hash):String(xe.id),Le=pe.get(ke)??te.length,ze=pe.get(Be)??te.length;return Le-ze})},[S,N,W]),nt=Ke.length,dt=nt>0,We=nt<s,pt=v.useCallback(()=>C([]),[]),Ge=v.useCallback(()=>N,[N]);return{existingFiles:S,pendingFiles:N,isDragOver:w,setIsDragOver:E,isDeleting:j,totalCount:nt,hasFiles:dt,canAddMore:We,allItems:Ke,imageFiles:Te,handleFiles:de,handleRemove:Ce,handleRetry:je,handleUploadAll:be,handleOpenGallery:Pe,handleDownload:Fe,handleDragEnd:oe,inputRef:T,galleryOpen:V,setGalleryOpen:X,galleryStartIndex:K,galleryKeyRef:ne,confirmDialogOpen:D,setConfirmDialogOpen:O,itemToDelete:z,executeRemoveAttachment:ge,authenticatedImageUrls:se,clear:pt,getPendingFiles:Ge}}const vM=({isDragOver:e,canAddMore:t,onFiles:n,setIsDragOver:r,inputRef:s,accept:o,maxFiles:i,maxSize:a,disabled:l,children:c})=>{const d=t&&!l;return h.jsxs(I,{className:`
|
||
relative border-2 border-dashed rounded-lg transition-colors
|
||
${l?"opacity-60 cursor-not-allowed":""}
|
||
${e&&!l?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-300 dark:border-gray-600"}
|
||
`,onDragOver:u=>{u.preventDefault(),d&&r(!0)},onDragLeave:()=>r(!1),onDrop:u=>{u.preventDefault(),r(!1),d&&n(u.dataTransfer.files)},children:[h.jsx("input",{ref:s,type:"file",multiple:!0,accept:o,onChange:u=>u.target.files&&!l&&n(u.target.files),className:"hidden",disabled:l}),!c&&h.jsxs(I,{className:`p-8 text-center transition-colors ${l?"cursor-not-allowed":"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800/50"}`,onClick:()=>!l&&s.current?.click(),children:[h.jsx(yt,{className:"fa-solid fa-cloud-arrow-up text-4xl text-gray-400 dark:text-gray-500 mb-4"}),h.jsx(kt,{className:"text-sm text-gray-600 dark:text-gray-400",children:Ht("attachment.drop_or_click")}),h.jsxs(kt,{className:"text-xs text-gray-500 dark:text-gray-500 mt-2",children:[Ht("attachment.upload_limit",{maxFiles:i,maxSize:a}),o&&` (${o})`]})]}),c]})},xM=window.G7Core,wM=window.G7Core?.createLogger?.("Comp:SortableThumbnail")??{log:(...e)=>console.log("[Comp:SortableThumbnail]",...e),warn:(...e)=>console.warn("[Comp:SortableThumbnail]",...e),error:(...e)=>console.error("[Comp:SortableThumbnail]",...e)},kM=({file:e,onRemove:t,onRetry:n,onImageClick:r,onDownload:s,isPrimary:o,onPrimaryClick:i,disabled:a})=>{const{attributes:l,listeners:c,setNodeRef:d,transform:u,transition:f,isDragging:g}=Zi({id:"hash"in e?e.hash:e.id}),m={transform:Wn.Transform.toString(u),transition:f,opacity:g?.5:1},p="status"in e&&e.status!==void 0,y=p?e.status:"done",b=y==="uploading",_=y==="compressing",x=y==="error",M=p?e.progress:100,S=p?e.preview:void 0,k=p?e.mime_type?.startsWith("image/")??!1:e.is_image,[N,C]=v.useState(void 0),w=!p&&k?e.download_url:void 0;v.useEffect(()=>{if(!w){C(void 0);return}if(ed(w)){C(w);return}let T=!0,P;return(async()=>{try{const F=await xM.api.get(w,{responseType:"blob"});T&&F&&(P=URL.createObjectURL(F),C(P))}catch(F){wM.error("Failed to load authenticated image:",F)}})(),()=>{T=!1,P&&URL.revokeObjectURL(P)}},[w]);const E=N;return h.jsxs(I,{ref:d,style:m,className:"relative group bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:[h.jsxs(I,{className:`aspect-square w-full flex items-center justify-center bg-gray-50 dark:bg-gray-900 relative ${k||!p?"cursor-pointer":""}`,onClick:()=>{b||_||(k&&r?r():!p&&s&&s())},children:[S||E?h.jsx(Nn,{src:S||E,alt:e.original_filename,className:"w-full h-full object-cover"}):h.jsx(yt,{className:`fa-solid ${pM(e.mime_type)} text-4xl text-gray-400 dark:text-gray-500`}),(b||_)&&h.jsxs(I,{className:"absolute inset-0 bg-black/50 flex flex-col items-center justify-center",children:[h.jsx(I,{className:"w-3/4 h-2 bg-gray-700 dark:bg-gray-600 rounded-full overflow-hidden",children:h.jsx(I,{className:"h-full bg-blue-500 dark:bg-blue-400 transition-all",style:{width:`${M}%`}})}),h.jsxs(J,{className:"text-white text-xs mt-1",children:[M,"%"]})]}),x&&h.jsx(I,{className:"absolute inset-0 bg-red-500/50 dark:bg-red-600/50 flex items-center justify-center",children:h.jsx(yt,{className:"fa-solid fa-exclamation-triangle text-2xl text-white"})}),i&&h.jsx(le,{type:"button",onClick:T=>{T.stopPropagation(),i()},className:`absolute top-1.5 left-1.5 z-10 p-1 rounded-full transition-colors ${o?"bg-yellow-500 text-white":"bg-gray-800/50 text-gray-300 hover:bg-yellow-500 hover:text-white opacity-0 group-hover:opacity-100"}`,title:Ht(o?"attachment.primary_image":"attachment.set_as_primary"),children:h.jsx(yt,{className:"fa-solid fa-star text-xs"})}),h.jsxs(I,{className:`absolute inset-0 bg-black/0 group-hover:bg-black/40 transition-colors flex items-start justify-end p-1 gap-1 opacity-0 group-hover:opacity-100 ${a?"hidden":""}`,children:[h.jsx(le,{type:"button",...l,...c,className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-gray-600 dark:text-gray-300 hover:bg-white cursor-grab active:cursor-grabbing",title:Ht("attachment.drag_to_reorder"),onClick:T=>T.stopPropagation(),children:h.jsx(yt,{className:"fa-solid fa-grip-vertical text-sm"})}),!p&&s&&h.jsx(le,{type:"button",onClick:T=>{T.stopPropagation(),s()},className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-blue-500 hover:bg-white",title:Ht("common.download"),children:h.jsx(yt,{className:"fa-solid fa-download text-sm"})}),x&&n&&h.jsx(le,{type:"button",onClick:T=>{T.stopPropagation(),n()},className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-orange-500 hover:bg-white",title:Ht("common.retry"),children:h.jsx(yt,{className:"fa-solid fa-arrow-rotate-right text-sm"})}),h.jsx(le,{type:"button",onClick:T=>{T.stopPropagation(),t()},disabled:b||_,className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-red-500 hover:bg-white disabled:opacity-50",title:Ht("common.delete"),children:h.jsx(yt,{className:"fa-solid fa-times text-sm"})})]})]}),h.jsxs(I,{className:`p-2 ${!p&&s?"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700":""}`,onClick:()=>{!p&&s&&s()},children:[h.jsx(kt,{className:"text-xs font-medium text-gray-900 dark:text-white truncate",title:e.original_filename,children:e.original_filename}),h.jsx(kt,{className:"text-xs text-gray-500 dark:text-gray-400",children:e.size_formatted})]})]})},CM=({allItems:e,canAddMore:t,totalCount:n,maxFiles:r,maxSize:s,accept:o,onRemove:i,onRetry:a,onImageClick:l,onDownload:c,onDragEnd:d,onAddClick:u,enablePrimarySelection:f,primaryFileId:g,onPrimaryChange:m,disabled:p})=>{const y=gc(gs(fo,{activationConstraint:{distance:8}}),gs(uo,{coordinateGetter:Qi}));return h.jsxs(I,{className:"p-3",children:[h.jsx(_c,{sensors:y,collisionDetection:pc,onDragEnd:d,children:h.jsx(qi,{items:e.map(b=>"hash"in b?b.hash:b.id),strategy:Ki,children:h.jsxs(I,{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-3",children:[e.map(b=>{const _="hash"in b,x=_?b.is_image:b.mime_type?.startsWith("image/")??!1;return h.jsx(kM,{file:b,onRemove:()=>i(b),onRetry:"status"in b&&b.status==="error"?()=>a(b):void 0,onImageClick:x?()=>l(b):void 0,onDownload:_?()=>c(b):void 0,isPrimary:f&&_&&(b.hash||b.id)===g,onPrimaryClick:f&&_?()=>m?.(b.hash||b.id):void 0,disabled:p},_?b.hash:b.id)}),t&&!p&&h.jsxs(I,{className:"aspect-square flex flex-col items-center justify-center border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg cursor-pointer hover:border-gray-400 dark:hover:border-gray-500 hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors",onClick:u,children:[h.jsx(yt,{className:"fa-solid fa-plus text-2xl text-gray-400 dark:text-gray-500 mb-1"}),h.jsx(J,{className:"text-xs text-gray-500 dark:text-gray-400",children:Ht("common.add")})]})]})})}),h.jsxs(I,{className:"mt-3 pt-3 border-t border-gray-200 dark:border-gray-700 flex justify-between items-center text-xs text-gray-500 dark:text-gray-400",children:[h.jsx(J,{children:Ht("attachment.attached_count",{count:n,max:r})}),h.jsxs(J,{children:[Ht("attachment.max_size",{size:s}),o&&` (${o})`]})]})]})},c0=v.forwardRef(({uploadTriggerEvent:e,attachmentableType:t,attachmentableId:n,collection:r="default",maxFiles:s=10,maxSize:o=10,maxConcurrentUploads:i=3,accept:a,imageCompression:l,roleIds:c=[],autoUpload:d=!0,onFilesChange:u,onUploadComplete:f,onUploadError:g,onRemove:m,onReorder:p,initialFiles:y=[],disabled:b=!1,className:_="",confirmBeforeRemove:x=!1,confirmRemoveTitle:M,confirmRemoveMessage:S,apiEndpoints:k,uploadParams:N,enablePrimarySelection:C=!1,primaryFileId:w,onPrimaryChange:E,id:T,editorAttrs:P},L)=>{const F={upload:k?.upload??"/api/admin/attachments",delete:k?.delete??"/api/admin/attachments/:id",reorder:k?.reorder??"/api/admin/attachments/reorder"},A=yM({attachmentableType:t,attachmentableId:n,collection:r,maxFiles:s,maxSize:o,maxConcurrentUploads:i,accept:a,imageCompression:l,roleIds:c,autoUpload:d,initialFiles:y,endpoints:F,onFilesChange:u,onUploadComplete:f,onUploadError:g,onRemove:m,onReorder:p,uploadTriggerEvent:e,confirmBeforeRemove:x,uploadParams:N});v.useImperativeHandle(L,()=>({uploadAll:A.handleUploadAll,clear:A.clear,getPendingFiles:A.getPendingFiles}));const D=v.useMemo(()=>A.imageFiles.map(z=>{const U=!("hash"in z),j=z,Y=z;return U?{src:j.preview||"",filename:j.original_filename,title:j.original_filename,downloadRequiresAuth:!1}:{src:A.authenticatedImageUrls.get(Y.id)||Y.download_url,downloadUrl:Y.download_url,filename:Y.original_filename,title:Y.original_filename,downloadRequiresAuth:!0}}),[A.imageFiles,A.authenticatedImageUrls]),O=v.useMemo(()=>({existingFiles:A.existingFiles,pendingFiles:A.pendingFiles,isDragOver:A.isDragOver,isDeleting:A.isDeleting,maxFiles:s,maxSize:o,accept:a,endpoints:F,confirmBeforeRemove:x,totalCount:A.totalCount,hasFiles:A.hasFiles,canAddMore:A.canAddMore,allItems:A.allItems,imageFiles:A.imageFiles,handleFiles:A.handleFiles,handleRemove:A.handleRemove,handleRetry:A.handleRetry,handleUploadAll:A.handleUploadAll,handleOpenGallery:A.handleOpenGallery,handleDownload:A.handleDownload,handleDragEnd:A.handleDragEnd,setIsDragOver:A.setIsDragOver,inputRef:A.inputRef,galleryOpen:A.galleryOpen,setGalleryOpen:A.setGalleryOpen,galleryStartIndex:A.galleryStartIndex,galleryKeyRef:A.galleryKeyRef,confirmDialogOpen:A.confirmDialogOpen,setConfirmDialogOpen:A.setConfirmDialogOpen,itemToDelete:A.itemToDelete,executeRemoveAttachment:A.executeRemoveAttachment,authenticatedImageUrls:A.authenticatedImageUrls}),[A,s,o,a,F,x]);return h.jsx(sM,{value:O,children:h.jsxs(I,{id:T,className:_,...P,children:[h.jsx(vM,{isDragOver:A.isDragOver,canAddMore:A.canAddMore,onFiles:A.handleFiles,setIsDragOver:A.setIsDragOver,inputRef:A.inputRef,accept:a,maxFiles:s,maxSize:o,disabled:b,children:A.hasFiles&&h.jsx(CM,{allItems:A.allItems,canAddMore:A.canAddMore,totalCount:A.totalCount,maxFiles:s,maxSize:o,accept:a,onRemove:A.handleRemove,onRetry:A.handleRetry,onImageClick:A.handleOpenGallery,onDownload:A.handleDownload,onDragEnd:A.handleDragEnd,onAddClick:()=>A.inputRef.current?.click(),enablePrimarySelection:C,primaryFileId:w,onPrimaryChange:E,disabled:b})}),x&&h.jsx(Uu,{isOpen:A.confirmDialogOpen,onClose:()=>{A.isDeleting||A.setConfirmDialogOpen(!1)},title:M??Ht("attachment.delete_confirm_title"),message:S??Ht("attachment.delete_confirm_message"),confirmText:Ht("common.delete"),confirmButtonVariant:"danger",onConfirm:()=>{A.itemToDelete&&A.executeRemoveAttachment(A.itemToDelete)},isLoading:A.isDeleting,loadingText:Ht("attachment.deleting")}),D.length>0&&A.galleryOpen&&h.jsx(ia,{images:D,isOpen:!0,onClose:()=>A.setGalleryOpen(!1),startIndex:A.galleryStartIndex,showDownload:!0},`gallery-${A.galleryKeyRef.current}`)]})})});c0.displayName="FileUploader";const SM=({name:e,value:t,options:n,onChange:r,disabled:s=!1,inline:o=!1,className:i="",size:a="md",label:l,error:c,id:d,editorAttrs:u})=>{const[f,g]=v.useState(()=>t??"");v.useEffect(()=>{g(t??"")},[t]);const m=_=>{const x=_.target.value;g(x),r&&!s&&r(_)},y={sm:{radio:"w-3.5 h-3.5",label:"text-xs",gap:"gap-1.5"},md:{radio:"w-4 h-4",label:"text-sm",gap:"gap-2"},lg:{radio:"w-5 h-5",label:"text-base",gap:"gap-2.5"}}[a],b=o?"flex flex-wrap items-center gap-4":"flex flex-col gap-2";return h.jsxs(I,{className:i,id:d,...u,children:[l&&h.jsx(J,{className:`block mb-2 font-medium text-gray-700 dark:text-gray-300 ${y.label}`,children:l}),h.jsx(I,{className:b,children:n.map(_=>{const x=String(_.value)===String(f),M=s||_.disabled;return h.jsxs(gn,{className:`inline-flex items-center ${y.gap} ${M?"cursor-not-allowed opacity-50":"cursor-pointer"}`,children:[h.jsx("input",{type:"radio",name:e,value:_.value,checked:x,onChange:m,disabled:M,className:`
|
||
${y.radio}
|
||
text-blue-600
|
||
bg-gray-100 dark:bg-gray-700
|
||
border-gray-300 dark:border-gray-600
|
||
focus:ring-blue-500 dark:focus:ring-blue-600
|
||
focus:ring-2
|
||
dark:ring-offset-gray-800
|
||
${M?"cursor-not-allowed":"cursor-pointer"}
|
||
`}),h.jsx(J,{className:`
|
||
${y.label}
|
||
font-medium
|
||
text-gray-900 dark:text-gray-300
|
||
`,children:_.label})]},_.value)})}),c&&h.jsx(J,{className:"mt-1 text-xs text-red-600 dark:text-red-400",children:c})]})},Es=()=>window.G7Core,ha=(e,t)=>Es()?.t?.(e,t)??e,_M=()=>Es()?.locale?.supported?.()??["ko","en"],EM=()=>Es()?.locale?.current?.()??"ko",d0=e=>{const t=ha(`common.language_${e}`);return t===`common.language_${e}`?{ko:"한국어",en:"English",ja:"日本語",zh:"中文"}[e]||e.toUpperCase():t},MM=({content:e="",value:t,onChange:n,multilingual:r=!1,isHtml:s=!1,onIsHtmlChange:o,rows:i=15,placeholder:a="",label:l,showHtmlModeToggle:c=!0,contentClassName:d="",purifyConfig:u,className:f="",name:g="content",htmlFieldName:m="content_mode",readOnly:p=!1,id:y,editorAttrs:b})=>{const _=v.useMemo(()=>_M(),[]),x=v.useMemo(()=>EM(),[]),[M,S]=v.useState(x),[k,N]=v.useState(s),[C,w]=v.useState(e),[E,T]=v.useState(t??{}),[P,L]=v.useState(!1);v.useEffect(()=>{N(s)},[s]),v.useEffect(()=>{r||w(e)},[e,r]),v.useEffect(()=>{r&&t&&T(t)},[t,r]);const F=v.useCallback(Y=>{const B=Y.target.value;if(w(B),n){const W=Es()?.createChangeEvent?.({value:B,name:g,type:"textarea"})??{target:{name:g,value:B}};n(W)}},[n,g]),A=v.useCallback((Y,B)=>{const W={...E,[Y]:B};if(T(W),n){const G=Es()?.createChangeEvent?.({value:W,name:g,type:"multilingual"})??{target:{name:g,value:W}};n(G)}},[n,g,E]),D=v.useCallback(Y=>{const B=Y.target.checked;if(N(B),B||L(!1),o){const W=Es()?.createChangeEvent?.({checked:B,name:m,type:"checkbox"})??{target:{name:m,checked:B}};o(W)}},[o,m]),O=v.useCallback(()=>{L(Y=>!Y)},[]),z=r?E[M]??"":C,U=v.useCallback(Y=>!!E[Y]?.trim(),[E]),j=()=>h.jsx(I,{className:"flex flex-wrap items-center gap-2 mb-3",children:_.map(Y=>{const B=Y===x,W=M===Y;return h.jsxs(le,{type:"button",className:`
|
||
inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-semibold transition-all
|
||
${W?B?"bg-blue-500 text-white dark:bg-blue-600 dark:text-white shadow-md scale-105":"bg-gray-500 text-white dark:bg-gray-600 dark:text-white shadow-md scale-105":B?"bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400 hover:bg-blue-100 dark:hover:bg-blue-900/50":"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"}
|
||
`,onClick:()=>S(Y),children:[h.jsx(ae,{name:"globe",className:"w-3 h-3"}),h.jsx(J,{children:d0(Y)}),B&&h.jsx(J,{className:"text-red-500",children:"*"}),U(Y)&&!W&&h.jsx(ae,{name:"check",className:"w-3 h-3 text-green-500 dark:text-green-400"})]},Y)})});return h.jsxs(I,{className:`space-y-2 ${f}`,id:y,...b,children:[h.jsxs(I,{className:"flex items-center justify-between",children:[l&&h.jsx(gn,{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:l}),h.jsxs(I,{className:"flex items-center gap-3",children:[k&&!p&&h.jsx(le,{type:"button",onClick:O,className:`px-3 py-1.5 text-xs font-bold rounded-lg focus:outline-none focus:ring-2 ${P?"text-gray-700 dark:text-gray-200 bg-gray-200 dark:bg-gray-600 border border-gray-300 dark:border-gray-500 hover:bg-gray-300 dark:hover:bg-gray-500 focus:ring-gray-400 dark:focus:ring-gray-500":"text-blue-600 dark:text-blue-400 bg-white dark:bg-gray-700 border border-blue-300 dark:border-blue-600 hover:bg-blue-50 dark:hover:bg-gray-600 focus:ring-blue-500 dark:focus:ring-blue-600"}`,children:ha(P?"common.preview_off":"common.preview")}),c&&h.jsxs(gn,{className:"flex items-center gap-2 p-2 cursor-pointer",children:[h.jsx(Et,{type:"checkbox",name:m,checked:k,onChange:D,disabled:p,className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"}),h.jsx(I,{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:ha("common.html_mode")})]})]})]}),r&&j(),!P&&(r?_.map(Y=>h.jsx(I,{className:M===Y?"block":"hidden",children:h.jsx(lr,{name:`${g}[${Y}]`,value:E[Y]??"",onChange:B=>A(Y,B.target.value),placeholder:`${a} (${d0(Y)})`,rows:i,readOnly:p,className:`block w-full rounded-lg border px-3 py-2 text-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-1 disabled:opacity-50 disabled:cursor-not-allowed ${k?"font-mono bg-white dark:bg-gray-800 border-blue-300 dark:border-blue-600 text-gray-800 dark:text-gray-200 focus:border-blue-500 focus:ring-blue-500":"bg-white dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-900 dark:text-white focus:border-blue-500 focus:ring-blue-500"}`})},Y)):h.jsx(lr,{name:g,value:C,onChange:F,placeholder:a,rows:i,readOnly:p,className:`block w-full rounded-lg border px-3 py-2 text-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-1 disabled:opacity-50 disabled:cursor-not-allowed ${k?"font-mono bg-white dark:bg-gray-800 border-blue-300 dark:border-blue-600 text-gray-800 dark:text-gray-200 focus:border-blue-500 focus:ring-blue-500":"bg-white dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-900 dark:text-white focus:border-blue-500 focus:ring-blue-500"}`})),P&&h.jsx(I,{className:"p-4 bg-gray-50 dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 min-h-[400px]",children:h.jsx(kl,{content:z,isHtml:!0,className:d||"prose dark:prose-invert max-w-none text-gray-900 dark:text-gray-100",purifyConfig:u})})]})},u0="g7_dismissed_warnings";function f0(){try{const e=sessionStorage.getItem(u0);return e?JSON.parse(e):[]}catch{return[]}}function NM(e){try{const t=f0();t.includes(e)||(t.push(e),sessionStorage.setItem(u0,JSON.stringify(t)))}catch{}}function OM(e){switch(e){case"error":return"error";case"warning":return"warning";case"info":default:return"info"}}const TM=({warnings:e,className:t=""})=>{const[n,r]=v.useState([]);v.useEffect(()=>{r(f0())},[]);const s=v.useCallback(i=>{NM(i),r(a=>[...a,i])},[]);if(!e||e.length===0)return null;const o=e.filter(i=>!n.includes(i.id));return o.length===0?null:h.jsx(I,{className:`space-y-2 ${t}`.trim(),children:o.map(i=>h.jsx(Ku,{type:OM(i.level),message:i.message,dismissible:!0,onDismiss:()=>s(i.id)},i.id))})},h0=window.G7Core?.createLogger?.("Comp:FilterVisibility")??{log:(...e)=>console.log("[Comp:FilterVisibility]",...e),warn:(...e)=>console.warn("[Comp:FilterVisibility]",...e),error:(...e)=>console.error("[Comp:FilterVisibility]",...e)},AM=({id:e,visibleFilters:t,defaultFilters:n=[],onFilterVisibilityChange:r})=>{const[s,o]=v.useState(!1),i=v.useRef(!0),a=v.useMemo(()=>{try{const f=window.G7Core?.AuthManager?.getInstance();return f?f.getUser()?.uuid:void 0}catch{return}},[]),l=v.useMemo(()=>`g7_filters_${e}${a!==void 0?`_${a}`:""}`,[e,a]),c=v.useCallback(()=>{try{const f=localStorage.getItem(l);if(f){const g=JSON.parse(f);if(Array.isArray(g))return g}}catch(f){h0.warn("Failed to load from localStorage:",f)}return null},[l]),d=v.useCallback(f=>{try{localStorage.setItem(l,JSON.stringify(f))}catch(g){h0.warn("Failed to save to localStorage:",g)}},[l]),u=v.useCallback(()=>{const f=c();return f||(t&&t.length>0?t:n)},[c,t,n]);return v.useEffect(()=>{if(!s){const f=u();r&&f.length>0&&r(f),o(!0)}},[s,r,u]),v.useEffect(()=>{if(s&&t&&t.length>0){if(i.current){i.current=!1;return}d(t)}},[s,t,d]),null},DM=window.G7Core?.createLogger?.("Comp:SlotContainer")??{log:(...e)=>console.log("[Comp:SlotContainer]",...e),warn:(...e)=>console.warn("[Comp:SlotContainer]",...e),error:(...e)=>console.error("[Comp:SlotContainer]",...e)};function IM(e,t){return t&&e&&typeof e.id=="string"&&e.id.length>0?{...e,id:`${e.id}__${t}`}:e}const LM=({slotId:e,className:t="",emptyContent:n,style:r,id:s,children:o})=>{const[i,a]=v.useState([]),[,l]=v.useState({}),c=v.useCallback(()=>{const m=window.__slotContextValue;if(m)return m;const p=window.G7Core;return p&&p.getSlotContext?.()||null},[]),d=v.useCallback(()=>{const m=c();m&&m.isEnabled&&a(m.getSlotComponents(e))},[e,c]);v.useEffect(()=>{const m=c();return!m||!m.isEnabled?void 0:(d(),m.subscribeToSlot(e,()=>{d(),l({})}))},[e,c,d]);const u=v.useCallback(()=>{const m=window.G7Core;return m?m.getDynamicRenderer?.():null},[]);if(i.length===0)return n?h.jsx(I,{className:t,style:r,id:s,children:n}):o?h.jsx(I,{className:t,style:r,id:s,children:o}):null;const f=u(),g=window.G7Core;return!f||!g?(DM.error("G7Core or DynamicRenderer not available"),null):h.jsxs(I,{className:t,style:r,id:s,children:[i.map(m=>{const{componentDef:p,dataContext:y,parentFormContext:b,getParentComponentContext:_,translationContext:x}=m,M=IM(p,s);return h.jsx(f,{componentDef:M,dataContext:y,translationContext:x,registry:g.getComponentRegistry(),bindingEngine:g.getDataBindingEngine(),translationEngine:g.getTranslationEngine(),actionDispatcher:g.getActionDispatcher(),parentComponentContext:_?.(),parentFormContextProp:b,isRootRenderer:!1},M.id||`slot-${e}-${m.order}`)}),o]})},g0=(e,t)=>window.G7Core?.t?.(e,t)??e,p0=(e,t,n)=>window.G7Core?.renderComponentLayout?.(e,t,n)??null,PM=({options:e=[],value:t,onChange:n,placeholder:r,disabled:s=!1,className:o="",maxHeight:i="320px",children:a,selectedChildren:l,__componentLayoutDefs:c,id:d,editorAttrs:u})=>{const[f,g]=v.useState(!1),m=v.useRef(null),p=v.useRef(null),y=v.useMemo(()=>t==null?null:e.find(k=>String(k.value)===String(t))||null,[e,t]);v.useEffect(()=>{const k=N=>{m.current&&!m.current.contains(N.target)&&g(!1)};return f&&document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[f]),v.useEffect(()=>{const k=N=>{N.key==="Escape"&&f&&(g(!1),p.current?.focus())};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[f]);const b=v.useCallback(()=>{s||g(k=>!k)},[s]),_=v.useCallback(k=>{n&&n({target:{value:k},preventDefault:()=>{},stopPropagation:()=>{},type:"change"}),g(!1),p.current?.focus()},[n]),x=r??g0("common.select"),M=()=>{if(!y)return h.jsx(J,{className:"text-gray-400 dark:text-gray-500",children:x});if(c?.selected){const k=p0(c.selected,{item:y,isSelected:!0},"selected");if(k)return k}return l||h.jsx(J,{className:"truncate",children:y.label})},S=(k,N)=>h.jsxs(I,{className:"flex items-center justify-between w-full",children:[h.jsx(J,{className:N?"text-blue-600 dark:text-blue-400 font-medium":"text-gray-900 dark:text-white",children:k.label}),N&&h.jsx(Jn,{className:"w-5 h-5 text-blue-600 dark:text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})]});return h.jsxs(I,{ref:m,className:`relative ${o}`,id:d,...u,children:[h.jsxs(le,{ref:p,type:"button",onClick:b,disabled:s,className:`
|
||
w-full px-4 py-2.5
|
||
bg-gray-100 dark:bg-gray-700
|
||
border-0 rounded-xl
|
||
text-sm text-gray-700 dark:text-gray-200 font-medium
|
||
focus:ring-2 focus:ring-blue-500 focus:outline-none
|
||
flex items-center justify-between gap-2
|
||
text-left cursor-pointer
|
||
disabled:opacity-50 disabled:cursor-not-allowed
|
||
`,"aria-haspopup":"listbox","aria-expanded":f,children:[h.jsx(I,{className:"flex-1 min-w-0",children:M()}),h.jsx(Jn,{className:`w-4 h-4 flex-shrink-0 transition-transform duration-200 ${f?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),f&&h.jsx(I,{className:"absolute z-50 w-full mt-2 bg-white dark:bg-gray-800 rounded-2xl shadow-lg border border-gray-200 dark:border-gray-600 overflow-hidden",role:"listbox",children:h.jsx(I,{className:"overflow-auto",style:{maxHeight:i},children:e.length===0?h.jsx(I,{className:"px-4 py-6 text-center text-gray-500 dark:text-gray-400",children:g0("common.no_options")}):e.map((k,N)=>{const C=String(k.value)===String(t);return h.jsx(le,{type:"button",onClick:()=>!k.disabled&&_(k.value),disabled:k.disabled,className:`
|
||
w-full px-4 py-3 text-left text-sm
|
||
hover:bg-gray-100 dark:hover:bg-gray-700
|
||
transition-colors
|
||
${C?"bg-blue-50 dark:bg-blue-900/20":""}
|
||
${k.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"}
|
||
`,role:"option","aria-selected":C,"data-item-value":k.value,"data-item-index":N,"data-item-selected":C,children:c?.item?p0(c.item,{item:k,index:N,isSelected:C},`item-${N}`):a||S(k,C)},k.value)})})})]})};function $M(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}const FM=({value:e,checked:t=!1,icon:n,label:r,variant:s="blue",customColor:o,className:i="",style:a,onChange:l,id:c,editorAttrs:d})=>{const[u,f]=v.useState(!1),g="inline-flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium border cursor-pointer transition-all";if(o){const b=$M(o),_=document.documentElement.classList.contains("dark");let x;return t?x={backgroundColor:o,color:"#ffffff",borderColor:o,opacity:u?.85:1}:x=b?{backgroundColor:`rgba(${b.r}, ${b.g}, ${b.b}, ${u?_?.25:.12:_?.15:.06})`,color:o,borderColor:`rgba(${b.r}, ${b.g}, ${b.b}, ${_?.3:.2})`}:{},h.jsxs(gn,{className:`${g} ${i}`,style:{...x,...a},onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),id:c,...d,children:[h.jsx(Et,{type:"checkbox",value:e,checked:t,onChange:M=>{l?.(M)},className:"hidden"}),n&&h.jsx(ae,{name:n,className:"w-4 h-4"}),h.jsx(I,{children:r})]})}const y=t?{green:"bg-green-600 dark:bg-green-600 text-white dark:text-white border-green-700 dark:border-green-500 hover:bg-green-700 dark:hover:bg-green-500",orange:"bg-orange-600 dark:bg-orange-600 text-white dark:text-white border-orange-700 dark:border-orange-500 hover:bg-orange-700 dark:hover:bg-orange-500",yellow:"bg-yellow-600 dark:bg-yellow-600 text-white dark:text-white border-yellow-700 dark:border-yellow-500 hover:bg-yellow-700 dark:hover:bg-yellow-500",gray:"bg-gray-600 dark:bg-gray-500 text-white dark:text-white border-gray-700 dark:border-gray-400 hover:bg-gray-700 dark:hover:bg-gray-400",blue:"bg-blue-600 dark:bg-blue-600 text-white dark:text-white border-blue-700 dark:border-blue-500 hover:bg-blue-700 dark:hover:bg-blue-500"}[s]:{green:"bg-green-50 dark:bg-green-900/20 text-green-600 dark:text-green-400 border-green-200 dark:border-green-800 hover:bg-green-100 dark:hover:bg-green-900/30",orange:"bg-orange-50 dark:bg-orange-900/20 text-orange-600 dark:text-orange-400 border-orange-200 dark:border-orange-800 hover:bg-orange-100 dark:hover:bg-orange-900/30",yellow:"bg-yellow-50 dark:bg-yellow-900/20 text-yellow-600 dark:text-yellow-400 border-yellow-200 dark:border-yellow-800 hover:bg-yellow-100 dark:hover:bg-yellow-900/30",gray:"bg-gray-50 dark:bg-gray-700 text-gray-600 dark:text-gray-300 border-gray-200 dark:border-gray-600 hover:bg-gray-100 dark:hover:bg-gray-600",blue:"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 border-blue-200 dark:border-blue-800 hover:bg-blue-100 dark:hover:bg-blue-900/30"}[s];return h.jsxs(gn,{className:`${g} ${y} ${i}`,style:a,id:c,...d,children:[h.jsx(Et,{type:"checkbox",value:e,checked:t,onChange:b=>{l?.(b)},className:"hidden"}),n&&h.jsx(ae,{name:n,className:"w-4 h-4"}),h.jsx(I,{children:r})]})},zM=({label:e,icon:t,iconPosition:n="left",position:r="right",className:s="",style:o,children:i})=>{const[a,l]=v.useState(!1),[c,d]=v.useState({top:0,left:0}),u=v.useRef(null),f=v.useRef(null),g=v.useCallback(()=>{if(!u.current)return;const p=u.current.getBoundingClientRect(),y=224;let b=r==="right"?p.right-y:p.left;const _=p.bottom+8;b<8&&(b=8),b+y>window.innerWidth-8&&(b=window.innerWidth-y-8),d({top:_,left:b})},[r]);v.useEffect(()=>{a&&g()},[a,g]),v.useEffect(()=>{if(!a)return;const p=()=>{l(!1)};return window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),()=>{window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}},[a]),v.useEffect(()=>{const p=y=>{const b=y.target,_=u.current?.contains(b),x=f.current?.contains(b);!_&&!x&&l(!1)};return a&&document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}},[a]);const m=a?Vn.createPortal(h.jsx("div",{ref:f,className:"fixed z-[9999] w-56 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg overflow-hidden",style:{top:c.top,left:c.left},onClick:()=>l(!1),children:i}),document.body):null;return h.jsxs(I,{className:`relative inline-block ${s}`,style:o,children:[h.jsxs(le,{ref:u,onClick:()=>l(!a),className:"flex items-center gap-2",children:[n==="left"&&t&&h.jsx(ae,{name:t,className:"w-4 h-4"}),e&&h.jsx(J,{className:"text-sm font-medium",children:e}),n==="right"&&t&&h.jsx(ae,{name:t,className:"w-4 h-4"})]}),m]})},VM=({label:e,icon:t,variant:n="default",disabled:r=!1,divider:s=!1,className:o="",style:i,onClick:a})=>{if(s)return h.jsx(I,{className:"h-px bg-gray-200 dark:bg-gray-700 my-1",style:i});const l=n==="danger"?"text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20":"text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700",c=r?"opacity-50 cursor-not-allowed":"cursor-pointer",d=()=>{!r&&a&&a()};return h.jsxs(I,{onClick:d,className:`flex items-center gap-3 px-4 py-3 transition-colors ${l} ${c} ${o}`,style:i,children:[t&&h.jsx(ae,{name:t,className:"w-4 h-4"}),e&&h.jsx(J,{className:"text-sm font-medium",children:e})]})},HM=()=>window.G7Core,ad=v.createContext(null),m0=()=>{const e=v.useContext(ad);if(!e){const t=HM(),n=t?.locale?.current?.()||"ko",r=t?.locale?.supported?.()||["ko","en"];return{activeLocale:n,getActiveLocale:()=>t?.locale?.current?.()||"ko",supportedLocales:r,isInsideMultilingualTabPanel:!1}}return{...e,isInsideMultilingualTabPanel:!0}},UM=()=>window.G7Core,BM=({value:e,onChange:t,placeholder:n,readOnly:r,disabled:s,hasError:o})=>{const{activeLocale:i,getActiveLocale:a}=m0(),l=typeof e=="string"?{[i]:e}:e||{},c=v.useCallback(u=>{const f=a();t({...l,[f]:u.target.value})},[l,a,t]),d=o?"border-red-500 dark:border-red-500 focus:ring-red-500 focus:border-red-500":"border-gray-300 dark:border-gray-600 focus:ring-blue-500 focus:border-blue-500";return h.jsx(Et,{type:"text",value:l[i]||"",onChange:c,placeholder:n,readOnly:r,disabled:s,className:`w-full px-3 py-2 text-sm border ${d} rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2`})},jM=(e,t)=>{if(!t)return!1;const n=t.startsWith("!"),r=n?t.slice(1):t,s=!!e[r];return n?!s:s},WM=({column:e,item:t,index:n,onValueChange:r,readOnly:s,error:o})=>{const i=t[e.key],a=s||e.readOnly||jM(t,e.readOnlyCondition)||e.disabled,l=!!o,c=l?"border-red-500 dark:border-red-500 focus:ring-red-500 focus:border-red-500":"border-gray-300 dark:border-gray-600 focus:ring-blue-500 focus:border-blue-500",d=v.useCallback(f=>{r(e.key,f)},[e.key,r]),u=f=>h.jsxs(I,{className:"w-full",children:[f,l&&h.jsx(J,{className:"text-xs text-red-500 dark:text-red-400 mt-1 block",children:o})]});switch(e.type){case"input":return u(h.jsx(Et,{type:"text",value:i||"",onChange:f=>d(f.target.value),placeholder:e.placeholder,readOnly:a,disabled:a,className:`w-full px-3 py-2 text-sm border ${c} rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 ${e.className||""}`}));case"number":return u(h.jsx(Et,{type:"number",value:i??"",onChange:f=>d(f.target.value?Number(f.target.value):null),placeholder:e.placeholder,min:e.min,max:e.max,step:e.step,readOnly:a,disabled:a,className:`w-full px-3 py-2 text-sm border ${c} rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 ${e.className||""}`}));case"select":return u(h.jsxs(Zr,{value:i??"",onChange:f=>d(f.target.value),disabled:a,className:`w-full px-3 py-2 text-sm border ${c} rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 ${e.className||""}`,children:[h.jsx("option",{value:"",children:"선택하세요"}),e.options?.map(f=>h.jsx("option",{value:f.value,disabled:f.disabled,children:f.label},f.value))]}));case"textarea":return u(h.jsx(lr,{value:i||"",onChange:f=>d(f.target.value),placeholder:e.placeholder,readOnly:a,disabled:a,className:`w-full px-3 py-2 text-sm border ${c} rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 resize-none ${e.className||""}`,rows:2}));case"multilingual":return u(h.jsx(BM,{value:i,onChange:f=>d(f),placeholder:e.placeholder,readOnly:a,disabled:a,hasError:l}));case"custom":return e.render?h.jsx(h.Fragment,{children:e.render(t,n,d)}):h.jsx(J,{className:"text-gray-500 dark:text-gray-400",children:"-"});default:return h.jsx(J,{className:"text-gray-900 dark:text-white text-sm",children:String(i??"")})}},GM=(e,t,n)=>{if(!e)return;if(n==="multilingual"){const o=UM()?.locale?.current?.()||"ko",i=`${t}.${o}`;return e[i]?.[0]}return e[t]?.[0]},YM=({item:e,index:t,id:n,columns:r,enableDrag:s=!0,showIndex:o=!0,canRemove:i=!0,rowActions:a,readOnly:l=!1,onValueChange:c,onRemove:d,className:u="",level:f=0,errors:g})=>{const{attributes:m,listeners:p,setNodeRef:y,transform:b,transition:_,isDragging:x}=Zi({id:n,disabled:!s||l}),M={transform:Wn.Transform.toString(b),transition:_,opacity:x?.5:1},S=v.useCallback((C,w)=>{c?.(C,w)},[c]),k=v.useCallback(C=>{C.onClick?.(e,t)},[e,t]),N=f>0?{paddingLeft:`${f*24}px`}:{};return h.jsxs(I,{ref:y,style:M,className:`flex items-center gap-2 py-2 px-2 border-b border-gray-100 dark:border-gray-700 last:border-b-0 hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors ${x?"bg-blue-50 dark:bg-blue-900/20 shadow-lg rounded-lg z-10":""} ${u}`,children:[s&&!l&&h.jsx(I,{...m,...p,className:"flex-shrink-0 w-6 h-6 flex items-center justify-center cursor-grab active:cursor-grabbing text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-400",style:N,children:h.jsx(ae,{name:"grip-vertical",className:"w-4 h-4"})}),o&&h.jsx(I,{className:"flex-shrink-0 w-8 text-center text-sm text-gray-500 dark:text-gray-400 font-medium",children:t+1}),r.map(C=>{const w=GM(g,C.key,C.type);return h.jsx(I,{className:`flex-1 min-w-0 ${C.width||""}`,style:C.width?{flex:"none",width:C.width}:{},children:h.jsx(WM,{column:C,item:e,index:t,onValueChange:S,readOnly:l,error:w})},C.key)}),a&&a.length>0&&!l&&h.jsx(I,{className:"flex-shrink-0 flex items-center gap-1",children:a.map(C=>{const w=typeof C.disabled=="function"?C.disabled(e,t):C.disabled;return h.jsx(le,{type:"button",onClick:()=>k(C),disabled:w,className:`p-1.5 rounded transition-colors ${C.danger?"text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 hover:text-red-600":"text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-gray-600 dark:hover:text-gray-300"} disabled:opacity-50 disabled:cursor-not-allowed`,title:C.label,children:C.icon?h.jsx(ae,{name:C.icon,className:"w-4 h-4"}):h.jsx(J,{className:"text-xs",children:C.label})},C.key)})}),i&&!a&&!l&&h.jsx(I,{className:"flex-shrink-0",children:h.jsx(le,{type:"button",onClick:d,className:"p-1.5 text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-gray-600 dark:hover:text-gray-300 rounded transition-colors",title:"삭제",children:h.jsx(ae,{name:"minus",className:"w-4 h-4"})})})]})},b0=()=>window.G7Core,ld=()=>`item_${Date.now()}_${Math.random().toString(36).substring(2,9)}`,KM=e=>{const t={_id:ld()};return e.forEach(n=>{if(n.type==="multilingual"){const s=b0()?.locale?.all?.()||["ko","en"],o={};s.forEach(i=>{o[i]=""}),t[n.key]=o}else n.type==="number"?t[n.key]=null:(n.type,t[n.key]="")}),t},XM=(e,t)=>{if(!e)return{};const n=`fields.${t}.`,r={};return Object.keys(e).forEach(s=>{if(s.startsWith(n)){const o=s.substring(n.length);r[o]=e[s]}}),r},qM=({items:e=[],columns:t,onChange:n,onAddItem:r,onRemoveItem:s,onReorder:o,addLabel:i="항목 추가",enableDrag:a=!0,showIndex:l=!0,minItems:c=0,maxItems:d,rowActions:u,emptyMessage:f="항목이 없습니다.",className:g="",headerClassName:m="",rowClassName:p="",name:y,readOnly:b=!1,createDefaultItem:_,childrenKey:x,itemIdKey:M="_id",errors:S,id:k,editorAttrs:N})=>{const C=v.useRef(null),w=v.useRef([]),E=v.useRef(null),T=v.useMemo(()=>{let Y=!1;for(const B of e)if(B[M]==null){Y=!0;break}return Y?e.map(B=>B[M]!=null?B:{...B,[M]:ld()}):e},[e,M]);w.current=T,v.useEffect(()=>{E.current=null},[T]);const P=v.useCallback(Y=>String(Y[M]??""),[M]);v.useEffect(()=>{if(y){const Y=b0();Y?.form&&(C.current=Y.form)}},[y]);const L=gc(gs(fo,{activationConstraint:{distance:8}}),gs(uo,{coordinateGetter:Qi})),F=v.useMemo(()=>T.map(Y=>P(Y)),[T,P]),A=v.useCallback(Y=>{const{active:B,over:W}=Y;if(W&&B.id!==W.id){const G=E.current??w.current,V=G.map(Q=>String(Q[M]??"")),X=V.indexOf(String(B.id)),K=V.indexOf(String(W.id));if(X!==-1&&K!==-1){const Q=ms([...G],X,K);E.current=Q,n?.(Q),o?.(Q)}}},[n,o,M]),D=v.useCallback((Y,B,W)=>{const V=[...E.current??w.current];V[Y]={...V[Y],[B]:W},E.current=V,n?.(V)},[n]),O=v.useCallback(()=>{const Y=E.current??w.current;if(d&&Y.length>=d)return;if(r){r();return}const B=_?_():KM(t);B[M]||(B[M]=ld());const W=[...Y,B];E.current=W,n?.(W)},[d,r,_,t,M,n]),z=v.useCallback(Y=>{const B=E.current??w.current;if(B.length<=c)return;const W=B[Y];if(s){s(Y,W);return}const G=B.filter((V,X)=>X!==Y);E.current=G,n?.(G)},[c,s,n]),U=T.length>c,j=!d||T.length<d;return h.jsxs(I,{className:`dynamic-field-list ${g}`,id:k,...N,children:[h.jsxs(I,{className:`flex items-center gap-2 py-2 px-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800/50 rounded-t-lg ${m}`,children:[a&&!b&&h.jsx(I,{className:"flex-shrink-0 w-6"}),l&&h.jsx(I,{className:"flex-shrink-0 w-8 text-center text-xs font-medium text-gray-500 dark:text-gray-400 uppercase",children:"#"}),t.map(Y=>h.jsxs(I,{className:`flex-1 min-w-0 text-xs font-medium text-gray-500 dark:text-gray-400 uppercase ${Y.width||""}`,style:Y.width?{flex:"none",width:Y.width}:{},children:[Y.label,Y.required&&h.jsx(J,{className:"text-red-500 dark:text-red-400 ml-0.5",children:"*"})]},Y.key)),(u||!b&&U)&&h.jsx(I,{className:"flex-shrink-0 w-8"})]}),T.length>0?h.jsx(_c,{sensors:L,collisionDetection:pc,onDragEnd:A,children:h.jsx(qi,{items:F,strategy:Ec,children:h.jsx(I,{className:"border-x border-gray-200 dark:border-gray-700",children:T.map((Y,B)=>{const W=P(Y),G=XM(S,B);return h.jsx(YM,{id:W,item:Y,index:B,columns:t,enableDrag:a,showIndex:l,canRemove:U,rowActions:u,readOnly:b,onValueChange:(V,X)=>D(B,V,X),onRemove:()=>z(B),className:p,errors:G},W)})})})}):h.jsx(I,{className:"border-x border-gray-200 dark:border-gray-700 py-8 text-center text-gray-500 dark:text-gray-400 text-sm",children:f}),!b&&j&&h.jsx(I,{className:"relative border border-gray-200 dark:border-gray-700 border-t-0 rounded-b-lg",children:h.jsx(I,{className:"flex items-center justify-center py-2",children:h.jsxs(le,{type:"button",onClick:O,className:"flex items-center gap-1.5 px-4 py-1.5 text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:[h.jsx(ae,{name:"plus",className:"w-4 h-4"}),h.jsx(J,{children:i})]})})}),(b||!j)&&T.length>0&&h.jsx(I,{className:"border-x border-b border-gray-200 dark:border-gray-700 rounded-b-lg h-1"})]})},y0=()=>window.G7Core,ZM=()=>y0()?.locale?.supported?.()??["ko","en"],QM=()=>y0()?.locale?.current?.()??"ko",JM={ko:"한국어",en:"English",ja:"日本語",zh:"中文"},RM=({children:e,className:t="",style:n,variant:r="default",defaultLocale:s,onLocaleChange:o,locales:i})=>{const a=v.useMemo(()=>i&&i.length>0?i:ZM(),[i]),[l,c]=v.useState(s||QM());v.useEffect(()=>{if(a.length>0&&!a.includes(l)){const p=a[0];c(p),o?.(p)}},[a,l,o]);const d=v.useRef(l);d.current=l;const u=v.useCallback(()=>d.current,[]),f=v.useCallback(p=>{c(p),o?.(p)},[o]),g=v.useMemo(()=>({activeLocale:l,getActiveLocale:u,supportedLocales:a}),[l,u,a]),m=p=>{const y=p===l,b="px-4 py-2 text-sm font-medium transition-all";return r==="pills"?y?`${b} bg-blue-600 text-white rounded-lg`:`${b} text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg`:r==="underline"?y?`${b} text-blue-600 dark:text-blue-400 border-b-2 border-blue-600 dark:border-blue-400`:`${b} text-gray-600 dark:text-gray-400 border-b-2 border-transparent hover:border-gray-300 dark:hover:border-gray-500`:y?`${b} text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20 border-b-2 border-blue-600`:`${b} text-gray-600 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-700 border-b-2 border-transparent`};return h.jsxs(I,{className:t,style:n,children:[h.jsx(Jo,{className:"flex gap-1 border-b border-gray-200 dark:border-gray-700 mb-4",children:a.map(p=>h.jsx(le,{type:"button",onClick:()=>f(p),className:m(p),children:h.jsx(J,{children:JM[p]||p})},p))}),h.jsx(ad.Provider,{value:g,children:e})]})},eN=({label:e,required:t=!1,error:n,helperText:r,className:s="",labelClassName:o="",children:i,horizontal:a=!1,labelWidth:l="w-1/3",id:c,editorAttrs:d})=>{const u=a?`flex items-start gap-4 ${s}`:`space-y-1 ${s}`,f=a?`${l} flex-shrink-0 pt-2`:"",g=a?"flex-1":"";return h.jsxs(I,{className:u,id:c,...d,children:[e&&h.jsx(I,{className:f,children:h.jsxs(gn,{className:`block text-sm font-medium text-gray-700 dark:text-gray-300 ${o}`,children:[e,t&&h.jsx("span",{className:"ml-1 text-red-500 dark:text-red-400",children:"*"})]})}),h.jsxs(I,{className:`${g} ${n?"form-field-error":""}`.trim(),children:[i,r&&!n&&h.jsx(I,{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:r}),n&&h.jsx(I,{className:"mt-1 text-xs text-red-600 dark:text-red-400",children:n})]})]})};/*!
|
||
* @kurkle/color v0.3.4
|
||
* https://github.com/kurkle/color#readme
|
||
* (c) 2024 Jukka Kurkela
|
||
* Released under the MIT License
|
||
*/function Eo(e){return e+.5|0}const br=(e,t,n)=>Math.max(Math.min(e,n),t);function Mo(e){return br(Eo(e*2.55),0,255)}function yr(e){return br(Eo(e*255),0,255)}function tr(e){return br(Eo(e/2.55)/100,0,1)}function v0(e){return br(Eo(e*100),0,100)}const Cn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},cd=[..."0123456789ABCDEF"],tN=e=>cd[e&15],nN=e=>cd[(e&240)>>4]+cd[e&15],ga=e=>(e&240)>>4===(e&15),rN=e=>ga(e.r)&&ga(e.g)&&ga(e.b)&&ga(e.a);function sN(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Cn[e[1]]*17,g:255&Cn[e[2]]*17,b:255&Cn[e[3]]*17,a:t===5?Cn[e[4]]*17:255}:(t===7||t===9)&&(n={r:Cn[e[1]]<<4|Cn[e[2]],g:Cn[e[3]]<<4|Cn[e[4]],b:Cn[e[5]]<<4|Cn[e[6]],a:t===9?Cn[e[7]]<<4|Cn[e[8]]:255})),n}const oN=(e,t)=>e<255?t(e):"";function iN(e){var t=rN(e)?tN:nN;return e?"#"+t(e.r)+t(e.g)+t(e.b)+oN(e.a,t):void 0}const aN=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function x0(e,t,n){const r=t*Math.min(n,1-n),s=(o,i=(o+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[s(0),s(8),s(4)]}function lN(e,t,n){const r=(s,o=(s+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[r(5),r(3),r(1)]}function cN(e,t,n){const r=x0(e,1,.5);let s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)r[s]*=1-t-n,r[s]+=t;return r}function dN(e,t,n,r,s){return e===s?(t-n)/r+(t<n?6:0):t===s?(n-e)/r+2:(e-t)/r+4}function dd(e){const n=e.r/255,r=e.g/255,s=e.b/255,o=Math.max(n,r,s),i=Math.min(n,r,s),a=(o+i)/2;let l,c,d;return o!==i&&(d=o-i,c=a>.5?d/(2-o-i):d/(o+i),l=dN(n,r,s,d,o),l=l*60+.5),[l|0,c||0,a]}function ud(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(yr)}function fd(e,t,n){return ud(x0,e,t,n)}function uN(e,t,n){return ud(cN,e,t,n)}function fN(e,t,n){return ud(lN,e,t,n)}function w0(e){return(e%360+360)%360}function hN(e){const t=aN.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?Mo(+t[5]):yr(+t[5]));const s=w0(+t[2]),o=+t[3]/100,i=+t[4]/100;return t[1]==="hwb"?r=uN(s,o,i):t[1]==="hsv"?r=fN(s,o,i):r=fd(s,o,i),{r:r[0],g:r[1],b:r[2],a:n}}function gN(e,t){var n=dd(e);n[0]=w0(n[0]+t),n=fd(n),e.r=n[0],e.g=n[1],e.b=n[2]}function pN(e){if(!e)return;const t=dd(e),n=t[0],r=v0(t[1]),s=v0(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${s}%, ${tr(e.a)})`:`hsl(${n}, ${r}%, ${s}%)`}const k0={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},C0={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function mN(){const e={},t=Object.keys(C0),n=Object.keys(k0);let r,s,o,i,a;for(r=0;r<t.length;r++){for(i=a=t[r],s=0;s<n.length;s++)o=n[s],a=a.replace(o,k0[o]);o=parseInt(C0[i],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}let pa;function bN(e){pa||(pa=mN(),pa.transparent=[0,0,0,0]);const t=pa[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const yN=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function vN(e){const t=yN.exec(e);let n=255,r,s,o;if(t){if(t[7]!==r){const i=+t[7];n=t[8]?Mo(i):br(i*255,0,255)}return r=+t[1],s=+t[3],o=+t[5],r=255&(t[2]?Mo(r):br(r,0,255)),s=255&(t[4]?Mo(s):br(s,0,255)),o=255&(t[6]?Mo(o):br(o,0,255)),{r,g:s,b:o,a:n}}}function xN(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${tr(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const hd=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Ms=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function wN(e,t,n){const r=Ms(tr(e.r)),s=Ms(tr(e.g)),o=Ms(tr(e.b));return{r:yr(hd(r+n*(Ms(tr(t.r))-r))),g:yr(hd(s+n*(Ms(tr(t.g))-s))),b:yr(hd(o+n*(Ms(tr(t.b))-o))),a:e.a+n*(t.a-e.a)}}function ma(e,t,n){if(e){let r=dd(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=fd(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function S0(e,t){return e&&Object.assign(t||{},e)}function _0(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=yr(e[3]))):(t=S0(e,{r:0,g:0,b:0,a:1}),t.a=yr(t.a)),t}function kN(e){return e.charAt(0)==="r"?vN(e):hN(e)}class No{constructor(t){if(t instanceof No)return t;const n=typeof t;let r;n==="object"?r=_0(t):n==="string"&&(r=sN(t)||bN(t)||kN(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=S0(this._rgb);return t&&(t.a=tr(t.a)),t}set rgb(t){this._rgb=_0(t)}rgbString(){return this._valid?xN(this._rgb):void 0}hexString(){return this._valid?iN(this._rgb):void 0}hslString(){return this._valid?pN(this._rgb):void 0}mix(t,n){if(t){const r=this.rgb,s=t.rgb;let o;const i=n===o?.5:n,a=2*i-1,l=r.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,r.r=255&c*r.r+o*s.r+.5,r.g=255&c*r.g+o*s.g+.5,r.b=255&c*r.b+o*s.b+.5,r.a=i*r.a+(1-i)*s.a,this.rgb=r}return this}interpolate(t,n){return t&&(this._rgb=wN(this._rgb,t._rgb,n)),this}clone(){return new No(this.rgb)}alpha(t){return this._rgb.a=yr(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Eo(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ma(this._rgb,2,t),this}darken(t){return ma(this._rgb,2,-t),this}saturate(t){return ma(this._rgb,1,t),this}desaturate(t){return ma(this._rgb,1,-t),this}rotate(t){return gN(this._rgb,t),this}}/*!
|
||
* Chart.js v4.5.1
|
||
* https://www.chartjs.org
|
||
* (c) 2025 Chart.js Contributors
|
||
* Released under the MIT License
|
||
*/function nr(){}const CN=(()=>{let e=0;return()=>e++})();function ft(e){return e==null}function Dt(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Qe(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Sn(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Yn(e,t){return Sn(e)?e:t}function Je(e,t){return typeof e>"u"?t:e}const SN=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,E0=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function bt(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function at(e,t,n,r){let s,o,i;if(Dt(e))for(o=e.length,s=0;s<o;s++)t.call(n,e[s],s);else if(Qe(e))for(i=Object.keys(e),o=i.length,s=0;s<o;s++)t.call(n,e[i[s]],i[s])}function ba(e,t){let n,r,s,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(s=e[n],o=t[n],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function ya(e){if(Dt(e))return e.map(ya);if(Qe(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let s=0;for(;s<r;++s)t[n[s]]=ya(e[n[s]]);return t}return e}function M0(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function _N(e,t,n,r){if(!M0(e))return;const s=t[e],o=n[e];Qe(s)&&Qe(o)?Oo(s,o,r):t[e]=ya(o)}function Oo(e,t,n){const r=Dt(t)?t:[t],s=r.length;if(!Qe(e))return e;n=n||{};const o=n.merger||_N;let i;for(let a=0;a<s;++a){if(i=r[a],!Qe(i))continue;const l=Object.keys(i);for(let c=0,d=l.length;c<d;++c)o(l[c],e,i,n)}return e}function To(e,t){return Oo(e,t,{merger:EN})}function EN(e,t,n){if(!M0(e))return;const r=t[e],s=n[e];Qe(r)&&Qe(s)?To(r,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=ya(s))}const N0={"":e=>e,x:e=>e.x,y:e=>e.y};function MN(e){const t=e.split("."),n=[];let r="";for(const s of t)r+=s,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function NN(e){const t=MN(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function zr(e,t){return(N0[t]||(N0[t]=NN(t)))(e)}function gd(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Ao=e=>typeof e<"u",vr=e=>typeof e=="function",O0=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function ON(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const ht=Math.PI,Ot=2*ht,va=Number.POSITIVE_INFINITY,TN=ht/180,It=ht/2,Vr=ht/4,T0=ht*2/3,A0=Math.log10,xr=Math.sign;function xa(e,t,n){return Math.abs(e-t)<n}function D0(e){const t=Math.round(e);e=xa(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(A0(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function AN(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((s,o)=>s-o).pop(),t}function DN(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function wa(e){return!DN(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function IN(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function LN(e,t,n){let r,s,o;for(r=0,s=e.length;r<s;r++)o=e[r][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function rr(e){return e*(ht/180)}function PN(e){return e*(180/ht)}function I0(e){if(!Sn(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function L0(e,t){const n=t.x-e.x,r=t.y-e.y,s=Math.sqrt(n*n+r*r);let o=Math.atan2(r,n);return o<-.5*ht&&(o+=Ot),{angle:o,distance:s}}function $N(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Kn(e){return(e%Ot+Ot)%Ot}function ka(e,t,n,r){const s=Kn(e),o=Kn(t),i=Kn(n),a=Kn(o-s),l=Kn(i-s),c=Kn(s-o),d=Kn(s-i);return s===o||s===i||r&&o===i||a>l&&c<d}function cn(e,t,n){return Math.max(t,Math.min(n,e))}function FN(e){return cn(e,-32768,32767)}function Hr(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function pd(e,t,n){n=n||(i=>e[i]<t);let r=e.length-1,s=0,o;for(;r-s>1;)o=s+r>>1,n(o)?s=o:r=o;return{lo:s,hi:r}}const md=(e,t,n,r)=>pd(e,n,r?s=>{const o=e[s][t];return o<n||o===n&&e[s+1][t]===n}:s=>e[s][t]<n),zN=(e,t,n)=>pd(e,n,r=>e[r][t]>=n);function VN(e,t,n){let r=0,s=e.length;for(;r<s&&e[r]<t;)r++;for(;s>r&&e[s-1]>n;)s--;return r>0||s<e.length?e.slice(r,s):e}const P0=["push","pop","shift","splice","unshift"];function HN(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),P0.forEach(n=>{const r="_onData"+gd(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const i=s.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...o)}),i}})})}function $0(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,s=r.indexOf(t);s!==-1&&r.splice(s,1),!(r.length>0)&&(P0.forEach(o=>{delete e[o]}),delete e._chartjs)}function F0(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const z0=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function V0(e,t){let n=[],r=!1;return function(...s){n=s,r||(r=!0,z0.call(window,()=>{r=!1,e.apply(t,n)}))}}function UN(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const bd=e=>e==="start"?"left":e==="end"?"right":"center",Jt=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,BN=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t,Ca=e=>e===0||e===1,H0=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Ot/n)),U0=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Ot/n)+1,Do={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*It)+1,easeOutSine:e=>Math.sin(e*It),easeInOutSine:e=>-.5*(Math.cos(ht*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Ca(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Ca(e)?e:H0(e,.075,.3),easeOutElastic:e=>Ca(e)?e:U0(e,.075,.3),easeInOutElastic(e){return Ca(e)?e:e<.5?.5*H0(e*2,.1125,.45):.5+.5*U0(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Do.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Do.easeInBounce(e*2)*.5:Do.easeOutBounce(e*2-1)*.5+.5};function B0(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function j0(e){return B0(e)?e:new No(e)}function yd(e){return B0(e)?e:new No(e).saturate(.5).darken(.1).hexString()}const jN=["x","y","borderWidth","radius","tension"],WN=["color","borderColor","backgroundColor"];function GN(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:WN},numbers:{type:"number",properties:jN}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function YN(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const W0=new Map;function KN(e,t){t=t||{};const n=e+JSON.stringify(t);let r=W0.get(n);return r||(r=new Intl.NumberFormat(e,t),W0.set(n,r)),r}function vd(e,t,n){return KN(t,n).format(e)}const XN={values(e){return Dt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let s,o=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=qN(e,n)}const i=A0(Math.abs(o)),a=isNaN(i)?1:Math.max(Math.min(-1*Math.floor(i),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),vd(e,r,l)}};function qN(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var G0={formatters:XN};function ZN(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:G0.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Ur=Object.create(null),xd=Object.create(null);function Io(e,t){if(!t)return e;const n=t.split(".");for(let r=0,s=n.length;r<s;++r){const o=n[r];e=e[o]||(e[o]=Object.create(null))}return e}function wd(e,t,n){return typeof t=="string"?Oo(Io(e,t),n):Oo(Io(e,""),t)}class QN{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,s)=>yd(s.backgroundColor),this.hoverBorderColor=(r,s)=>yd(s.borderColor),this.hoverColor=(r,s)=>yd(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return wd(this,t,n)}get(t){return Io(this,t)}describe(t,n){return wd(xd,t,n)}override(t,n){return wd(Ur,t,n)}route(t,n,r,s){const o=Io(this,t),i=Io(this,r),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=i[s];return Qe(l)?Object.assign({},c,l):Je(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var _t=new QN({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[GN,YN,ZN]);function JN(e){return!e||ft(e.size)||ft(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Y0(e,t,n,r,s){let o=t[s];return o||(o=t[s]=e.measureText(s).width,n.push(s)),o>r&&(r=o),r}function Br(e,t,n){const r=e.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((t-s)*r)/r+s}function K0(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function X0(e,t,n,r){q0(e,t,n,r,null)}function q0(e,t,n,r,s){let o,i,a,l,c,d,u,f;const g=t.pointStyle,m=t.rotation,p=t.radius;let y=(m||0)*TN;if(g&&typeof g=="object"&&(o=g.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(y),e.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),e.restore();return}if(!(isNaN(p)||p<=0)){switch(e.beginPath(),g){default:s?e.ellipse(n,r,s/2,p,0,0,Ot):e.arc(n,r,p,0,Ot),e.closePath();break;case"triangle":d=s?s/2:p,e.moveTo(n+Math.sin(y)*d,r-Math.cos(y)*p),y+=T0,e.lineTo(n+Math.sin(y)*d,r-Math.cos(y)*p),y+=T0,e.lineTo(n+Math.sin(y)*d,r-Math.cos(y)*p),e.closePath();break;case"rectRounded":c=p*.516,l=p-c,i=Math.cos(y+Vr)*l,u=Math.cos(y+Vr)*(s?s/2-c:l),a=Math.sin(y+Vr)*l,f=Math.sin(y+Vr)*(s?s/2-c:l),e.arc(n-u,r-a,c,y-ht,y-It),e.arc(n+f,r-i,c,y-It,y),e.arc(n+u,r+a,c,y,y+It),e.arc(n-f,r+i,c,y+It,y+ht),e.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*p,d=s?s/2:l,e.rect(n-d,r-l,2*d,2*l);break}y+=Vr;case"rectRot":u=Math.cos(y)*(s?s/2:p),i=Math.cos(y)*p,a=Math.sin(y)*p,f=Math.sin(y)*(s?s/2:p),e.moveTo(n-u,r-a),e.lineTo(n+f,r-i),e.lineTo(n+u,r+a),e.lineTo(n-f,r+i),e.closePath();break;case"crossRot":y+=Vr;case"cross":u=Math.cos(y)*(s?s/2:p),i=Math.cos(y)*p,a=Math.sin(y)*p,f=Math.sin(y)*(s?s/2:p),e.moveTo(n-u,r-a),e.lineTo(n+u,r+a),e.moveTo(n+f,r-i),e.lineTo(n-f,r+i);break;case"star":u=Math.cos(y)*(s?s/2:p),i=Math.cos(y)*p,a=Math.sin(y)*p,f=Math.sin(y)*(s?s/2:p),e.moveTo(n-u,r-a),e.lineTo(n+u,r+a),e.moveTo(n+f,r-i),e.lineTo(n-f,r+i),y+=Vr,u=Math.cos(y)*(s?s/2:p),i=Math.cos(y)*p,a=Math.sin(y)*p,f=Math.sin(y)*(s?s/2:p),e.moveTo(n-u,r-a),e.lineTo(n+u,r+a),e.moveTo(n+f,r-i),e.lineTo(n-f,r+i);break;case"line":i=s?s/2:Math.cos(y)*p,a=Math.sin(y)*p,e.moveTo(n-i,r-a),e.lineTo(n+i,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(y)*(s?s/2:p),r+Math.sin(y)*p);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Z0(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function kd(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Cd(e){e.restore()}function RN(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),ft(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function eO(e,t,n,r,s){if(s.strikethrough||s.underline){const o=e.measureText(r),i=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,d=s.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(i,d),e.lineTo(a,d),e.stroke()}}function tO(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Lo(e,t,n,r,s,o={}){const i=Dt(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(e.save(),e.font=s.string,RN(e,o),l=0;l<i.length;++l)c=i[l],o.backdrop&&tO(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),ft(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,n,r,o.maxWidth)),e.fillText(c,n,r,o.maxWidth),eO(e,n,r,c,o),r+=Number(s.lineHeight);e.restore()}function Sa(e,t){const{x:n,y:r,w:s,h:o,radius:i}=t;e.arc(n+i.topLeft,r+i.topLeft,i.topLeft,1.5*ht,ht,!0),e.lineTo(n,r+o-i.bottomLeft),e.arc(n+i.bottomLeft,r+o-i.bottomLeft,i.bottomLeft,ht,It,!0),e.lineTo(n+s-i.bottomRight,r+o),e.arc(n+s-i.bottomRight,r+o-i.bottomRight,i.bottomRight,It,0,!0),e.lineTo(n+s,r+i.topRight),e.arc(n+s-i.topRight,r+i.topRight,i.topRight,0,-It,!0),e.lineTo(n+i.topLeft,r)}const nO=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,rO=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function sO(e,t){const n=(""+e).match(nO);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const oO=e=>+e||0;function Sd(e,t){const n={},r=Qe(t),s=r?Object.keys(t):t,o=Qe(e)?r?i=>Je(e[i],e[t[i]]):i=>e[i]:()=>e;for(const i of s)n[i]=oO(o(i));return n}function Q0(e){return Sd(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Ns(e){return Sd(e,["topLeft","topRight","bottomLeft","bottomRight"])}function _n(e){const t=Q0(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Rt(e,t){e=e||{},t=t||_t.font;let n=Je(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=Je(e.style,t.style);r&&!(""+r).match(rO)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const s={family:Je(e.family,t.family),lineHeight:sO(Je(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:Je(e.weight,t.weight),string:""};return s.string=JN(s),s}function _a(e,t,n,r){let s,o,i;for(s=0,o=e.length;s<o;++s)if(i=e[s],i!==void 0&&i!==void 0)return i}function iO(e,t,n){const{min:r,max:s}=e,o=E0(t,(s-r)/2),i=(a,l)=>n&&a===0?0:a+l;return{min:i(r,-Math.abs(o)),max:i(s,o)}}function Os(e,t){return Object.assign(Object.create(e),t)}function _d(e,t=[""],n,r,s=()=>e[0]){const o=n||e;typeof r>"u"&&(r=nm("_fallback",e));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:r,_getTarget:s,override:a=>_d([a,...e],t,o,r)};return new Proxy(i,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return R0(a,l,()=>gO(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return rm(a).includes(l)},ownKeys(a){return rm(a)},set(a,l,c){const d=a._storage||(a._storage=s());return a[l]=d[l]=c,delete a._keys,!0}})}function Ts(e,t,n,r){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:J0(e,r),setContext:o=>Ts(e,o,n,r),override:o=>Ts(e.override(o),t,n,r)};return new Proxy(s,{deleteProperty(o,i){return delete o[i],delete e[i],!0},get(o,i,a){return R0(o,i,()=>lO(o,i,a))},getOwnPropertyDescriptor(o,i){return o._descriptors.allKeys?Reflect.has(e,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,i)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,i){return Reflect.has(e,i)},ownKeys(){return Reflect.ownKeys(e)},set(o,i,a){return e[i]=a,delete o[i],!0}})}function J0(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:r,isScriptable:vr(n)?n:()=>n,isIndexable:vr(r)?r:()=>r}}const aO=(e,t)=>e?e+gd(t):t,Ed=(e,t)=>Qe(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function R0(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function lO(e,t,n){const{_proxy:r,_context:s,_subProxy:o,_descriptors:i}=e;let a=r[t];return vr(a)&&i.isScriptable(t)&&(a=cO(t,a,e,n)),Dt(a)&&a.length&&(a=dO(t,a,e,i.isIndexable)),Ed(t,a)&&(a=Ts(a,s,o&&o[t],i)),a}function cO(e,t,n,r){const{_proxy:s,_context:o,_subProxy:i,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(o,i||r);return a.delete(e),Ed(e,l)&&(l=Md(s._scopes,s,e,l)),l}function dO(e,t,n,r){const{_proxy:s,_context:o,_subProxy:i,_descriptors:a}=n;if(typeof o.index<"u"&&r(e))return t[o.index%t.length];if(Qe(t[0])){const l=t,c=s._scopes.filter(d=>d!==l);t=[];for(const d of l){const u=Md(c,s,e,d);t.push(Ts(u,o,i&&i[e],a))}}return t}function em(e,t,n){return vr(e)?e(t,n):e}const uO=(e,t)=>e===!0?t:typeof e=="string"?zr(t,e):void 0;function fO(e,t,n,r,s){for(const o of t){const i=uO(n,o);if(i){e.add(i);const a=em(i._fallback,n,s);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(i===!1&&typeof r<"u"&&n!==r)return null}return!1}function Md(e,t,n,r){const s=t._rootScopes,o=em(t._fallback,n,r),i=[...e,...s],a=new Set;a.add(r);let l=tm(a,i,n,o||n,r);return l===null||typeof o<"u"&&o!==n&&(l=tm(a,i,o,l,r),l===null)?!1:_d(Array.from(a),[""],s,o,()=>hO(t,n,r))}function tm(e,t,n,r,s){for(;n;)n=fO(e,t,n,r,s);return n}function hO(e,t,n){const r=e._getTarget();t in r||(r[t]={});const s=r[t];return Dt(s)&&Qe(n)?n:s||{}}function gO(e,t,n,r){let s;for(const o of t)if(s=nm(aO(o,e),n),typeof s<"u")return Ed(e,s)?Md(n,r,e,s):s}function nm(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function rm(e){let t=e._keys;return t||(t=e._keys=pO(e._scopes)),t}function pO(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(r);return Array.from(t)}function Nd(){return typeof window<"u"&&typeof document<"u"}function Od(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Ea(e,t,n){let r;return typeof e=="string"?(r=parseInt(e,10),e.indexOf("%")!==-1&&(r=r/100*t.parentNode[n])):r=e,r}const Ma=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function mO(e,t){return Ma(e).getPropertyValue(t)}const bO=["top","right","bottom","left"];function jr(e,t,n){const r={};n=n?"-"+n:"";for(let s=0;s<4;s++){const o=bO[s];r[o]=parseFloat(e[t+"-"+o+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const yO=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function vO(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:s,offsetY:o}=r;let i=!1,a,l;if(yO(s,o,e.target))a=s,l=o;else{const c=t.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,i=!0}return{x:a,y:l,box:i}}function Wr(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,s=Ma(n),o=s.boxSizing==="border-box",i=jr(s,"padding"),a=jr(s,"border","width"),{x:l,y:c,box:d}=vO(e,n),u=i.left+(d&&a.left),f=i.top+(d&&a.top);let{width:g,height:m}=t;return o&&(g-=i.width+a.width,m-=i.height+a.height),{x:Math.round((l-u)/g*n.width/r),y:Math.round((c-f)/m*n.height/r)}}function xO(e,t,n){let r,s;if(t===void 0||n===void 0){const o=e&&Od(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const i=o.getBoundingClientRect(),a=Ma(o),l=jr(a,"border","width"),c=jr(a,"padding");t=i.width-c.width-l.width,n=i.height-c.height-l.height,r=Ea(a.maxWidth,o,"clientWidth"),s=Ea(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:r||va,maxHeight:s||va}}const wr=e=>Math.round(e*10)/10;function wO(e,t,n,r){const s=Ma(e),o=jr(s,"margin"),i=Ea(s.maxWidth,e,"clientWidth")||va,a=Ea(s.maxHeight,e,"clientHeight")||va,l=xO(e,t,n);let{width:c,height:d}=l;if(s.boxSizing==="content-box"){const f=jr(s,"border","width"),g=jr(s,"padding");c-=g.width+f.width,d-=g.height+f.height}return c=Math.max(0,c-o.width),d=Math.max(0,r?c/r:d-o.height),c=wr(Math.min(c,i,l.maxWidth)),d=wr(Math.min(d,a,l.maxHeight)),c&&!d&&(d=wr(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&d>l.height&&(d=l.height,c=wr(Math.floor(d*r))),{width:c,height:d}}function sm(e,t,n){const r=t||1,s=wr(e.height*r),o=wr(e.width*r);e.height=wr(e.height),e.width=wr(e.width);const i=e.canvas;return i.style&&(n||!i.style.height&&!i.style.width)&&(i.style.height=`${e.height}px`,i.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||i.height!==s||i.width!==o?(e.currentDevicePixelRatio=r,i.height=s,i.width=o,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const kO=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Nd()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function om(e,t){const n=mO(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}const CO=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},SO=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function As(e,t,n){return e?CO(t,n):SO()}function im(e,t){let n,r;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function am(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function Na(e,t,n){return e.options.clip?e[n]:t[n]}function _O(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:Na(n,t,"left"),right:Na(n,t,"right"),top:Na(r,t,"top"),bottom:Na(r,t,"bottom")}:t}function EO(e,t){const n=t._clip;if(n.disabled)return!1;const r=_O(t,e.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:r.bottom+(n.bottom===!0?0:n.bottom)}}/*!
|
||
* Chart.js v4.5.1
|
||
* https://www.chartjs.org
|
||
* (c) 2025 Chart.js Contributors
|
||
* Released under the MIT License
|
||
*/class MO{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,s){const o=n.listeners[s],i=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:i,currentStep:Math.min(r-n.start,i)}))}_refresh(){this._request||(this._running=!0,this._request=z0.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,s)=>{if(!r.running||!r.items.length)return;const o=r.items;let i=o.length-1,a=!1,l;for(;i>=0;--i)l=o[i],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(o[i]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,r,t,"progress")),o.length||(r.running=!1,this._notify(s,r,t,"complete"),r.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,s)=>Math.max(r,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let s=r.length-1;for(;s>=0;--s)r[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var sr=new MO;const lm="transparent",NO={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=j0(e||lm),s=r.valid&&j0(t||lm);return s&&s.valid?s.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class OO{constructor(t,n,r,s){const o=n[r];s=_a([t.to,s,o,t.from]);const i=_a([t.from,o,s]);this._active=!0,this._fn=t.fn||NO[t.type||typeof i],this._easing=Do[t.easing]||Do.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=i,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const s=this._target[this._prop],o=r-this._start,i=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(i,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=_a([t.to,n,s,t.from]),this._from=_a([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,s=this._prop,o=this._from,i=this._loop,a=this._to;let l;if(this._active=o!==a&&(i||n<r),!this._active){this._target[s]=a,this._notify(!0);return}if(n<0){this._target[s]=o;return}l=n/r%2,l=i&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let s=0;s<r.length;s++)r[s][n]()}}class cm{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Qe(t))return;const n=Object.keys(_t.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!Qe(o))return;const i={};for(const a of n)i[a]=o[a];(Dt(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!r.has(a))&&r.set(a,i)})})}_animateOptions(t,n){const r=n.options,s=AO(t,r);if(!s)return[];const o=this._createAnimations(s,r);return r.$shared&&TO(t.options.$animations,r).then(()=>{t.options=r},()=>{}),o}_createAnimations(t,n){const r=this._properties,s=[],o=t.$animations||(t.$animations={}),i=Object.keys(n),a=Date.now();let l;for(l=i.length-1;l>=0;--l){const c=i[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,n));continue}const d=n[c];let u=o[c];const f=r.get(c);if(u)if(f&&u.active()){u.update(f,d,a);continue}else u.cancel();if(!f||!f.duration){t[c]=d;continue}o[c]=u=new OO(f,t,c,d),s.push(u)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return sr.add(this._chart,r),!0}}function TO(e,t){const n=[],r=Object.keys(t);for(let s=0;s<r.length;s++){const o=e[r[s]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function AO(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function dm(e,t){const n=e&&e.options||{},r=n.reverse,s=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:r?o:s,end:r?s:o}}function DO(e,t,n){if(n===!1)return!1;const r=dm(e,n),s=dm(t,n);return{top:s.end,right:r.end,bottom:s.start,left:r.start}}function IO(e){let t,n,r,s;return Qe(e)?(t=e.top,n=e.right,r=e.bottom,s=e.left):t=n=r=s=e,{top:t,right:n,bottom:r,left:s,disabled:e===!1}}function um(e,t){const n=[],r=e._getSortedDatasetMetas(t);let s,o;for(s=0,o=r.length;s<o;++s)n.push(r[s].index);return n}function fm(e,t,n,r={}){const s=e.keys,o=r.mode==="single";let i,a,l,c;if(t===null)return;let d=!1;for(i=0,a=s.length;i<a;++i){if(l=+s[i],l===n){if(d=!0,r.all)continue;break}c=e.values[l],Sn(c)&&(o||t===0||xr(t)===xr(c))&&(t+=c)}return!d&&!r.all?0:t}function LO(e,t){const{iScale:n,vScale:r}=t,s=n.axis==="x"?"x":"y",o=r.axis==="x"?"x":"y",i=Object.keys(e),a=new Array(i.length);let l,c,d;for(l=0,c=i.length;l<c;++l)d=i[l],a[l]={[s]:d,[o]:e[d]};return a}function Td(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function PO(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function $O(e){const{min:t,max:n,minDefined:r,maxDefined:s}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function FO(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function hm(e,t,n,r){for(const s of t.getMatchingVisibleMetas(r).reverse()){const o=e[s.index];if(n&&o>0||!n&&o<0)return s.index}return null}function gm(e,t){const{chart:n,_cachedMeta:r}=e,s=n._stacks||(n._stacks={}),{iScale:o,vScale:i,index:a}=r,l=o.axis,c=i.axis,d=PO(o,i,r),u=t.length;let f;for(let g=0;g<u;++g){const m=t[g],{[l]:p,[c]:y}=m,b=m._stacks||(m._stacks={});f=b[c]=FO(s,d,p),f[a]=y,f._top=hm(f,i,!0,r.type),f._bottom=hm(f,i,!1,r.type);const _=f._visualValues||(f._visualValues={});_[a]=y}}function Ad(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function zO(e,t){return Os(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function VO(e,t,n){return Os(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Po(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const s of t){const o=s._stacks;if(!o||o[r]===void 0||o[r][n]===void 0)return;delete o[r][n],o[r]._visualValues!==void 0&&o[r]._visualValues[n]!==void 0&&delete o[r]._visualValues[n]}}}const Dd=e=>e==="reset"||e==="none",pm=(e,t)=>t?e:Object.assign({},e),HO=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:um(n,!0),values:null};class Ds{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Td(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Po(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),s=(u,f,g,m)=>u==="x"?f:u==="r"?m:g,o=n.xAxisID=Je(r.xAxisID,Ad(t,"x")),i=n.yAxisID=Je(r.yAxisID,Ad(t,"y")),a=n.rAxisID=Je(r.rAxisID,Ad(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,o,i,a),d=n.vAxisID=s(l,i,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(i),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&$0(this._data,this),t._stacked&&Po(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Qe(n)){const s=this._cachedMeta;this._data=LO(n,s)}else if(r!==n){if(r){$0(r,this);const s=this._cachedMeta;Po(s),s._parsed=[]}n&&Object.isExtensible(n)&&HN(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let s=!1;this._dataCheck();const o=n._stacked;n._stacked=Td(n.vScale,n),n.stack!==r.stack&&(s=!0,Po(n),n.stack=r.stack),this._resyncElements(t),(s||o!==n._stacked)&&(gm(this,n._parsed),n._stacked=Td(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:s}=this,{iScale:o,_stacked:i}=r,a=o.axis;let l=t===0&&n===s.length?!0:r._sorted,c=t>0&&r._parsed[t-1],d,u,f;if(this._parsing===!1)r._parsed=s,r._sorted=!0,f=s;else{Dt(s[t])?f=this.parseArrayData(r,s,t,n):Qe(s[t])?f=this.parseObjectData(r,s,t,n):f=this.parsePrimitiveData(r,s,t,n);const g=()=>u[a]===null||c&&u[a]<c[a];for(d=0;d<n;++d)r._parsed[d+t]=u=f[d],l&&(g()&&(l=!1),c=u);r._sorted=l}i&&gm(this,f)}parsePrimitiveData(t,n,r,s){const{iScale:o,vScale:i}=t,a=o.axis,l=i.axis,c=o.getLabels(),d=o===i,u=new Array(s);let f,g,m;for(f=0,g=s;f<g;++f)m=f+r,u[f]={[a]:d||o.parse(c[m],m),[l]:i.parse(n[m],m)};return u}parseArrayData(t,n,r,s){const{xScale:o,yScale:i}=t,a=new Array(s);let l,c,d,u;for(l=0,c=s;l<c;++l)d=l+r,u=n[d],a[l]={x:o.parse(u[0],d),y:i.parse(u[1],d)};return a}parseObjectData(t,n,r,s){const{xScale:o,yScale:i}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let d,u,f,g;for(d=0,u=s;d<u;++d)f=d+r,g=n[f],c[d]={x:o.parse(zr(g,a),f),y:i.parse(zr(g,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const s=this.chart,o=this._cachedMeta,i=n[t.axis],a={keys:um(s,!0),values:n._stacks[t.axis]._visualValues};return fm(a,i,o.index,{mode:r})}updateRangeFromParsed(t,n,r,s){const o=r[n.axis];let i=o===null?NaN:o;const a=s&&r._stacks[n.axis];s&&a&&(s.values=a,i=fm(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,i),t.max=Math.max(t.max,i)}getMinMax(t,n){const r=this._cachedMeta,s=r._parsed,o=r._sorted&&t===r.iScale,i=s.length,a=this._getOtherScale(t),l=HO(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:u}=$O(a);let f,g;function m(){g=s[f];const p=g[a.axis];return!Sn(g[t.axis])||d>p||u<p}for(f=0;f<i&&!(!m()&&(this.updateRangeFromParsed(c,t,g,l),o));++f);if(o){for(f=i-1;f>=0;--f)if(!m()){this.updateRangeFromParsed(c,t,g,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let s,o,i;for(s=0,o=n.length;s<o;++s)i=n[s][t.axis],Sn(i)&&r.push(i);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,s=n.vScale,o=this.getParsed(t);return{label:r?""+r.getLabelForValue(o[r.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=IO(Je(this.options.clip,DO(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,s=r.data||[],o=n.chartArea,i=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let d;for(r.dataset&&r.dataset.draw(t,o,a,l),d=a;d<a+l;++d){const u=s[d];u.hidden||(u.active&&c?i.push(u):u.draw(t,o))}for(d=0;d<i.length;++d)i[d].draw(t,o)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const i=this._cachedMeta.data[t];o=i.$context||(i.$context=VO(this.getContext(),t,i)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=zO(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=r,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const s=n==="active",o=this._cachedDataOpts,i=t+"-"+n,a=o[i],l=this.enableOptionSharing&&Ao(r);if(a)return pm(a,l);const c=this.chart.config,d=c.datasetElementScopeKeys(this._type,t),u=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),d),g=Object.keys(_t.elements[t]),m=()=>this.getContext(r,s,n),p=c.resolveNamedOptions(f,g,m,u);return p.$shared&&(p.$shared=l,o[i]=Object.freeze(pm(p,l))),p}_resolveAnimations(t,n,r){const s=this.chart,o=this._cachedDataOpts,i=`animation-${n}`,a=o[i];if(a)return a;let l;if(s.options.animation!==!1){const d=this.chart.config,u=d.datasetAnimationScopeKeys(this._type,n),f=d.getOptionScopes(this.getDataset(),u);l=d.createResolver(f,this.getContext(t,r,n))}const c=new cm(s,l&&l.animations);return l&&l._cacheable&&(o[i]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Dd(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),s=this._sharedOptions,o=this.getSharedOptions(r),i=this.includeOptions(n,o)||o!==s;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:i}}updateElement(t,n,r,s){Dd(s)?Object.assign(t,r):this._resolveAnimations(n,s).update(t,r)}updateSharedOptions(t,n,r){t&&!Dd(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,s){t.active=s;const o=this.getStyle(n,s);this._resolveAnimations(n,r,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=r.length,o=n.length,i=Math.min(o,s);i&&this.parse(0,i),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,n,r=!0){const s=this._cachedMeta,o=s.data,i=t+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=i;a--)c[a]=c[a-n]};for(l(o),a=t;a<i;++a)o[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,n),r&&this.updateElements(o,t,n,"reset")}updateElements(t,n,r,s){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const s=r._parsed.splice(t,n);r._stacked&&Po(r,s)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,s]=t;this[n](r,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}$e(Ds,"defaults",{}),$e(Ds,"datasetElementType",null),$e(Ds,"dataElementType",null);function UO(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let s=0,o=n.length;s<o;s++)r=r.concat(n[s].controller.getAllParsedValues(e));e._cache.$bar=F0(r.sort((s,o)=>s-o))}return e._cache.$bar}function BO(e){const t=e.iScale,n=UO(t,e.type);let r=t._length,s,o,i,a;const l=()=>{i===32767||i===-32768||(Ao(a)&&(r=Math.min(r,Math.abs(i-a)||r)),a=i)};for(s=0,o=n.length;s<o;++s)i=t.getPixelForValue(n[s]),l();for(a=void 0,s=0,o=t.ticks.length;s<o;++s)i=t.getPixelForTick(s),l();return r}function jO(e,t,n,r){const s=n.barThickness;let o,i;return ft(s)?(o=t.min*n.categoryPercentage,i=n.barPercentage):(o=s*r,i=1),{chunk:o/r,ratio:i,start:t.pixels[e]-o/2}}function WO(e,t,n,r){const s=t.pixels,o=s[e];let i=e>0?s[e-1]:null,a=e<s.length-1?s[e+1]:null;const l=n.categoryPercentage;i===null&&(i=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-i);const c=o-(o-Math.min(i,a))/2*l;return{chunk:Math.abs(a-i)/2*l/r,ratio:n.barPercentage,start:c}}function GO(e,t,n,r){const s=n.parse(e[0],r),o=n.parse(e[1],r),i=Math.min(s,o),a=Math.max(s,o);let l=i,c=a;Math.abs(i)>Math.abs(a)&&(l=a,c=i),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:o,min:i,max:a}}function mm(e,t,n,r){return Dt(e)?GO(e,t,n,r):t[n.axis]=n.parse(e,r),t}function bm(e,t,n,r){const s=e.iScale,o=e.vScale,i=s.getLabels(),a=s===o,l=[];let c,d,u,f;for(c=n,d=n+r;c<d;++c)f=t[c],u={},u[s.axis]=a||s.parse(i[c],c),l.push(mm(f,u,o,c));return l}function Id(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function YO(e,t,n){return e!==0?xr(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function KO(e){let t,n,r,s,o;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(s="end",o="start"):(s="start",o="end"),{start:n,end:r,reverse:t,top:s,bottom:o}}function XO(e,t,n,r){let s=t.borderSkipped;const o={};if(!s){e.borderSkipped=o;return}if(s===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:i,end:a,reverse:l,top:c,bottom:d}=KO(e);s==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?s=c:(n._bottom||0)===r?s=d:(o[ym(d,i,a,l)]=!0,s=c)),o[ym(s,i,a,l)]=!0,e.borderSkipped=o}function ym(e,t,n,r){return r?(e=qO(e,t,n),e=vm(e,n,t)):e=vm(e,t,n),e}function qO(e,t,n){return e===t?n:e===n?t:e}function vm(e,t,n){return e==="start"?t:e==="end"?n:e}function ZO(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Oa extends Ds{parsePrimitiveData(t,n,r,s){return bm(t,n,r,s)}parseArrayData(t,n,r,s){return bm(t,n,r,s)}parseObjectData(t,n,r,s){const{iScale:o,vScale:i}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,d=i.axis==="x"?a:l,u=[];let f,g,m,p;for(f=r,g=r+s;f<g;++f)p=n[f],m={},m[o.axis]=o.parse(zr(p,c),f),u.push(mm(zr(p,d),m,i,f));return u}updateRangeFromParsed(t,n,r,s){super.updateRangeFromParsed(t,n,r,s);const o=r._custom;o&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:s}=n,o=this.getParsed(t),i=o._custom,a=Id(i)?"["+i.start+", "+i.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+r.getLabelForValue(o[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,s){const o=s==="reset",{index:i,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),d=this._getRuler(),{sharedOptions:u,includeOptions:f}=this._getSharedOptions(n,s);for(let g=n;g<n+r;g++){const m=this.getParsed(g),p=o||ft(m[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),y=this._calculateBarIndexPixels(g,d),b=(m._stacks||{})[a.axis],_={horizontal:c,base:p.base,enableBorderRadius:!b||Id(m._custom)||i===b._top||i===b._bottom,x:c?p.head:y.center,y:c?y.center:p.head,height:c?y.size:Math.abs(p.size),width:c?Math.abs(p.size):y.size};f&&(_.options=u||this.resolveDataElementOptions(g,t[g].active?"active":s));const x=_.options||t[g].options;XO(_,x,b,i),ZO(_,x,d.ratio),this.updateElement(t[g],g,_,s)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,s=r.getMatchingVisibleMetas(this._type).filter(d=>d.controller.options.grouped),o=r.options.stacked,i=[],a=this._cachedMeta.controller.getParsed(n),l=a&&a[r.axis],c=d=>{const u=d._parsed.find(g=>g[r.axis]===l),f=u&&u[d.vScale.axis];if(ft(f)||isNaN(f))return!0};for(const d of s)if(!(n!==void 0&&c(d))&&((o===!1||i.indexOf(d.stack)===-1||o===void 0&&d.stack===void 0)&&i.push(d.stack),d.index===t))break;return i.length||i.push(void 0),i}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(r=>t[r].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)t[Je(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,r){const s=this._getStacks(t,r),o=n!==void 0?s.indexOf(n):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,s=[];let o,i;for(o=0,i=n.data.length;o<i;++o)s.push(r.getPixelForValue(this.getParsed(o)[r.axis],o));const a=t.barThickness;return{min:a||BO(n),pixels:s,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:s},options:{base:o,minBarLength:i}}=this,a=o||0,l=this.getParsed(t),c=l._custom,d=Id(c);let u=l[n.axis],f=0,g=r?this.applyStack(n,l,r):u,m,p;g!==u&&(f=g-u,g=u),d&&(u=c.barStart,g=c.barEnd-c.barStart,u!==0&&xr(u)!==xr(c.barEnd)&&(f=0),f+=u);const y=!ft(o)&&!d?o:f;let b=n.getPixelForValue(y);if(this.chart.getDataVisibility(t)?m=n.getPixelForValue(f+g):m=b,p=m-b,Math.abs(p)<i){p=YO(p,n,a)*i,u===a&&(b-=p/2);const _=n.getPixelForDecimal(0),x=n.getPixelForDecimal(1),M=Math.min(_,x),S=Math.max(_,x);b=Math.max(Math.min(b,S),M),m=b+p,r&&!d&&(l._stacks[n.axis]._visualValues[s]=n.getValueForPixel(m)-n.getValueForPixel(b))}if(b===n.getPixelForValue(a)){const _=xr(p)*n.getLineWidthForValue(a)/2;b+=_,p-=_}return{size:p,base:b,head:m,center:m+p/2}}_calculateBarIndexPixels(t,n){const r=n.scale,s=this.options,o=s.skipNull,i=Je(s.maxBarThickness,1/0);let a,l;const c=this._getAxisCount();if(n.grouped){const d=o?this._getStackCount(t):n.stackCount,u=s.barThickness==="flex"?WO(t,n,s,d*c):jO(t,n,s,d*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,g=this._getAxis().indexOf(Je(f,this.getFirstScaleIdForIndexAxis())),m=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+g;a=u.start+u.chunk*m+u.chunk/2,l=Math.min(i,u.chunk*u.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(i,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,s=r.length;let o=0;for(;o<s;++o)this.getParsed(o)[n.axis]!==null&&!r[o].hidden&&r[o].draw(this._ctx)}}$e(Oa,"id","bar"),$e(Oa,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),$e(Oa,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function QO(e,t,n){let r=1,s=1,o=0,i=0;if(t<Ot){const a=e,l=a+t,c=Math.cos(a),d=Math.sin(a),u=Math.cos(l),f=Math.sin(l),g=(x,M,S)=>ka(x,a,l,!0)?1:Math.max(M,M*n,S,S*n),m=(x,M,S)=>ka(x,a,l,!0)?-1:Math.min(M,M*n,S,S*n),p=g(0,c,u),y=g(It,d,f),b=m(ht,c,u),_=m(ht+It,d,f);r=(p-b)/2,s=(y-_)/2,o=-(p+b)/2,i=-(y+_)/2}return{ratioX:r,ratioY:s,offsetX:o,offsetY:i}}class $o extends Ds{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=r;else{let o=l=>+r[l];if(Qe(r[t])){const{key:l="value"}=this._parsing;o=c=>+zr(r[c],l)}let i,a;for(i=t,a=t+n;i<a;++i)s._parsed[i]=o(i)}}_getRotation(){return rr(this.options.rotation-90)}_getCircumference(){return rr(this.options.circumference)}_getRotationExtents(){let t=Ot,n=-Ot;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const s=this.chart.getDatasetMeta(r).controller,o=s._getRotation(),i=s._getCircumference();t=Math.min(t,o),n=Math.max(n,o+i)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,s=this._cachedMeta,o=s.data,i=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-i)/2,0),l=Math.min(SN(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:d,rotation:u}=this._getRotationExtents(),{ratioX:f,ratioY:g,offsetX:m,offsetY:p}=QO(u,d,l),y=(r.width-i)/f,b=(r.height-i)/g,_=Math.max(Math.min(y,b)/2,0),x=E0(this.options.radius,_),M=Math.max(x*l,0),S=(x-M)/this._getVisibleDatasetWeightTotal();this.offsetX=m*x,this.offsetY=p*x,s.total=this.calculateTotal(),this.outerRadius=x-S*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-S*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){const r=this.options,s=this._cachedMeta,o=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/Ot)}updateElements(t,n,r,s){const o=s==="reset",i=this.chart,a=i.chartArea,c=i.options.animation,d=(a.left+a.right)/2,u=(a.top+a.bottom)/2,f=o&&c.animateScale,g=f?0:this.innerRadius,m=f?0:this.outerRadius,{sharedOptions:p,includeOptions:y}=this._getSharedOptions(n,s);let b=this._getRotation(),_;for(_=0;_<n;++_)b+=this._circumference(_,o);for(_=n;_<n+r;++_){const x=this._circumference(_,o),M=t[_],S={x:d+this.offsetX,y:u+this.offsetY,startAngle:b,endAngle:b+x,circumference:x,outerRadius:m,innerRadius:g};y&&(S.options=p||this.resolveDataElementOptions(_,M.active?"active":s)),b+=x,this.updateElement(M,_,S,s)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,s;for(s=0;s<n.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!n[s].hidden&&(r+=Math.abs(o))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Ot*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,s=r.data.labels||[],o=vd(n._parsed[t],r.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const r=this.chart;let s,o,i,a,l;if(!t){for(s=0,o=r.data.datasets.length;s<o;++s)if(r.isDatasetVisible(s)){i=r.getDatasetMeta(s),t=i.data,a=i.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,s=t.length;r<s;++r){const o=this.resolveDataElementOptions(r);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(Je(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}$e($o,"id","doughnut"),$e($o,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),$e($o,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),$e($o,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data,{labels:{pointStyle:r,textAlign:s,color:o,useBorderRadius:i,borderRadius:a}}=t.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((l,c)=>{const u=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:u.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(c),lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:u.borderWidth,strokeStyle:u.borderColor,textAlign:s,pointStyle:r,borderRadius:i&&(a||u.borderRadius),index:c}}):[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});function Gr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ld{constructor(t){$e(this,"options");this.options=t||{}}static override(t){Object.assign(Ld.prototype,t)}init(){}formats(){return Gr()}parse(){return Gr()}format(){return Gr()}add(){return Gr()}diff(){return Gr()}startOf(){return Gr()}endOf(){return Gr()}}var JO={_date:Ld};function RO(e,t,n,r){const{controller:s,data:o,_sorted:i}=e,a=s._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&i&&o.length){const c=a._reversePixels?zN:md;if(r){if(s._sharedOptions){const d=o[0],u=typeof d.getRange=="function"&&d.getRange(t);if(u){const f=c(o,t,n-u),g=c(o,t,n+u);return{lo:f.lo,hi:g.hi}}}}else{const d=c(o,t,n);if(l){const{vScale:u}=s._cachedMeta,{_parsed:f}=e,g=f.slice(0,d.lo+1).reverse().findIndex(p=>!ft(p[u.axis]));d.lo-=Math.max(0,g);const m=f.slice(d.hi).findIndex(p=>!ft(p[u.axis]));d.hi+=Math.max(0,m)}return d}}return{lo:0,hi:o.length-1}}function Ta(e,t,n,r,s){const o=e.getSortedVisibleDatasetMetas(),i=n[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:d}=o[a],{lo:u,hi:f}=RO(o[a],t,i,s);for(let g=u;g<=f;++g){const m=d[g];m.skip||r(m,c,g)}}}function eT(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,s){const o=t?Math.abs(r.x-s.x):0,i=n?Math.abs(r.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(i,2))}}function Pd(e,t,n,r,s){const o=[];return!s&&!e.isPointInArea(t)||Ta(e,n,t,function(a,l,c){!s&&!Z0(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function tT(e,t,n,r){let s=[];function o(i,a,l){const{startAngle:c,endAngle:d}=i.getProps(["startAngle","endAngle"],r),{angle:u}=L0(i,{x:t.x,y:t.y});ka(u,c,d)&&s.push({element:i,datasetIndex:a,index:l})}return Ta(e,n,t,o),s}function nT(e,t,n,r,s,o){let i=[];const a=eT(n);let l=Number.POSITIVE_INFINITY;function c(d,u,f){const g=d.inRange(t.x,t.y,s);if(r&&!g)return;const m=d.getCenterPoint(s);if(!(!!o||e.isPointInArea(m))&&!g)return;const y=a(t,m);y<l?(i=[{element:d,datasetIndex:u,index:f}],l=y):y===l&&i.push({element:d,datasetIndex:u,index:f})}return Ta(e,n,t,c),i}function $d(e,t,n,r,s,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!r?tT(e,t,n,s):nT(e,t,n,r,s,o)}function xm(e,t,n,r,s){const o=[],i=n==="x"?"inXRange":"inYRange";let a=!1;return Ta(e,n,t,(l,c,d)=>{l[i]&&l[i](t[n],s)&&(o.push({element:l,datasetIndex:c,index:d}),a=a||l.inRange(t.x,t.y,s))}),r&&!a?[]:o}var rT={modes:{index(e,t,n,r){const s=Wr(t,e),o=n.axis||"x",i=n.includeInvisible||!1,a=n.intersect?Pd(e,s,o,r,i):$d(e,s,o,!1,r,i),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const d=a[0].index,u=c.data[d];u&&!u.skip&&l.push({element:u,datasetIndex:c.index,index:d})}),l):[]},dataset(e,t,n,r){const s=Wr(t,e),o=n.axis||"xy",i=n.includeInvisible||!1;let a=n.intersect?Pd(e,s,o,r,i):$d(e,s,o,!1,r,i);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let d=0;d<c.length;++d)a.push({element:c[d],datasetIndex:l,index:d})}return a},point(e,t,n,r){const s=Wr(t,e),o=n.axis||"xy",i=n.includeInvisible||!1;return Pd(e,s,o,r,i)},nearest(e,t,n,r){const s=Wr(t,e),o=n.axis||"xy",i=n.includeInvisible||!1;return $d(e,s,o,n.intersect,r,i)},x(e,t,n,r){const s=Wr(t,e);return xm(e,s,"x",n.intersect,r)},y(e,t,n,r){const s=Wr(t,e);return xm(e,s,"y",n.intersect,r)}}};const wm=["left","top","right","bottom"];function Fo(e,t){return e.filter(n=>n.pos===t)}function km(e,t){return e.filter(n=>wm.indexOf(n.pos)===-1&&n.box.axis===t)}function zo(e,t){return e.sort((n,r)=>{const s=t?r:n,o=t?n:r;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function sT(e){const t=[];let n,r,s,o,i,a;for(n=0,r=(e||[]).length;n<r;++n)s=e[n],{position:o,options:{stack:i,stackWeight:a=1}}=s,t.push({index:n,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:i&&o+i,stackWeight:a});return t}function oT(e){const t={};for(const n of e){const{stack:r,pos:s,stackWeight:o}=n;if(!r||!wm.includes(s))continue;const i=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=o}return t}function iT(e,t){const n=oT(e),{vBoxMaxWidth:r,hBoxMaxHeight:s}=t;let o,i,a;for(o=0,i=e.length;o<i;++o){a=e[o];const{fullSize:l}=a.box,c=n[a.stack],d=c&&a.stackWeight/c.weight;a.horizontal?(a.width=d?d*r:l&&t.availableWidth,a.height=s):(a.width=r,a.height=d?d*s:l&&t.availableHeight)}return n}function aT(e){const t=sT(e),n=zo(t.filter(c=>c.box.fullSize),!0),r=zo(Fo(t,"left"),!0),s=zo(Fo(t,"right")),o=zo(Fo(t,"top"),!0),i=zo(Fo(t,"bottom")),a=km(t,"x"),l=km(t,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:s.concat(l).concat(i).concat(a),chartArea:Fo(t,"chartArea"),vertical:r.concat(s).concat(l),horizontal:o.concat(i).concat(a)}}function Cm(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Sm(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function lT(e,t,n,r){const{pos:s,box:o}=n,i=e.maxPadding;if(!Qe(s)){n.size&&(e[s]-=n.size);const u=r[n.stack]||{size:0,count:1};u.size=Math.max(u.size,n.horizontal?o.height:o.width),n.size=u.size/u.count,e[s]+=n.size}o.getPadding&&Sm(i,o.getPadding());const a=Math.max(0,t.outerWidth-Cm(i,e,"left","right")),l=Math.max(0,t.outerHeight-Cm(i,e,"top","bottom")),c=a!==e.w,d=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:d}:{same:d,other:c}}function cT(e){const t=e.maxPadding;function n(r){const s=Math.max(t[r]-e[r],0);return e[r]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function dT(e,t){const n=t.maxPadding;function r(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(i=>{o[i]=Math.max(t[i],n[i])}),o}return r(e?["left","right"]:["top","bottom"])}function Vo(e,t,n,r){const s=[];let o,i,a,l,c,d;for(o=0,i=e.length,c=0;o<i;++o){a=e[o],l=a.box,l.update(a.width||t.w,a.height||t.h,dT(a.horizontal,t));const{same:u,other:f}=lT(t,n,a,r);c|=u&&s.length,d=d||f,l.fullSize||s.push(a)}return c&&Vo(s,t,n,r)||d}function Aa(e,t,n,r,s){e.top=n,e.left=t,e.right=t+r,e.bottom=n+s,e.width=r,e.height=s}function _m(e,t,n,r){const s=n.padding;let{x:o,y:i}=t;for(const a of e){const l=a.box,c=r[a.stack]||{placed:0,weight:1},d=a.stackWeight/c.weight||1;if(a.horizontal){const u=t.w*d,f=c.size||l.height;Ao(c.start)&&(i=c.start),l.fullSize?Aa(l,s.left,i,n.outerWidth-s.right-s.left,f):Aa(l,t.left+c.placed,i,u,f),c.start=i,c.placed+=u,i=l.bottom}else{const u=t.h*d,f=c.size||l.width;Ao(c.start)&&(o=c.start),l.fullSize?Aa(l,o,s.top,f,n.outerHeight-s.bottom-s.top):Aa(l,o,t.top+c.placed,f,u),c.start=o,c.placed+=u,o=l.right}}t.x=o,t.y=i}var En={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const s=_n(e.options.layout.padding),o=Math.max(t-s.width,0),i=Math.max(n-s.height,0),a=aT(e.boxes),l=a.vertical,c=a.horizontal;at(e.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const d=l.reduce((p,y)=>y.box.options&&y.box.options.display===!1?p:p+1,0)||1,u=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:o,availableHeight:i,vBoxMaxWidth:o/2/d,hBoxMaxHeight:i/2}),f=Object.assign({},s);Sm(f,_n(r));const g=Object.assign({maxPadding:f,w:o,h:i,x:s.left,y:s.top},s),m=iT(l.concat(c),u);Vo(a.fullSize,g,u,m),Vo(l,g,u,m),Vo(c,g,u,m)&&Vo(l,g,u,m),cT(g),_m(a.leftAndTop,g,u,m),g.x+=g.w,g.y+=g.h,_m(a.rightAndBottom,g,u,m),e.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},at(a.chartArea,p=>{const y=p.box;Object.assign(y,e.chartArea),y.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class Em{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,s){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):r)}}isAttached(t){return!0}updateConfig(t){}}class uT extends Em{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Da="$chartjs",fT={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Mm=e=>e===null||e==="";function hT(e,t){const n=e.style,r=e.getAttribute("height"),s=e.getAttribute("width");if(e[Da]={initial:{height:r,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Mm(s)){const o=om(e,"width");o!==void 0&&(e.width=o)}if(Mm(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=om(e,"height");o!==void 0&&(e.height=o)}return e}const Nm=kO?{passive:!0}:!1;function gT(e,t,n){e&&e.addEventListener(t,n,Nm)}function pT(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Nm)}function mT(e,t){const n=fT[e.type]||e.type,{x:r,y:s}=Wr(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:s!==void 0?s:null}}function Ia(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function bT(e,t,n){const r=e.canvas,s=new MutationObserver(o=>{let i=!1;for(const a of o)i=i||Ia(a.addedNodes,r),i=i&&!Ia(a.removedNodes,r);i&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function yT(e,t,n){const r=e.canvas,s=new MutationObserver(o=>{let i=!1;for(const a of o)i=i||Ia(a.removedNodes,r),i=i&&!Ia(a.addedNodes,r);i&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const Ho=new Map;let Om=0;function Tm(){const e=window.devicePixelRatio;e!==Om&&(Om=e,Ho.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function vT(e,t){Ho.size||window.addEventListener("resize",Tm),Ho.set(e,t)}function xT(e){Ho.delete(e),Ho.size||window.removeEventListener("resize",Tm)}function wT(e,t,n){const r=e.canvas,s=r&&Od(r);if(!s)return;const o=V0((a,l)=>{const c=s.clientWidth;n(a,l),c<s.clientWidth&&n()},window),i=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,d=l.contentRect.height;c===0&&d===0||o(c,d)});return i.observe(s),vT(e,o),i}function Fd(e,t,n){n&&n.disconnect(),t==="resize"&&xT(e)}function kT(e,t,n){const r=e.canvas,s=V0(o=>{e.ctx!==null&&n(mT(o,e))},e);return gT(r,t,s),s}class CT extends Em{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(hT(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Da])return!1;const r=n[Da].initial;["height","width"].forEach(o=>{const i=r[o];ft(i)?n.removeAttribute(o):n.setAttribute(o,i)});const s=r.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[Da],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),i={attach:bT,detach:yT,resize:wT}[n]||kT;s[n]=i(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),s=r[n];if(!s)return;({attach:Fd,detach:Fd,resize:Fd}[n]||pT)(t,n,s),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,s){return wO(t,n,r,s)}isAttached(t){const n=t&&Od(t);return!!(n&&n.isConnected)}}function ST(e){return!Nd()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?uT:CT}let Yr=(Xa=class{constructor(){$e(this,"x");$e(this,"y");$e(this,"active",!1);$e(this,"options");$e(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return wa(this.x)&&wa(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const s={};return t.forEach(o=>{s[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),s}},$e(Xa,"defaults",{}),$e(Xa,"defaultRoutes"),Xa);function _T(e,t){const n=e.options.ticks,r=ET(e),s=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?NT(t):[],i=o.length,a=o[0],l=o[i-1],c=[];if(i>s)return OT(t,c,o,i/s),c;const d=MT(o,t,s);if(i>0){let u,f;const g=i>1?Math.round((l-a)/(i-1)):null;for(La(t,c,d,ft(g)?0:a-g,a),u=0,f=i-1;u<f;u++)La(t,c,d,o[u],o[u+1]);return La(t,c,d,l,ft(g)?t.length:l+g),c}return La(t,c,d),c}function ET(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),s=e._maxLength/n;return Math.floor(Math.min(r,s))}function MT(e,t,n){const r=TT(e),s=t.length/n;if(!r)return Math.max(s,1);const o=AN(r);for(let i=0,a=o.length-1;i<a;i++){const l=o[i];if(l>s)return l}return Math.max(s,1)}function NT(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function OT(e,t,n,r){let s=0,o=n[0],i;for(r=Math.ceil(r),i=0;i<e.length;i++)i===o&&(t.push(e[i]),s++,o=n[s*r])}function La(e,t,n,r,s){const o=Je(r,0),i=Math.min(Je(s,e.length),e.length);let a=0,l,c,d;for(n=Math.ceil(n),s&&(l=s-r,n=l/Math.floor(l/n)),d=o;d<0;)a++,d=Math.round(o+a*n);for(c=Math.max(o,0);c<i;c++)c===d&&(t.push(e[c]),a++,d=Math.round(o+a*n))}function TT(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const AT=e=>e==="left"?"right":e==="right"?"left":e,Am=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Dm=(e,t)=>Math.min(t||e,e);function Im(e,t){const n=[],r=e.length/t,s=e.length;let o=0;for(;o<s;o+=r)n.push(e[Math.floor(o)]);return n}function DT(e,t,n){const r=e.ticks.length,s=Math.min(t,r-1),o=e._startPixel,i=e._endPixel,a=1e-6;let l=e.getPixelForTick(s),c;if(!(n&&(r===1?c=Math.max(l-o,i-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-a||l>i+a)))return l}function IT(e,t){at(e,n=>{const r=n.gc,s=r.length/2;let o;if(s>t){for(o=0;o<s;++o)delete n.data[r[o]];r.splice(0,s)}})}function Uo(e){return e.drawTicks?e.tickLength:0}function Lm(e,t){if(!e.display)return 0;const n=Rt(e.font,t),r=_n(e.padding);return(Dt(e.text)?e.text.length:1)*n.lineHeight+r.height}function LT(e,t){return Os(e,{scale:t,type:"scale"})}function PT(e,t,n){return Os(e,{tick:n,index:t,type:"tick"})}function $T(e,t,n){let r=bd(e);return(n&&t!=="right"||!n&&t==="right")&&(r=AT(r)),r}function FT(e,t,n,r){const{top:s,left:o,bottom:i,right:a,chart:l}=e,{chartArea:c,scales:d}=l;let u=0,f,g,m;const p=i-s,y=a-o;if(e.isHorizontal()){if(g=Jt(r,o,a),Qe(n)){const b=Object.keys(n)[0],_=n[b];m=d[b].getPixelForValue(_)+p-t}else n==="center"?m=(c.bottom+c.top)/2+p-t:m=Am(e,n,t);f=a-o}else{if(Qe(n)){const b=Object.keys(n)[0],_=n[b];g=d[b].getPixelForValue(_)-y+t}else n==="center"?g=(c.left+c.right)/2-y+t:g=Am(e,n,t);m=Jt(r,i,s),u=n==="left"?-It:It}return{titleX:g,titleY:m,maxWidth:f,rotation:u}}class Is extends Yr{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:s}=this;return t=Yn(t,Number.POSITIVE_INFINITY),n=Yn(n,Number.NEGATIVE_INFINITY),r=Yn(r,Number.POSITIVE_INFINITY),s=Yn(s,Number.NEGATIVE_INFINITY),{min:Yn(t,r),max:Yn(n,s),minDefined:Sn(t),maxDefined:Sn(n)}}getMinMax(t){let{min:n,max:r,minDefined:s,maxDefined:o}=this.getUserBounds(),i;if(s&&o)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)i=a[l].controller.getMinMax(this,t),s||(n=Math.min(n,i.min)),o||(r=Math.max(r,i.max));return n=o&&n>r?r:n,r=s&&n>r?n:r,{min:Yn(n,Yn(r,n)),max:Yn(r,Yn(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){bt(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:s,grace:o,ticks:i}=this.options,a=i.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=iO(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Im(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||i.source==="auto")&&(this.ticks=_T(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){bt(this.options.afterUpdate,[this])}beforeSetDimensions(){bt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){bt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),bt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){bt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,s,o;for(r=0,s=t.length;r<s;r++)o=t[r],o.label=bt(n.callback,[o.value,r,t],this)}afterTickToLabelConversion(){bt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){bt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=Dm(this.ticks.length,t.ticks.maxTicksLimit),s=n.minRotation||0,o=n.maxRotation;let i=s,a,l,c;if(!this._isVisible()||!n.display||s>=o||r<=1||!this.isHorizontal()){this.labelRotation=s;return}const d=this._getLabelSizes(),u=d.widest.width,f=d.highest.height,g=cn(this.chart.width-u,0,this.maxWidth);a=t.offset?this.maxWidth/r:g/(r-1),u+6>a&&(a=g/(r-(t.offset?.5:1)),l=this.maxHeight-Uo(t.grid)-n.padding-Lm(t.title,this.chart.options.font),c=Math.sqrt(u*u+f*f),i=PN(Math.min(Math.asin(cn((d.highest.height+6)/a,-1,1)),Math.asin(cn(l/c,-1,1))-Math.asin(cn(f/c,-1,1)))),i=Math.max(s,Math.min(o,i))),this.labelRotation=i}afterCalculateLabelRotation(){bt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){bt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:s,grid:o}}=this,i=this._isVisible(),a=this.isHorizontal();if(i){const l=Lm(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=Uo(o)+l):(t.height=this.maxHeight,t.width=Uo(o)+l),r.display&&this.ticks.length){const{first:c,last:d,widest:u,highest:f}=this._getLabelSizes(),g=r.padding*2,m=rr(this.labelRotation),p=Math.cos(m),y=Math.sin(m);if(a){const b=r.mirror?0:y*u.width+p*f.height;t.height=Math.min(this.maxHeight,t.height+b+g)}else{const b=r.mirror?0:p*u.width+y*f.height;t.width=Math.min(this.maxWidth,t.width+b+g)}this._calculatePadding(c,d,y,p)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,s){const{ticks:{align:o,padding:i},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,g=0;l?c?(f=s*t.width,g=r*n.height):(f=r*t.height,g=s*n.width):o==="start"?g=n.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,g=n.width/2),this.paddingLeft=Math.max((f-d+i)*this.width/(this.width-d),0),this.paddingRight=Math.max((g-u+i)*this.width/(this.width-u),0)}else{let d=n.height/2,u=t.height/2;o==="start"?(d=0,u=t.height):o==="end"&&(d=n.height,u=0),this.paddingTop=d+i,this.paddingBottom=u+i}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){bt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)ft(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=Im(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:s,_longestTextCache:o}=this,i=[],a=[],l=Math.floor(n/Dm(n,r));let c=0,d=0,u,f,g,m,p,y,b,_,x,M,S;for(u=0;u<n;u+=l){if(m=t[u].label,p=this._resolveTickFontOptions(u),s.font=y=p.string,b=o[y]=o[y]||{data:{},gc:[]},_=p.lineHeight,x=M=0,!ft(m)&&!Dt(m))x=Y0(s,b.data,b.gc,x,m),M=_;else if(Dt(m))for(f=0,g=m.length;f<g;++f)S=m[f],!ft(S)&&!Dt(S)&&(x=Y0(s,b.data,b.gc,x,S),M+=_);i.push(x),a.push(M),c=Math.max(x,c),d=Math.max(M,d)}IT(o,n);const k=i.indexOf(c),N=a.indexOf(d),C=w=>({width:i[w]||0,height:a[w]||0});return{first:C(0),last:C(n-1),widest:C(k),highest:C(N),widths:i,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return FN(this._alignToPixels?Br(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=PT(this.getContext(),t,r))}return this.$context||(this.$context=LT(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=rr(this.labelRotation),r=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),o=this._getLabelSizes(),i=t.autoSkipPadding||0,a=o?o.widest.width+i:0,l=o?o.highest.height+i:0;return this.isHorizontal()?l*r>a*s?a/r:l/s:l*s<a*r?l/r:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,s=this.options,{grid:o,position:i,border:a}=s,l=o.offset,c=this.isHorizontal(),u=this.ticks.length+(l?1:0),f=Uo(o),g=[],m=a.setContext(this.getContext()),p=m.display?m.width:0,y=p/2,b=function(D){return Br(r,D,p)};let _,x,M,S,k,N,C,w,E,T,P,L;if(i==="top")_=b(this.bottom),N=this.bottom-f,w=_-y,T=b(t.top)+y,L=t.bottom;else if(i==="bottom")_=b(this.top),T=t.top,L=b(t.bottom)-y,N=_+y,w=this.top+f;else if(i==="left")_=b(this.right),k=this.right-f,C=_-y,E=b(t.left)+y,P=t.right;else if(i==="right")_=b(this.left),E=t.left,P=b(t.right)-y,k=_+y,C=this.left+f;else if(n==="x"){if(i==="center")_=b((t.top+t.bottom)/2+.5);else if(Qe(i)){const D=Object.keys(i)[0],O=i[D];_=b(this.chart.scales[D].getPixelForValue(O))}T=t.top,L=t.bottom,N=_+y,w=N+f}else if(n==="y"){if(i==="center")_=b((t.left+t.right)/2);else if(Qe(i)){const D=Object.keys(i)[0],O=i[D];_=b(this.chart.scales[D].getPixelForValue(O))}k=_-y,C=k-f,E=t.left,P=t.right}const F=Je(s.ticks.maxTicksLimit,u),A=Math.max(1,Math.ceil(u/F));for(x=0;x<u;x+=A){const D=this.getContext(x),O=o.setContext(D),z=a.setContext(D),U=O.lineWidth,j=O.color,Y=z.dash||[],B=z.dashOffset,W=O.tickWidth,G=O.tickColor,V=O.tickBorderDash||[],X=O.tickBorderDashOffset;M=DT(this,x,l),M!==void 0&&(S=Br(r,M,U),c?k=C=E=P=S:N=w=T=L=S,g.push({tx1:k,ty1:N,tx2:C,ty2:w,x1:E,y1:T,x2:P,y2:L,width:U,color:j,borderDash:Y,borderDashOffset:B,tickWidth:W,tickColor:G,tickBorderDash:V,tickBorderDashOffset:X}))}return this._ticksLength=u,this._borderValue=_,g}_computeLabelItems(t){const n=this.axis,r=this.options,{position:s,ticks:o}=r,i=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:d,mirror:u}=o,f=Uo(r.grid),g=f+d,m=u?-d:g,p=-rr(this.labelRotation),y=[];let b,_,x,M,S,k,N,C,w,E,T,P,L="middle";if(s==="top")k=this.bottom-m,N=this._getXAxisLabelAlignment();else if(s==="bottom")k=this.top+m,N=this._getXAxisLabelAlignment();else if(s==="left"){const A=this._getYAxisLabelAlignment(f);N=A.textAlign,S=A.x}else if(s==="right"){const A=this._getYAxisLabelAlignment(f);N=A.textAlign,S=A.x}else if(n==="x"){if(s==="center")k=(t.top+t.bottom)/2+g;else if(Qe(s)){const A=Object.keys(s)[0],D=s[A];k=this.chart.scales[A].getPixelForValue(D)+g}N=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")S=(t.left+t.right)/2-g;else if(Qe(s)){const A=Object.keys(s)[0],D=s[A];S=this.chart.scales[A].getPixelForValue(D)}N=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?L="top":l==="end"&&(L="bottom"));const F=this._getLabelSizes();for(b=0,_=a.length;b<_;++b){x=a[b],M=x.label;const A=o.setContext(this.getContext(b));C=this.getPixelForTick(b)+o.labelOffset,w=this._resolveTickFontOptions(b),E=w.lineHeight,T=Dt(M)?M.length:1;const D=T/2,O=A.color,z=A.textStrokeColor,U=A.textStrokeWidth;let j=N;i?(S=C,N==="inner"&&(b===_-1?j=this.options.reverse?"left":"right":b===0?j=this.options.reverse?"right":"left":j="center"),s==="top"?c==="near"||p!==0?P=-T*E+E/2:c==="center"?P=-F.highest.height/2-D*E+E:P=-F.highest.height+E/2:c==="near"||p!==0?P=E/2:c==="center"?P=F.highest.height/2-D*E:P=F.highest.height-T*E,u&&(P*=-1),p!==0&&!A.showLabelBackdrop&&(S+=E/2*Math.sin(p))):(k=C,P=(1-T)*E/2);let Y;if(A.showLabelBackdrop){const B=_n(A.backdropPadding),W=F.heights[b],G=F.widths[b];let V=P-B.top,X=0-B.left;switch(L){case"middle":V-=W/2;break;case"bottom":V-=W;break}switch(N){case"center":X-=G/2;break;case"right":X-=G;break;case"inner":b===_-1?X-=G:b>0&&(X-=G/2);break}Y={left:X,top:V,width:G+B.width,height:W+B.height,color:A.backdropColor}}y.push({label:M,font:w,textOffset:P,options:{rotation:p,color:O,strokeColor:z,strokeWidth:U,textAlign:j,textBaseline:L,translation:[S,k],backdrop:Y}})}return y}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-rr(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:s,padding:o}}=this.options,i=this._getLabelSizes(),a=t+o,l=i.widest.width;let c,d;return n==="left"?s?(d=this.right+o,r==="near"?c="left":r==="center"?(c="center",d+=l/2):(c="right",d+=l)):(d=this.right-a,r==="near"?c="right":r==="center"?(c="center",d-=l/2):(c="left",d=this.left)):n==="right"?s?(d=this.left+o,r==="near"?c="right":r==="center"?(c="center",d-=l/2):(c="left",d-=l)):(d=this.left+a,r==="near"?c="left":r==="center"?(c="center",d+=l/2):(c="right",d=this.right)):c="right",{textAlign:c,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:s,width:o,height:i}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,s,o,i),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,i;const a=(l,c,d)=>{!d.width||!d.color||(r.save(),r.lineWidth=d.width,r.strokeStyle=d.color,r.setLineDash(d.borderDash||[]),r.lineDashOffset=d.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(o=0,i=s.length;o<i;++o){const l=s[o];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:s}}=this,o=r.setContext(this.getContext()),i=r.display?o.width:0;if(!i)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,d,u,f;this.isHorizontal()?(c=Br(t,this.left,i)-i/2,d=Br(t,this.right,a)+a/2,u=f=l):(u=Br(t,this.top,i)-i/2,f=Br(t,this.bottom,a)+a/2,c=d=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,u),n.lineTo(d,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,s=this._computeLabelArea();s&&kd(r,s);const o=this.getLabelItems(t);for(const i of o){const a=i.options,l=i.font,c=i.label,d=i.textOffset;Lo(r,c,0,d,l,a)}s&&Cd(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:s}}=this;if(!r.display)return;const o=Rt(r.font),i=_n(r.padding),a=r.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||Qe(n)?(l+=i.bottom,Dt(r.text)&&(l+=o.lineHeight*(r.text.length-1))):l+=i.top;const{titleX:c,titleY:d,maxWidth:u,rotation:f}=FT(this,l,n,a);Lo(t,r.text,0,0,o,{color:r.color,maxWidth:u,rotation:f,textAlign:$T(a,n,s),textBaseline:"middle",translation:[c,d]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=Je(t.grid&&t.grid.z,-1),s=Je(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Is.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",s=[];let o,i;for(o=0,i=n.length;o<i;++o){const a=n[o];a[r]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return Rt(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Pa{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;HT(n)&&(r=this.register(n));const s=this.items,o=t.id,i=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,zT(t,i,r),this.override&&_t.override(t.id,t.overrides)),i}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,s=this.scope;r in n&&delete n[r],s&&r in _t[s]&&(delete _t[s][r],this.override&&delete Ur[r])}}function zT(e,t,n){const r=Oo(Object.create(null),[n?_t.get(n):{},_t.get(t),e.defaults]);_t.set(t,r),e.defaultRoutes&&VT(t,e.defaultRoutes),e.descriptors&&_t.describe(t,e.descriptors)}function VT(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),s=r.pop(),o=[e].concat(r).join("."),i=t[n].split("."),a=i.pop(),l=i.join(".");_t.route(o,s,l,a)})}function HT(e){return"id"in e&&"defaults"in e}class UT{constructor(){this.controllers=new Pa(Ds,"datasets",!0),this.elements=new Pa(Yr,"elements"),this.plugins=new Pa(Object,"plugins"),this.scales=new Pa(Is,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(s=>{const o=r||this._getRegistryForType(s);r||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):at(s,i=>{const a=r||this._getRegistryForType(i);this._exec(t,a,i)})})}_exec(t,n,r){const s=gd(t);bt(r["before"+s],[],r),n[t](r),bt(r["after"+s],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const s=n.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return s}}var Xn=new UT;class BT{constructor(){this._init=void 0}notify(t,n,r,s){if(n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const o=s?this._descriptors(t).filter(s):this._descriptors(t),i=this._notify(o,t,n,r);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),i}_notify(t,n,r,s){s=s||{};for(const o of t){const i=o.plugin,a=i[r],l=[n,s,o.options];if(bt(a,l,i)===!1&&s.cancelable)return!1}return!0}invalidate(){ft(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,s=Je(r.options&&r.options.plugins,{}),o=jT(r);return s===!1&&!n?[]:GT(t,o,s,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,s=(o,i)=>o.filter(a=>!i.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,r),t,"stop"),this._notify(s(r,n),t,"start")}}function jT(e){const t={},n=[],r=Object.keys(Xn.plugins.items);for(let o=0;o<r.length;o++)n.push(Xn.getPlugin(r[o]));const s=e.plugins||[];for(let o=0;o<s.length;o++){const i=s[o];n.indexOf(i)===-1&&(n.push(i),t[i.id]=!0)}return{plugins:n,localIds:t}}function WT(e,t){return!t&&e===!1?null:e===!0?{}:e}function GT(e,{plugins:t,localIds:n},r,s){const o=[],i=e.getContext();for(const a of t){const l=a.id,c=WT(r[l],s);c!==null&&o.push({plugin:a,options:YT(e.config,{plugin:a,local:n[l]},c,i)})}return o}function YT(e,{plugin:t,local:n},r,s){const o=e.pluginScopeKeys(t),i=e.getOptionScopes(r,o);return n&&t.defaults&&i.push(t.defaults),e.createResolver(i,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function zd(e,t){const n=_t.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function KT(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function XT(e,t){return e===t?"_index_":"_value_"}function Pm(e){if(e==="x"||e==="y"||e==="r")return e}function qT(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Vd(e,...t){if(Pm(e))return e;for(const n of t){const r=n.axis||qT(n.position)||e.length>1&&Pm(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function $m(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function ZT(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return $m(e,"x",n[0])||$m(e,"y",n[0])}return{}}function QT(e,t){const n=Ur[e.type]||{scales:{}},r=t.scales||{},s=zd(e.type,t),o=Object.create(null);return Object.keys(r).forEach(i=>{const a=r[i];if(!Qe(a))return console.error(`Invalid scale configuration for scale: ${i}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${i}`);const l=Vd(i,a,ZT(i,e),_t.scales[a.type]),c=XT(l,s),d=n.scales||{};o[i]=To(Object.create(null),[{axis:l},a,d[l],d[c]])}),e.data.datasets.forEach(i=>{const a=i.type||e.type,l=i.indexAxis||zd(a,t),d=(Ur[a]||{}).scales||{};Object.keys(d).forEach(u=>{const f=KT(u,l),g=i[f+"AxisID"]||f;o[g]=o[g]||Object.create(null),To(o[g],[{axis:f},r[g],d[u]])})}),Object.keys(o).forEach(i=>{const a=o[i];To(a,[_t.scales[a.type],_t.scale])}),o}function Fm(e){const t=e.options||(e.options={});t.plugins=Je(t.plugins,{}),t.scales=QT(e,t)}function zm(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function JT(e){return e=e||{},e.data=zm(e.data),Fm(e),e}const Vm=new Map,Hm=new Set;function $a(e,t){let n=Vm.get(e);return n||(n=t(),Vm.set(e,n),Hm.add(n)),n}const Bo=(e,t,n)=>{const r=zr(t,n);r!==void 0&&e.add(r)};class RT{constructor(t){this._config=JT(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=zm(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Fm(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return $a(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return $a(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return $a(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return $a(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let s=r.get(t);return(!s||n)&&(s=new Map,r.set(t,s)),s}getOptionScopes(t,n,r){const{options:s,type:o}=this,i=this._cachedScopes(t,r),a=i.get(n);if(a)return a;const l=new Set;n.forEach(d=>{t&&(l.add(t),d.forEach(u=>Bo(l,t,u))),d.forEach(u=>Bo(l,s,u)),d.forEach(u=>Bo(l,Ur[o]||{},u)),d.forEach(u=>Bo(l,_t,u)),d.forEach(u=>Bo(l,xd,u))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Hm.has(n)&&i.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Ur[n]||{},_t.datasets[n]||{},{type:n},_t,xd]}resolveNamedOptions(t,n,r,s=[""]){const o={$shared:!0},{resolver:i,subPrefixes:a}=Um(this._resolverCache,t,s);let l=i;if(t5(i,n)){o.$shared=!1,r=vr(r)?r():r;const c=this.createResolver(t,r,a);l=Ts(i,r,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,r=[""],s){const{resolver:o}=Um(this._resolverCache,t,r);return Qe(n)?Ts(o,n,void 0,s):o}}function Um(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const s=n.join();let o=r.get(s);return o||(o={resolver:_d(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(s,o)),o}const e5=e=>Qe(e)&&Object.getOwnPropertyNames(e).some(t=>vr(e[t]));function t5(e,t){const{isScriptable:n,isIndexable:r}=J0(e);for(const s of t){const o=n(s),i=r(s),a=(i||o)&&e[s];if(o&&(vr(a)||e5(a))||i&&Dt(a))return!0}return!1}var n5="4.5.1";const r5=["top","bottom","left","right","chartArea"];function Bm(e,t){return e==="top"||e==="bottom"||r5.indexOf(e)===-1&&t==="x"}function jm(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Wm(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),bt(n&&n.onComplete,[e],t)}function s5(e){const t=e.chart,n=t.options.animation;bt(n&&n.onProgress,[e],t)}function Gm(e){return Nd()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Fa={},Ym=e=>{const t=Gm(e);return Object.values(Fa).filter(n=>n.canvas===t).pop()};function o5(e,t,n){const r=Object.keys(e);for(const s of r){const o=+s;if(o>=t){const i=e[s];delete e[s],(n>0||o>t)&&(e[o+n]=i)}}}function i5(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}let jo=(Cr=class{static register(...t){Xn.add(...t),Km()}static unregister(...t){Xn.remove(...t),Km()}constructor(t,n){const r=this.config=new RT(n),s=Gm(t),o=Ym(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const i=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||ST(s)),this.platform.updateConfig(r);const a=this.platform.acquireContext(s,i.aspectRatio),l=a&&a.canvas,c=l&&l.height,d=l&&l.width;if(this.id=CN(),this.ctx=a,this.canvas=l,this.width=d,this.height=c,this._options=i,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new BT,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=UN(u=>this.update(u),i.resizeDelay||0),this._dataChanges=[],Fa[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}sr.listen(this,"complete",Wm),sr.listen(this,"progress",s5),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:s,_aspectRatio:o}=this;return ft(t)?n&&o?o:s?r/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Xn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():sm(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return K0(this.canvas,this.ctx),this}stop(){return sr.stop(this),this}resize(t,n){sr.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,s=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(s,t,n,o),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,sm(this,a,!0)&&(this.notifyPlugins("resize",{size:i}),bt(r.onResize,[this,i],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};at(n,(r,s)=>{r.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,s=Object.keys(r).reduce((i,a)=>(i[a]=!1,i),{});let o=[];n&&(o=o.concat(Object.keys(n).map(i=>{const a=n[i],l=Vd(i,a),c=l==="r",d=l==="x";return{options:a,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),at(o,i=>{const a=i.options,l=a.id,c=Vd(l,a),d=Je(a.type,i.dtype);(a.position===void 0||Bm(a.position,c)!==Bm(i.dposition))&&(a.position=i.dposition),s[l]=!0;let u=null;if(l in r&&r[l].type===d)u=r[l];else{const f=Xn.getScale(d);u=new f({id:l,type:d,ctx:this.ctx,chart:this}),r[u.id]=u}u.init(a,t)}),at(s,(i,a)=>{i||delete r[a]}),at(r,i=>{En.configure(this,i,i.options),En.addBox(this,i)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((s,o)=>s.index-o.index),r>n){for(let s=n;s<r;++s)this._destroyDatasetMeta(s);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(jm("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,s)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,s;for(this._removeUnreferencedMetasets(),r=0,s=n.length;r<s;r++){const o=n[r];let i=this.getDatasetMeta(r);const a=o.type||this.config.type;if(i.type&&i.type!==a&&(this._destroyDatasetMeta(r),i=this.getDatasetMeta(r)),i.type=a,i.indexAxis=o.indexAxis||zd(a,this.options),i.order=o.order||0,i.index=r,i.label=""+o.label,i.visible=this.isDatasetVisible(r),i.controller)i.controller.updateIndex(r),i.controller.linkScales();else{const l=Xn.getController(a),{datasetElementType:c,dataElementType:d}=_t.datasets[a];Object.assign(l,{dataElementType:Xn.getElement(d),datasetElementType:c&&Xn.getElement(c)}),i.controller=new l(this,r),t.push(i.controller)}}return this._updateMetasets(),t}_resetElements(){at(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let i=0;for(let c=0,d=this.data.datasets.length;c<d;c++){const{controller:u}=this.getDatasetMeta(c),f=!s&&o.indexOf(u)===-1;u.buildOrUpdateElements(f),i=Math.max(+u.getMaxOverflow(),i)}i=this._minPadding=r.layout.autoPadding?i:0,this._updateLayout(i),s||at(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(jm("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){at(this.scales,t=>{En.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!O0(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:s,count:o}of n){const i=r==="_removeElements"?-o:o;o5(t,s,i)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(t.filter(i=>i[0]===o).map((i,a)=>a+","+i.splice(1).join(","))),s=r(0);for(let o=1;o<n;o++)if(!O0(s,r(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;En.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],at(this.boxes,s=>{r&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,vr(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),s={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(r.controller._update(n),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(sr.has(this)?this.attached&&!sr.running(this)&&sr.start(this):(this.draw(),Wm({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let s,o;for(s=0,o=n.length;s<o;++s){const i=n[s];(!t||i.visible)&&r.push(i)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r={meta:t,index:t.index,cancelable:!0},s=EO(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(s&&kd(n,s),t.controller.draw(),s&&Cd(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Z0(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,s){const o=rT.modes[n];return typeof o=="function"?o(this,t,r,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let s=r.filter(o=>o&&o._dataset===n).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(s)),s}getContext(){return this.$context||(this.$context=Os(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const s=r?"show":"hide",o=this.getDatasetMeta(t),i=o.controller._resolveAnimations(void 0,s);Ao(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),i.update(o,{visible:r}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),sr.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),K0(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Fa[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(o,i)=>{n.addEventListener(this,o,i),t[o]=i},s=(o,i,a)=>{o.offsetX=i,o.offsetY=a,this._eventHandler(o)};at(this.options.events,o=>r(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let i;const a=()=>{s("attach",a),this.attached=!0,this.resize(),r("resize",o),r("detach",i)};i=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():i()}unbindEvents(){at(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},at(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const s=r?"set":"remove";let o,i,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){i=t[a];const c=i&&this.getDatasetMeta(i.datasetIndex).controller;c&&c[s+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:o,index:i})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[i],index:i}});!ba(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const s=this.options.hover,o=(l,c)=>l.filter(d=>!c.some(u=>d.datasetIndex===u.datasetIndex&&d.index===u.index)),i=o(n,t),a=r?t:o(t,n);i.length&&this.updateHoverStyle(i,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=i=>(i.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,s)===!1)return;const o=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,s),(o||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:s=[],options:o}=this,i=n,a=this._getActiveElements(t,s,r,i),l=ON(t),c=i5(t,this._lastEvent,r,l);r&&(this._lastEvent=null,bt(o.onHover,[t,a,this],this),l&&bt(o.onClick,[t,a,this],this));const d=!ba(a,s);return(d||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,d}_getActiveElements(t,n,r,s){if(t.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}},$e(Cr,"defaults",_t),$e(Cr,"instances",Fa),$e(Cr,"overrides",Ur),$e(Cr,"registry",Xn),$e(Cr,"version",n5),$e(Cr,"getChart",Ym),Cr);function Km(){return at(jo.instances,e=>e._plugins.invalidate())}function a5(e,t,n){const{startAngle:r,x:s,y:o,outerRadius:i,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:d}=l,u=Math.min(c/i,Kn(r-n));if(e.beginPath(),e.arc(s,o,i-c/2,r+u/2,n-u/2),a>0){const f=Math.min(c/a,Kn(r-n));e.arc(s,o,a+c/2,n-f/2,r+f/2,!0)}else{const f=Math.min(c/2,i*Kn(r-n));if(d==="round")e.arc(s,o,f,n-ht/2,r+ht/2,!0);else if(d==="bevel"){const g=2*f*f,m=-g*Math.cos(n+ht/2)+s,p=-g*Math.sin(n+ht/2)+o,y=g*Math.cos(r+ht/2)+s,b=g*Math.sin(r+ht/2)+o;e.lineTo(m,p),e.lineTo(y,b)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function l5(e,t,n){const{startAngle:r,pixelMargin:s,x:o,y:i,outerRadius:a,innerRadius:l}=t;let c=s/a;e.beginPath(),e.arc(o,i,a,r-c,n+c),l>s?(c=s/l,e.arc(o,i,l,n+c,r-c,!0)):e.arc(o,i,s,n+It,r-It),e.closePath(),e.clip()}function c5(e){return Sd(e,["outerStart","outerEnd","innerStart","innerEnd"])}function d5(e,t,n,r){const s=c5(e.options.borderRadius),o=(n-t)/2,i=Math.min(o,r*t/2),a=l=>{const c=(n-Math.min(o,l))*r/2;return cn(l,0,Math.min(o,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:cn(s.innerStart,0,i),innerEnd:cn(s.innerEnd,0,i)}}function Ls(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function za(e,t,n,r,s,o){const{x:i,y:a,startAngle:l,pixelMargin:c,innerRadius:d}=t,u=Math.max(t.outerRadius+r+n-c,0),f=d>0?d+r+n+c:0;let g=0;const m=s-l;if(r){const A=d>0?d-r:0,D=u>0?u-r:0,O=(A+D)/2,z=O!==0?m*O/(O+r):m;g=(m-z)/2}const p=Math.max(.001,m*u-n/ht)/u,y=(m-p)/2,b=l+y+g,_=s-y-g,{outerStart:x,outerEnd:M,innerStart:S,innerEnd:k}=d5(t,f,u,_-b),N=u-x,C=u-M,w=b+x/N,E=_-M/C,T=f+S,P=f+k,L=b+S/T,F=_-k/P;if(e.beginPath(),o){const A=(w+E)/2;if(e.arc(i,a,u,w,A),e.arc(i,a,u,A,E),M>0){const U=Ls(C,E,i,a);e.arc(U.x,U.y,M,E,_+It)}const D=Ls(P,_,i,a);if(e.lineTo(D.x,D.y),k>0){const U=Ls(P,F,i,a);e.arc(U.x,U.y,k,_+It,F+Math.PI)}const O=(_-k/f+(b+S/f))/2;if(e.arc(i,a,f,_-k/f,O,!0),e.arc(i,a,f,O,b+S/f,!0),S>0){const U=Ls(T,L,i,a);e.arc(U.x,U.y,S,L+Math.PI,b-It)}const z=Ls(N,b,i,a);if(e.lineTo(z.x,z.y),x>0){const U=Ls(N,w,i,a);e.arc(U.x,U.y,x,b-It,w)}}else{e.moveTo(i,a);const A=Math.cos(w)*u+i,D=Math.sin(w)*u+a;e.lineTo(A,D);const O=Math.cos(E)*u+i,z=Math.sin(E)*u+a;e.lineTo(O,z)}e.closePath()}function u5(e,t,n,r,s){const{fullCircles:o,startAngle:i,circumference:a}=t;let l=t.endAngle;if(o){za(e,t,n,r,l,s);for(let c=0;c<o;++c)e.fill();isNaN(a)||(l=i+(a%Ot||Ot))}return za(e,t,n,r,l,s),e.fill(),l}function f5(e,t,n,r,s){const{fullCircles:o,startAngle:i,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:d,borderDash:u,borderDashOffset:f,borderRadius:g}=l,m=l.borderAlign==="inner";if(!c)return;e.setLineDash(u||[]),e.lineDashOffset=f,m?(e.lineWidth=c*2,e.lineJoin=d||"round"):(e.lineWidth=c,e.lineJoin=d||"bevel");let p=t.endAngle;if(o){za(e,t,n,r,p,s);for(let y=0;y<o;++y)e.stroke();isNaN(a)||(p=i+(a%Ot||Ot))}m&&l5(e,t,p),l.selfJoin&&p-i>=ht&&g===0&&d!=="miter"&&a5(e,t,p),o||(za(e,t,n,r,p,s),e.stroke())}class Wo extends Yr{constructor(n){super();$e(this,"circumference");$e(this,"endAngle");$e(this,"fullCircles");$e(this,"innerRadius");$e(this,"outerRadius");$e(this,"pixelMargin");$e(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,r,s){const o=this.getProps(["x","y"],s),{angle:i,distance:a}=L0(o,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:d,outerRadius:u,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),g=(this.options.spacing+this.options.borderWidth)/2,m=Je(f,c-l),p=ka(i,l,c)&&l!==c,y=m>=Ot||p,b=Hr(a,d+g,u+g);return y&&b}getCenterPoint(n){const{x:r,y:s,startAngle:o,endAngle:i,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:d}=this.options,u=(o+i)/2,f=(a+l+d+c)/2;return{x:r+Math.cos(u)*f,y:s+Math.sin(u)*f}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:s}=this,o=(r.offset||0)/4,i=(r.spacing||0)/2,a=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=s>Ot?Math.floor(s/Ot):0,s===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(ht,s||0)),d=o*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,u5(n,this,d,i,a),f5(n,this,d,i,a),n.restore()}}$e(Wo,"id","arc"),$e(Wo,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),$e(Wo,"defaultRoutes",{backgroundColor:"backgroundColor"}),$e(Wo,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function Xm(e,t){const{x:n,y:r,base:s,width:o,height:i}=e.getProps(["x","y","base","width","height"],t);let a,l,c,d,u;return e.horizontal?(u=i/2,a=Math.min(n,s),l=Math.max(n,s),c=r-u,d=r+u):(u=o/2,a=n-u,l=n+u,c=Math.min(r,s),d=Math.max(r,s)),{left:a,top:c,right:l,bottom:d}}function kr(e,t,n,r){return e?0:cn(t,n,r)}function h5(e,t,n){const r=e.options.borderWidth,s=e.borderSkipped,o=Q0(r);return{t:kr(s.top,o.top,0,n),r:kr(s.right,o.right,0,t),b:kr(s.bottom,o.bottom,0,n),l:kr(s.left,o.left,0,t)}}function g5(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),s=e.options.borderRadius,o=Ns(s),i=Math.min(t,n),a=e.borderSkipped,l=r||Qe(s);return{topLeft:kr(!l||a.top||a.left,o.topLeft,0,i),topRight:kr(!l||a.top||a.right,o.topRight,0,i),bottomLeft:kr(!l||a.bottom||a.left,o.bottomLeft,0,i),bottomRight:kr(!l||a.bottom||a.right,o.bottomRight,0,i)}}function p5(e){const t=Xm(e),n=t.right-t.left,r=t.bottom-t.top,s=h5(e,n/2,r/2),o=g5(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:n-s.l-s.r,h:r-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function Hd(e,t,n,r){const s=t===null,o=n===null,a=e&&!(s&&o)&&Xm(e,r);return a&&(s||Hr(t,a.left,a.right))&&(o||Hr(n,a.top,a.bottom))}function m5(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function b5(e,t){e.rect(t.x,t.y,t.w,t.h)}function Ud(e,t,n={}){const r=e.x!==n.x?-t:0,s=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-r,i=(e.y+e.h!==n.y+n.h?t:0)-s;return{x:e.x+r,y:e.y+s,w:e.w+o,h:e.h+i,radius:e.radius}}class Va extends Yr{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:s}}=this,{inner:o,outer:i}=p5(this),a=m5(i.radius)?Sa:b5;t.save(),(i.w!==o.w||i.h!==o.h)&&(t.beginPath(),a(t,Ud(i,n,o)),t.clip(),a(t,Ud(o,-n,i)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,Ud(o,n)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,n,r){return Hd(this,t,n,r)}inXRange(t,n){return Hd(this,t,null,n)}inYRange(t,n){return Hd(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(n+s)/2:n,y:o?r:(r+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}$e(Va,"id","bar"),$e(Va,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),$e(Va,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});const qm=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},y5=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Zm extends Yr{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=bt(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,s)=>t.sort(r,s,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,s=Rt(r.font),o=s.size,i=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=qm(r,o);let c,d;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,d=this._fitRows(i,o,a,l)+10):(d=this.maxHeight,c=this._fitCols(i,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,s){const{ctx:o,maxWidth:i,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],d=s+a;let u=t;o.textAlign="left",o.textBaseline="middle";let f=-1,g=-d;return this.legendItems.forEach((m,p)=>{const y=r+n/2+o.measureText(m.text).width;(p===0||c[c.length-1]+y+2*a>i)&&(u+=d,c[c.length-(p>0?0:1)]=0,g+=d,f++),l[p]={left:0,top:g,row:f,width:y,height:s},c[c.length-1]+=y+a}),u}_fitCols(t,n,r,s){const{ctx:o,maxHeight:i,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],d=i-t;let u=a,f=0,g=0,m=0,p=0;return this.legendItems.forEach((y,b)=>{const{itemWidth:_,itemHeight:x}=v5(r,n,o,y,s);b>0&&g+x+2*a>d&&(u+=f+a,c.push({width:f,height:g}),m+=f+a,p++,f=g=0),l[b]={left:m,top:g,col:p,width:_,height:x},f=Math.max(f,_),g+=x+a}),u+=f,c.push({width:f,height:g}),u}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:s},rtl:o}}=this,i=As(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=Jt(r,this.left+s,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Jt(r,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=i.leftForLtr(i.x(l),c.width),l+=c.width+s}else{let a=0,l=Jt(r,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Jt(r,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=i.leftForLtr(i.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;kd(t,this),this._draw(),Cd(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:s}=this,{align:o,labels:i}=t,a=_t.color,l=As(t.rtl,this.left,this.width),c=Rt(i.font),{padding:d}=i,u=c.size,f=u/2;let g;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:m,boxHeight:p,itemHeight:y}=qm(i,u),b=function(k,N,C){if(isNaN(m)||m<=0||isNaN(p)||p<0)return;s.save();const w=Je(C.lineWidth,1);if(s.fillStyle=Je(C.fillStyle,a),s.lineCap=Je(C.lineCap,"butt"),s.lineDashOffset=Je(C.lineDashOffset,0),s.lineJoin=Je(C.lineJoin,"miter"),s.lineWidth=w,s.strokeStyle=Je(C.strokeStyle,a),s.setLineDash(Je(C.lineDash,[])),i.usePointStyle){const E={radius:p*Math.SQRT2/2,pointStyle:C.pointStyle,rotation:C.rotation,borderWidth:w},T=l.xPlus(k,m/2),P=N+f;q0(s,E,T,P,i.pointStyleWidth&&m)}else{const E=N+Math.max((u-p)/2,0),T=l.leftForLtr(k,m),P=Ns(C.borderRadius);s.beginPath(),Object.values(P).some(L=>L!==0)?Sa(s,{x:T,y:E,w:m,h:p,radius:P}):s.rect(T,E,m,p),s.fill(),w!==0&&s.stroke()}s.restore()},_=function(k,N,C){Lo(s,C.text,k,N+y/2,c,{strikethrough:C.hidden,textAlign:l.textAlign(C.textAlign)})},x=this.isHorizontal(),M=this._computeTitleHeight();x?g={x:Jt(o,this.left+d,this.right-r[0]),y:this.top+d+M,line:0}:g={x:this.left+d,y:Jt(o,this.top+M+d,this.bottom-n[0].height),line:0},im(this.ctx,t.textDirection);const S=y+d;this.legendItems.forEach((k,N)=>{s.strokeStyle=k.fontColor,s.fillStyle=k.fontColor;const C=s.measureText(k.text).width,w=l.textAlign(k.textAlign||(k.textAlign=i.textAlign)),E=m+f+C;let T=g.x,P=g.y;l.setWidth(this.width),x?N>0&&T+E+d>this.right&&(P=g.y+=S,g.line++,T=g.x=Jt(o,this.left+d,this.right-r[g.line])):N>0&&P+S>this.bottom&&(T=g.x=T+n[g.line].width+d,g.line++,P=g.y=Jt(o,this.top+M+d,this.bottom-n[g.line].height));const L=l.x(T);if(b(L,P,k),T=BN(w,T+m+f,x?T+E:this.right,t.rtl),_(l.x(T),P,k),x)g.x+=E+d;else if(typeof k.text!="string"){const F=c.lineHeight;g.y+=Qm(k,F)+d}else g.y+=S}),am(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=Rt(n.font),s=_n(n.padding);if(!n.display)return;const o=As(t.rtl,this.left,this.width),i=this.ctx,a=n.position,l=r.size/2,c=s.top+l;let d,u=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),d=this.top+c,u=Jt(t.align,u,this.right-f);else{const m=this.columnSizes.reduce((p,y)=>Math.max(p,y.height),0);d=c+Jt(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const g=Jt(a,u,u+f);i.textAlign=o.textAlign(bd(a)),i.textBaseline="middle",i.strokeStyle=n.color,i.fillStyle=n.color,i.font=r.string,Lo(i,n.text,g,d,r)}_computeTitleHeight(){const t=this.options.title,n=Rt(t.font),r=_n(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,s,o;if(Hr(t,this.left,this.right)&&Hr(n,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;r<o.length;++r)if(s=o[r],Hr(t,s.left,s.left+s.width)&&Hr(n,s.top,s.top+s.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!k5(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=y5(s,r);s&&!o&&bt(n.onLeave,[t,s,this],this),this._hoveredItem=r,r&&!o&&bt(n.onHover,[t,r,this],this)}else r&&bt(n.onClick,[t,r,this],this)}}function v5(e,t,n,r,s){const o=x5(r,e,t,n),i=w5(s,r,t.lineHeight);return{itemWidth:o,itemHeight:i}}function x5(e,t,n,r){let s=e.text;return s&&typeof s!="string"&&(s=s.reduce((o,i)=>o.length>i.length?o:i)),t+n.size/2+r.measureText(s).width}function w5(e,t,n){let r=e;return typeof t.text!="string"&&(r=Qm(t,n)),r}function Qm(e,t){const n=e.text?e.text.length:0;return t*n}function k5(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var Jm={id:"legend",_element:Zm,start(e,t,n){const r=e.legend=new Zm({ctx:e.ctx,options:n,chart:e});En.configure(e,r,n),En.addBox(e,r)},stop(e){En.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;En.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,s=n.chart;s.isDatasetVisible(r)?(s.hide(r),t.hidden=!0):(s.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:s,color:o,useBorderRadius:i,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),d=_n(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:i&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Rm extends Yr{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const s=Dt(r.text)?r.text.length:1;this._padding=_n(r.padding);const o=s*Rt(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:s,right:o,options:i}=this,a=i.align;let l=0,c,d,u;return this.isHorizontal()?(d=Jt(a,r,o),u=n+t,c=o-r):(i.position==="left"?(d=r+t,u=Jt(a,s,n),l=ht*-.5):(d=o-t,u=Jt(a,n,s),l=ht*.5),c=s-n),{titleX:d,titleY:u,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=Rt(n.font),o=r.lineHeight/2+this._padding.top,{titleX:i,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);Lo(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:bd(n.align),textBaseline:"middle",translation:[i,a]})}}function C5(e,t){const n=new Rm({ctx:e.ctx,options:t,chart:e});En.configure(e,n,t),En.addBox(e,n),e.titleBlock=n}var S5={id:"title",_element:Rm,start(e,t,n){C5(e,n)},stop(e){const t=e.titleBlock;En.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;En.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Go={average(e){if(!e.length)return!1;let t,n,r=new Set,s=0,o=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();r.add(l.x),s+=l.y,++o}}return o===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,y:s/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,s=Number.POSITIVE_INFINITY,o,i,a;for(o=0,i=e.length;o<i;++o){const l=e[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),d=$N(t,c);d<s&&(s=d,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function qn(e,t){return t&&(Dt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function or(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
||
`)>-1?e.split(`
|
||
`):e}function _5(e,t){const{element:n,datasetIndex:r,index:s}=t,o=e.getDatasetMeta(r).controller,{label:i,value:a}=o.getLabelAndValue(s);return{chart:e,label:i,parsed:o.getParsed(s),raw:e.data.datasets[r].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:r,element:n}}function eb(e,t){const n=e.chart.ctx,{body:r,footer:s,title:o}=e,{boxWidth:i,boxHeight:a}=t,l=Rt(t.bodyFont),c=Rt(t.titleFont),d=Rt(t.footerFont),u=o.length,f=s.length,g=r.length,m=_n(t.padding);let p=m.height,y=0,b=r.reduce((M,S)=>M+S.before.length+S.lines.length+S.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,u&&(p+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),b){const M=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=g*M+(b-g)*l.lineHeight+(b-1)*t.bodySpacing}f&&(p+=t.footerMarginTop+f*d.lineHeight+(f-1)*t.footerSpacing);let _=0;const x=function(M){y=Math.max(y,n.measureText(M).width+_)};return n.save(),n.font=c.string,at(e.title,x),n.font=l.string,at(e.beforeBody.concat(e.afterBody),x),_=t.displayColors?i+2+t.boxPadding:0,at(r,M=>{at(M.before,x),at(M.lines,x),at(M.after,x)}),_=0,n.font=d.string,at(e.footer,x),n.restore(),y+=m.width,{width:y,height:p}}function E5(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function M5(e,t,n,r){const{x:s,width:o}=r,i=n.caretSize+n.caretPadding;if(e==="left"&&s+o+i>t.width||e==="right"&&s-o-i<0)return!0}function N5(e,t,n,r){const{x:s,width:o}=n,{width:i,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=i-o/2&&(c="right"),M5(c,e,t,n)&&(c="center"),c}function tb(e,t,n){const r=n.yAlign||t.yAlign||E5(e,n);return{xAlign:n.xAlign||t.xAlign||N5(e,t,n,r),yAlign:r}}function O5(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function T5(e,t,n){let{y:r,height:s}=e;return t==="top"?r+=n:t==="bottom"?r-=s+n:r-=s/2,r}function nb(e,t,n,r){const{caretSize:s,caretPadding:o,cornerRadius:i}=e,{xAlign:a,yAlign:l}=n,c=s+o,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:g}=Ns(i);let m=O5(t,a);const p=T5(t,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(d,f)+s:a==="right"&&(m+=Math.max(u,g)+s),{x:cn(m,0,r.width-t.width),y:cn(p,0,r.height-t.height)}}function Ha(e,t,n){const r=_n(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function rb(e){return qn([],or(e))}function A5(e,t,n){return Os(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function sb(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const ob={beforeTitle:nr,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:nr,beforeBody:nr,beforeLabel:nr,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return ft(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:nr,afterBody:nr,beforeFooter:nr,footer:nr,afterFooter:nr};function dn(e,t,n,r){const s=e[t].call(n,r);return typeof s>"u"?ob[t].call(n,r):s}class Bd extends Yr{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),s=r.enabled&&n.options.animation&&r.animations,o=new cm(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=A5(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,s=dn(r,"beforeTitle",this,t),o=dn(r,"title",this,t),i=dn(r,"afterTitle",this,t);let a=[];return a=qn(a,or(s)),a=qn(a,or(o)),a=qn(a,or(i)),a}getBeforeBody(t,n){return rb(dn(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,s=[];return at(t,o=>{const i={before:[],lines:[],after:[]},a=sb(r,o);qn(i.before,or(dn(a,"beforeLabel",this,o))),qn(i.lines,dn(a,"label",this,o)),qn(i.after,or(dn(a,"afterLabel",this,o))),s.push(i)}),s}getAfterBody(t,n){return rb(dn(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,s=dn(r,"beforeFooter",this,t),o=dn(r,"footer",this,t),i=dn(r,"afterFooter",this,t);let a=[];return a=qn(a,or(s)),a=qn(a,or(o)),a=qn(a,or(i)),a}_createItems(t){const n=this._active,r=this.chart.data,s=[],o=[],i=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(_5(this.chart,n[l]));return t.filter&&(a=a.filter((d,u,f)=>t.filter(d,u,f,r))),t.itemSort&&(a=a.sort((d,u)=>t.itemSort(d,u,r))),at(a,d=>{const u=sb(t.callbacks,d);s.push(dn(u,"labelColor",this,d)),o.push(dn(u,"labelPointStyle",this,d)),i.push(dn(u,"labelTextColor",this,d))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=i,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),s=this._active;let o,i=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const a=Go[r.position].call(this,s,this._eventPosition);i=this._createItems(r),this.title=this.getTitle(i,r),this.beforeBody=this.getBeforeBody(i,r),this.body=this.getBody(i,r),this.afterBody=this.getAfterBody(i,r),this.footer=this.getFooter(i,r);const l=this._size=eb(this,r),c=Object.assign({},a,l),d=tb(this.chart,r,c),u=nb(r,c,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,o={opacity:1,x:u.x,y:u.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=i,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,s){const o=this.getCaretPosition(t,r,s);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,r){const{xAlign:s,yAlign:o}=this,{caretSize:i,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:d,bottomRight:u}=Ns(a),{x:f,y:g}=t,{width:m,height:p}=n;let y,b,_,x,M,S;return o==="center"?(M=g+p/2,s==="left"?(y=f,b=y-i,x=M+i,S=M-i):(y=f+m,b=y+i,x=M-i,S=M+i),_=y):(s==="left"?b=f+Math.max(l,d)+i:s==="right"?b=f+m-Math.max(c,u)-i:b=this.caretX,o==="top"?(x=g,M=x-i,y=b-i,_=b+i):(x=g+p,M=x+i,y=b+i,_=b-i),S=x),{x1:y,x2:b,x3:_,y1:x,y2:M,y3:S}}drawTitle(t,n,r){const s=this.title,o=s.length;let i,a,l;if(o){const c=As(r.rtl,this.x,this.width);for(t.x=Ha(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",i=Rt(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=i.string,l=0;l<o;++l)n.fillText(s[l],c.x(t.x),t.y+i.lineHeight/2),t.y+=i.lineHeight+a,l+1===o&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,s,o){const i=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=o,d=Rt(o.bodyFont),u=Ha(this,"left",o),f=s.x(u),g=l<d.lineHeight?(d.lineHeight-l)/2:0,m=n.y+g;if(o.usePointStyle){const p={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},y=s.leftForLtr(f,c)+c/2,b=m+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,X0(t,p,y,b),t.strokeStyle=i.borderColor,t.fillStyle=i.backgroundColor,X0(t,p,y,b)}else{t.lineWidth=Qe(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,t.strokeStyle=i.borderColor,t.setLineDash(i.borderDash||[]),t.lineDashOffset=i.borderDashOffset||0;const p=s.leftForLtr(f,c),y=s.leftForLtr(s.xPlus(f,1),c-2),b=Ns(i.borderRadius);Object.values(b).some(_=>_!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Sa(t,{x:p,y:m,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=i.backgroundColor,t.beginPath(),Sa(t,{x:y,y:m+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(p,m,c,l),t.strokeRect(p,m,c,l),t.fillStyle=i.backgroundColor,t.fillRect(y,m+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:s}=this,{bodySpacing:o,bodyAlign:i,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:d}=r,u=Rt(r.bodyFont);let f=u.lineHeight,g=0;const m=As(r.rtl,this.x,this.width),p=function(C){n.fillText(C,m.x(t.x+g),t.y+f/2),t.y+=f+o},y=m.textAlign(i);let b,_,x,M,S,k,N;for(n.textAlign=i,n.textBaseline="middle",n.font=u.string,t.x=Ha(this,y,r),n.fillStyle=r.bodyColor,at(this.beforeBody,p),g=a&&y!=="right"?i==="center"?c/2+d:c+2+d:0,M=0,k=s.length;M<k;++M){for(b=s[M],_=this.labelTextColors[M],n.fillStyle=_,at(b.before,p),x=b.lines,a&&x.length&&(this._drawColorBox(n,t,M,m,r),f=Math.max(u.lineHeight,l)),S=0,N=x.length;S<N;++S)p(x[S]),f=u.lineHeight;at(b.after,p)}g=0,f=u.lineHeight,at(this.afterBody,p),t.y-=o}drawFooter(t,n,r){const s=this.footer,o=s.length;let i,a;if(o){const l=As(r.rtl,this.x,this.width);for(t.x=Ha(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",i=Rt(r.footerFont),n.fillStyle=r.footerColor,n.font=i.string,a=0;a<o;++a)n.fillText(s[a],l.x(t.x),t.y+i.lineHeight/2),t.y+=i.lineHeight+r.footerSpacing}}drawBackground(t,n,r,s){const{xAlign:o,yAlign:i}=this,{x:a,y:l}=t,{width:c,height:d}=r,{topLeft:u,topRight:f,bottomLeft:g,bottomRight:m}=Ns(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(a+u,l),i==="top"&&this.drawCaret(t,n,r,s),n.lineTo(a+c-f,l),n.quadraticCurveTo(a+c,l,a+c,l+f),i==="center"&&o==="right"&&this.drawCaret(t,n,r,s),n.lineTo(a+c,l+d-m),n.quadraticCurveTo(a+c,l+d,a+c-m,l+d),i==="bottom"&&this.drawCaret(t,n,r,s),n.lineTo(a+g,l+d),n.quadraticCurveTo(a,l+d,a,l+d-g),i==="center"&&o==="left"&&this.drawCaret(t,n,r,s),n.lineTo(a,l+u),n.quadraticCurveTo(a,l,a+u,l),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,s=r&&r.x,o=r&&r.y;if(s||o){const i=Go[t.position].call(this,this._active,this._eventPosition);if(!i)return;const a=this._size=eb(this,t),l=Object.assign({},i,this._size),c=tb(n,t,l),d=nb(t,l,c,n);(s._to!==d.x||o._to!==d.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const i=_n(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(o,t,s,n),im(t,n.textDirection),o.y+=i.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),am(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!ba(r,s),i=this._positionChanged(s,n);(o||i)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],i=this._getActiveElements(t,o,n,r),a=this._positionChanged(i,t),l=n||!ba(i,o)||a;return l&&(this._active=i,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const i=this.chart.getElementsAtEventForMode(t,o.mode,o,r);return o.reverse&&i.reverse(),i}_positionChanged(t,n){const{caretX:r,caretY:s,options:o}=this,i=Go[o.position].call(this,t,n);return i!==!1&&(r!==i.x||s!==i.y)}}$e(Bd,"positioners",Go);var ib={id:"tooltip",_element:Bd,positioners:Go,afterInit(e,t,n){n&&(e.tooltip=new Bd({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:ob},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const D5=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function I5(e,t,n,r){const s=e.indexOf(t);if(s===-1)return D5(e,t,n,r);const o=e.lastIndexOf(t);return s!==o?n:s}const L5=(e,t)=>e===null?null:cn(Math.round(e),0,t);function ab(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class jd extends Is{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:s,label:o}of n)r[s]===o&&r.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(ft(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:I5(r,t,Je(n,t),this._addedLabels),L5(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(s=this.getLabels().length-1)),this.min=r,this.max=s}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,s=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let i=t;i<=n;i++)s.push({value:i});return s}getLabelForValue(t){return ab.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}$e(jd,"id","category"),$e(jd,"defaults",{ticks:{callback:ab}});function P5(e,t){const n=[],{bounds:s,step:o,min:i,max:a,precision:l,count:c,maxTicks:d,maxDigits:u,includeBounds:f}=e,g=o||1,m=d-1,{min:p,max:y}=t,b=!ft(i),_=!ft(a),x=!ft(c),M=(y-p)/(u+1);let S=D0((y-p)/m/g)*g,k,N,C,w;if(S<1e-14&&!b&&!_)return[{value:p},{value:y}];w=Math.ceil(y/S)-Math.floor(p/S),w>m&&(S=D0(w*S/m/g)*g),ft(l)||(k=Math.pow(10,l),S=Math.ceil(S*k)/k),s==="ticks"?(N=Math.floor(p/S)*S,C=Math.ceil(y/S)*S):(N=p,C=y),b&&_&&o&&IN((a-i)/o,S/1e3)?(w=Math.round(Math.min((a-i)/S,d)),S=(a-i)/w,N=i,C=a):x?(N=b?i:N,C=_?a:C,w=c-1,S=(C-N)/w):(w=(C-N)/S,xa(w,Math.round(w),S/1e3)?w=Math.round(w):w=Math.ceil(w));const E=Math.max(I0(S),I0(N));k=Math.pow(10,ft(l)?E:l),N=Math.round(N*k)/k,C=Math.round(C*k)/k;let T=0;for(b&&(f&&N!==i?(n.push({value:i}),N<i&&T++,xa(Math.round((N+T*S)*k)/k,i,lb(i,M,e))&&T++):N<i&&T++);T<w;++T){const P=Math.round((N+T*S)*k)/k;if(_&&P>a)break;n.push({value:P})}return _&&f&&C!==a?n.length&&xa(n[n.length-1].value,a,lb(a,M,e))?n[n.length-1].value=a:n.push({value:a}):(!_||C===a)&&n.push({value:C}),n}function lb(e,t,{horizontal:n,minRotation:r}){const s=rr(r),o=(n?Math.sin(s):Math.cos(s))||.001,i=.75*t*(""+e).length;return Math.min(t/o,i)}class $5 extends Is{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return ft(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:s,max:o}=this;const i=l=>s=n?s:l,a=l=>o=r?o:l;if(t){const l=xr(s),c=xr(o);l<0&&c<0?a(0):l>0&&c>0&&i(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||i(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,s;return r?(s=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const s={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,i=P5(s,o);return t.bounds==="ticks"&&LN(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const s=(r-n)/Math.max(t.length-1,1)/2;n-=s,r+=s}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return vd(t,this.chart.options.locale,this.options.ticks.format)}}class Wd extends $5{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Sn(t)?t:0,this.max=Sn(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=rr(this.options.ticks.minRotation),s=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}$e(Wd,"id","linear"),$e(Wd,"defaults",{ticks:{callback:G0.formatters.numeric}});const Ua={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},un=Object.keys(Ua);function cb(e,t){return e-t}function db(e,t){if(ft(t))return null;const n=e._adapter,{parser:r,round:s,isoWeekday:o}=e._parseOpts;let i=t;return typeof r=="function"&&(i=r(i)),Sn(i)||(i=typeof r=="string"?n.parse(i,r):n.parse(i)),i===null?null:(s&&(i=s==="week"&&(wa(o)||o===!0)?n.startOf(i,"isoWeek",o):n.startOf(i,s)),+i)}function ub(e,t,n,r){const s=un.length;for(let o=un.indexOf(e);o<s-1;++o){const i=Ua[un[o]],a=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((n-t)/(a*i.size))<=r)return un[o]}return un[s-1]}function F5(e,t,n,r,s){for(let o=un.length-1;o>=un.indexOf(n);o--){const i=un[o];if(Ua[i].common&&e._adapter.diff(s,r,i)>=t-1)return i}return un[n?un.indexOf(n):0]}function z5(e){for(let t=un.indexOf(e)+1,n=un.length;t<n;++t)if(Ua[un[t]].common)return un[t]}function fb(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:s}=pd(n,t),o=n[r]>=t?n[r]:n[s];e[o]=!0}}function V5(e,t,n,r){const s=e._adapter,o=+s.startOf(t[0].value,r),i=t[t.length-1].value;let a,l;for(a=o;a<=i;a=+s.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function hb(e,t,n){const r=[],s={},o=t.length;let i,a;for(i=0;i<o;++i)a=t[i],s[a]=i,r.push({value:a,major:!1});return o===0||!n?r:V5(e,r,s,n)}class Ba extends Is{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),s=this._adapter=new JO._date(t.adapters.date);s.init(n),To(r.displayFormats,s.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:db(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:s,max:o,minDefined:i,maxDefined:a}=this.getUserBounds();function l(c){!i&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!i||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=Sn(s)&&!isNaN(s)?s:+n.startOf(Date.now(),r),o=Sn(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,s=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,i=this.max,a=VN(s,o,i);return this._unit=n.unit||(r.autoSkip?ub(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):F5(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:z5(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),hb(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const i=t.length<3?.5:.25;n=cn(n,0,i),r=cn(r,0,i),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,s=this.options,o=s.time,i=o.unit||ub(o.minUnit,n,r,this._getLabelCapacity(n)),a=Je(s.ticks.stepSize,1),l=i==="week"?o.isoWeekday:!1,c=wa(l)||l===!0,d={};let u=n,f,g;if(c&&(u=+t.startOf(u,"isoWeek",l)),u=+t.startOf(u,c?"day":i),t.diff(r,n,i)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+i);const m=s.ticks.source==="data"&&this.getDataTimestamps();for(f=u,g=0;f<r;f=+t.add(f,a,i),g++)fb(d,f,m);return(f===r||s.bounds==="ticks"||g===1)&&fb(d,f,m),Object.keys(d).sort(cb).map(p=>+p)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const s=this.options.time.displayFormats,o=this._unit,i=n||s[o];return this._adapter.format(t,i)}_tickFormatFunction(t,n,r,s){const o=this.options,i=o.ticks.callback;if(i)return bt(i,[t,n,r],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,d=l&&a[l],u=c&&a[c],f=r[n],g=c&&u&&f&&f.major;return this._adapter.format(t,s||(g?u:d))}generateTickLabels(t){let n,r,s;for(n=0,r=t.length;n<r;++n)s=t[n],s.label=this._tickFormatFunction(s.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,s=rr(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(s),i=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:r*o+a*i,h:r*i+a*o}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,s=r[n.unit]||r.millisecond,o=this._tickFormatFunction(t,0,hb(this,[t],this._majorUnit),s),i=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/i.w:this.height/i.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,r=s.length;n<r;++n)t=t.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const s=this.getLabels();for(n=0,r=s.length;n<r;++n)t.push(db(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return F0(t.sort(cb))}}$e(Ba,"id","time"),$e(Ba,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function ja(e,t,n){let r=0,s=e.length-1,o,i,a,l;n?(t>=e[r].pos&&t<=e[s].pos&&({lo:r,hi:s}=md(e,"pos",t)),{pos:o,time:a}=e[r],{pos:i,time:l}=e[s]):(t>=e[r].time&&t<=e[s].time&&({lo:r,hi:s}=md(e,"time",t)),{time:o,pos:a}=e[r],{time:i,pos:l}=e[s]);const c=i-o;return c?a+(l-a)*(t-o)/c:a}class gb extends Ba{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=ja(n,this.min),this._tableRange=ja(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,s=[],o=[];let i,a,l,c,d;for(i=0,a=t.length;i<a;++i)c=t[i],c>=n&&c<=r&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(i=0,a=s.length;i<a;++i)d=s[i+1],l=s[i-1],c=s[i],Math.round((d+l)/2)!==c&&o.push({time:c,pos:i/(a-1)});return o}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(ja(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return ja(this._table,r*this._tableRange+this._minPos,!0)}}$e(gb,"id","timeseries"),$e(gb,"defaults",Ba.defaults);const pb="label";function mb(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function H5(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function bb(e,t){e.labels=t}function yb(e,t,n=pb){const r=[];e.datasets=t.map(s=>{const o=e.datasets.find(i=>i[n]===s[n]);return!o||!s.data||r.includes(o)?{...s}:(r.push(o),Object.assign(o,s),o)})}function U5(e,t=pb){const n={labels:[],datasets:[]};return bb(n,e.labels),yb(n,e.datasets,t),n}function B5(e,t){const{height:n=150,width:r=300,redraw:s=!1,datasetIdKey:o,type:i,data:a,options:l,plugins:c=[],fallbackContent:d,updateMode:u,...f}=e,g=v.useRef(null),m=v.useRef(null),p=()=>{g.current&&(m.current=new jo(g.current,{type:i,data:U5(a,o),options:l&&{...l},plugins:c}),mb(t,m.current))},y=()=>{mb(t,null),m.current&&(m.current.destroy(),m.current=null)};return v.useEffect(()=>{!s&&m.current&&l&&H5(m.current,l)},[s,l]),v.useEffect(()=>{!s&&m.current&&bb(m.current.config.data,a.labels)},[s,a.labels]),v.useEffect(()=>{!s&&m.current&&a.datasets&&yb(m.current.config.data,a.datasets,o)},[s,a.datasets]),v.useEffect(()=>{m.current&&(s?(y(),setTimeout(p)):m.current.update(u))},[s,l,a.labels,a.datasets,u]),v.useEffect(()=>{m.current&&(y(),setTimeout(p))},[i]),v.useEffect(()=>(p(),()=>y()),[]),h.jsx("canvas",{ref:g,role:"img",height:n,width:r,...f,children:d})}const j5=v.forwardRef(B5);function vb(e,t){return jo.register(t),v.forwardRef((n,r)=>h.jsx(j5,{...n,ref:r,type:e}))}const W5=vb("bar",Oa),G5=vb("doughnut",$o);jo.register(jd,Wd,Va,S5,ib,Jm);const Y5=({labels:e,datasets:t,height:n=200,showLegend:r=!1,showGrid:s=!1,showYGrid:o=!1,showYAxis:i=!1,className:a="",id:l,editorAttrs:c})=>{const d=v.useMemo(()=>({labels:e??[],datasets:(t??[]).map((m,p)=>({label:m.label,data:m.data,backgroundColor:m.backgroundColor||(p===0?"#7C3AED":"#DDD6FE"),borderRadius:m.borderRadius??4,barThickness:16,maxBarThickness:20,yAxisID:m.yAxisID??"y"}))}),[e,t]),u=v.useMemo(()=>(t??[]).some(m=>m.yAxisID==="y1"),[t]),f=v.useMemo(()=>({responsive:!0,maintainAspectRatio:!1,animation:{duration:750,easing:"easeOutQuart"},animations:{x:{duration:0},y:{from:m=>{if(m.type==="data")return m.chart.scales.y.getPixelForValue(0)}}},transitions:{active:{animation:{duration:200}},resize:{animation:{duration:0}}},plugins:{legend:{display:r,position:"top"},tooltip:{backgroundColor:"#1e293b",titleColor:"#fff",bodyColor:"#fff",padding:12,cornerRadius:8}},scales:{x:{grid:{display:s},border:{display:!1},ticks:{color:"#94a3b8",font:{size:11}}},y:{type:"linear",position:"left",grid:{display:o,color:"#e2e8f0"},border:{display:!1},ticks:{display:i,color:"#94a3b8",font:{size:11},padding:8},beginAtZero:!0,grace:"5%"},...u?{y1:{type:"linear",position:"right",grid:{display:!1},border:{display:!1},ticks:{display:i,color:"#94a3b8",font:{size:11},padding:8},beginAtZero:!0,grace:"5%"}}:{}}}),[r,s,o,i,u]),g=typeof n=="number"?n:/^\d+$/.test(String(n))?`${n}px`:n;return h.jsx("div",{className:`bar-chart-container ${a}`,style:{height:g},id:l,...c,children:h.jsx(W5,{data:d,options:f})})},K5=v.memo(Y5,(e,t)=>JSON.stringify(e.labels)===JSON.stringify(t.labels)&&JSON.stringify(e.datasets)===JSON.stringify(t.datasets)&&e.height===t.height&&e.showLegend===t.showLegend&&e.showGrid===t.showGrid&&e.showYGrid===t.showYGrid&&e.showYAxis===t.showYAxis&&e.className===t.className&&e.id===t.id&&e.editorAttrs===t.editorAttrs);jo.register(Wo,ib,Jm);const X5=({data:e,centerLabel:t,centerValue:n,size:r=200,cutout:s="70%",showLegend:o=!1,className:i="",id:a,editorAttrs:l})=>{const c=v.useMemo(()=>({labels:(e??[]).map(f=>f.name),datasets:[{data:(e??[]).map(f=>f.value),backgroundColor:(e??[]).map(f=>f.color),borderWidth:0,hoverOffset:4}]}),[e]),d=v.useMemo(()=>({responsive:!0,maintainAspectRatio:!1,cutout:s,plugins:{legend:{display:o},tooltip:{backgroundColor:"#1e293b",titleColor:"#fff",bodyColor:"#fff",padding:12,cornerRadius:8,callbacks:{label:f=>` $${f.parsed.toLocaleString()}`}}}}),[s,o]),u=typeof r=="number"?r:/^\d+$/.test(String(r))?`${r}px`:r;return h.jsx("div",{className:`donut-chart-wrapper ${i}`,id:a,...l,children:h.jsxs("div",{className:"relative",style:{width:u,height:u},children:[h.jsx(G5,{data:c,options:d}),(t||n)&&h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[t&&h.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400",children:t}),n&&h.jsx("span",{className:"text-lg font-bold text-slate-900 dark:text-white",children:n})]})]})})},q5=({id:e,className:t,style:n,children:r,editorAttrs:s})=>h.jsx("div",{id:e,className:t,style:n,...s,children:r}),Z5=({children:e,cols:t=1,responsive:n,gap:r,rowGap:s,colGap:o,autoRows:i,autoCols:a,flow:l="row",className:c="",style:d,onClick:u,id:f,editorAttrs:g})=>{const m=["grid"];if(t&&m.push(`grid-cols-${t}`),n&&(n.sm&&m.push(`sm:grid-cols-${n.sm}`),n.md&&m.push(`md:grid-cols-${n.md}`),n.lg&&m.push(`lg:grid-cols-${n.lg}`),n.xl&&m.push(`xl:grid-cols-${n.xl}`),n["2xl"]&&m.push(`2xl:grid-cols-${n["2xl"]}`)),r!==void 0&&r>0&&m.push(`gap-${r}`),s!==void 0&&s>0&&m.push(`gap-y-${s}`),o!==void 0&&o>0&&m.push(`gap-x-${o}`),i){const y={auto:"auto-rows-auto",min:"auto-rows-min",max:"auto-rows-max",fr:"auto-rows-fr"};m.push(y[i])}if(a){const y={auto:"auto-cols-auto",min:"auto-cols-min",max:"auto-cols-max",fr:"auto-cols-fr"};m.push(y[a])}const p={row:"grid-flow-row",col:"grid-flow-col",dense:"grid-flow-dense","row-dense":"grid-flow-row-dense","col-dense":"grid-flow-col-dense"};return m.push(p[l]),c&&m.push(c),h.jsx(I,{className:m.join(" "),style:d,onClick:u,id:f,...g,children:e})},Q5=({children:e,direction:t="row",justify:n="start",align:r="stretch",wrap:s="nowrap",gap:o=0,grow:i=!1,shrink:a=!0,className:l="",style:c,onClick:d,id:u,editorAttrs:f})=>{const g=["flex"],m={row:"flex-row","row-reverse":"flex-row-reverse",col:"flex-col","col-reverse":"flex-col-reverse"};g.push(m[t]);const p={wrap:"flex-wrap",nowrap:"flex-nowrap","wrap-reverse":"flex-wrap-reverse"};g.push(p[s]);const y={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly"};g.push(y[n]);const b={start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"};return g.push(b[r]),o>0&&g.push(`gap-${o}`),i===!0?g.push("flex-grow"):typeof i=="number"&&i>0&&g.push(`flex-grow-${i}`),a===!1?g.push("shrink-0"):a===!0?g.push("flex-shrink"):typeof a=="number"&&a>0&&g.push(`flex-shrink-${a}`),l&&g.push(l),h.jsx(I,{className:g.join(" "),style:c,onClick:d,id:u,...f,children:e})},J5=({title:e,subtitle:t,children:n,padding:r="none",background:s="none",maxWidth:o,centered:i=!1,border:a=!1,shadow:l="none",rounded:c=!1,className:d="",style:u,onClick:f,id:g,editorAttrs:m})=>{const p=[],y={none:"",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"};y[r]&&p.push(y[r]);const b={none:"",white:"bg-white dark:bg-gray-700",gray:"bg-gray-50 dark:bg-gray-800",primary:"bg-blue-50 dark:bg-blue-900/20",secondary:"bg-gray-50 dark:bg-gray-800"};if(s!=="none"&&p.push(b[s]),o){const x={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl","4xl":"max-w-4xl","6xl":"max-w-6xl","7xl":"max-w-7xl",full:"max-w-full"};p.push(x[o])}i&&p.push("mx-auto"),a&&p.push("border","border-gray-200","dark:border-gray-700");const _={none:"",sm:"shadow-sm",md:"shadow-md",lg:"shadow-lg",xl:"shadow-xl"};return l!=="none"&&p.push(_[l]),c&&p.push("rounded-lg"),d&&p.push(d),h.jsxs(iu,{className:p.join(" "),style:u,onClick:f,id:g,...m,children:[(e||t)&&h.jsxs("div",{className:"mb-4",children:[e&&h.jsx("h2",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:e}),t&&h.jsx("p",{className:"mt-1 text-sm text-gray-600 dark:text-gray-400",children:t})]}),n]})},R5=({leftWidth:e="250px",rightWidth:t="300px",leftSlot:n,centerSlot:r,rightSlot:s,className:o="",style:i,id:a,editorAttrs:l})=>{const c=`flex flex-row w-full h-full ${o}`.trim(),d={width:e,flexShrink:0},u={flex:1,minWidth:0},f={width:t,flexShrink:0};return h.jsxs(I,{className:c,style:i,id:a,...l,children:[h.jsx(I,{className:"flex flex-col",style:d,children:n}),h.jsx(I,{className:"flex flex-col",style:u,children:r}),h.jsx(I,{className:"flex flex-col",style:f,children:s})]})},eA={language:"json",theme:"vs-dark",options:{automaticLayout:!0,minimap:{enabled:!0},scrollBeyondLastLine:!1,fontSize:14,tabSize:2,formatOnPaste:!0,formatOnType:!0,wordWrap:"on",folding:!0,lineNumbers:"on",renderWhitespace:"selection"}},xb=[{uri:`${window.location.origin}/schemas/layout.json`,fileMatch:["*layout*.json"],schema:{type:"object",properties:{version:{type:"string"},endpoint:{type:"string"},components:{type:"array"}},required:["version","endpoint","components"]}}],tA={"vs/nls":{availableLanguages:{"*":"ko"}}};function nA(e){e.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,schemas:xb,enableSchemaRequest:!0,schemaValidation:"error",schemaRequest:"error"})}const rA={identifier:"sirsoft-admin_basic",vendor:"sirsoft",name:{ko:"Admin Basic",en:"Admin Basic"},version:"1.0.8",license:"MIT",description:{ko:"그누보드7 기본 관리자 템플릿",en:"Gnuboard7 default admin template"},type:"admin",locales:["ko","en"],author:{name:"sirsoft",email:"contact@sirsoft.com",url:"https://sirsoft.com"},release_date:"2026-05-15",g7_version:">=7.0.10",dependencies:{modules:{},plugins:{}},assets:{css:["assets/css/main.css","assets/css/ui-system.css"],js:["dist/components.js"],fonts:["assets/fonts/"],images:["assets/images/"]},components:{basic:["a","button","checkbox","div","form","h1","h2","h3","hr","icon","img","input","label","li","nav","p","section","select","span","svg","table","tbody","td","textarea","th","thead","tr","ul"],composite:["action-menu","admin-footer","admin-header","admin-sidebar","alert-dialog","breadcrumb","card","confirm-dialog","data-grid","dialog","dropdown","empty-state","filter-group","icon-button","loading-spinner","modal","page-header","pagination","product-card","search-bar","stat-card","status-badge","tab-navigation","template-card","toast"],layout:["container","flex","grid","section"]},preview:{thumbnail:"preview/thumbnail.png",screenshots:["preview/screenshot1.png","preview/screenshot2.png"]},error_config:{layouts:{401:"errors/401",403:"errors/403",404:"errors/404",500:"errors/500",503:"errors/503",maintenance:"errors/maintenance"}},github_url:"https://github.com/gnuboard/g7-template-sirsoft-admin_basic",github_changelog_url:"https://github.com/gnuboard/g7-template-sirsoft-admin_basic/blob/main/CHANGELOG.md",externals:[{id:"fontawesome",type:"style",asset:"vendor/font-awesome/6.4.0/css/all.inlined.css"},{id:"pretendard",type:"webfont",asset:"vendor/pretendard/1.3.9/pretendard-variable.css"},{id:"flag-icons",type:"style",asset:"vendor/flag-icons/7.2.3/css/flag-icons.min.css"}]},ir=window.G7Core?.createLogger?.("Handler:SetTheme")??{log:(...e)=>console.log("[Handler:SetTheme]",...e),warn:(...e)=>console.warn("[Handler:SetTheme]",...e),error:(...e)=>console.error("[Handler:SetTheme]",...e)},Gd=["auto","light","dark"],wb="g7_color_scheme",sA=e=>e==="auto"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e,Wa=e=>{const t=sA(e);document.documentElement.setAttribute("data-theme",t),t==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")};function oA(){try{const e=localStorage.getItem(wb),t=e&&Gd.includes(e)?e:"auto";Wa(t);try{window.G7Core?.state?.setGlobal?.({theme:t})}catch(n){ir.warn("Failed to set global theme state:",n)}ir.log("Initial theme applied:",t)}catch(e){ir.warn("Failed to load initial theme:",e),Wa("auto")}}async function iA(e,t){const n=e?.target;if(n&&typeof n=="string"&&Gd.includes(n)){Wa(n);try{window.G7Core?.state?.setGlobal?.({theme:n})}catch(r){ir.warn("Failed to set global theme state:",r)}return}oA()}async function aA(e,t){let n;if(e?.target&&typeof e.target=="string"&&!e.target.includes("{{")&&(n=e.target),!n||typeof n!="string"){ir.warn("Invalid theme:",n);return}if(!Gd.includes(n)){ir.warn("Unsupported theme:",n);return}const r=n;try{localStorage.setItem(wb,r)}catch(s){ir.error("Failed to save theme to localStorage:",s);return}Wa(r);try{window.G7Core?.state?.setGlobal?.({theme:r})}catch(s){ir.warn("Failed to set global theme state:",s)}ir.log("Theme changed to:",r)}const Ps=window.G7Core?.createLogger?.("Handler:InitMenu")??{log:(...e)=>console.log("[Handler:InitMenu]",...e),warn:(...e)=>console.warn("[Handler:InitMenu]",...e),error:(...e)=>console.error("[Handler:InitMenu]",...e)};function kb(e,t){for(const n of e){if(n.slug===t)return n;if(n.children&&n.children.length>0){const r=kb(n.children,t);if(r)return r}}return null}function Cb(e){return new URLSearchParams(window.location.search).get(e)}function lA(e){return window.G7Core?.state?.getDataSource?.(e)}function cA(e){const t=[e,e?.data,e?.data?.data];for(const n of t)if(Array.isArray(n)&&n.length>0)return n;return null}async function dA(e,t=30,n=100){for(let r=0;r<t;r++){const s=cA(lA(e));if(s)return s;await new Promise(o=>setTimeout(o,n))}return null}async function uA(e){const t=window.G7Core;try{const r=(await t?.api?.get?.(`/api/admin/menus/${e.id}`))?.data;if(r&&typeof r=="object"&&r.id===e.id)return r}catch(n){Ps.warn("[initMenuFromUrl] Failed to hydrate menu detail:",n)}return e}async function fA(e,t){const n=window.G7Core,r=Cb("menu"),s=Cb("mode");if(!r){Ps.log("[initMenuFromUrl] No menu parameter in URL");return}if(!n?.state?.set){Ps.warn("[initMenuFromUrl] G7Core.state.set not available");return}const o=await dA("menus");if(!o){Ps.warn("[initMenuFromUrl] menus data not available after waiting");return}const i=kb(o,r);if(!i){Ps.warn("[initMenuFromUrl] Menu not found with slug:",r);return}const a=await uA(i),l=s==="edit"?"edit":"view";n.state.set({selectedMenuId:a.id,selectedMenu:a,panelMode:l}),l==="edit"&&n.state.set({formData:{name:a.name,slug:a.slug,url:a.url,icon:a.icon,parent_id:a.parent_id,extension_type:a.extension_type,extension_identifier:a.extension_identifier,is_active:a.is_active,roles:(a.roles??[]).map(c=>c.id)}}),Ps.log("[initMenuFromUrl] Menu initialized from URL:",{slug:r,mode:l,menuId:i.id})}const tn=window.G7Core?.createLogger?.("Handler:FilterVisibility")??{log:(...e)=>console.log("[Handler:FilterVisibility]",...e),warn:(...e)=>console.warn("[Handler:FilterVisibility]",...e),error:(...e)=>console.error("[Handler:FilterVisibility]",...e)},Ga="g7_filter_visibility_";async function hA(e,t){const{storageKey:n,defaultFilters:r=[],stateKey:s="visibleFilters"}=e?.params||{};if(!n){tn.warn("[initFilterVisibility] storageKey is required");return}const o=`${Ga}${n}`;try{const i=localStorage.getItem(o);let a;if(i){const l=JSON.parse(i);Array.isArray(l)?(a=l,tn.log(`[initFilterVisibility] Loaded from localStorage: ${a.join(", ")}`)):(a=r,tn.warn("[initFilterVisibility] Invalid saved data format, using defaults"))}else a=r,tn.log(`[initFilterVisibility] No saved data, using defaults: ${r.join(", ")}`);t?.setState&&t.setState({[s]:a})}catch(i){tn.error("[initFilterVisibility] Failed to load filter visibility:",i),t?.setState&&t.setState({[s]:r})}}async function gA(e,t){const{storageKey:n,filters:r}=e?.params||{};if(!n){tn.warn("[saveFilterVisibility] storageKey is required");return}if(!Array.isArray(r)){tn.warn("[saveFilterVisibility] filters must be an array");return}const s=`${Ga}${n}`;try{localStorage.setItem(s,JSON.stringify(r)),tn.log(`[saveFilterVisibility] Saved to localStorage: ${r.join(", ")}`)}catch(o){tn.error("[saveFilterVisibility] Failed to save filter visibility:",o)}}async function pA(e,t){const{storageKey:n,filterId:r,stateKey:s="visibleFilters"}=e?.params||{};if(!n||!r){tn.warn("[toggleFilterVisibility] storageKey and filterId are required");return}const o=t?.state?.[s]||[];let i;o.includes(r)?i=o.filter(l=>l!==r):i=[...o,r],t?.setState&&t.setState({[s]:i});const a=`${Ga}${n}`;try{localStorage.setItem(a,JSON.stringify(i)),tn.log(`[toggleFilterVisibility] Toggled ${r}: ${i.join(", ")}`)}catch(l){tn.error("[toggleFilterVisibility] Failed to save:",l)}}async function mA(e,t){const{storageKey:n,defaultFilters:r=[],stateKey:s="visibleFilters"}=e?.params||{};if(!n){tn.warn("[resetFilterVisibility] storageKey is required");return}const o=`${Ga}${n}`;try{localStorage.setItem(o,JSON.stringify(r)),t?.setState&&t.setState({[s]:r}),tn.log(`[resetFilterVisibility] Reset to defaults: ${r.join(", ")}`)}catch(i){tn.error("[resetFilterVisibility] Failed to reset:",i)}}const $s=window.G7Core?.createLogger?.("Handler:MultilingualTag")??{log:(...e)=>console.log("[Handler:MultilingualTag]",...e),warn:(...e)=>console.warn("[Handler:MultilingualTag]",...e),error:(...e)=>console.error("[Handler:MultilingualTag]",...e)};async function bA(e,t){const n=window.G7Core;if(!n){$s.error("G7Core not available");return}const r=n.state?.getGlobal?.()?.multilingualTagEdit;if(!r){$s.warn("No multilingualTagEdit state found"),n.modal?.close?.();return}const{fieldName:s,editingIndex:o,values:i,statePath:a,currentTags:l}=r;if(!Object.values(i||{}).some(g=>typeof g=="string"&&g.trim()!=="")){$s.warn("No values to save"),n.modal?.close?.(),Yd(n);return}const d=Array.isArray(l)?l:[];let u;o==null?u=[...d,i]:u=d.map((g,m)=>m===o?i:g);const f=a||(s?.startsWith("form.")?s:`form.${s}`);n.state?.setParentLocal?.({[f]:u}),n.modal?.close?.(),Yd(n)}async function yA(e,t){const n=window.G7Core;if(!n){$s.error("G7Core not available");return}n.modal?.close?.(),Yd(n)}async function vA(e,t){const n=window.G7Core;if(!n){$s.error("G7Core not available");return}const r=e?.params?.locale;if(!r){$s.warn("No locale specified");return}const s=t?.event;let o="";s?.target?.value!==void 0?o=s.target.value:s?.value!==void 0&&(o=s.value);const a=(n.state?.getGlobal?.()||{}).multilingualTagEdit||{},l={...a.values||{},[r]:o};n.dispatch?.({handler:"setState",params:{target:"global",multilingualTagEdit:{...a,values:l}}})}function Yd(e){e.dispatch?.({handler:"setState",params:{target:"global",multilingualTagEdit:null}})}function Sb(e){const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0"),s=String(e.getHours()).padStart(2,"0"),o=String(e.getMinutes()).padStart(2,"0"),i=String(e.getSeconds()).padStart(2,"0");return`${t}-${n}-${r}T${s}:${o}:${i}`}function xA(e){const t=new Date,n=new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59),r=Sb(n),s=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0);switch(e){case"today":break;case"week":s.setDate(s.getDate()-6);break;case"month":s.setMonth(s.getMonth()-1);break;case"3months":s.setMonth(s.getMonth()-3);break;case"6months":s.setMonth(s.getMonth()-6);break;case"1year":s.setFullYear(s.getFullYear()-1);break}return{startDate:Sb(s),endDate:r}}function wA(e){const{preset:t}=e.params||{preset:"today"},{startDate:n,endDate:r}=xA(t);return{startDate:n,endDate:r,preset:t}}const Yo=window.G7Core?.createLogger?.("Handler:Sidebar")??{log:(...e)=>console.log("[Handler:Sidebar]",...e),warn:(...e)=>console.warn("[Handler:Sidebar]",...e),error:(...e)=>console.error("[Handler:Sidebar]",...e)},_b="g7_admin_sidebar_collapsed";function Eb(){try{return localStorage.getItem(_b)==="1"}catch{return!1}}function kA(e){try{localStorage.setItem(_b,e?"1":"0")}catch(t){Yo.error("Failed to save sidebar state to localStorage:",t)}try{window.G7Core?.state?.setGlobal?.({sidebarCollapsed:e})}catch(t){Yo.warn("Failed to set global sidebar state:",t)}}function Mb(){const e=Eb();try{window.G7Core?.state?.setGlobal?.({sidebarCollapsed:e})}catch(t){Yo.warn("Failed to restore sidebar state:",t)}Yo.log("Initial sidebar collapsed state restored:",e)}async function CA(e,t){Mb()}async function SA(e,t){const r=!(()=>{try{return!!window.G7Core?.state?.getGlobal?.()?.sidebarCollapsed}catch{return Eb()}})();kA(r),Yo.log("Sidebar collapsed toggled to:",r)}const Kd=window.G7Core?.createLogger?.("Handler:DownloadAttachment")??{log:(...e)=>console.log("[Handler:DownloadAttachment]",...e),warn:(...e)=>console.warn("[Handler:DownloadAttachment]",...e),error:(...e)=>console.error("[Handler:DownloadAttachment]",...e)};async function _A(e,t){const n=window.G7Core,{url:r,filename:s}=e?.params||{};if(!r){Kd.warn("다운로드 URL 이 없어 요청을 건너뜁니다.");return}if(!n?.api?.get){Kd.error("G7Core.api.get 이 초기화되지 않아 다운로드를 실행할 수 없습니다.");return}try{const o=await n.api.get(r,{responseType:"blob"});if(o){const i=URL.createObjectURL(o),a=document.createElement("a");a.href=i,a.download=s||"",document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)}}catch(o){Kd.error("첨부파일 다운로드 실패",o),n?.toast?.error?.(n?.t?.("common.download_failed")??"Download failed")}}const Ya=window.G7Core?.createLogger?.("Handler:DetectAssetUrlMode")??{log:(...e)=>console.log("[Handler:DetectAssetUrlMode]",...e),warn:(...e)=>console.warn("[Handler:DetectAssetUrlMode]",...e),error:(...e)=>console.error("[Handler:DetectAssetUrlMode]",...e)},EA="G7_ASSET_PROBE_OK";async function Nb(e){try{const t=await fetch(e,{cache:"no-store",credentials:"omit"});if(!t.ok)return!1;const n=t.headers.get("content-type")??"";return/javascript|ecmascript/i.test(n)?(await t.text()).includes(EA):!1}catch{return!1}}async function Ob(){const[e,t]=await Promise.all([Nb("/api/system/asset-probe.js"),Nb("/api/system/asset-probe")]);return e&&t?"extension":!e&&t?"extensionless":"unavailable"}function MA(){return window.G7Config?.settings?.general?.asset_url_mode??"extension"}async function NA(e){try{const t=await Ob();if(t==="unavailable")return;const n=MA();if(t===n)return;window.G7Core?.state?.setGlobal?.({assetUrlModeDrift:{detected:t,stored:n}})}catch(t){Ya.warn("자산 URL 방식 대조 실패 (대시보드 동작에는 영향 없음):",t)}}async function OA(e,t){const n=window.G7Core,r=t?.setState??n?.state?.setLocal,s=o=>{typeof r=="function"?r({asset_url_mode_detect_status:o}):Ya.warn("setState 를 찾지 못해 감지 상태를 폼에 반영하지 못했습니다")};try{s("detecting");const o=await Ob();if(o==="unavailable"){s("unavailable");return}typeof r=="function"?r({"general.asset_url_mode":o,asset_url_mode_detect_status:o}):Ya.warn("setState 를 찾지 못해 감지 결과를 폼에 반영하지 못했습니다")}catch(o){Ya.error("자산 URL 방식 감지 실패:",o),s("unavailable")}}const Ka={detectAssetUrlMode:OA,checkAssetUrlModeDrift:NA,setTheme:aA,initTheme:iA,scrollToSection:zu,initMenuFromUrl:fA,initFilterVisibility:hA,saveFilterVisibility:gA,toggleFilterVisibility:pA,resetFilterVisibility:mA,saveMultilingualTag:bA,cancelMultilingualTag:yA,updateMultilingualTagValue:vA,setDateRange:wA,toggleSidebar:SA,initSidebar:CA,downloadAttachment:_A},Ko=window.G7Core?.createLogger?.("Template:sirsoft-admin_basic:IdentityLauncher")??{log:(...e)=>console.log("[Template:sirsoft-admin_basic:IdentityLauncher]",...e),warn:(...e)=>console.warn("[Template:sirsoft-admin_basic:IdentityLauncher]",...e),error:(...e)=>console.error("[Template:sirsoft-admin_basic:IdentityLauncher]",...e)};function TA(){const t=window.G7Core?.api?.getToken?.()??null;return t?{Authorization:`Bearer ${t}`}:{}}function AA(){try{const e=typeof window<"u"?window.localStorage?.getItem("g7_locale"):null;return e?{"Accept-Language":e}:{}}catch{return{}}}async function DA(e,t=null){const n={purpose:e.purpose};e.provider_id&&(n.provider_id=e.provider_id),t&&(n.target=t);const r=e.challenge_start_url||"/api/identity/challenges",s=await fetch(r,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",Accept:"application/json",...AA(),...TA()},body:JSON.stringify(n)}),o=await s.json().catch(()=>null);if(!s.ok||!o?.success){const a=o?.message??`Challenge 시작 실패 (HTTP ${s.status})`;throw new Error(a)}const i=o.data??o;return{id:i.id,expires_at:i.expires_at,render_hint:i.render_hint??e.render_hint??"text_code",public_payload:i.public_payload,redirect_url:i.redirect_url,max_attempts:typeof i.max_attempts=="number"?i.max_attempts:void 0}}async function IA(e){const t=window.G7Core,n=t?.identity;if(!t?.dispatch||!t?.state||!n)return Ko.error("G7Core 또는 G7Core.identity 가 초기화되지 않아 launcher 를 실행할 수 없습니다."),{status:"failed",failureCode:"G7_NOT_READY"};if(e.render_hint==="external_redirect"||e.redirect_url)return n.redirectExternally(e);const r=e.target&&(e.target.email||e.target.phone)?e.target:null;let s;try{s=await DA(e,r)}catch(m){Ko.error("Challenge 시작 실패:",m);try{await t.dispatch({handler:"toast",params:{type:"error",message:m instanceof Error?m.message:"본인인증 시작에 실패했습니다."}})}catch{}return{status:"failed",failureCode:"CHALLENGE_START_FAILED",reason:m instanceof Error?m.message:String(m)}}if(s.redirect_url)return n.redirectExternally({...e,render_hint:"external_redirect",redirect_url:s.redirect_url});const o=s.expires_at?new Date(s.expires_at).getTime():0,i=o>0?Math.max(0,Math.floor((o-Date.now())/1e3)):0,a=typeof s.max_attempts=="number"?s.max_attempts:0;t.state.set({identityChallenge:{policy_key:e.policy_key,purpose:e.purpose,provider_id:e.provider_id??null,render_hint:s.render_hint,challenge_id:s.id,expires_at:s.expires_at,public_payload:s.public_payload??{},target:r,code:"",error:null,attempts:0,maxAttempts:a,remainingSeconds:i,resendCooldown:0}});let l=o,c=0;const d=window.setInterval(()=>{const m=l>0?Math.max(0,Math.floor((l-Date.now())/1e3)):0;c=Math.max(0,c-1),t.state.set({identityChallenge:{remainingSeconds:m,resendCooldown:c}})},1e3);let u=null;try{u=t.state.subscribe?.(m=>{const p=m?.identityChallenge?.expires_at;if(typeof p=="string"){const b=new Date(p).getTime();Number.isFinite(b)&&b!==l&&(l=b)}const y=m?.identityChallenge?.resendCooldown;typeof y=="number"&&y>c&&(c=y)})??null}catch{}const f=n.createDeferred();try{await t.dispatch({handler:"openModal",target:"identity-challenge-modal"})}catch(m){return Ko.error("openModal 실패 — 풀페이지로 폴백:",m),window.clearInterval(d),u?.(),n.redirectExternally({...e,render_hint:"external_redirect",redirect_url:`/admin/identity/challenge?challenge_id=${encodeURIComponent(s.id)}&return=${encodeURIComponent(window.location.href)}`})}const g=await f;return window.clearInterval(d),u?.(),g}function LA(){const e=window.G7Core?.identity;if(!e?.setLauncher){Ko.warn("G7Core.identity 가 아직 초기화되지 않아 launcher 등록을 건너뜁니다. 코어 부트스트랩 순서를 확인하세요.");return}e.setLauncher(IA),Ko.log("IDV launcher registered (sirsoft-admin_basic)")}function PA(e){const t=e.icons;return Array.isArray(t)?t.filter(n=>!!n&&typeof n=="object"&&typeof n.value=="string"):[]}function $A(e,t){const n=e.label;return typeof n=="string"?n.startsWith("$t:")?t(n.slice(3)):n:e.value}function FA(e,t,n){if(n==="")return!0;const r=n.toLowerCase();return e.value.toLowerCase().includes(r)||t.toLowerCase().includes(r)?!0:(e.keywords??[]).some(s=>s.toLowerCase().includes(r))}function zA({entry:e}){const t=e.preview;return t?.html?h.jsx("span",{className:"g7le-icon-preview",dangerouslySetInnerHTML:{__html:t.html},style:qd}):t?.className?h.jsx("span",{className:`g7le-icon-preview ${t.className}`,style:qd}):h.jsx("i",{className:`fas fa-${e.value}`,style:qd,"aria-hidden":"true"})}function VA({control:e,value:t,onChange:n,t:r}){const s=PA(e),o=t==null?"":String(t),i=typeof e.iconColumns=="number"?e.iconColumns:6,a=e.iconSearchPlaceholder,l=typeof a=="string"&&a.startsWith("$t:")?r(a.slice(3)):r("layout_editor.icon_picker.search_placeholder"),[c,d]=v.useState("");if(s.length===0)return h.jsx("div",{className:"g7le-widget g7le-widget--icon-picker","data-testid":"g7le-widget-icon-picker",style:Tb,children:h.jsx("input",{type:"text",className:"g7le-widget g7le-widget--icon-free","data-testid":"g7le-widget-icon-picker-free",value:o,placeholder:r("layout_editor.icon_picker.free_input_hint"),onChange:g=>n(g.target.value===""?void 0:g.target.value),style:Ab})});const u=g=>$A(g,r),f=s.filter(g=>FA(g,u(g),c));return h.jsxs("div",{className:"g7le-widget g7le-widget--icon-picker","data-testid":"g7le-widget-icon-picker",style:Tb,children:[h.jsx("input",{type:"text",className:"g7le-widget g7le-widget--icon-search","data-testid":"g7le-widget-icon-picker-search",value:c,placeholder:l,onChange:g=>d(g.target.value),style:Ab}),h.jsxs("div",{className:"g7le-icon-grid","data-testid":"g7le-widget-icon-picker-grid",style:{...HA,gridTemplateColumns:`repeat(${i}, minmax(0, 1fr))`},children:[h.jsx("button",{type:"button","data-testid":"g7le-icon-cell-none",title:r("layout_editor.icon_picker.none"),onClick:()=>n(void 0),"aria-pressed":o==="",style:o===""?Db:Xd,children:h.jsx("span",{style:UA,children:"—"})}),f.map(g=>{const m=g.value===o;return h.jsx("button",{type:"button","data-testid":`g7le-icon-cell-${g.value}`,title:u(g),"aria-pressed":m,onClick:()=>n(g.value),style:m?Db:Xd,children:h.jsx(zA,{entry:g})},g.value)})]}),f.length===0&&h.jsx("div",{"data-testid":"g7le-widget-icon-picker-empty",style:BA,children:r("layout_editor.icon_picker.no_results")})]})}const Tb={display:"flex",flexDirection:"column",gap:6,width:"100%"},Ab={padding:"5px 8px",fontSize:12,border:"1px solid #cbd5e1",borderRadius:6,width:"100%"},HA={display:"grid",gap:4,maxHeight:220,overflowY:"auto",padding:2},Xd={display:"flex",alignItems:"center",justifyContent:"center",minHeight:34,padding:4,border:"1px solid #e2e8f0",borderRadius:6,background:"#fff",cursor:"pointer"},Db={...Xd,border:"2px solid #2563eb",background:"#eff6ff"},qd={display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:16,lineHeight:1},UA={fontSize:10,color:"#475569",fontFamily:"monospace",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"},BA={fontSize:11,color:"#94a3b8",fontStyle:"italic",padding:"4px 2px"},Ib=130,Fn=20;function jA(e){const t=e?.arrayProp;return typeof t=="string"&&t?t:"tabs"}function WA(e){let t=0;for(const n of e){const r=typeof n.id=="number"?n.id:Number(n.id);Number.isFinite(r)&&r>t&&(t=r)}return t+1}function GA({node:e,params:t,cellBoxes:n,t:r,onPatchNode:s}){const o=jA(t),i=v.useMemo(()=>{const g=(e.props??{})[o];return typeof g=="string"||!Array.isArray(g)?null:g},[e,o]),a=v.useMemo(()=>{const g=new Map,m=`props.${o}.`;for(const p of n??[]){if(!p.path.startsWith(m))continue;const y=Number(p.path.slice(m.length));Number.isInteger(y)&&g.set(y,{top:p.top,left:p.left,width:p.width,height:p.height})}return g},[n,o]),l=v.useCallback(g=>{const m=e.props??{};s({...e,props:{...m,[o]:g}})},[e,o,s]),c=v.useCallback(g=>{if(!i)return;const p={id:WA(i),label:r("editor.tabnav_inplace.new_tab")},y=i.slice();y.splice(g,0,p),l(y)},[i,l,r]),d=v.useCallback(g=>{if(!i)return;const m=i.slice();m.splice(g,1),l(m)},[i,l]),u=v.useCallback((g,m)=>{if(!i)return;const p=g+m;if(p<0||p>=i.length)return;const y=i.slice(),[b]=y.splice(g,1);y.splice(p,0,b),l(y)},[i,l]);if(!i||a.size===0)return null;const f={position:"absolute",width:Fn,height:Fn,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,lineHeight:1,border:"1px solid rgba(0,0,0,0.15)",borderRadius:4,background:"#ffffff",color:"#1f2937",cursor:"pointer",boxShadow:"0 1px 2px rgba(0,0,0,0.18)",pointerEvents:"auto",padding:0,zIndex:Ib};return h.jsx("div",{className:"g7le-tabnav-inplace","data-testid":"g7le-tabnav-inplace",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:Ib},children:i.map((g,m)=>{const p=a.get(m);if(!p)return null;const y=p.left+p.width;return h.jsxs("div",{"data-testid":`g7le-tabnav-aff-${m}`,children:[h.jsx("button",{type:"button","data-testid":`g7le-tabnav-remove-${m}`,title:r("editor.tabnav_inplace.remove"),"aria-label":r("editor.tabnav_inplace.remove"),style:{...f,left:y-Fn/2,top:p.top-Fn/2,color:"#b91c1c"},onClick:b=>{b.preventDefault(),b.stopPropagation(),d(m)},children:"✕"}),m>0&&h.jsx("button",{type:"button","data-testid":`g7le-tabnav-move-left-${m}`,title:r("editor.tabnav_inplace.move_left"),"aria-label":r("editor.tabnav_inplace.move_left"),style:{...f,left:p.left,top:p.top+p.height-Fn/2},onClick:b=>{b.preventDefault(),b.stopPropagation(),u(m,-1)},children:"◀"}),m<i.length-1&&h.jsx("button",{type:"button","data-testid":`g7le-tabnav-move-right-${m}`,title:r("editor.tabnav_inplace.move_right"),"aria-label":r("editor.tabnav_inplace.move_right"),style:{...f,left:y-Fn,top:p.top+p.height-Fn/2},onClick:b=>{b.preventDefault(),b.stopPropagation(),u(m,1)},children:"▶"}),m===0&&h.jsx("button",{type:"button","data-testid":"g7le-tabnav-add-0",title:r("editor.tabnav_inplace.add"),"aria-label":r("editor.tabnav_inplace.add"),style:{...f,left:p.left-Fn,top:p.top+p.height/2-Fn/2,color:"#15803d"},onClick:b=>{b.preventDefault(),b.stopPropagation(),c(0)},children:"+"}),h.jsx("button",{type:"button","data-testid":`g7le-tabnav-add-${m+1}`,title:r("editor.tabnav_inplace.add"),"aria-label":r("editor.tabnav_inplace.add"),style:{...f,left:y-Fn/2,top:p.top+p.height/2-Fn/2,color:"#15803d"},onClick:b=>{b.preventDefault(),b.stopPropagation(),c(m+1)},children:"+"})]},`tab-aff-${g.id}-${m}`)})})}const Zd=window.G7Core?.createLogger?.("Template:sirsoft-admin_basic:EditorWidgets")??{log:(...e)=>console.log("[Template:sirsoft-admin_basic:EditorWidgets]",...e),warn:(...e)=>console.warn("[Template:sirsoft-admin_basic:EditorWidgets]",...e)};function YA(){if(typeof window>"u")return;const e=window.G7Core?.layoutEditor;if(!e?.registerWidget){Zd.warn("G7Core.layoutEditor 미노출 — icon-picker 위젯 등록 보류");return}e.registerWidget("icon-picker",VA),Zd.log("편집기 위젯 'icon-picker' 등록됨(Font Awesome 검색 그리드)"),e.registerCanvasOverlay&&(e.registerCanvasOverlay("tabnav",GA),Zd.log("편집기 캔버스 오버레이 'tabnav' 등록됨(TabNavigation 탭 인플레이스)"))}const Qd=window.G7Core?.createLogger?.("Template:sirsoft-admin_basic")??{log:(...e)=>console.log("[Template:sirsoft-admin_basic]",...e),warn:(...e)=>console.warn("[Template:sirsoft-admin_basic]",...e),error:(...e)=>console.error("[Template:sirsoft-admin_basic]",...e)};typeof window<"u"&&(window.G7TemplateHandlers=Ka);function Lb(){if(typeof window<"u"){let e=0;const t=50,n=()=>{const r=window.G7Core?.getActionDispatcher?.();r?(Object.entries(Ka).forEach(([s,o])=>{r.registerHandler(s,o)}),Qd.log(`${Object.keys(Ka).length} custom handler(s) registered:`,Object.keys(Ka)),LA(),Mb()):(e++,e<=t?(Qd.warn(`ActionDispatcher not found, retrying... (${e}/${t})`),setTimeout(n,100)):Qd.error("Failed to register handlers: ActionDispatcher not available after maximum retries"))};document.readyState==="complete"?n():window.addEventListener("load",n)}}return YA(),Lb(),R.A=qr,R.Accordion=Nc,R.ActionMenu=Vs,R.AdminFooter=Ov,R.AdminHeader=_v,R.AdminSidebar=Sv,R.Alert=Ku,R.AlertDialog=pv,R.Badge=fu,R.BarChart=K5,R.Breadcrumb=ju,R.Button=le,R.Card=sy,R.CardGrid=Jy,R.CategoryTree=Q_,R.Checkbox=On,R.ChipCheckbox=FM,R.Code=ey,R.CodeEditor=Kx,R.ColumnSelector=ew,R.ConfirmDialog=Uu,R.Container=q5,R.DataGrid=Yy,R.Dialog=Hu,R.Div=I,R.DonutChart=X5,R.Dropdown=ev,R.DropdownButton=zM,R.DropdownMenuItem=VM,R.DynamicFieldList=qM,R.EmptyState=wv,R.ExtensionBadge=Uh,R.FileInput=su,R.FileUploader=c0,R.FilterGroup=sv,R.FilterVisibilitySelector=AM,R.Flex=Q5,R.Form=al,R.FormField=eN,R.Fragment=ny,R.Grid=Z5,R.H1=sl,R.H2=cr,R.H3=Xr,R.H4=ou,R.Hr=ry,R.HtmlContent=kl,R.HtmlEditor=MM,R.I=yt,R.Icon=ae,R.IconButton=fv,R.IconName=he,R.IconSelect=G_,R.ImageGallery=ia,R.Img=Nn,R.Input=Et,R.Label=gn,R.LanguageSelector=Nv,R.LayoutEditorHeader=Lv,R.LayoutFileList=Pv,R.LayoutHistoryPanel=qx,R.LayoutWarnings=TM,R.Li=il,R.LoadingSpinner=Cv,R.LoginForm=Zx,R.Modal=ri,R.MultilingualInput=fl,R.MultilingualLocaleContext=ad,R.MultilingualTabPanel=RM,R.MultilingualTagInput=RC,R.Nav=Jo,R.NotificationCenter=Ev,R.Ol=Kb,R.Optgroup=Qb,R.Option=Zb,R.P=kt,R.PageHeader=Tv,R.PageLoading=sw,R.PageTransitionIndicator=nw,R.Pagination=Ro,R.PermissionTree=q_,R.Pre=ty,R.ProductCard=tv,R.RadioGroup=SM,R.RichSelect=PM,R.SearchBar=rv,R.SearchableDropdown=eS,R.Section=iu,R.SectionHeader=Dv,R.SectionLayout=J5,R.Select=Zr,R.SlotContainer=LM,R.SortableMenuItem=Tg,R.SortableMenuList=j_,R.Span=J,R.StatCard=nv,R.StatusBadge=ei,R.Svg=Jn,R.TabNavigation=ov,R.TabNavigationScroll=dv,R.Table=ll,R.TagInput=ZC,R.TagSelect=tS,R.Tbody=dl,R.Td=rn,R.TemplateCard=Iv,R.Textarea=lr,R.Tfoot=ul,R.Th=Qr,R.Thead=cl,R.ThemeToggle=Jx,R.ThreeColumnLayout=R5,R.Toast=vv,R.Toggle=hl,R.Tr=dr,R.Ul=ol,R.UnifiedIcon=Rb,R.UserProfile=Mv,R.VersionList=uf,R.configureJSONLanguageService=nA,R.defaultJSONSchemas=xb,R.executeImageDownload=nd,R.initTemplate=Lb,R.jsonEditorDefaults=eA,R.monacoInitOptions=tA,R.templateMetadata=rA,R.useCurrentMultilingualLocale=m0,R.useImageGallery=qp,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}),R})({},ReactJSXRuntime,React,ReactDOM);
|