fix(cart): 장바구니 전체 선택 개수 최초 로딩 미표시 수정

표시식이 selectedCount 를 fallback 없이 보간했다. 이 키는 체크박스 change
핸들러에서만 기록되므로 최초 마운트 구간에 undefined 이고, 엔진이 undefined 를
예외 없이 빈 문자열로 서식해 (/27) 로 보였다. 선택 상태의 SSoT 인 selectedItems
파생으로 교체해 주문 요약과 계산 방식을 일치시켰다.

같은 결함 클래스(초기값 없는 키를 옵셔널 없이 하위 접근) 28곳을 함께 방어하고,
3조건 동시 충족만 잡는 audit 룰로 codify 했다. 브라우저 실측(T9)에서 다운로드
이력 모달의 iteration 문자열 선언(매 렌더 TypeError)·미존재 아이콘명·정적 id
중복 3종을 추가로 발견해 정정했다.

공개 이슈: gnuboard/g7
This commit is contained in:
HeuJung committed 2026-08-12 10:17:22 +09:00
1 parent 95957bb167
commit 7765695339
25 files changed
+839 -99

No files matched your search

+1 -1
View File
@@ -517,8 +517,8 @@ cp .env.example .env
<a href="https://github.com/laelbe" title="laelbe"><img src="https://github.com/laelbe.png" width="48" alt="laelbe"></a>
<a href="https://github.com/bigmsg" title="bigmsg"><img src="https://github.com/bigmsg.png" width="48" alt="bigmsg"></a>
<a href="https://github.com/hwaryeon1234" title="hwaryeon1234"><img src="https://github.com/hwaryeon1234.png" width="48" alt="hwaryeon1234"></a>
<a href="https://github.com/abc101" title="abc101"><img src="https://github.com/abc101.png" width="48" alt="abc101"></a>
<a href="https://github.com/koojunho" title="koojunho"><img src="https://github.com/koojunho.png" width="48" alt="koojunho"></a>
<a href="https://github.com/abc101" title="abc101"><img src="https://github.com/abc101.png" width="48" alt="abc101"></a>
<a href="https://github.com/yks118" title="yks118"><img src="https://github.com/yks118.png" width="48" alt="yks118"></a>
<a href="https://github.com/kitrio" title="kitrio"><img src="https://github.com/kitrio.png" width="48" alt="kitrio"></a>
<a href="https://github.com/movielee2020" title="movielee2020"><img src="https://github.com/movielee2020.png" width="48" alt="movielee2020"></a>
+1 -1
View File
@@ -533,8 +533,8 @@ Thanks to everyone who reported an issue or suggested a feature that shipped —
<a href="https://github.com/laelbe" title="laelbe"><img src="https://github.com/laelbe.png" width="48" alt="laelbe"></a>
<a href="https://github.com/bigmsg" title="bigmsg"><img src="https://github.com/bigmsg.png" width="48" alt="bigmsg"></a>
<a href="https://github.com/hwaryeon1234" title="hwaryeon1234"><img src="https://github.com/hwaryeon1234.png" width="48" alt="hwaryeon1234"></a>
<a href="https://github.com/abc101" title="abc101"><img src="https://github.com/abc101.png" width="48" alt="abc101"></a>
<a href="https://github.com/koojunho" title="koojunho"><img src="https://github.com/koojunho.png" width="48" alt="koojunho"></a>
<a href="https://github.com/abc101" title="abc101"><img src="https://github.com/abc101.png" width="48" alt="abc101"></a>
<a href="https://github.com/yks118" title="yks118"><img src="https://github.com/yks118.png" width="48" alt="yks118"></a>
<a href="https://github.com/kitrio" title="kitrio"><img src="https://github.com/kitrio.png" width="48" alt="kitrio"></a>
<a href="https://github.com/movielee2020" title="movielee2020"><img src="https://github.com/movielee2020.png" width="48" alt="movielee2020"></a>
@@ -10,6 +10,9 @@
- 언어/통화 설정에서 기본 제공 통화(달러·엔·위안·유로)를 삭제해도 저장 직후 다시 나타나던 문제를 수정했습니다. 삭제한 통화는 설정 화면과 쇼핑몰 화면 양쪽에서 유지되며, 통화 추가로 다시 등록하면 복원됩니다. 사용 중지된 통화를 표시 통화로 갖고 있던 구매자의 주문은 기본 통화로 안전하게 진행됩니다. (#91 @koojunho 님께서 제보해주셨습니다.)
- 통화를 삭제한 뒤 그 통화로 결제된 과거 주문의 금액 표기가 달라지던 문제를 수정했습니다. 주문·환불 금액의 소수 자릿수는 주문 시점 기준을 유지하므로, 엔화처럼 소수점을 쓰지 않는 통화가 `¥14,835.00` 으로 바뀌거나 소수점 이하 자릿수가 많은 통화의 표시 금액이 잘리지 않습니다. (#91 @koojunho 님께서 제보해주셨습니다.)
- 관리자 엑셀 다운로드 관리의 다운로드 이력 모달에서, 이력 항목이 아직 선택되지 않은 순간에 파일 정보·상태 배지가 비정상적으로 처리되던 문제를 보완했습니다. 항목을 선택한 뒤의 표시는 종전과 동일합니다.
- 같은 모달의 "다운로드 기록" 목록이 항상 비어 보이던 문제를 수정했습니다. 이제 누가 언제 몇 번째로 내려받았는지 기록이 표시됩니다.
- 같은 모달의 "처리중"·"실패"·"만료" 상태 배지에서 아이콘이 표시되지 않던 문제를 수정했습니다.
## [1.1.0] - 2026-08-10
@@ -97,11 +97,17 @@ describe('B2 — 주문상세 모달 상품표 카드형 전환', () => {
const cancel = load('partials/admin_ecommerce_order_detail/_modal_cancel_order.json');
const batch = load('partials/admin_ecommerce_order_detail/_modal_batch_change_confirm.json');
const unitPrice = collect(
// 금액 노드는 서버가 통화까지 포함해 서식한 `*_formatted` 를 그대로 출력한다.
// (한때 `원` 리터럴로 이 노드를 찾았으나 통화 하드코딩 제거 후 선택자가 아무것도 못 찾아
// `cls(undefined)` 를 단언하는 빈 가드가 되어 있었다 — 선택자를 서식 필드 기준으로 고정한다)
const unitPrices = collect(
cancel,
(n) => typeof n.text === 'string' && n.text.includes('unit_price') && n.text.includes('원'),
)[0];
expect(cls(unitPrice)).toContain('whitespace-nowrap');
(n) => typeof n.text === 'string' && n.text.includes('unit_price_formatted'),
);
expect(unitPrices.length, '단가 표시 노드를 찾지 못했다').toBeGreaterThan(0);
for (const node of unitPrices) {
expect(cls(node)).toContain('whitespace-nowrap');
}
const batchAmounts = collect(
batch,
@@ -0,0 +1,131 @@
/**
* @file excel-download-history-modal-fallback.test.tsx
* @description 엑셀 다운로드 이력 모달의 미선택 상태 표시 가드 (공개 이슈 #92 동일 결함 클래스)
*
* 결함 클래스: 부모 레이아웃 state 에 `null` 로만 선언된 키를 옵셔널 체이닝 없이 하위 접근하면,
* 그 키를 채우는 유일한 지점(행 클릭 setState)이 아직 실행되지 않은 구간에서 표시가 비거나
* 조건식이 예외로 떨어진다. `admin_ecommerce_excel_download_index.json` 의 `selectedItem` 이
* 그 형태이고, 이 모달에는 selectedItem 을 검사하는 `if` 가드가 없다.
*
* 정정: 모달의 모든 `selectedItem` 하위 접근에 `?.` + 표시식 폴백(`?? ''`, count 인자는 `?? 0`)을 부여한다.
* 값이 채워진 뒤의 출력은 이전과 바이트 동일하므로 기능 변화는 없다.
*
* @vitest-environment jsdom
*/
import { describe, it, expect } from 'vitest';
import downloadHistoryModal from '../../../layouts/admin/partials/admin_ecommerce_excel_download_index/_modal_download_history.json';
import excelDownloadIndex from '../../../layouts/admin/admin_ecommerce_excel_download_index.json';
/**
* JSON 트리에서 특정 문자열을 포함하는 문자열 값을 모두 수집합니다.
*
* @param node 순회 시작 노드
* @param needle 찾을 부분 문자열
* @returns 매칭된 문자열 값 목록
*/
function collectStringsContaining(node: unknown, needle: string): string[] {
const out: string[] = [];
const walk = (n: unknown): void => {
if (Array.isArray(n)) {
n.forEach(walk);
return;
}
if (!n || typeof n !== 'object') return;
const obj = n as Record<string, unknown>;
for (const v of Object.values(obj)) {
if (typeof v === 'string' && v.includes(needle)) out.push(v);
}
Object.values(obj).forEach(walk);
};
walk(node);
return out;
}
const refs = collectStringsContaining(downloadHistoryModal, 'selectedItem');
describe('_modal_download_history.json — selectedItem 표시 가드', () => {
/**
* @scenario selection_state=unselected
* @effects history_modal_display_guarded
*/
it('부모 레이아웃이 selectedItem 을 null 로만 시드한다 (전제 확인)', () => {
const state = (excelDownloadIndex as any).state ?? {};
expect(
Object.prototype.hasOwnProperty.call(state, 'selectedItem'),
'selectedItem 시드가 사라졌다면 이 테스트의 전제를 재검토할 것'
).toBe(true);
expect(state.selectedItem).toBeNull();
});
/**
* @scenario selection_state=unselected
* @effects history_modal_display_guarded
*/
it('selectedItem 하위 접근은 전부 옵셔널 체이닝을 쓴다', () => {
expect(refs.length, 'selectedItem 참조를 찾지 못했다').toBeGreaterThan(0);
const unguarded = refs.filter((r) => /selectedItem\.[A-Za-z_]/.test(r));
expect(
unguarded,
`selectedItem 뒤에 '?.' 없는 역참조: ${unguarded.join(' | ')}`
).toEqual([]);
});
/**
* 다운로드 기록 목록이 문자열 형태 `"iteration": "{{...}}"` 로 선언되어 있어
* 엔진이 `iteration.source` 를 읽지 못하고 매 렌더마다 TypeError 로 떨어졌다
* (목록이 통째로 비어 보임 — 브라우저 실측에서 발견).
*
* @scenario selection_state=selected
* @effects history_list_renders
*/
it('다운로드 기록 iteration 이 source/item_var/index_var 객체 형태다', () => {
const iterations: unknown[] = [];
const walk = (n: unknown): void => {
if (Array.isArray(n)) { n.forEach(walk); return; }
if (!n || typeof n !== 'object') return;
const obj = n as Record<string, unknown>;
if ('iteration' in obj) iterations.push(obj.iteration);
Object.values(obj).forEach(walk);
};
walk(downloadHistoryModal);
expect(iterations.length, 'iteration 선언을 찾지 못했다').toBeGreaterThan(0);
for (const it of iterations) {
expect(typeof it, `문자열 형태 iteration 은 엔진이 해석하지 못한다: ${String(it)}`).toBe('object');
const cfg = it as Record<string, unknown>;
expect(typeof cfg.source).toBe('string');
expect(cfg.item_var).toBeTruthy();
}
});
/**
* @scenario selection_state=selected
* @effects history_modal_display_guarded
*/
it('표시식(text)은 값 부재 시 폴백을 갖는다', () => {
const textRefs: string[] = [];
const walk = (n: unknown): void => {
if (Array.isArray(n)) {
n.forEach(walk);
return;
}
if (!n || typeof n !== 'object') return;
const obj = n as Record<string, unknown>;
if (typeof obj.text === 'string' && obj.text.includes('selectedItem')) {
textRefs.push(obj.text);
}
Object.values(obj).forEach(walk);
};
walk(downloadHistoryModal);
// 개수를 고정한다 — `> 0` 만 두면 표시식이 삭제돼도 남은 것들이 폴백을 갖는 한 통과한다.
// 현재 6건: file_content / category_name / created_date / expire_date / download_count /
// download_history.length (마지막 1건은 원래부터 가드가 있어 #92 수정 대상 5건에 포함되지 않는다)
expect(textRefs.length, `selectedItem 표시식 개수 변동: ${textRefs.join(' | ')}`).toBe(6);
for (const t of textRefs) {
expect(t, `폴백 없는 표시식: ${t}`).toMatch(/\?\?\s*('{2}|0)/);
}
});
});
@@ -41,7 +41,7 @@
"props": {
"className": "text-primary text-right"
},
"text": "{{_local.selectedItem.file_content}}"
"text": "{{_local.selectedItem?.file_content ?? ''}}"
},
{
"type": "basic",
@@ -57,7 +57,7 @@
"props": {
"className": "text-primary text-right"
},
"text": "{{_local.selectedItem.category_name}}"
"text": "{{_local.selectedItem?.category_name ?? ''}}"
},
{
"type": "basic",
@@ -77,7 +77,7 @@
{
"type": "basic",
"name": "Span",
"condition": "{{_local.selectedItem.status === 'completed'}}",
"condition": "{{_local.selectedItem?.status === 'completed'}}",
"props": {
"className": "badge-status badge-status-success"
},
@@ -87,7 +87,7 @@
"name": "Icon",
"props": {
"name": "check-circle",
"className": "w-3 h-3"
"className": "text-xs"
}
},
{
@@ -100,7 +100,7 @@
{
"type": "basic",
"name": "Span",
"condition": "{{_local.selectedItem.status === 'processing'}}",
"condition": "{{_local.selectedItem?.status === 'processing'}}",
"props": {
"className": "badge-status badge-status-processing"
},
@@ -109,8 +109,8 @@
"type": "basic",
"name": "Icon",
"props": {
"name": "loader",
"className": "w-3 h-3 animate-spin"
"name": "spinner",
"className": "text-xs animate-spin"
}
},
{
@@ -123,7 +123,7 @@
{
"type": "basic",
"name": "Span",
"condition": "{{_local.selectedItem.status === 'failed'}}",
"condition": "{{_local.selectedItem?.status === 'failed'}}",
"props": {
"className": "badge-status badge-status-error"
},
@@ -132,8 +132,8 @@
"type": "basic",
"name": "Icon",
"props": {
"name": "alert-circle",
"className": "w-3 h-3"
"name": "circle-exclamation",
"className": "text-xs"
}
},
{
@@ -146,7 +146,7 @@
{
"type": "basic",
"name": "Span",
"condition": "{{_local.selectedItem.status === 'expired'}}",
"condition": "{{_local.selectedItem?.status === 'expired'}}",
"props": {
"className": "badge-status badge-status-expired"
},
@@ -155,8 +155,8 @@
"type": "basic",
"name": "Icon",
"props": {
"name": "file-text",
"className": "w-3 h-3"
"name": "file-lines",
"className": "text-xs"
}
},
{
@@ -182,7 +182,7 @@
"props": {
"className": "text-primary text-right"
},
"text": "{{_local.selectedItem.created_date}}"
"text": "{{_local.selectedItem?.created_date ?? ''}}"
},
{
"type": "basic",
@@ -198,7 +198,7 @@
"props": {
"className": "text-primary text-right"
},
"text": "{{_local.selectedItem.expire_date}}"
"text": "{{_local.selectedItem?.expire_date ?? ''}}"
},
{
"type": "basic",
@@ -214,7 +214,7 @@
"props": {
"className": "text-primary text-right font-medium"
},
"text": "$t:sirsoft-ecommerce.admin.excel_download.modal.download_history.download_count|count={{_local.selectedItem.download_count}}"
"text": "$t:sirsoft-ecommerce.admin.excel_download.modal.download_history.download_count|count={{_local.selectedItem?.download_count ?? 0}}"
}
]
}
@@ -259,10 +259,14 @@
},
"children": [
{
"id": "history_item",
"id": "history_item_{{index}}",
"type": "basic",
"name": "Div",
"iteration": "{{_local.selectedItem?.download_history ?? []}}",
"iteration": {
"source": "{{_local.selectedItem?.download_history ?? []}}",
"item_var": "item",
"index_var": "index"
},
"props": {
"className": "admin-card mb-3"
},
@@ -286,7 +290,7 @@
"name": "Icon",
"props": {
"name": "user",
"className": "w-4 h-4"
"className": "text-base"
}
}
]
@@ -329,7 +333,7 @@
"name": "Icon",
"props": {
"name": "calendar",
"className": "w-3 h-3"
"className": "text-xs"
}
},
{
@@ -0,0 +1,36 @@
feature: 엑셀 다운로드 이력 모달의 선택 항목 표시 가드
description: |
관리자 "엑셀 다운로드 관리" 화면의 다운로드 이력 모달은 목록에서 고른 항목(`_local.selectedItem`)의
파일 내용·분류·생성일·만료일·다운로드 횟수를 표시한다. 이 키는 부모 레이아웃이 `null` 로만 시드하고
행 클릭 시에만 채워지므로, 아직 아무 행도 고르지 않은 구간이 항상 존재한다.
수정 이력 (공개 이슈 #92 와 동일한 결함 클래스):
- 모든 표시식이 `{{_local.selectedItem.<field>}}` 형태로 옵셔널 체이닝이 없었고,
모달에 selectedItem 을 검사하는 `if` 가드도 없었다. 상태 배지의 조건식
(`selectedItem.status === '...'`)은 값 부재 구간에서 조건 평가가 실패해
경고 로그를 남기며 false 로 떨어지고 있었다.
- 모든 하위 접근에 `?.` 를, 표시식에 폴백(`?? ''`, 횟수는 `?? 0`)을 부여했다.
값이 채워진 뒤의 출력은 이전과 동일하므로 기능 변화는 없다.
- 브라우저 실측에서 별개 결함이 함께 드러났다 — "다운로드 기록" 목록의 iteration 이
문자열 형태로 선언되어 엔진이 source 를 읽지 못하고 매 렌더마다 예외로 떨어졌다.
목록이 통째로 비어 보이던 문제이며, 객체 형태(source/item_var/index_var)로 정정했다.
- 상태 배지 3종의 아이콘 이름이 Font Awesome Free 에 없는 값이라 빈 글리프로 렌더됐다.
axes:
selection_state: [unselected, selected] # 이력 행 미선택 / 선택
effects:
- history_modal_display_guarded # 값 부재 구간에서 조건 평가 실패·표시 공백이 발생하지 않음
- history_list_renders # 다운로드 기록 목록이 실제로 렌더된다 (iteration 선언 형태)
test_files:
- modules/_bundled/sirsoft-ecommerce/resources/js/__tests__/layouts/excel-download-history-modal-fallback.test.tsx
validation:
audit_rule: frontend-change-requires-e2e
browser_check: Chrome MCP # 관리자 화면 실측(정밀 점검 매트릭스 T9)으로 브라우저 검증 대체
note: |
레이아웃 JSON 은 헤더 주석을 가질 수 없어 `e2e:allow` 를 붙일 수 없다. 표시식의 옵셔널/폴백
유무는 정적 구조로 판정 가능하므로 레이아웃 정적 가드 테스트가 두 selection_state 를 모두
떠받치고, 실제 모달 열기 전/후 화면은 Chrome MCP 정밀 점검이 확인한다.
@@ -4,6 +4,15 @@
형식은 [Keep a Changelog](https://keepachangelog.com/ko/1.1.0/)를 따르며,
[Semantic Versioning](https://semver.org/lang/ko/)을 준수합니다.
## [1.1.1] - 2026-08-11
### Fixed
- 장바구니를 처음 열었을 때 "전체 선택" 옆 개수가 `(/27)` 처럼 선택 개수 없이 표시되던 문제를 수정했습니다. 이제 진입·새로고침·다른 화면에서 돌아온 경우 모두 `(27/27)` 로 바로 표시되며, 체크박스 상태 및 주문 요약의 "선택 상품 N / M개" 와 항상 같은 값을 가리킵니다. (#92 @koojunho 님께서 제보해주셨습니다.)
- 장바구니 옵션변경 모달의 재고 안내와 마이페이지 프로필의 입력 오류 메시지가, 표시할 값이 아직 준비되지 않은 순간에도 빈칸으로 남지 않도록 보완했습니다. 값이 준비된 뒤의 표시는 종전과 동일합니다.
- 마이페이지 게시판 알림 수신 설정(댓글·답글 등 4개 항목)의 체크 상태가 저장값과 어긋날 수 있던 가능성을 차단했습니다. 저장된 값이 어떤 형태든 화면의 체크 표시와 저장 결과가 항상 일치합니다.
- 장바구니 "전체 선택" 체크박스가 다크 모드에서 테두리 색을 따르지 않던 문제를 수정했습니다.
## [1.1.0] - 2026-08-10
### Added
@@ -10,7 +10,7 @@
* 회귀 차단: 버튼 액션이 (a) redirectToLoginWithReturn 핸들러이고 (b) 깨진
* navigate+{{_global.currentPath}} 패턴이 잔존하지 않는지 고정한다.
*
* @scenario entry_point:secret_post_login_button
* @scenario entry_point=secret_post_login_button
* @effects secret_button_redirect_not_empty,login_returns_to_original_path
*/
+1 -1
View File
@@ -1 +1 @@
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-scroll-snap-strictness:proximity;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:""}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-red-950:oklch(25.8% .092 26.042);--color-orange-50:oklch(98% .016 73.684);--color-orange-100:oklch(95.4% .038 75.164);--color-orange-200:oklch(90.1% .076 70.697);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-orange-600:oklch(64.6% .222 41.116);--color-orange-700:oklch(55.3% .195 38.402);--color-orange-800:oklch(47% .157 37.304);--color-orange-900:oklch(40.8% .123 38.172);--color-orange-950:oklch(26.6% .079 36.259);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-amber-950:oklch(27.9% .077 45.635);--color-yellow-50:oklch(98.7% .026 102.212);--color-yellow-100:oklch(97.3% .071 103.193);--color-yellow-200:oklch(94.5% .129 101.54);--color-yellow-300:oklch(90.5% .182 98.111);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-600:oklch(68.1% .162 75.834);--color-yellow-700:oklch(55.4% .135 66.442);--color-yellow-800:oklch(47.6% .114 61.907);--color-yellow-900:oklch(42.1% .095 57.708);--color-yellow-950:oklch(28.6% .066 53.813);--color-lime-50:oklch(98.6% .031 120.757);--color-lime-100:oklch(96.7% .067 122.328);--color-lime-200:oklch(93.8% .127 124.321);--color-lime-300:oklch(89.7% .196 126.665);--color-lime-400:oklch(84.1% .238 128.85);--color-lime-500:oklch(76.8% .233 130.85);--color-lime-600:oklch(64.8% .2 131.684);--color-lime-700:oklch(53.2% .157 131.589);--color-lime-800:oklch(45.3% .124 130.933);--color-lime-900:oklch(40.5% .101 131.063);--color-lime-950:oklch(27.4% .072 132.109);--color-green-50:oklch(98.2% .018 155.826);--color-green-100:oklch(96.2% .044 156.743);--color-green-200:oklch(92.5% .084 155.995);--color-green-300:oklch(87.1% .15 154.449);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-green-800:oklch(Line truncated
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-scroll-snap-strictness:proximity;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:""}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-red-950:oklch(25.8% .092 26.042);--color-orange-50:oklch(98% .016 73.684);--color-orange-100:oklch(95.4% .038 75.164);--color-orange-200:oklch(90.1% .076 70.697);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-orange-600:oklch(64.6% .222 41.116);--color-orange-700:oklch(55.3% .195 38.402);--color-orange-800:oklch(47% .157 37.304);--color-orange-900:oklch(40.8% .123 38.172);--color-orange-950:oklch(26.6% .079 36.259);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-amber-950:oklch(27.9% .077 45.635);--color-yellow-50:oklch(98.7% .026 102.212);--color-yellow-100:oklch(97.3% .071 103.193);--color-yellow-200:oklch(94.5% .129 101.54);--color-yellow-300:oklch(90.5% .182 98.111);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-600:oklch(68.1% .162 75.834);--color-yellow-700:oklch(55.4% .135 66.442);--color-yellow-800:oklch(47.6% .114 61.907);--color-yellow-900:oklch(42.1% .095 57.708);--color-yellow-950:oklch(28.6% .066 53.813);--color-lime-50:oklch(98.6% .031 120.757);--color-lime-100:oklch(96.7% .067 122.328);--color-lime-200:oklch(93.8% .127 124.321);--color-lime-300:oklch(89.7% .196 126.665);--color-lime-400:oklch(84.1% .238 128.85);--color-lime-500:oklch(76.8% .233 130.85);--color-lime-600:oklch(64.8% .2 131.684);--color-lime-700:oklch(53.2% .157 131.589);--color-lime-800:oklch(45.3% .124 130.933);--color-lime-900:oklch(40.5% .101 131.063);--color-lime-950:oklch(27.4% .072 132.109);--color-green-50:oklch(98.2% .018 155.826);--color-green-100:oklch(96.2% .044 156.743);--color-green-200:oklch(92.5% .084 155.995);--color-green-300:oklch(87.1% .15 154.449);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .1Line truncated
+14 -13
View File
@@ -1,23 +1,24 @@
var SirsoftBasic=(function(J,d,k,Jt){"use strict";function Dc(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const N=Dc(k),Lc=()=>window.G7Core,Q=k.forwardRef(({children:e,variant:t="primary",size:r="md",className:n="",...o},a)=>{const s="inline-flex items-center justify-center",l=Lc()?.style?.mergeClasses?.(s,n)??`${s} ${n}`;return d.jsx("button",{ref:a,className:l,...o,children:e})});Q.displayName="Button";const W=k.forwardRef(({children:e,className:t="",...r},n)=>d.jsx("div",{ref:n,className:t,...r,children:e})),R=({children:e,className:t="",...r})=>d.jsx("span",{className:t,...r,children:e}),fn=({children:e,className:t="",...r})=>d.jsx("svg",{className:t,...r,children:e}),xt=k.forwardRef(({label:e,error:t,className:r="",onChange:n,onKeyPress:o,value:a,defaultValue:s,type:l="text",checked:f,defaultChecked:h,...c},i)=>{const u=l==="radio"||l==="checkbox",g=k.useRef(!1),p=k.useRef(null);k.useImperativeHandle(i,()=>p.current);const[m,w]=k.useState(a??s??"");k.useEffect(()=>{!u&&!g.current&&a!==void 0&&w(a)},[a,u]);const C=k.useCallback(()=>{g.current=!0},[]),O=k.useCallback(y=>{if(g.current=!1,n){const T=y.target.value;w(T);const A=new Event("change",{bubbles:!0});Object.defineProperty(A,"target",{writable:!1,value:{value:T}}),Object.defineProperty(A,"currentTarget",{writable:!1,value:{value:T}}),n(A)}},[n]),v=k.useCallback(y=>{const T=y.target.value;w(T),!g.current&&n&&n(y)},[n]),E=k.useCallback(y=>{g.current||o&&o(y)},[o]),{loadingactions:I,formdata:_,...M}=c;if(u)return d.jsx("input",{ref:p,type:l,className:r,onChange:n,checked:f,defaultChecked:h,value:a,...M});const x=a!==void 0?{value:m}:{defaultValue:s};return d.jsx("input",{ref:p,type:l,className:r,onChange:v,onKeyPress:E,onCompositionStart:C,onCompositionEnd:O,...x,...M})});xt.displayName="Input";const ja=k.forwardRef(({accept:e,maxSize:t,onChange:r,onError:n,buttonText:o="Browse",placeholder:a="No file selected",className:s="",disabled:l,...f},h)=>{const c=k.useRef(null),i=h||c,[u,g]=k.useState(""),p={},m={};Object.entries(f).forEach(([v,E])=>{v.startsWith("data-editor-")||v==="id"||v==="onMouseMove"||v==="onMouseLeave"?p[v]=E:m[v]=E});const w=k.useCallback(()=>{!l&&i.current&&i.current.click()},[l,i]),C=k.useCallback(v=>{const E=v.target.files?.[0]||null;if(!E){g(""),r?.(null);return}if(t&&E.size>t*1024*1024){const I=`File size exceeds ${t}MB limit`;n?.(I),i.current&&(i.current.value=""),g("");return}g(E.name),r?.(E)},[t,r,n,i]),O=k.useCallback(v=>{v.stopPropagation(),i.current&&(i.current.value=""),g(""),r?.(null)},[r,i]);return d.jsxs(W,{className:`flex items-center gap-2 ${s}`,...p,children:[d.jsx(xt,{ref:i,type:"file",accept:e,onChange:C,disabled:l,className:"hidden",...m}),d.jsx(Q,{type:"button",onClick:w,disabled:l,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:o}),d.jsx(R,{className:"flex-1 text-sm text-gray-600 dark:text-gray-400 truncate",children:u||a}),u&&!l&&d.jsx(Q,{type:"button",onClick:O,className:"p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200","aria-label":"Clear file",children:d.jsx(fn,{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})});ja.displayName="FileInput";var Je=(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.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",eLine truncated
var SirsoftBasic=(function(ee,d,C,or){"use strict";function sd(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const N=sd(C),ld=()=>window.G7Core,J=C.forwardRef(({children:e,variant:t="primary",size:r="md",className:n="",...o},a)=>{const s="inline-flex items-center justify-center",l=ld()?.style?.mergeClasses?.(s,n)??`${s} ${n}`;return d.jsx("button",{ref:a,className:l,...o,children:e})});J.displayName="Button";const j=C.forwardRef(({children:e,className:t="",...r},n)=>d.jsx("div",{ref:n,className:t,...r,children:e})),te=({children:e,className:t="",...r})=>d.jsx("span",{className:t,...r,children:e}),En=({children:e,className:t="",...r})=>d.jsx("svg",{className:t,...r,children:e}),Et=C.forwardRef(({label:e,error:t,className:r="",onChange:n,onKeyPress:o,value:a,defaultValue:s,type:l="text",checked:f,defaultChecked:h,...c},i)=>{const u=l==="radio"||l==="checkbox",g=C.useRef(!1),p=C.useRef(null);C.useImperativeHandle(i,()=>p.current);const[m,x]=C.useState(a??s??"");C.useEffect(()=>{!u&&!g.current&&a!==void 0&&x(a)},[a,u]);const k=C.useCallback(()=>{g.current=!0},[]),M=C.useCallback(y=>{if(g.current=!1,n){const T=y.target.value;x(T);const I=new Event("change",{bubbles:!0});Object.defineProperty(I,"target",{writable:!1,value:{value:T}}),Object.defineProperty(I,"currentTarget",{writable:!1,value:{value:T}}),n(I)}},[n]),v=C.useCallback(y=>{const T=y.target.value;x(T),!g.current&&n&&n(y)},[n]),E=C.useCallback(y=>{g.current||o&&o(y)},[o]),{loadingactions:O,formdata:S,...A}=c;if(u)return d.jsx("input",{ref:p,type:l,className:r,onChange:n,checked:f,defaultChecked:h,value:a,...A});const w=a!==void 0?{value:m}:{defaultValue:s};return d.jsx("input",{ref:p,type:l,className:r,onChange:v,onKeyPress:E,onCompositionStart:k,onCompositionEnd:M,...w,...A})});Et.displayName="Input";const as=C.forwardRef(({accept:e,maxSize:t,onChange:r,onError:n,buttonText:o="Browse",placeholder:a="No file selected",className:s="",disabled:l,...f},h)=>{const c=C.useRef(null),i=h||c,[u,g]=C.useState(""),p={},m={};Object.entries(f).forEach(([v,E])=>{v.startsWith("data-editor-")||v==="id"||v==="onMouseMove"||v==="onMouseLeave"?p[v]=E:m[v]=E});const x=C.useCallback(()=>{!l&&i.current&&i.current.click()},[l,i]),k=C.useCallback(v=>{const E=v.target.files?.[0]||null;if(!E){g(""),r?.(null);return}if(t&&E.size>t*1024*1024){const O=`File size exceeds ${t}MB limit`;n?.(O),i.current&&(i.current.value=""),g("");return}g(E.name),r?.(E)},[t,r,n,i]),M=C.useCallback(v=>{v.stopPropagation(),i.current&&(i.current.value=""),g(""),r?.(null)},[r,i]);return d.jsxs(j,{className:`flex items-center gap-2 ${s}`,...p,children:[d.jsx(Et,{ref:i,type:"file",accept:e,onChange:k,disabled:l,className:"hidden",...m}),d.jsx(J,{type:"button",onClick:x,disabled:l,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:o}),d.jsx(te,{className:"flex-1 text-sm text-gray-600 dark:text-gray-400 truncate",children:u||a}),u&&!l&&d.jsx(J,{type:"button",onClick:M,className:"p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200","aria-label":"Clear file",children:d.jsx(En,{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})});as.displayName="FileInput";var rt=(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.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-tagLine truncated
w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors
${f==="auto"?"bg-gray-50 dark:bg-gray-700":""}
`,children:[d.jsx(de,{name:Je.Settings,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),d.jsx(R,{className:"flex-1 text-left text-gray-900 dark:text-white",children:r}),f==="auto"&&d.jsx(de,{name:Je.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),d.jsxs(Q,{onClick:()=>g("light"),className:`
`,children:[d.jsx(ge,{name:rt.Settings,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),d.jsx(te,{className:"flex-1 text-left text-gray-900 dark:text-white",children:r}),f==="auto"&&d.jsx(ge,{name:rt.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),d.jsxs(J,{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
${f==="light"?"bg-gray-50 dark:bg-gray-700":""}
`,children:[d.jsx(de,{name:Je.Sun,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),d.jsx(R,{className:"flex-1 text-left text-gray-900 dark:text-white",children:n}),f==="light"&&d.jsx(de,{name:Je.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),d.jsxs(Q,{onClick:()=>g("dark"),className:`
`,children:[d.jsx(ge,{name:rt.Sun,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),d.jsx(te,{className:"flex-1 text-left text-gray-900 dark:text-white",children:n}),f==="light"&&d.jsx(ge,{name:rt.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),d.jsxs(J,{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
${f==="dark"?"bg-gray-50 dark:bg-gray-700":""}
`,children:[d.jsx(de,{name:Je.Moon,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),d.jsx(R,{className:"flex-1 text-left text-gray-900 dark:text-white",children:o}),f==="dark"&&d.jsx(de,{name:Je.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]})]})})]})},Jc=Object.freeze(Object.defineProperty({__proto__:null,ThemeToggle:hn,default:hn},Symbol.toStringTag,{value:"Module"})),Qa={xs:"w-6 h-6 text-xs",sm:"w-8 h-8 text-sm",md:"w-10 h-10 text-base",lg:"w-12 h-12 text-lg",xl:"w-16 h-16 text-xl","2xl":"w-24 h-24 text-2xl","3xl":"w-32 h-32 text-3xl","4xl":"w-40 h-40 text-4xl","5xl":"w-48 h-48 text-5xl"},Rc="rounded-full overflow-hidden flex-shrink-0 border border-gray-200 dark:border-gray-700",ed="grayscale opacity-50",co={normal:"bg-gradient-to-br from-blue-500 to-purple-600",withdrawn:"bg-gray-300 dark:bg-gray-600",guest:"bg-gray-200 dark:bg-gray-700"},Ur=({author:e,name:t,avatar:r,size:n="md",className:o="",text:a,isWithdrawn:s=!1,isGuest:l=!1,id:f,editorAttrs:h})=>{const c=r??e?.avatar,i=a??t??e?.name??"?",u=s||e?.status==="withdrawn",g=l||e?.is_guest||!1,p=k.useMemo(()=>[Qa[n]||Qa.md,Rc,u?ed:"",o].filter(Boolean).join(" "),[n,u,o]),m=g?co.guest:u?co.withdrawn:co.normal,w=()=>g?d.jsx(W,{className:`w-full h-full flex items-center justify-center ${m}`,children:d.jsx(de,{name:"user",className:"text-gray-400 dark:text-gray-500"})}):u?d.jsx(W,{className:`w-full h-full flex items-center justify-center ${m}`,children:d.jsx(de,{name:"user",className:"text-gray-500 dark:text-gray-400"})}):d.jsx(W,{className:`w-full h-full flex items-center justify-center text-white font-semibold ${m}`,children:i.charAt(0).toUpperCase()});return d.jsx(W,{className:p,id:f,...h,children:c&&!g&&!u?d.jsx(Lt,{src:c,alt:i,className:"w-full h-full object-cover"}):w()})},td=Object.freeze(Object.defineProperty({__proto__:null,Avatar:Ur},Symbol.toStringTag,{value:"Module"})),rd=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 Ja(e,t){return t&&e&&typeof e.id=="string"&&e.id.length>0?{...e,id:`${e.id}__${t}`}:e}const pn=({slotId:e,className:t="",emptyContent:r,style:n,id:o,children:a})=>{const[s,l]=k.useState([]),[,f]=k.useState({}),h=k.useCallback(()=>{const p=window.__slotContextValue;if(p)return p;const m=window.G7Core;return m&&m.getSlotContext?.()||null},[]),c=k.useCallback(()=>{const p=h();p&&p.isEnabled&&l(p.getSlotComponents(e))},[e,h]);k.useEffect(()=>{const p=h();return!p||!p.isEnabled?void 0:(c(),p.subscribeToSlot(e,()=>{c(),f({})}))},[e,h,c]);const i=k.useCallback(()=>{const p=window.G7Core;return p?p.getDynamicRenderer?.():null},[]);if(s.length===0)return r?d.jsx(W,{className:t,style:n,id:o,children:r}):a?d.jsx(W,{className:t,style:n,id:o,children:a}):null;const u=i(),g=window.G7Core;return!u||!g?(rd.error("G7Core or DynamicRenderer not available"),null):d.jsxs(W,{className:t,style:n,id:o,children:[s.map(p=>{const{componentDef:m,dataContext:w,parentFormContext:C,getParentComponentContext:O,translationContext:v}=p,E=Ja(m,o);return d.jsx(u,{componentDef:E,dataContext:w,translationContext:v,registry:g.getComponentRegistry(),bindingEngine:g.getDataBindingEngine(),translationEngine:g.getTranslationEngine(),actionDispatcher:g.getActionDispatcher(),parentComponentContext:O?.(),parentFormContextProp:C,isRootRenderer:!1},E.id||`slot-${e}-${p.order}`)}),a]})},nd=Object.freeze(Object.defineProperty({__proto__:null,SlotContainer:pn,default:pn,scopeSlotChildDef:Ja},Symbol.toStringTag,{value:"Module"})),mn=({notifications:e=[],unreadCount:t=0,hasMore:r=!1,loading:n=!1,titleText:o="알림",emptyText:a="알림이 없습니다.",markAllReadText:s="모두 읽음",deleteAllText:l="모두 삭제",unreadOnlyText:f="안 읽은 알림만",unreadOnly:h=!1,onNotificationClick:c,onClose:i,onLoadMore:u,onMarkAllRead:g,onDeleteAll:p,onDelete:m,onUnreadOnlyToggle:w,dropdownAlign:C="right",className:O="",id:v,editorAttrs:E})=>{const[I,_]=k.useState(!1),M=k.useRef(null),x=k.useRef(null),y=k.useRef(null),T=k.useRef(null),A=k.useRef(new Set),P=k.useRef(u),D=k.useRef(r),L=k.useRef(n),U=k.useRef(e.length),S=k.useRef(-1);k.useEffect(()=>{P.current=u,D.current=r,L.current=n,U.current=e.length}),k.useEffect(()=>{if(!T.current||!y.current||!I)return;S.current=-1;const G=new IntersectionObserver(([Y])=>{Y.isIntersecting&&(L.current||!D.current||S.current!==U.current&&(S.current=U.current,P.current?.()))},{root:y.current,threshold:.1});return G.observe(T.current),()=>G.disconnect()},[I]),k.useEffect(()=>{if(!y.current||!I)return;const G=new IntersectionObserver(B=>{B.forEach(K=>{const j=K.target.getAttribute("data-notification-id"),H=K.target.getAttribute("data-unread")==="true";j&&H&&K.isIntersecting&&A.current.add(j)})},{root:y.current,threshold:.5});return y.current.querySelectorAll("[data-notification-id]").forEach(B=>G.observe(B)),()=>G.disconnect()},[I,e Line truncated
`+wt),Ge&&bn([P,D,L],Qt=>{wt=Hr(wt,Qt," ")}),E&&Le?E.createHTML(wt):wt},t.setConfig=function(){let ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};qe(ge),Me=!0},t.clearConfig=function(){Be=null,Me=!1},t.isValidAttribute=function(ge,z,Z){Be||qe({});const ce=$e(ge),Ye=$e(z);return Nc(ce,Ye,Z)},t.addHook=function(ge,z){typeof z=="function"&&zr(A[ge],z)},t.removeHook=function(ge,z){if(z!==void 0){const Z=hd(A[ge],z);return Z===-1?void 0:pd(A[ge],Z,1)[0]}return as(A[ge])},t.removeHooks=function(ge){A[ge]=[]},t.removeAllHooks=function(){A=gs()},t}var wo=hs();const Id=()=>{const e=()=>{const n=window.G7Core?.state?.get?.();return n&&(n.preferredCurrency||n.defaultCurrency)||""},[t,r]=k.useState(e);return k.useEffect(()=>{const n=window.G7Core?.state?.subscribe;if(r(e()),typeof n!="function")return;const o=n(a=>{r(a&&(a.preferredCurrency||a.defaultCurrency)||"")});return typeof o=="function"?o:void 0},[]),t},Dd=(e,t=!1)=>{window.G7Core?.dispatch?.({handler:"navigate",params:t?{path:e,mergeQuery:!0,query:{}}:{path:e}})},Ld=e=>{const t=Math.round(e*2)/2;return[1,2,3,4,5].map(r=>t>=r?"full":t>=r-.5?"half":"empty")},ps=({product:e,onClick:t,shopBase:r="/shop",preserveListQuery:n=!1,className:o="",id:a,editorAttrs:s})=>{const l=Id(),f=v=>{const E=`multi_currency_${v}`,I=e[E];if(I&&I[l])return I[l].formatted;const _=`${v}_formatted`;return e[_]},h=e.name_localized??(typeof e.name=="string"?e.name:"")??"",c=f("selling_price"),i=f("list_price"),u=e.discount_rate&&e.discount_rate>0,g=e.sales_status&&e.sales_status!=="on_sale",p=e.labels??[],m=v=>wo.sanitize(v,{ALLOWED_TAGS:["mark"],ALLOWED_ATTR:[]}),w=e.name_highlighted,C=e.description_highlighted??e.short_description,O=()=>{if(t)t(e.id);else{const v=r==="/"?"":r,E=e.product_code??e.id;Dd(`${v}/products/${E}`,n)}};return d.jsxs(Q,{onClick:O,className:`block w-full text-left group bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden hover:shadow-lg transition-shadow cursor-pointer ${o}`,id:a,...s,children:[d.jsxs(W,{className:"relative aspect-square overflow-hidden bg-gray-100 dark:bg-gray-700",children:[d.jsx(Lt,{src:e.thumbnail_url,alt:h,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-200",loading:"lazy"}),g&&d.jsx(W,{className:"absolute inset-0 bg-black/50 flex items-center justify-center",children:d.jsx(R,{className:`text-lg font-bold ${e.sales_status==="sold_out"?"text-red-300":e.sales_status==="suspended"?"text-amber-300":"text-blue-300"}`,style:{textShadow:"0 1px 4px rgba(0,0,0,0.6)"},children:e.sales_status_label??e.sales_status})}),u&&e.sales_status!=="sold_out"&&e.sales_status!=="suspended"&&d.jsxs(R,{className:"absolute top-2 left-2 px-2 py-1 bg-red-500 text-white text-xs font-bold rounded",children:[e.discount_rate,"%"]}),p.length>0&&d.jsx(W,{className:"absolute bottom-2 right-2 flex gap-1 flex-wrap justify-end",children:p.map((v,E)=>d.jsx(R,{className:"text-xs text-white font-medium px-1.5 py-0.5 rounded",style:{backgroundColor:v.color||"#6b7280"},children:v.name},E))})]}),d.jsxs(W,{className:"p-4",children:[d.jsxs(W,{className:"flex items-center gap-1.5 flex-wrap",children:[e.primary_category&&d.jsx(R,{className:"inline-block text-xs font-medium text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/30 px-2 py-0.5 rounded",children:e.primary_category}),e.brand_name&&d.jsx(R,{className:"text-xs text-gray-500 dark:text-gray-400",children:e.brand_name})]}),w?d.jsx(W,{className:"mt-1 font-medium text-gray-900 dark:text-white line-clamp-1 [&_mark]:bg-yellow-200 [&_mark]:dark:bg-yellow-500/40 [&_mark]:px-0.5 [&_mark]:rounded",dangerouslySetInnerHTML:{__html:m(w)}}):d.jsx(gn,{className:"mt-1 font-medium text-gray-900 dark:text-white line-clamp-1",children:h}),C&&d.jsx(W,{className:"mt-1 text-sm text-gray-600 dark:text-gray-400 line-clamp-2 [&_mark]:bg-yellow-200 [&_mark]:dark:bg-yellow-500/40 [&_mark]:px-0.5 [&_mark]:rounded",dangerouslySetInnerHTML:{__html:m(C)}}),d.jsxs(W,{className:"mt-1.5 flex items-center gap-1",children:[Ld(e.rating_avg??0).map((v,E)=>d.jsxs(R,{className:`text-xs ${v==="empty"?"text-gray-300 dark:text-gray-600":"text-yellow-400"}`,children:[v==="full"&&d.jsx("i",{className:"fa-solid fa-star"}),v==="half"&&d.jsx("i",{className:"fa-solid fa-star-half-stroke"}),v==="empty"&&d.jsx("i",{className:"fa-regular fa-star"})]},E)),d.jsx(R,{className:"text-xs text-gray-600 dark:text-gray-400 ml-0.5",children:(e.rating_avg??0).toFixed(1)}),d.jsxs(R,{className:"text-xs text-gray-400 dark:text-gray-500",children:["(",e.review_count??0,")"]})]}),d.jsxs(W,{className:"mt-2 flex items-baseline gap-2",children:[d.jsx(R,{className:"font-bold text-gray-900 dark:text-white",children:c}),i&&u&&d.jsx(R,{className:"text-sm text-gray-500 dark:text-gray-400 line-through",children:i})]})]})]})},Pd=Object.freeze(Object.defineProperty({__proto__:null,default:ps},Symbol.toStringTag,{value:"Module"})),$d={ALLOWED_TAGS:["svg","g","defs","title","desc","rect","circle","ellips Line truncated
`,children:[d.jsx(ge,{name:rt.Moon,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),d.jsx(te,{className:"flex-1 text-left text-gray-900 dark:text-white",children:o}),f==="dark"&&d.jsx(ge,{name:rt.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]})]})})]})},Sd=Object.freeze(Object.defineProperty({__proto__:null,ThemeToggle:Nn,default:Nn},Symbol.toStringTag,{value:"Module"})),hs={xs:"w-6 h-6 text-xs",sm:"w-8 h-8 text-sm",md:"w-10 h-10 text-base",lg:"w-12 h-12 text-lg",xl:"w-16 h-16 text-xl","2xl":"w-24 h-24 text-2xl","3xl":"w-32 h-32 text-3xl","4xl":"w-40 h-40 text-4xl","5xl":"w-48 h-48 text-5xl"},Ed="rounded-full overflow-hidden flex-shrink-0 border border-gray-200 dark:border-gray-700",Td="grayscale opacity-50",Eo={normal:"bg-gradient-to-br from-blue-500 to-purple-600",withdrawn:"bg-gray-300 dark:bg-gray-600",guest:"bg-gray-200 dark:bg-gray-700"},Jr=({author:e,name:t,avatar:r,size:n="md",className:o="",text:a,isWithdrawn:s=!1,isGuest:l=!1,id:f,editorAttrs:h})=>{const c=r??e?.avatar,i=a??t??e?.name??"?",u=s||e?.status==="withdrawn",g=l||e?.is_guest||!1,p=C.useMemo(()=>[hs[n]||hs.md,Ed,u?Td:"",o].filter(Boolean).join(" "),[n,u,o]),m=g?Eo.guest:u?Eo.withdrawn:Eo.normal,x=()=>g?d.jsx(j,{className:`w-full h-full flex items-center justify-center ${m}`,children:d.jsx(ge,{name:"user",className:"text-gray-400 dark:text-gray-500"})}):u?d.jsx(j,{className:`w-full h-full flex items-center justify-center ${m}`,children:d.jsx(ge,{name:"user",className:"text-gray-500 dark:text-gray-400"})}):d.jsx(j,{className:`w-full h-full flex items-center justify-center text-white font-semibold ${m}`,children:i.charAt(0).toUpperCase()});return d.jsx(j,{className:p,id:f,...h,children:c&&!g&&!u?d.jsx(zt,{src:c,alt:i,className:"w-full h-full object-cover"}):x()})},Nd=Object.freeze(Object.defineProperty({__proto__:null,Avatar:Jr},Symbol.toStringTag,{value:"Module"})),Ad=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 ps(e,t){return t&&e&&typeof e.id=="string"&&e.id.length>0?{...e,id:`${e.id}__${t}`}:e}const An=({slotId:e,className:t="",emptyContent:r,style:n,id:o,children:a})=>{const[s,l]=C.useState([]),[,f]=C.useState({}),h=C.useCallback(()=>{const p=window.__slotContextValue;if(p)return p;const m=window.G7Core;return m&&m.getSlotContext?.()||null},[]),c=C.useCallback(()=>{const p=h();p&&p.isEnabled&&l(p.getSlotComponents(e))},[e,h]);C.useEffect(()=>{const p=h();return!p||!p.isEnabled?void 0:(c(),p.subscribeToSlot(e,()=>{c(),f({})}))},[e,h,c]);const i=C.useCallback(()=>{const p=window.G7Core;return p?p.getDynamicRenderer?.():null},[]);if(s.length===0)return r?d.jsx(j,{className:t,style:n,id:o,children:r}):a?d.jsx(j,{className:t,style:n,id:o,children:a}):null;const u=i(),g=window.G7Core;return!u||!g?(Ad.error("G7Core or DynamicRenderer not available"),null):d.jsxs(j,{className:t,style:n,id:o,children:[s.map(p=>{const{componentDef:m,dataContext:x,parentFormContext:k,getParentComponentContext:M,translationContext:v}=p,E=ps(m,o);return d.jsx(u,{componentDef:E,dataContext:x,translationContext:v,registry:g.getComponentRegistry(),bindingEngine:g.getDataBindingEngine(),translationEngine:g.getTranslationEngine(),actionDispatcher:g.getActionDispatcher(),parentComponentContext:M?.(),parentFormContextProp:k,isRootRenderer:!1},E.id||`slot-${e}-${p.order}`)}),a]})},Od=Object.freeze(Object.defineProperty({__proto__:null,SlotContainer:An,default:An,scopeSlotChildDef:ps},Symbol.toStringTag,{value:"Module"})),On=({notifications:e=[],unreadCount:t=0,hasMore:r=!1,loading:n=!1,titleText:o="알림",emptyText:a="알림이 없습니다.",markAllReadText:s="모두 읽음",deleteAllText:l="모두 삭제",unreadOnlyText:f="안 읽은 알림만",unreadOnly:h=!1,onNotificationClick:c,onClose:i,onLoadMore:u,onMarkAllRead:g,onDeleteAll:p,onDelete:m,onUnreadOnlyToggle:x,dropdownAlign:k="right",className:M="",id:v,editorAttrs:E})=>{const[O,S]=C.useState(!1),A=C.useRef(null),w=C.useRef(null),y=C.useRef(null),T=C.useRef(null),I=C.useRef(new Set),F=C.useRef(u),D=C.useRef(r),L=C.useRef(n),$=C.useRef(e.length),_=C.useRef(-1);C.useEffect(()=>{F.current=u,D.current=r,L.current=n,$.current=e.length}),C.useEffect(()=>{if(!T.current||!y.current||!O)return;_.current=-1;const H=new IntersectionObserver(([Y])=>{Y.isIntersecting&&(L.current||!D.current||_.current!==$.current&&(_.current=$.current,F.current?.()))},{root:y.current,threshold:.1});return H.observe(T.current),()=>H.disconnect()},[O]),C.useEffect(()=>{if(!y.current||!O)return;const H=new IntersectionObserver(B=>{B.forEach(X=>{const G=X.target.getAttribute("data-notification-id"),W=X.target.getAttribute("data-unread")==="true";G&&W&&X.isIntersecting&&I.current.add(G)})},{root:y.current,threshold:.5});return y.current.querySelectorAll("[data-notification-id]").forEach(B=>H.observe(B)),()=>H.disconnect()},[O, Line truncated
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gd(e,t){return Ud(e)||zd(e,t)||jd(e,t)||Hd()}function jd(e,t){if(e){if(typeof e=="string")return ws(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ws(e,t):void 0}}const xs=Object.entries,ks=Object.setPrototypeOf,Bd=Object.isFrozen,Wd=Object.getPrototypeOf,Vd=Object.getOwnPropertyDescriptor;let ut=Object.freeze,ft=Object.seal,Ar=Object.create,Cs=typeof Reflect<"u"&&Reflect,To=Cs.apply,No=Cs.construct;ut||(ut=function(t){return t}),ft||(ft=function(t){return t}),To||(To=function(t,r){for(var n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];return t.apply(r,o)}),No||(No=function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return new t(...n)});const Or=tt(Array.prototype.forEach),Kd=tt(Array.prototype.lastIndexOf),_s=tt(Array.prototype.pop),Mr=tt(Array.prototype.push),Yd=tt(Array.prototype.splice),ar=Array.isArray,Rr=tt(String.prototype.toLowerCase),Ao=tt(String.prototype.toString),Ss=tt(String.prototype.match),en=tt(String.prototype.replace),Es=tt(String.prototype.indexOf),Xd=tt(String.prototype.trim),Zd=tt(Number.prototype.toString),qd=tt(Boolean.prototype.toString),Ts=typeof BigInt>"u"?null:tt(BigInt.prototype.toString),Ns=typeof Symbol>"u"?null:tt(Symbol.prototype.toString),at=tt(Object.prototype.hasOwnProperty),tn=tt(Object.prototype.toString),st=tt(RegExp.prototype.test),hr=Qd(TypeError);function tt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return To(e,t,n)}}function Qd(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return No(e,r)}}function Ge(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Rr;if(ks&&ks(e,null),!ar(t))return e;let n=t.length;for(;n--;){let o=t[n];if(typeof o=="string"){const a=r(o);a!==o&&(Bd(t)||(t[n]=a),o=a)}e[o]=!0}return e}function Jd(e){for(let t=0;t<e.length;t++)at(e,t)||(e[t]=null);return e}function yt(e){const t=Ar(null);for(const n of xs(e)){var r=Gd(n,2);const o=r[0],a=r[1];at(e,o)&&(ar(a)?t[o]=Jd(a):a&&typeof a=="object"&&a.constructor===Object?t[o]=yt(a):t[o]=a)}return t}function Rd(e){switch(typeof e){case"string":return e;case"number":return Zd(e);case"boolean":return qd(e);case"bigint":return Ts?Ts(e):"0";case"symbol":return Ns?Ns(e):"Symbol()";case"undefined":return tn(e);case"function":case"object":{if(e===null)return tn(e);const t=e,r=Zt(t,"toString");if(typeof r=="function"){const n=r(t);return typeof n=="string"?n:tn(n)}return tn(e)}default:return tn(e)}}function Zt(e,t){for(;e!==null;){const n=Vd(e,t);if(n){if(n.get)return tt(n.get);if(typeof n.value=="function")return tt(n.value)}e=Wd(e)}function r(){return null}return r}function eu(e){try{return st(e,""),!0}catch{return!1}}const As=ut(["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"]),Oo=ut(["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"]),Mo=ut(["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"]),tu=ut(["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","s Line truncated
`+Yt),re&&(Yt=mo(Yt)),S&&le?F(Yt):Yt},t.setConfig=function(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ts(R),Me=!0,Xe=ce,Fe=_e},t.clearConfig=function(){Zr=null,Me=!1,Xe=null,Fe=null,S=w,A=""},t.isValidAttribute=function(R,P,K){Zr||ts({});const q=Qe(R),de=Qe(P);return nd(q,de,K)},t.addHook=function(R,P){typeof P=="function"&&at(Y,R)&&Mr(Y[R],P)},t.removeHook=function(R,P){if(at(Y,R)){if(P!==void 0){const K=Kd(Y[R],P);return K===-1?void 0:Yd(Y[R],K,1)[0]}return _s(Y[R])}},t.removeHooks=function(R){at(Y,R)&&(Y[R]=[])},t.removeAllHooks=function(){Y=Fs()},t}var Do=$s();const mu=()=>{const e=()=>{const n=window.G7Core?.state?.get?.();return n&&(n.preferredCurrency||n.defaultCurrency)||""},[t,r]=C.useState(e);return C.useEffect(()=>{const n=window.G7Core?.state?.subscribe;if(r(e()),typeof n!="function")return;const o=n(a=>{r(a&&(a.preferredCurrency||a.defaultCurrency)||"")});return typeof o=="function"?o:void 0},[]),t},bu=(e,t=!1)=>{window.G7Core?.dispatch?.({handler:"navigate",params:t?{path:e,mergeQuery:!0,query:{}}:{path:e}})},yu=e=>{const t=Math.round(e*2)/2;return[1,2,3,4,5].map(r=>t>=r?"full":t>=r-.5?"half":"empty")},Us=({product:e,onClick:t,shopBase:r="/shop",preserveListQuery:n=!1,className:o="",id:a,editorAttrs:s})=>{const l=mu(),f=v=>{const E=`multi_currency_${v}`,O=e[E];if(O&&O[l])return O[l].formatted;const S=`${v}_formatted`;return e[S]},h=e.name_localized??(typeof e.name=="string"?e.name:"")??"",c=f("selling_price"),i=f("list_price"),u=e.discount_rate&&e.discount_rate>0,g=e.sales_status&&e.sales_status!=="on_sale",p=e.labels??[],m=v=>Do.sanitize(v,{ALLOWED_TAGS:["mark"],ALLOWED_ATTR:[]}),x=e.name_highlighted,k=e.description_highlighted??e.short_description,M=()=>{if(t)t(e.id);else{const v=r==="/"?"":r,E=e.product_code??e.id;bu(`${v}/products/${E}`,n)}};return d.jsxs(J,{onClick:M,className:`block w-full text-left group bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden hover:shadow-lg transition-shadow cursor-pointer ${o}`,id:a,...s,children:[d.jsxs(j,{className:"relative aspect-square overflow-hidden bg-gray-100 dark:bg-gray-700",children:[d.jsx(zt,{src:e.thumbnail_url,alt:h,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-200",loading:"lazy"}),g&&d.jsx(j,{className:"absolute inset-0 bg-black/50 flex items-center justify-center",children:d.jsx(te,{className:`text-lg font-bold ${e.sales_status==="sold_out"?"text-red-300":e.sales_status==="suspended"?"text-amber-300":"text-blue-300"}`,style:{textShadow:"0 1px 4px rgba(0,0,0,0.6)"},children:e.sales_status_label??e.sales_status})}),u&&e.sales_status!=="sold_out"&&e.sales_status!=="suspended"&&d.jsxs(te,{className:"absolute top-2 left-2 px-2 py-1 bg-red-500 text-white text-xs font-bold rounded",children:[e.discount_rate,"%"]}),p.length>0&&d.jsx(j,{className:"absolute bottom-2 right-2 flex gap-1 flex-wrap justify-end",children:p.map((v,E)=>d.jsx(te,{className:"text-xs text-white font-medium px-1.5 py-0.5 rounded",style:{backgroundColor:v.color||"#6b7280"},children:v.name},E))})]}),d.jsxs(j,{className:"p-4",children:[d.jsxs(j,{className:"flex items-center gap-1.5 flex-wrap",children:[e.primary_category&&d.jsx(te,{className:"inline-block text-xs font-medium text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/30 px-2 py-0.5 rounded",children:e.primary_category}),e.brand_name&&d.jsx(te,{className:"text-xs text-gray-500 dark:text-gray-400",children:e.brand_name})]}),x?d.jsx(j,{className:"mt-1 font-medium text-gray-900 dark:text-white line-clamp-1 [&_mark]:bg-yellow-200 [&_mark]:dark:bg-yellow-500/40 [&_mark]:px-0.5 [&_mark]:rounded",dangerouslySetInnerHTML:{__html:m(x)}}):d.jsx(Tn,{className:"mt-1 font-medium text-gray-900 dark:text-white line-clamp-1",children:h}),k&&d.jsx(j,{className:"mt-1 text-sm text-gray-600 dark:text-gray-400 line-clamp-2 [&_mark]:bg-yellow-200 [&_mark]:dark:bg-yellow-500/40 [&_mark]:px-0.5 [&_mark]:rounded",dangerouslySetInnerHTML:{__html:m(k)}}),d.jsxs(j,{className:"mt-1.5 flex items-center gap-1",children:[yu(e.rating_avg??0).map((v,E)=>d.jsxs(te,{className:`text-xs ${v==="empty"?"text-gray-300 dark:text-gray-600":"text-yellow-400"}`,children:[v==="full"&&d.jsx("i",{className:"fa-solid fa-star"}),v==="half"&&d.jsx("i",{className:"fa-solid fa-star-half-stroke"}),v==="empty"&&d.jsx("i",{className:"fa-regular fa-star"})]},E)),d.jsx(te,{className:"text-xs text-gray-600 dark:text-gray-400 ml-0.5",children:(e.rating_avg??0).toFixed(1)}),d.jsxs(te,{className:"text-xs text-gray-400 dark:text-gray-500",children:["(",e.review_count??0,")"]})]}),d.jsxs(j,{className:"mt-2 flex items-baseline gap-2",children:[d.jsx(te,{className:"font-bold text-gray-900 dark:text-white",children:c}),i&&u&&d.jsx(te,{className:"text-sm text-gray-500 dark:text-gray-400 line-through",children:i})]})]})]})},vu=Object.freeze(Object.defineProperty({__proto__:null,default:Us},Symbol.toStringTag,{value:"Module"})),wu={ALLOWED_TAGS:["svg","g","defs","title Line truncated
inline-flex items-center rounded-full border transition-colors
${f[o]}
${p?`${u.activeColor} border-transparent`:"border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"}
`,title:Ml(u.labelKey),children:[d.jsx(R,{className:h[o],children:u.emoji}),d.jsx(R,{children:Ml(u.labelKey)}),g>0&&d.jsx(R,{className:"font-medium",children:g})]},u.type)})})},Yf=Object.freeze(Object.defineProperty({__proto__:null,default:Ol},Symbol.toStringTag,{value:"Module"})),Mn=window.G7Core?.createLogger?.("Comp:RichTextEditor")??{log:(...e)=>console.log("[Comp:RichTextEditor]",...e),warn:(...e)=>console.warn("[Comp:RichTextEditor]",...e),error:(...e)=>console.error("[Comp:RichTextEditor]",...e)},St=(e,t)=>window.G7Core?.t?.(e,t)??e,Il=({name:e,initialValue:t="",placeholder:r,onChange:n,imageUploadUrl:o="/api/upload/image",minHeight:a="300px",disabled:s=!1,className:l="",id:f,editorAttrs:h})=>{const c=k.useRef(null),[i,u]=k.useState(t),[g,p]=k.useState(!1),[m,w]=k.useState(!1),[C,O]=k.useState("");k.useEffect(()=>{c.current&&!c.current.innerHTML&&(c.current.innerHTML=t)},[t]),k.useEffect(()=>{n&&n(i)},[i,n]);const v=T=>{Mn.log("Apply format:",T)},E=async T=>{const A=new FormData;A.append("file",T);try{const P=await fetch(o,{method:"POST",body:A,credentials:"include"});if(!P.ok)throw new Error("업로드 실패");const D=await P.json();Mn.log("Image uploaded:",D.url)}catch(P){Mn.error("이미지 업로드 오류:",P)}},I=T=>{const A=T.target.files?.[0];A&&E(A)},_=()=>{C&&(Mn.log("Insert link:",C),w(!1),O(""))},M=[{format:"bold",icon:"B",title:St("editor.toolbar.bold")},{format:"italic",icon:"I",title:St("editor.toolbar.italic")},{format:"underline",icon:"U",title:St("editor.toolbar.underline")},{format:"strike",icon:"S",title:St("editor.toolbar.strike")},{format:"code",icon:"</>",title:St("editor.toolbar.code")}],x=[{format:"h1",label:"H1"},{format:"h2",label:"H2"},{format:"h3",label:"H3"}],y=[{format:"bulletList",icon:"•",title:St("editor.toolbar.bullet_list")},{format:"orderedList",icon:"1.",title:St("editor.toolbar.ordered_list")},{format:"blockquote",icon:"❝",title:St("editor.toolbar.blockquote")}];return d.jsxs(W,{className:`border border-gray-300 dark:border-gray-600 rounded-lg overflow-hidden ${l}`,id:f,...h,children:[d.jsxs(W,{className:"flex flex-wrap items-center gap-1 p-2 bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:[d.jsx(W,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:M.map(T=>d.jsx(Q,{type:"button",onClick:()=>v(T.format),disabled:s,className:"w-8 h-8 flex items-center justify-center text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50",title:T.title,children:T.icon},T.format))}),d.jsx(W,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:x.map(T=>d.jsx(Q,{type:"button",onClick:()=>v(T.format),disabled:s,className:"px-2 h-8 text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50",children:T.label},T.format))}),d.jsx(W,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:y.map(T=>d.jsx(Q,{type:"button",onClick:()=>v(T.format),disabled:s,className:"w-8 h-8 flex items-center justify-center text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50",title:T.title,children:T.icon},T.format))}),d.jsxs(W,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:[d.jsx(Q,{type:"button",onClick:()=>w(!0),disabled:s,className:"w-8 h-8 flex items-center justify-center text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50",title:St("editor.toolbar.link"),children:"🔗"}),d.jsxs(yr,{className:"w-8 h-8 flex items-center justify-center text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded cursor-pointer",children:["🖼",d.jsx(xt,{type:"file",accept:"image/*",onChange:I,disabled:s,className:"hidden"})]})]}),d.jsxs(Q,{type:"button",onClick:()=>p(!g),disabled:s,className:`px-2 h-8 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50 ${g?"bg-gray-200 dark:bg-gray-700":""}`,children:["</>",St("editor.toolbar.code_view")]})]}),g?d.jsx(no,{value:i,onChange:T=>u(T.target.value),placeholder:r,disabled:s,className:"w-full p-4 bg-gray-900 text-gray-100 font-mono text-sm focus:outline-none resize-none",style:{minHeight:a}}):d.jsx(W,{ref:c,contentEditable:!s,onInput:T=>u(T.currentTarget.innerHTML),className:"p-4 bg-white dark:bg-gray-900 text-gray-900 dark:text-white focus:outline-none prose dark:prose-invert max-w-none",style:{minHeight:a},"data-placeholder":r}),d.jsx(xt,{type:"hidden",name:e,value:i}),m&&d.jsx(W,{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:d.jsxs(W,{className:"bg-white dark:bg-gray-800 rounded-lg p-6 w-96",children:[d.jsx(gn,{className:"text-lg font-medium text-gray-900 dark:text-white mb-4",children:St("editor Line truncated
`,title:ti(u.labelKey),children:[d.jsx(te,{className:h[o],children:u.emoji}),d.jsx(te,{children:ti(u.labelKey)}),g>0&&d.jsx(te,{className:"font-medium",children:g})]},u.type)})})},Pg=Object.freeze(Object.defineProperty({__proto__:null,default:ri},Symbol.toStringTag,{value:"Module"})),jn=window.G7Core?.createLogger?.("Comp:RichTextEditor")??{log:(...e)=>console.log("[Comp:RichTextEditor]",...e),warn:(...e)=>console.warn("[Comp:RichTextEditor]",...e),error:(...e)=>console.error("[Comp:RichTextEditor]",...e)},Mt=(e,t)=>window.G7Core?.t?.(e,t)??e,ni=({name:e,initialValue:t="",placeholder:r,onChange:n,imageUploadUrl:o="/api/upload/image",minHeight:a="300px",disabled:s=!1,className:l="",id:f,editorAttrs:h})=>{const c=C.useRef(null),[i,u]=C.useState(t),[g,p]=C.useState(!1),[m,x]=C.useState(!1),[k,M]=C.useState("");C.useEffect(()=>{c.current&&!c.current.innerHTML&&(c.current.innerHTML=t)},[t]),C.useEffect(()=>{n&&n(i)},[i,n]);const v=T=>{jn.log("Apply format:",T)},E=async T=>{const I=new FormData;I.append("file",T);try{const F=await fetch(o,{method:"POST",body:I,credentials:"include"});if(!F.ok)throw new Error("업로드 실패");const D=await F.json();jn.log("Image uploaded:",D.url)}catch(F){jn.error("이미지 업로드 오류:",F)}},O=T=>{const I=T.target.files?.[0];I&&E(I)},S=()=>{k&&(jn.log("Insert link:",k),x(!1),M(""))},A=[{format:"bold",icon:"B",title:Mt("editor.toolbar.bold")},{format:"italic",icon:"I",title:Mt("editor.toolbar.italic")},{format:"underline",icon:"U",title:Mt("editor.toolbar.underline")},{format:"strike",icon:"S",title:Mt("editor.toolbar.strike")},{format:"code",icon:"</>",title:Mt("editor.toolbar.code")}],w=[{format:"h1",label:"H1"},{format:"h2",label:"H2"},{format:"h3",label:"H3"}],y=[{format:"bulletList",icon:"•",title:Mt("editor.toolbar.bullet_list")},{format:"orderedList",icon:"1.",title:Mt("editor.toolbar.ordered_list")},{format:"blockquote",icon:"❝",title:Mt("editor.toolbar.blockquote")}];return d.jsxs(j,{className:`border border-gray-300 dark:border-gray-600 rounded-lg overflow-hidden ${l}`,id:f,...h,children:[d.jsxs(j,{className:"flex flex-wrap items-center gap-1 p-2 bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:[d.jsx(j,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:A.map(T=>d.jsx(J,{type:"button",onClick:()=>v(T.format),disabled:s,className:"w-8 h-8 flex items-center justify-center text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50",title:T.title,children:T.icon},T.format))}),d.jsx(j,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:w.map(T=>d.jsx(J,{type:"button",onClick:()=>v(T.format),disabled:s,className:"px-2 h-8 text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50",children:T.label},T.format))}),d.jsx(j,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:y.map(T=>d.jsx(J,{type:"button",onClick:()=>v(T.format),disabled:s,className:"w-8 h-8 flex items-center justify-center text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50",title:T.title,children:T.icon},T.format))}),d.jsxs(j,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:[d.jsx(J,{type:"button",onClick:()=>x(!0),disabled:s,className:"w-8 h-8 flex items-center justify-center text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50",title:Mt("editor.toolbar.link"),children:"🔗"}),d.jsxs(Nr,{className:"w-8 h-8 flex items-center justify-center text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded cursor-pointer",children:["🖼",d.jsx(Et,{type:"file",accept:"image/*",onChange:O,disabled:s,className:"hidden"})]})]}),d.jsxs(J,{type:"button",onClick:()=>p(!g),disabled:s,className:`px-2 h-8 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50 ${g?"bg-gray-200 dark:bg-gray-700":""}`,children:["</>",Mt("editor.toolbar.code_view")]})]}),g?d.jsx(wo,{value:i,onChange:T=>u(T.target.value),placeholder:r,disabled:s,className:"w-full p-4 bg-gray-900 text-gray-100 font-mono text-sm focus:outline-none resize-none",style:{minHeight:a}}):d.jsx(j,{ref:c,contentEditable:!s,onInput:T=>u(T.currentTarget.innerHTML),className:"p-4 bg-white dark:bg-gray-900 text-gray-900 dark:text-white focus:outline-none prose dark:prose-invert max-w-none",style:{minHeight:a},"data-placeholder":r}),d.jsx(Et,{type:"hidden",name:e,value:i}),m&&d.jsx(j,{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:d.jsxs(j,{className:"bg-white dark:bg-gray-800 rounded-lg p-6 w-96",children:[d.jsx(Tn,{className:"text-lg font-medium text-gray-900 dark:text-white mb-4",children:Mt("edi Line truncated
whitespace-pre-wrap
text-gray-900 dark:text-gray-100
font-sans
${n}
`.trim().replace(/\s+/g," ");return d.jsx(W,{className:i,id:a,...s,children:l})}const f={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"]},h=k.useMemo(()=>{const i=o?{...f,...o,FORBID_TAGS:[...f.FORBID_TAGS,...o.FORBID_TAGS||[]],FORBID_ATTR:[...f.FORBID_ATTR,...o.FORBID_ATTR||[]]}:f;return wo.sanitize(l,i).replace(/<a\s+([^>]*?)href=["']([^"']+)["']([^>]*?)>/gi,(g,p,m,w)=>(m.startsWith("http://")||m.startsWith("https://"))&&!g.includes("rel=")?`<a ${p}href="${m}"${w} rel="noopener noreferrer">`:g)},[l,o]),c=`
`.trim().replace(/\s+/g," ");return d.jsx(j,{className:i,id:a,...s,children:l})}const f={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"]},h=C.useMemo(()=>{const i=o?{...f,...o,FORBID_TAGS:[...f.FORBID_TAGS,...o.FORBID_TAGS||[]],FORBID_ATTR:[...f.FORBID_ATTR,...o.FORBID_ATTR||[]]}:f;return Do.sanitize(l,i).replace(/<a\s+([^>]*?)href=["']([^"']+)["']([^>]*?)>/gi,(g,p,m,x)=>(m.startsWith("http://")||m.startsWith("https://"))&&!g.includes("rel=")?`<a ${p}href="${m}"${x} rel="noopener noreferrer">`:g)},[l,o]),c=`
prose dark:prose-invert max-w-none
prose-p:my-2
prose-headings:font-bold prose-headings:mt-6 prose-headings:mb-4
@@ -39,7 +40,7 @@ var SirsoftBasic=(function(J,d,k,Jt){"use strict";function Dc(e){const t=Object.
[&_tr:hover]:bg-gray-50 dark:[&_tr:hover]:bg-gray-700/50
after:content-[''] after:block after:clear-both
${n}
`.trim().replace(/\s+/g," ");return d.jsx(W,{id:a,className:c,dangerouslySetInnerHTML:{__html:h},...s})},qf=Object.freeze(Object.defineProperty({__proto__:null,HtmlContent:qo},Symbol.toStringTag,{value:"Module"})),Zo=()=>window.G7Core,Qo=(e,t)=>Zo()?.t?.(e,t)??e,Dl=({content:e="",onChange:t,isHtml:r=!1,onIsHtmlChange:n,rows:o=15,placeholder:a="",label:s,showHtmlModeToggle:l=!0,contentClassName:f="",purifyConfig:h,className:c="",name:i="content",htmlFieldName:u="content_mode",readOnly:g=!1,id:p,editorAttrs:m})=>{const[w,C]=k.useState(r),[O,v]=k.useState(e),[E,I]=k.useState(!1);k.useEffect(()=>{C(r)},[r]),k.useEffect(()=>{v(e)},[e]);const _=k.useCallback(y=>{const T=y.target.value;if(v(T),t){const A=Zo()?.createChangeEvent?.({value:T,name:i,type:"textarea"})??{target:{name:i,value:T}};t(A)}},[t,i]),M=k.useCallback(y=>{const T=y.target.checked;if(C(T),T||I(!1),n){const A=Zo()?.createChangeEvent?.({checked:T,name:u,type:"checkbox"})??{target:{name:u,checked:T}};n(A)}},[n,u]),x=k.useCallback(()=>{I(y=>!y)},[]);return d.jsxs(W,{className:`space-y-2 ${c}`,id:p,...m,children:[d.jsxs(W,{className:"flex items-center justify-between",children:[s&&d.jsx(yr,{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:s}),d.jsxs(W,{className:"flex items-center gap-3",children:[w&&!g&&d.jsx(Q,{type:"button",onClick:x,className:`px-3 py-1.5 text-xs font-bold rounded-lg focus:outline-none focus:ring-2 ${E?"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:Qo(E?"common.preview_off":"common.preview")}),l&&d.jsxs(yr,{className:"flex items-center gap-2 p-2 cursor-pointer",children:[d.jsx(xt,{type:"checkbox",name:u,checked:w,onChange:M,disabled:g,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"}),d.jsx(W,{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:Qo("common.html_mode")})]})]})]}),!E&&d.jsx(no,{name:i,value:O,onChange:_,placeholder:a,rows:o,readOnly:g,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 ${w?"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"}`}),E&&d.jsx(W,{className:"p-4 bg-gray-50 dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 min-h-[400px]",children:d.jsx(qo,{content:O,isHtml:!0,className:f||"prose dark:prose-invert max-w-none text-gray-900 dark:text-gray-100",purifyConfig:h})})]})},Zf=Object.freeze(Object.defineProperty({__proto__:null,HtmlEditor:Dl},Symbol.toStringTag,{value:"Module"})),Ll=e=>window.G7Core?.t?.(e)??e,Jo=({maxHeight:e=500,expandText:t,collapseText:r,className:n="",children:o,id:a,editorAttrs:s})=>{const[l,f]=k.useState(!1),[h,c]=k.useState(!1),i=k.useRef(null),u=k.useCallback(()=>{if(i.current){const w=i.current.scrollHeight;c(w>e)}},[e]);k.useEffect(()=>{u();const w=i.current;if(!w)return;const C=w.querySelectorAll("img");C.forEach(v=>{v.complete||v.addEventListener("load",u)});let O=null;return typeof ResizeObserver<"u"&&(O=new ResizeObserver(u),O.observe(w)),()=>{C.forEach(v=>{v.removeEventListener("load",u)}),O?.disconnect()}},[u,o]);const g=()=>{f(w=>!w)},p=t||Ll("sirsoft-ecommerce.shop.product.expand_detail"),m=r||Ll("sirsoft-ecommerce.shop.product.collapse_detail");return d.jsxs(W,{className:n,id:a,...s,children:[d.jsxs(W,{className:"relative",children:[d.jsx(W,{ref:i,className:!l&&h?"overflow-hidden transition-[max-height] duration-300 ease-in-out":"transition-[max-height] duration-300 ease-in-out",style:!l&&h?{maxHeight:`${e}px`}:void 0,children:o}),!l&&h&&d.jsx(W,{className:"absolute bottom-0 left-0 right-0 h-24 bg-gradient-to-t from-white dark:from-gray-900 to-transparent pointer-events-none"})]}),h&&d.jsxs(Q,{type:"button",onClick:g,className:"flex items-center justify-center w-full py-3.5 bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors cursor-pointer gap-1.5",children:[d.jsx(R,{className:"text-sm font-semibold text-gray-600 dark:text-gray-400",children:l?m:p}),d.jsx(de,{name:l?"chevron-up":"chevron-down",size:"sm"})]})]})},Qf=Object.freeze(Object.defineProperty({__proto__:null,ExpandableContent:Jo,default:Jo},Symbol.toStringTag,{value:"Module"})),Jf=(e,t)=>window.G7Core?.t?.(e,t)??e, Line truncated
`.trim().replace(/\s+/g," ");return d.jsx(j,{id:a,className:c,dangerouslySetInnerHTML:{__html:h},...s})},Lg=Object.freeze(Object.defineProperty({__proto__:null,HtmlContent:ca},Symbol.toStringTag,{value:"Module"})),da=()=>window.G7Core,ua=(e,t)=>da()?.t?.(e,t)??e,oi=({content:e="",onChange:t,isHtml:r=!1,onIsHtmlChange:n,rows:o=15,placeholder:a="",label:s,showHtmlModeToggle:l=!0,contentClassName:f="",purifyConfig:h,className:c="",name:i="content",htmlFieldName:u="content_mode",readOnly:g=!1,id:p,editorAttrs:m})=>{const[x,k]=C.useState(r),[M,v]=C.useState(e),[E,O]=C.useState(!1);C.useEffect(()=>{k(r)},[r]),C.useEffect(()=>{v(e)},[e]);const S=C.useCallback(y=>{const T=y.target.value;if(v(T),t){const I=da()?.createChangeEvent?.({value:T,name:i,type:"textarea"})??{target:{name:i,value:T}};t(I)}},[t,i]),A=C.useCallback(y=>{const T=y.target.checked;if(k(T),T||O(!1),n){const I=da()?.createChangeEvent?.({checked:T,name:u,type:"checkbox"})??{target:{name:u,checked:T}};n(I)}},[n,u]),w=C.useCallback(()=>{O(y=>!y)},[]);return d.jsxs(j,{className:`space-y-2 ${c}`,id:p,...m,children:[d.jsxs(j,{className:"flex items-center justify-between",children:[s&&d.jsx(Nr,{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:s}),d.jsxs(j,{className:"flex items-center gap-3",children:[x&&!g&&d.jsx(J,{type:"button",onClick:w,className:`px-3 py-1.5 text-xs font-bold rounded-lg focus:outline-none focus:ring-2 ${E?"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:ua(E?"common.preview_off":"common.preview")}),l&&d.jsxs(Nr,{className:"flex items-center gap-2 p-2 cursor-pointer",children:[d.jsx(Et,{type:"checkbox",name:u,checked:x,onChange:A,disabled:g,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"}),d.jsx(j,{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:ua("common.html_mode")})]})]})]}),!E&&d.jsx(wo,{name:i,value:M,onChange:S,placeholder:a,rows:o,readOnly:g,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 ${x?"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"}`}),E&&d.jsx(j,{className:"p-4 bg-gray-50 dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 min-h-[400px]",children:d.jsx(ca,{content:M,isHtml:!0,className:f||"prose dark:prose-invert max-w-none text-gray-900 dark:text-gray-100",purifyConfig:h})})]})},Fg=Object.freeze(Object.defineProperty({__proto__:null,HtmlEditor:oi},Symbol.toStringTag,{value:"Module"})),ai=e=>window.G7Core?.t?.(e)??e,fa=({maxHeight:e=500,expandText:t,collapseText:r,className:n="",children:o,id:a,editorAttrs:s})=>{const[l,f]=C.useState(!1),[h,c]=C.useState(!1),i=C.useRef(null),u=C.useCallback(()=>{if(i.current){const x=i.current.scrollHeight;c(x>e)}},[e]);C.useEffect(()=>{u();const x=i.current;if(!x)return;const k=x.querySelectorAll("img");k.forEach(v=>{v.complete||v.addEventListener("load",u)});let M=null;return typeof ResizeObserver<"u"&&(M=new ResizeObserver(u),M.observe(x)),()=>{k.forEach(v=>{v.removeEventListener("load",u)}),M?.disconnect()}},[u,o]);const g=()=>{f(x=>!x)},p=t||ai("sirsoft-ecommerce.shop.product.expand_detail"),m=r||ai("sirsoft-ecommerce.shop.product.collapse_detail");return d.jsxs(j,{className:n,id:a,...s,children:[d.jsxs(j,{className:"relative",children:[d.jsx(j,{ref:i,className:!l&&h?"overflow-hidden transition-[max-height] duration-300 ease-in-out":"transition-[max-height] duration-300 ease-in-out",style:!l&&h?{maxHeight:`${e}px`}:void 0,children:o}),!l&&h&&d.jsx(j,{className:"absolute bottom-0 left-0 right-0 h-24 bg-gradient-to-t from-white dark:from-gray-900 to-transparent pointer-events-none"})]}),h&&d.jsxs(J,{type:"button",onClick:g,className:"flex items-center justify-center w-full py-3.5 bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors cursor-pointer gap-1.5",children:[d.jsx(te,{className:"text-sm font-semibold text-gray-600 dark:text-gray-400",children:l?m:p}),d.jsx(ge,{name:l?"chevron-up":"chevron-down",size:"sm"})]})]})},$g=Object.freeze(Object.defineProperty({__proto__:null,ExpandableContent:fa,default:fa},Symbol.toStringTag,{value:"Module"})),Ug=(e,t)=>window.G7Core?.t?.(e,t)??e Line truncated
let scriptImported = false
self.addEventListener('message', async (e) => {
const { file, id, imageCompressionLibUrl, options } = e.data
@@ -58,20 +59,20 @@ self.addEventListener('message', async (e) => {
self.postMessage({ error: e.message + '\\n' + e.stack, id })
}
})
`;let oa;function cg(e,t){return new Promise(((r,n)=>{oa||(oa=(function(s){const l=[];return l.push(s),URL.createObjectURL(new Blob(l))})(ig));const o=new Worker(oa);o.addEventListener("message",(function(s){if(t.signal&&t.signal.aborted)o.terminate();else if(s.data.progress===void 0){if(s.data.error)return n(new Error(s.data.error)),void o.terminate();r(s.data.file),o.terminate()}else t.onProgress(s.data.progress)})),o.addEventListener("error",n),t.signal&&t.signal.addEventListener("abort",(()=>{n(t.signal.reason),o.terminate()})),o.postMessage({file:e,imageCompressionLibUrl:t.libURL,options:{...t,onProgress:void 0,signal:void 0}})}))}function ct(e,t){return new Promise((function(r,n){let o,a,s,l,f,h;if(o={...t},s=0,{onProgress:l}=o,o.maxSizeMB=o.maxSizeMB||Number.POSITIVE_INFINITY,f=typeof o.useWebWorker!="boolean"||o.useWebWorker,delete o.useWebWorker,o.onProgress=g=>{s=g,typeof l=="function"&&l(s)},!(e instanceof Blob||e instanceof lg))return n(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(e.type))return n(new Error("The file given is not an image"));if(h=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,!f||typeof Worker!="function"||h)return Xl(e,o).then(function(g){try{return a=g,u.call(this)}catch(p){return n(p)}}.bind(this),n);var c=function(){try{return u.call(this)}catch(g){return n(g)}}.bind(this),i=function(g){try{return Xl(e,o).then((function(p){try{return a=p,c()}catch(m){return n(m)}}),n)}catch(p){return n(p)}};try{return o.libURL=o.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",cg(e,o).then((function(g){try{return a=g,c()}catch{return i()}}),i)}catch{i()}function u(){try{a.name=e.name,a.lastModified=e.lastModified}catch{}try{o.preserveExif&&e.type==="image/jpeg"&&(!o.fileType||o.fileType&&o.fileType===e.type)&&(a=Fl(e,a))}catch{}return r(a)}}))}ct.getDataUrlFromFile=Gl,ct.getFilefromDataUrl=na,ct.loadImage=jl,ct.drawImageInCanvas=Wl,ct.drawFileInCanvas=Pn,ct.canvasToFile=$n,ct.getExifOrientation=Vl,ct.handleMaxWidthOrHeight=Kl,ct.followExifOrientation=Yl,ct.cleanupCanvasMemory=Kt,ct.isAutoOrientationInBrowser=Nr,ct.approximateBelowMaximumCanvasSizeOfBrowser=Bl,ct.copyExifWithoutOrientation=Fl,ct.getBrowserName=fr,ct.version="2.0.2";const dg=window.G7Core,Fn=e=>{const t=["B","KB","MB","GB"];let r=0,n=e;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(2)} ${t[r]}`},ql=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 r=Object.values(t.response.data.errors)[0];if(Array.isArray(r)&&r[0])return r[0]}if(t.message)return t.message}return e instanceof Error?e.message:"업로드 실패"},Zl=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",Re=(e,t)=>dg?.t?.(e,t)??e,gr=window.G7Core;function Ql(e){const{attachmentableType:t,attachmentableId:r,collection:n,maxFiles:o,maxSize:a,maxConcurrentUploads:s,accept:l,imageCompression:f,roleIds:h,autoUpload:c,initialFiles:i,endpoints:u,onFilesChange:g,onUploadComplete:p,onUploadError:m,onRemove:w,onReorder:C,uploadTriggerEvent:O,confirmBeforeRemove:v,uploadParams:E}=e,[I,_]=k.useState(i),[M,x]=k.useState([]),[y,T]=k.useState(!1),A=k.useRef(null),P=k.useRef(0),D=k.useRef(new Set),L=k.useRef(new Map),[U,S]=k.useState(!1),[b,F]=k.useState(null),[$,G]=k.useState(!1),Y=k.useRef(!1),[B,K]=k.useState([]),j=k.useRef(i),[H,q]=k.useState(!1),[ue,te]=k.useState(0),fe=k.useRef(0),[ee,ke]=k.useState(new Map),me=k.useRef(new Map);k.useEffect(()=>{g?.(M)},[M,g]);const Ge=k.useMemo(()=>{const X=j.current;return X===i?X:X.length!==i.length?(j.current=i,i):X.length===0&&i.length===0?X:i.some((ie,le)=>ie.id!==X[le]?.id)?(j.current=i,i):X},[i]);k.useEffect(()=>{if(Y.current)return;const X=Ge.filter(le=>!D.current.has(le.id)&&(!le.hash||!D.current.has(le.hash))),se=new Set(X.map(le=>le.id)),ie=Array.from(L.current.values()).filter(le=>!se.has(le.id)&&!D.current.has(le.id));_([...X,...ie])},[Ge]);const De=k.useCallback(async X=>{const se={maxSizeMB:f?.maxSizeMB??1,maxWidthOrHeight:f?.maxWidthOrHeight??1920,useWebWorker:!0};return await ct(X,se)},[f]),ye=k.useCallback(async X=>{const se=I.length+M.length,ie=Math.max(0,o-se),le=Array.from(X).slice(0,ie);if(X.length>ie){const ne=Array.from(X).slice(ie),Te=Re("attachment.upload_limit_exceeded",{max:o});m?.(Te,ne[0]??X[0])}for(const ne of le){if(ne.size>a*1024*1024){m?.(`[${ne.name}] 파일 크기(${Fn(ne.size)})가 최대 허용 크기(${a}MB)를 초과합니다.`,ne);continue}if(l){const ve="."+ne.name.split(".").pop()?.toLowerCase();if(!l.split(",").map(Ue=>Ue.trim().toLowerCase()).some(Ue=>{if(Ue.includes("/")){if(Ue.endsWith("/* Line truncated
`;let ya;function Zg(e,t){return new Promise(((r,n)=>{ya||(ya=(function(s){const l=[];return l.push(s),URL.createObjectURL(new Blob(l))})(Xg));const o=new Worker(ya);o.addEventListener("message",(function(s){if(t.signal&&t.signal.aborted)o.terminate();else if(s.data.progress===void 0){if(s.data.error)return n(new Error(s.data.error)),void o.terminate();r(s.data.file),o.terminate()}else t.onProgress(s.data.progress)})),o.addEventListener("error",n),t.signal&&t.signal.addEventListener("abort",(()=>{n(t.signal.reason),o.terminate()})),o.postMessage({file:e,imageCompressionLibUrl:t.libURL,options:{...t,onProgress:void 0,signal:void 0}})}))}function mt(e,t){return new Promise((function(r,n){let o,a,s,l,f,h;if(o={...t},s=0,{onProgress:l}=o,o.maxSizeMB=o.maxSizeMB||Number.POSITIVE_INFINITY,f=typeof o.useWebWorker!="boolean"||o.useWebWorker,delete o.useWebWorker,o.onProgress=g=>{s=g,typeof l=="function"&&l(s)},!(e instanceof Blob||e instanceof Yg))return n(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(e.type))return n(new Error("The file given is not an image"));if(h=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,!f||typeof Worker!="function"||h)return vi(e,o).then(function(g){try{return a=g,u.call(this)}catch(p){return n(p)}}.bind(this),n);var c=function(){try{return u.call(this)}catch(g){return n(g)}}.bind(this),i=function(g){try{return vi(e,o).then((function(p){try{return a=p,c()}catch(m){return n(m)}}),n)}catch(p){return n(p)}};try{return o.libURL=o.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",Zg(e,o).then((function(g){try{return a=g,c()}catch{return i()}}),i)}catch{i()}function u(){try{a.name=e.name,a.lastModified=e.lastModified}catch{}try{o.preserveExif&&e.type==="image/jpeg"&&(!o.fileType||o.fileType&&o.fileType===e.type)&&(a=ii(e,a))}catch{}return r(a)}}))}mt.getDataUrlFromFile=fi,mt.getFilefromDataUrl=ba,mt.loadImage=gi,mt.drawImageInCanvas=pi,mt.drawFileInCanvas=Yn,mt.canvasToFile=Xn,mt.getExifOrientation=mi,mt.handleMaxWidthOrHeight=bi,mt.followExifOrientation=yi,mt.cleanupCanvasMemory=qt,mt.isAutoOrientationInBrowser=Gr,mt.approximateBelowMaximumCanvasSizeOfBrowser=hi,mt.copyExifWithoutOrientation=ii,mt.getBrowserName=kr,mt.version="2.0.2";const qg=window.G7Core,Zn=e=>{const t=["B","KB","MB","GB"];let r=0,n=e;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(2)} ${t[r]}`},wi=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 r=Object.values(t.response.data.errors)[0];if(Array.isArray(r)&&r[0])return r[0]}if(t.message)return t.message}return e instanceof Error?e.message:"업로드 실패"},xi=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",nt=(e,t)=>qg?.t?.(e,t)??e,Cr=window.G7Core;function ki(e){const{attachmentableType:t,attachmentableId:r,collection:n,maxFiles:o,maxSize:a,maxConcurrentUploads:s,accept:l,imageCompression:f,roleIds:h,autoUpload:c,initialFiles:i,endpoints:u,onFilesChange:g,onUploadComplete:p,onUploadError:m,onRemove:x,onReorder:k,uploadTriggerEvent:M,confirmBeforeRemove:v,uploadParams:E}=e,[O,S]=C.useState(i),[A,w]=C.useState([]),[y,T]=C.useState(!1),I=C.useRef(null),F=C.useRef(0),D=C.useRef(new Set),L=C.useRef(new Map),[$,_]=C.useState(!1),[b,z]=C.useState(null),[U,H]=C.useState(!1),Y=C.useRef(!1),[B,X]=C.useState([]),G=C.useRef(i),[W,Q]=C.useState(!1),[me,se]=C.useState(0),pe=C.useRef(0),[ne,ce]=C.useState(new Map),ve=C.useRef(new Map);C.useEffect(()=>{g?.(A)},[A,g]);const _e=C.useMemo(()=>{const Z=G.current;return Z===i?Z:Z.length!==i.length?(G.current=i,i):Z.length===0&&i.length===0?Z:i.some((he,ue)=>he.id!==Z[ue]?.id)?(G.current=i,i):Z},[i]);C.useEffect(()=>{if(Y.current)return;const Z=_e.filter(ue=>!D.current.has(ue.id)&&(!ue.hash||!D.current.has(ue.hash))),le=new Set(Z.map(ue=>ue.id)),he=Array.from(L.current.values()).filter(ue=>!le.has(ue.id)&&!D.current.has(ue.id));S([...Z,...he])},[_e]);const ze=C.useCallback(async Z=>{const le={maxSizeMB:f?.maxSizeMB??1,maxWidthOrHeight:f?.maxWidthOrHeight??1920,useWebWorker:!0};return await mt(Z,le)},[f]),ie=C.useCallback(async Z=>{const le=O.length+A.length,he=Math.max(0,o-le),ue=Array.from(Z).slice(0,he);if(Z.length>he){const fe=Array.from(Z).slice(he),Le=nt("attachment.upload_limit_exceeded",{max:o});m?.(Le,fe[0]??Z[0])}for(const fe of ue){if(fe.size>a*1024*1024){m?.(`[${fe.name}] 파일 크기(${Zn(fe.size)})가 최대 허용 크기(${a}MB)를 초과합니다.`,fe);continue}if(l){const Se="."+fe.name.split(".").pop()?.toLowerCase();if(!l.split(",").map(He=>He.trim().toLowerCase()).some(He=>{if(He.includes("/")){if(He.endsWith("/* Line truncated
relative border-2 border-dashed rounded-lg transition-colors
${e?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-300 dark:border-gray-600"}
`,onDragOver:h=>{h.preventDefault(),t&&n(!0)},onDragLeave:()=>n(!1),onDrop:h=>{h.preventDefault(),n(!1),t&&r(h.dataTransfer.files)},children:[d.jsx("input",{ref:o,type:"file",multiple:!0,accept:a,onChange:h=>h.target.files&&r(h.target.files),className:"hidden"}),!f&&d.jsxs(W,{className:"p-8 text-center cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors",onClick:()=>o.current?.click(),children:[d.jsx(Ct,{className:"fa-solid fa-cloud-arrow-up text-4xl text-gray-400 dark:text-gray-500 mb-4"}),d.jsx(Dt,{className:"text-sm text-gray-600 dark:text-gray-400",children:Re("attachment.drop_or_click")}),d.jsxs(Dt,{className:"text-xs text-gray-500 dark:text-gray-500 mt-2",children:[Re("attachment.upload_limit",{maxFiles:s,maxSize:l}),a&&` (${a})`]})]}),f]});function ug(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return k.useMemo(()=>n=>{t.forEach(o=>o(n))},t)}const Un=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ar(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function aa(e){return"nodeType"in e}function yt(e){var t,r;return e?Ar(e)?e:aa(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function sa(e){const{Document:t}=yt(e);return e instanceof t}function Qr(e){return Ar(e)?!1:e instanceof yt(e).HTMLElement}function Rl(e){return e instanceof yt(e).SVGElement}function Mr(e){return e?Ar(e)?e.document:aa(e)?sa(e)?e:Qr(e)||Rl(e)?e.ownerDocument:document:document:document}const Yt=Un?k.useLayoutEffect:k.useEffect;function la(e){const t=k.useRef(e);return Yt(()=>{t.current=e}),k.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function fg(){const e=k.useRef(null),t=k.useCallback((n,o)=>{e.current=setInterval(n,o)},[]),r=k.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function Jr(e,t){t===void 0&&(t=[e]);const r=k.useRef(e);return Yt(()=>{r.current!==e&&(r.current=e)},t),r}function Rr(e,t){const r=k.useRef();return k.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function zn(e){const t=la(e),r=k.useRef(null),n=k.useCallback(o=>{o!==r.current&&t?.(o,r.current),r.current=o},[]);return[r,n]}function ia(e){const t=k.useRef();return k.useEffect(()=>{t.current=e},[e]),t.current}let ca={};function en(e,t){return k.useMemo(()=>{if(t)return t;const r=ca[e]==null?0:ca[e]+1;return ca[e]=r,e+"-"+r},[e,t])}function ei(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.reduce((a,s)=>{const l=Object.entries(s);for(const[f,h]of l){const c=a[f];c!=null&&(a[f]=c+e*h)}return a},{...t})}}const Or=ei(1),tn=ei(-1);function gg(e){return"clientX"in e&&"clientY"in e}function da(e){if(!e)return!1;const{KeyboardEvent:t}=yt(e.target);return t&&e instanceof t}function hg(e){if(!e)return!1;const{TouchEvent:t}=yt(e.target);return t&&e instanceof t}function ua(e){if(hg(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return gg(e)?{x:e.clientX,y:e.clientY}:null}const rn=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[rn.Translate.toString(e),rn.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),ti="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function pg(e){return e.matches(ti)?e:e.querySelector(ti)}const mg={display:"none"};function bg(e){let{id:t,value:r}=e;return k.createElement("div",{id:t,style:mg},r)}function yg(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const o={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 k.createElement("div",{id:t,style:o,role:"status","aria-live":n,"aria-atomic":!0},r)}function vg(){const[e,t]=k.useState("");return{announce:k.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const ri=k.createContext(null);function wg(e){const t=k.useContext(ri);k.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function xg(){const[e]=k.useState(()=>new Set),t=k.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[k.useCallback(n=>{let{type:o,event:a}=n;e.forEach(s=>{var l;return(l=s[o])==null?void 0:l.call(s,a)})},[e]),t]}const kg={draggable:`
`,onDragOver:h=>{h.preventDefault(),t&&n(!0)},onDragLeave:()=>n(!1),onDrop:h=>{h.preventDefault(),n(!1),t&&r(h.dataTransfer.files)},children:[d.jsx("input",{ref:o,type:"file",multiple:!0,accept:a,onChange:h=>h.target.files&&r(h.target.files),className:"hidden"}),!f&&d.jsxs(j,{className:"p-8 text-center cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors",onClick:()=>o.current?.click(),children:[d.jsx(Ot,{className:"fa-solid fa-cloud-arrow-up text-4xl text-gray-400 dark:text-gray-500 mb-4"}),d.jsx(Ut,{className:"text-sm text-gray-600 dark:text-gray-400",children:nt("attachment.drop_or_click")}),d.jsxs(Ut,{className:"text-xs text-gray-500 dark:text-gray-500 mt-2",children:[nt("attachment.upload_limit",{maxFiles:s,maxSize:l}),a&&` (${a})`]})]}),f]});function Qg(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return C.useMemo(()=>n=>{t.forEach(o=>o(n))},t)}const qn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function jr(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function va(e){return"nodeType"in e}function Ct(e){var t,r;return e?jr(e)?e:va(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function wa(e){const{Document:t}=Ct(e);return e instanceof t}function dn(e){return jr(e)?!1:e instanceof Ct(e).HTMLElement}function _i(e){return e instanceof Ct(e).SVGElement}function Br(e){return e?jr(e)?e.document:va(e)?wa(e)?e:dn(e)||_i(e)?e.ownerDocument:document:document:document}const Qt=qn?C.useLayoutEffect:C.useEffect;function xa(e){const t=C.useRef(e);return Qt(()=>{t.current=e}),C.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function Jg(){const e=C.useRef(null),t=C.useCallback((n,o)=>{e.current=setInterval(n,o)},[]),r=C.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function un(e,t){t===void 0&&(t=[e]);const r=C.useRef(e);return Qt(()=>{r.current!==e&&(r.current=e)},t),r}function fn(e,t){const r=C.useRef();return C.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function Qn(e){const t=xa(e),r=C.useRef(null),n=C.useCallback(o=>{o!==r.current&&t?.(o,r.current),r.current=o},[]);return[r,n]}function ka(e){const t=C.useRef();return C.useEffect(()=>{t.current=e},[e]),t.current}let Ca={};function gn(e,t){return C.useMemo(()=>{if(t)return t;const r=Ca[e]==null?0:Ca[e]+1;return Ca[e]=r,e+"-"+r},[e,t])}function Si(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.reduce((a,s)=>{const l=Object.entries(s);for(const[f,h]of l){const c=a[f];c!=null&&(a[f]=c+e*h)}return a},{...t})}}const Wr=Si(1),hn=Si(-1);function Rg(e){return"clientX"in e&&"clientY"in e}function _a(e){if(!e)return!1;const{KeyboardEvent:t}=Ct(e.target);return t&&e instanceof t}function eh(e){if(!e)return!1;const{TouchEvent:t}=Ct(e.target);return t&&e instanceof t}function Sa(e){if(eh(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return Rg(e)?{x:e.clientX,y:e.clientY}:null}const pn=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[pn.Translate.toString(e),pn.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),Ei="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function th(e){return e.matches(Ei)?e:e.querySelector(Ei)}const rh={display:"none"};function nh(e){let{id:t,value:r}=e;return C.createElement("div",{id:t,style:rh},r)}function oh(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const o={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 C.createElement("div",{id:t,style:o,role:"status","aria-live":n,"aria-atomic":!0},r)}function ah(){const[e,t]=C.useState("");return{announce:C.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const Ti=C.createContext(null);function sh(e){const t=C.useContext(Ti);C.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function lh(){const[e]=C.useState(()=>new Set),t=C.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[C.useCallback(n=>{let{type:o,event:a}=n;e.forEach(s=>{var l;return(l=s[o])==null?void 0:l.call(s,a)})},[e]),t]}const ih={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.
`},Cg={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Sg(e){let{announcements:t=Cg,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=kg}=e;const{announce:a,announcement:s}=vg(),l=en("DndLiveRegion"),[f,h]=k.useState(!1);if(k.useEffect(()=>{h(!0)},[]),wg(k.useMemo(()=>({onDragStart(i){let{active:u}=i;a(t.onDragStart({active:u}))},onDragMove(i){let{active:u,over:g}=i;t.onDragMove&&a(t.onDragMove({active:u,over:g}))},onDragOver(i){let{active:u,over:g}=i;a(t.onDragOver({active:u,over:g}))},onDragEnd(i){let{active:u,over:g}=i;a(t.onDragEnd({active:u,over:g}))},onDragCancel(i){let{active:u,over:g}=i;a(t.onDragCancel({active:u,over:g}))}}),[a,t])),!f)return null;const c=k.createElement(k.Fragment,null,k.createElement(bg,{id:n,value:o.draggable}),k.createElement(yg,{id:l,announcement:s}));return r?Jt.createPortal(c,r):c}var et;(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"})(et||(et={}));function Hn(){}function ni(e,t){return k.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function _g(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return k.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const Gt=Object.freeze({x:0,y:0});function oi(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ai(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function Eg(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function si(e){let{left:t,top:r,height:n,width:o}=e;return[{x:t,y:r},{x:t+o,y:r},{x:t,y:r+n},{x:t+o,y:r+n}]}function li(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function ii(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const Tg=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=ii(t,t.left,t.top),a=[];for(const s of n){const{id:l}=s,f=r.get(l);if(f){const h=oi(ii(f),o);a.push({id:l,data:{droppableContainer:s,value:h}})}}return a.sort(ai)},Ng=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=si(t),a=[];for(const s of n){const{id:l}=s,f=r.get(l);if(f){const h=si(f),c=o.reduce((u,g,p)=>u+oi(h[p],g),0),i=Number((c/4).toFixed(4));a.push({id:l,data:{droppableContainer:s,value:i}})}}return a.sort(ai)};function Ag(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),s=o-n,l=a-r;if(n<o&&r<a){const f=t.width*t.height,h=e.width*e.height,c=s*l,i=c/(f+h-c);return Number(i.toFixed(4))}return 0}const Mg=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=[];for(const a of n){const{id:s}=a,l=r.get(s);if(l){const f=Ag(l,t);f>0&&o.push({id:s,data:{droppableContainer:a,value:f}})}}return o.sort(Eg)};function Og(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function ci(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Gt}function Ig(e){return function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return o.reduce((s,l)=>({...s,top:s.top+e*l.y,bottom:s.bottom+e*l.y,left:s.left+e*l.x,right:s.right+e*l.x}),{...r})}}const Dg=Ig(1);function Lg(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 Pg(e,t,r){const n=Lg(t);if(!n)return e;const{scaleX:o,scaleY:a,x:s,y:l}=n,f=e.left-s-(1-o)*parseFloat(r),h=e.top-l-(1-a)*parseFloat(r.slice(r.indexOf(" ")+1)),c=o?e.width/o:e.width,i=a?e.height/a:e.height;return{width:c,height:i,top:h,right:f+c,bottom:h+i,left:f}}const $g={ignoreTransform:!1};function Ir(e,t){t===void 0&&(t=$g);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:h,transformOrigin:c}=yt(e).getComputedStyle(e);h&&(r=Pg(r,h,c))}const{top:n,left:o,width:a,height:s,bottom:l,right:f}=r;return{top:n,left:o,width:a,height:s,bottom:l,right:f}}function di(e){return Ir(e,{ignoreTransform:!0})}function Fg(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function Ug(e,t){return t===void 0&&(t=yt(e).getComputedStyle(e)),t.position==="fixed"}function zg(e,t){t===void 0&&(t=yt(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","o Line truncated
`},ch={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function dh(e){let{announcements:t=ch,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=ih}=e;const{announce:a,announcement:s}=ah(),l=gn("DndLiveRegion"),[f,h]=C.useState(!1);if(C.useEffect(()=>{h(!0)},[]),sh(C.useMemo(()=>({onDragStart(i){let{active:u}=i;a(t.onDragStart({active:u}))},onDragMove(i){let{active:u,over:g}=i;t.onDragMove&&a(t.onDragMove({active:u,over:g}))},onDragOver(i){let{active:u,over:g}=i;a(t.onDragOver({active:u,over:g}))},onDragEnd(i){let{active:u,over:g}=i;a(t.onDragEnd({active:u,over:g}))},onDragCancel(i){let{active:u,over:g}=i;a(t.onDragCancel({active:u,over:g}))}}),[a,t])),!f)return null;const c=C.createElement(C.Fragment,null,C.createElement(nh,{id:n,value:o.draggable}),C.createElement(oh,{id:l,announcement:s}));return r?or.createPortal(c,r):c}var ot;(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"})(ot||(ot={}));function Jn(){}function Ni(e,t){return C.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function uh(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return C.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const Vt=Object.freeze({x:0,y:0});function Ai(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Oi(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function fh(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function Mi(e){let{left:t,top:r,height:n,width:o}=e;return[{x:t,y:r},{x:t+o,y:r},{x:t,y:r+n},{x:t+o,y:r+n}]}function Ii(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function Pi(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const gh=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=Pi(t,t.left,t.top),a=[];for(const s of n){const{id:l}=s,f=r.get(l);if(f){const h=Ai(Pi(f),o);a.push({id:l,data:{droppableContainer:s,value:h}})}}return a.sort(Oi)},hh=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=Mi(t),a=[];for(const s of n){const{id:l}=s,f=r.get(l);if(f){const h=Mi(f),c=o.reduce((u,g,p)=>u+Ai(h[p],g),0),i=Number((c/4).toFixed(4));a.push({id:l,data:{droppableContainer:s,value:i}})}}return a.sort(Oi)};function ph(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),s=o-n,l=a-r;if(n<o&&r<a){const f=t.width*t.height,h=e.width*e.height,c=s*l,i=c/(f+h-c);return Number(i.toFixed(4))}return 0}const mh=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=[];for(const a of n){const{id:s}=a,l=r.get(s);if(l){const f=ph(l,t);f>0&&o.push({id:s,data:{droppableContainer:a,value:f}})}}return o.sort(fh)};function bh(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function Di(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Vt}function yh(e){return function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return o.reduce((s,l)=>({...s,top:s.top+e*l.y,bottom:s.bottom+e*l.y,left:s.left+e*l.x,right:s.right+e*l.x}),{...r})}}const vh=yh(1);function wh(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 xh(e,t,r){const n=wh(t);if(!n)return e;const{scaleX:o,scaleY:a,x:s,y:l}=n,f=e.left-s-(1-o)*parseFloat(r),h=e.top-l-(1-a)*parseFloat(r.slice(r.indexOf(" ")+1)),c=o?e.width/o:e.width,i=a?e.height/a:e.height;return{width:c,height:i,top:h,right:f+c,bottom:h+i,left:f}}const kh={ignoreTransform:!1};function Vr(e,t){t===void 0&&(t=kh);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:h,transformOrigin:c}=Ct(e).getComputedStyle(e);h&&(r=xh(r,h,c))}const{top:n,left:o,width:a,height:s,bottom:l,right:f}=r;return{top:n,left:o,width:a,height:s,bottom:l,right:f}}function Li(e){return Vr(e,{ignoreTransform:!0})}function Ch(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function _h(e,t){return t===void 0&&(t=Ct(e).getComputedStyle(e)),t.position==="fixed"}function Sh(e,t){t===void 0&&(t=Ct(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","o Line truncated
flex items-center gap-3 p-4 rounded-lg border shadow-lg
min-w-[300px] max-w-md
transition-all duration-300
${o.bg}
${r?"opacity-100 translate-y-0":`opacity-0 ${s}`}
`,role:"alert",children:[d.jsx(de,{name:a,className:`w-5 h-5 flex-shrink-0 ${o.text}`}),d.jsx(R,{className:`flex-1 text-sm font-medium ${o.text}`,children:e.message}),d.jsx(Q,{onClick:n,className:`flex-shrink-0 p-1 rounded hover:bg-black/10 dark:hover:bg-white/10 ${o.text} focus:outline-none`,"aria-label":Jh("common.close"),children:d.jsx(de,{name:Je.Times,className:"w-4 h-4"})})]})},r0=Object.freeze(Object.defineProperty({__proto__:null,Toast:Ca,default:Ca},Symbol.toStringTag,{value:"Module"})),n0=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)},Sa=({className:e="",style:t})=>{const[r,n]=k.useState(!1);return k.useEffect(()=>{const o=window.G7Core?.TransitionManager;if(!o){n0.warn("TransitionManager를 찾을 수 없습니다.");return}return n(o.getIsPending()),o.subscribe(s=>{n(s)})},[]),r?d.jsxs(W,{className:`fixed top-0 left-0 right-0 z-50 ${e}`,style:t,role:"progressbar","aria-label":"페이지 로딩 중",children:[d.jsx(W,{className:"h-1 bg-gradient-to-r from-blue-500 via-blue-600 to-blue-500 animate-pulse",children:d.jsx(W,{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"}})}),d.jsx("style",{children:`
`,role:"alert",children:[d.jsx(ge,{name:a,className:`w-5 h-5 flex-shrink-0 ${o.text}`}),d.jsx(te,{className:`flex-1 text-sm font-medium ${o.text}`,children:e.message}),d.jsx(J,{onClick:n,className:`flex-shrink-0 p-1 rounded hover:bg-black/10 dark:hover:bg-white/10 ${o.text} focus:outline-none`,"aria-label":U0("common.close"),children:d.jsx(ge,{name:rt.Times,className:"w-4 h-4"})})]})},j0=Object.freeze(Object.defineProperty({__proto__:null,Toast:$a,default:$a},Symbol.toStringTag,{value:"Module"})),B0=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)},Ua=({className:e="",style:t})=>{const[r,n]=C.useState(!1);return C.useEffect(()=>{const o=window.G7Core?.TransitionManager;if(!o){B0.warn("TransitionManager를 찾을 수 없습니다.");return}return n(o.getIsPending()),o.subscribe(s=>{n(s)})},[]),r?d.jsxs(j,{className:`fixed top-0 left-0 right-0 z-50 ${e}`,style:t,role:"progressbar","aria-label":"페이지 로딩 중",children:[d.jsx(j,{className:"h-1 bg-gradient-to-r from-blue-500 via-blue-600 to-blue-500 animate-pulse",children:d.jsx(j,{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"}})}),d.jsx("style",{children:`
@keyframes loading {
0% {
transform: translateX(-100%);
@@ -83,5 +84,5 @@ self.addEventListener('message', async (e) => {
transform: translateX(-100%);
}
}
`})]}):null},o0=Object.freeze(Object.defineProperty({__proto__:null,PageTransitionIndicator:Sa,default:Sa},Symbol.toStringTag,{value:"Module"})),Ki=window.G7Core?.createLogger?.("Comp:PageTransitionBlur")??{log:(...e)=>console.log("[Comp:PageTransitionBlur]",...e),warn:(...e)=>console.warn("[Comp:PageTransitionBlur]",...e)},_a=({className:e="",style:t})=>{const[r,n]=k.useState(!1);return k.useEffect(()=>{const o=window.G7Core?.TransitionManager;if(!o){Ki.warn("TransitionManager를 찾을 수 없습니다.");return}return n(o.getIsPending()),o.subscribe(s=>{Ki.log("isPending changed:",s),n(s)})},[]),r?d.jsx(W,{className:`fixed inset-0 z-40 bg-white/30 dark:bg-gray-900/30 backdrop-blur-sm transition-opacity duration-150 pointer-events-none ${e}`,style:t,role:"status","aria-label":"페이지 전환 중","data-testid":"page-transition-blur"}):null},a0=Object.freeze(Object.defineProperty({__proto__:null,PageTransitionBlur:_a,default:_a},Symbol.toStringTag,{value:"Module"})),Yi={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},Xi=new Set(["hidden","block","inline-block","inline","flex","inline-flex","grid","inline-grid","table","table-row","table-cell","contents","list-item","flow-root"]),s0=new Set(["Div","Flex","Grid","Section","Article","Nav","Aside","Main","Header","Footer","Fragment","Form","Container"]),l0=new Set(["H1","H2","H3","H4","H5","H6","P","Span","Label","A","Strong","Em","Small","Badge"]),i0=new Set(["Input","Textarea","Select","Checkbox","Radio","Toggle","DatePicker","TagInput","SearchBar"]),c0=new Set(["Img","Image","Avatar","AvatarUploader","ImageGallery","ProductImageViewer","FileUploader"]),qi={DataGrid:(e,t)=>d.jsxs("div",{className:"w-full border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:[d.jsx("div",{className:`h-10 bg-gray-100 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 ${e}`,children:d.jsxs("div",{className:"flex items-center h-full px-4 gap-8",children:[d.jsx("div",{className:"h-3 w-16 bg-gray-300 dark:bg-gray-600 rounded"}),d.jsx("div",{className:"h-3 w-24 bg-gray-300 dark:bg-gray-600 rounded"}),d.jsx("div",{className:"h-3 w-20 bg-gray-300 dark:bg-gray-600 rounded"}),d.jsx("div",{className:"h-3 w-16 bg-gray-300 dark:bg-gray-600 rounded"})]})}),Array.from({length:t},(r,n)=>d.jsx("div",{className:`h-12 border-b border-gray-100 dark:border-gray-800 ${e}`,style:{animationDelay:`${n*75}ms`},children:d.jsxs("div",{className:"flex items-center h-full px-4 gap-8",children:[d.jsx("div",{className:"h-3 w-12 bg-gray-200 dark:bg-gray-700 rounded"}),d.jsx("div",{className:"h-3 flex-1 bg-gray-200 dark:bg-gray-700 rounded"}),d.jsx("div",{className:"h-3 w-16 bg-gray-100 dark:bg-gray-800 rounded"}),d.jsx("div",{className:"h-3 w-14 bg-gray-100 dark:bg-gray-800 rounded"})]})},n))]}),Pagination:e=>d.jsx("div",{className:"flex justify-center gap-1.5 py-3",children:Array.from({length:5},(t,r)=>d.jsx("div",{className:`w-8 h-8 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))}),Tabs:e=>d.jsxs("div",{children:[d.jsx("div",{className:"flex gap-4 border-b border-gray-200 dark:border-gray-700 pb-2 mb-3",children:Array.from({length:3},(t,r)=>d.jsx("div",{className:`h-4 w-20 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))}),d.jsx("div",{className:`h-32 bg-gray-100 dark:bg-gray-800 rounded ${e}`})]}),TabNavigation:e=>d.jsx("div",{className:"flex gap-4 border-b border-gray-200 dark:border-gray-700 pb-2",children:Array.from({length:3},(t,r)=>d.jsx("div",{className:`h-4 w-20 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))}),ProductCard:e=>d.jsxs("div",{className:"rounded-lg overflow-hidden",children:[d.jsx("div",{className:`h-48 w-full bg-gray-200 dark:bg-gray-700 ${e}`}),d.jsxs("div",{className:"p-3 space-y-2",children:[d.jsx("div",{className:`h-3.5 w-3/4 bg-gray-200 dark:bg-gray-700 rounded ${e}`}),d.jsx("div",{className:`h-4 w-1/3 bg-gray-300 dark:bg-gray-600 rounded ${e}`})]})]}),UserInfo:e=>d.jsx("div",{className:`h-3 w-14 bg-gray-200 dark:bg-gray-700 rounded ${e}`}),QuantitySelector:e=>d.jsx("div",{className:`h-9 w-28 bg-gray-100 dark:bg-gray-800 rounded border border-gray-200 dark:border-gray-700 ${e}`}),Header:e=>d.jsx("header",{className:"bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:d.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:d.jsxs("div",{className:"flex items-center justify-between h-16",children:[d.jsxs("div",{className:"flex items-center gap-8",children:[d.jsx("div",{className:`h-8 w-24 bg-gray-200 dark:bg-gray-700 rounded ${e}`}),d.jsx("div",{className:"hidden lg:flex items-center gap-6",children:Array.from({length:4},(t,r)=>d.jsx("div",{className:`h-3.5 w-16 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))})]}),d.jsx("div",{className:"flex items-center gap-4",children:Array.from({length:3},(t,r)=>d.jsx("div",{className:`h-8 w-8 bg-gray-200 dark:bg-gray-700 rounded-full ${e}`},r))})]})})}),Footer:e=>d.jsx("footer",{className:"bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray- Line truncated
`})]}):null},W0=Object.freeze(Object.defineProperty({__proto__:null,PageTransitionIndicator:Ua,default:Ua},Symbol.toStringTag,{value:"Module"})),bc=window.G7Core?.createLogger?.("Comp:PageTransitionBlur")??{log:(...e)=>console.log("[Comp:PageTransitionBlur]",...e),warn:(...e)=>console.warn("[Comp:PageTransitionBlur]",...e)},za=({className:e="",style:t})=>{const[r,n]=C.useState(!1);return C.useEffect(()=>{const o=window.G7Core?.TransitionManager;if(!o){bc.warn("TransitionManager를 찾을 수 없습니다.");return}return n(o.getIsPending()),o.subscribe(s=>{bc.log("isPending changed:",s),n(s)})},[]),r?d.jsx(j,{className:`fixed inset-0 z-40 bg-white/30 dark:bg-gray-900/30 backdrop-blur-sm transition-opacity duration-150 pointer-events-none ${e}`,style:t,role:"status","aria-label":"페이지 전환 중","data-testid":"page-transition-blur"}):null},V0=Object.freeze(Object.defineProperty({__proto__:null,PageTransitionBlur:za,default:za},Symbol.toStringTag,{value:"Module"})),yc={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},vc=new Set(["hidden","block","inline-block","inline","flex","inline-flex","grid","inline-grid","table","table-row","table-cell","contents","list-item","flow-root"]),K0=new Set(["Div","Flex","Grid","Section","Article","Nav","Aside","Main","Header","Footer","Fragment","Form","Container"]),Y0=new Set(["H1","H2","H3","H4","H5","H6","P","Span","Label","A","Strong","Em","Small","Badge"]),X0=new Set(["Input","Textarea","Select","Checkbox","Radio","Toggle","DatePicker","TagInput","SearchBar"]),Z0=new Set(["Img","Image","Avatar","AvatarUploader","ImageGallery","ProductImageViewer","FileUploader"]),wc={DataGrid:(e,t)=>d.jsxs("div",{className:"w-full border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:[d.jsx("div",{className:`h-10 bg-gray-100 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 ${e}`,children:d.jsxs("div",{className:"flex items-center h-full px-4 gap-8",children:[d.jsx("div",{className:"h-3 w-16 bg-gray-300 dark:bg-gray-600 rounded"}),d.jsx("div",{className:"h-3 w-24 bg-gray-300 dark:bg-gray-600 rounded"}),d.jsx("div",{className:"h-3 w-20 bg-gray-300 dark:bg-gray-600 rounded"}),d.jsx("div",{className:"h-3 w-16 bg-gray-300 dark:bg-gray-600 rounded"})]})}),Array.from({length:t},(r,n)=>d.jsx("div",{className:`h-12 border-b border-gray-100 dark:border-gray-800 ${e}`,style:{animationDelay:`${n*75}ms`},children:d.jsxs("div",{className:"flex items-center h-full px-4 gap-8",children:[d.jsx("div",{className:"h-3 w-12 bg-gray-200 dark:bg-gray-700 rounded"}),d.jsx("div",{className:"h-3 flex-1 bg-gray-200 dark:bg-gray-700 rounded"}),d.jsx("div",{className:"h-3 w-16 bg-gray-100 dark:bg-gray-800 rounded"}),d.jsx("div",{className:"h-3 w-14 bg-gray-100 dark:bg-gray-800 rounded"})]})},n))]}),Pagination:e=>d.jsx("div",{className:"flex justify-center gap-1.5 py-3",children:Array.from({length:5},(t,r)=>d.jsx("div",{className:`w-8 h-8 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))}),Tabs:e=>d.jsxs("div",{children:[d.jsx("div",{className:"flex gap-4 border-b border-gray-200 dark:border-gray-700 pb-2 mb-3",children:Array.from({length:3},(t,r)=>d.jsx("div",{className:`h-4 w-20 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))}),d.jsx("div",{className:`h-32 bg-gray-100 dark:bg-gray-800 rounded ${e}`})]}),TabNavigation:e=>d.jsx("div",{className:"flex gap-4 border-b border-gray-200 dark:border-gray-700 pb-2",children:Array.from({length:3},(t,r)=>d.jsx("div",{className:`h-4 w-20 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))}),ProductCard:e=>d.jsxs("div",{className:"rounded-lg overflow-hidden",children:[d.jsx("div",{className:`h-48 w-full bg-gray-200 dark:bg-gray-700 ${e}`}),d.jsxs("div",{className:"p-3 space-y-2",children:[d.jsx("div",{className:`h-3.5 w-3/4 bg-gray-200 dark:bg-gray-700 rounded ${e}`}),d.jsx("div",{className:`h-4 w-1/3 bg-gray-300 dark:bg-gray-600 rounded ${e}`})]})]}),UserInfo:e=>d.jsx("div",{className:`h-3 w-14 bg-gray-200 dark:bg-gray-700 rounded ${e}`}),QuantitySelector:e=>d.jsx("div",{className:`h-9 w-28 bg-gray-100 dark:bg-gray-800 rounded border border-gray-200 dark:border-gray-700 ${e}`}),Header:e=>d.jsx("header",{className:"bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:d.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:d.jsxs("div",{className:"flex items-center justify-between h-16",children:[d.jsxs("div",{className:"flex items-center gap-8",children:[d.jsx("div",{className:`h-8 w-24 bg-gray-200 dark:bg-gray-700 rounded ${e}`}),d.jsx("div",{className:"hidden lg:flex items-center gap-6",children:Array.from({length:4},(t,r)=>d.jsx("div",{className:`h-3.5 w-16 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))})]}),d.jsx("div",{className:"flex items-center gap-4",children:Array.from({length:3},(t,r)=>d.jsx("div",{className:`h-8 w-8 bg-gray-200 dark:bg-gray-700 rounded-full ${e}`},r))})]})})}),Footer:e=>d.jsx("footer",{className:"bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray- Line truncated
//# sourceMappingURL=components.iife.js.map
@@ -524,7 +524,7 @@
"props": {
"className": "text-sm text-red-600 dark:text-red-400"
},
"text": "{{_local.profileErrors.name[0]}}"
"text": "{{_local.profileErrors?.name?.[0] ?? ''}}"
}
]
},
@@ -562,7 +562,7 @@
"props": {
"className": "text-sm text-red-600 dark:text-red-400"
},
"text": "{{_local.profileErrors.nickname[0]}}"
"text": "{{_local.profileErrors?.nickname?.[0] ?? ''}}"
}
]
}
@@ -651,7 +651,7 @@
"props": {
"className": "text-sm text-red-600 dark:text-red-400"
},
"text": "{{_local.profileErrors.mobile[0]}}"
"text": "{{_local.profileErrors?.mobile?.[0] ?? ''}}"
}
]
},
@@ -689,7 +689,7 @@
"props": {
"className": "text-sm text-red-600 dark:text-red-400"
},
"text": "{{_local.profileErrors.phone[0]}}"
"text": "{{_local.profileErrors?.phone?.[0] ?? ''}}"
}
]
},
@@ -727,7 +727,7 @@
"props": {
"className": "text-sm text-red-600 dark:text-red-400"
},
"text": "{{_local.profileErrors.homepage[0]}}"
"text": "{{_local.profileErrors?.homepage?.[0] ?? ''}}"
}
]
}
@@ -799,7 +799,7 @@
"props": {
"className": "text-sm text-red-600 dark:text-red-400"
},
"text": "{{_local.profileErrors.country[0]}}"
"text": "{{_local.profileErrors?.country?.[0] ?? ''}}"
}
]
},
@@ -836,7 +836,7 @@
"props": {
"className": "text-sm text-red-600 dark:text-red-400"
},
"text": "{{_local.profileErrors.language[0]}}"
"text": "{{_local.profileErrors?.language?.[0] ?? ''}}"
}
]
},
@@ -875,7 +875,7 @@
"props": {
"className": "text-sm text-red-600 dark:text-red-400"
},
"text": "{{_local.profileErrors.timezone[0]}}"
"text": "{{_local.profileErrors?.timezone?.[0] ?? ''}}"
}
]
},
@@ -963,7 +963,7 @@
"props": {
"className": "text-sm text-red-600 dark:text-red-400"
},
"text": "{{_local.profileErrors?.zipcode ? _local.profileErrors.zipcode[0] : (_local.profileErrors?.address ? _local.profileErrors.address[0] : (_local.profileErrors?.address_detail ? _local.profileErrors.address_detail[0] : ''))}}"
"text": "{{_local.profileErrors?.zipcode?.[0] ?? _local.profileErrors?.address?.[0] ?? _local.profileErrors?.address_detail?.[0] ?? ''}}"
}
]
}
@@ -1038,7 +1038,7 @@
"props": {
"className": "text-sm text-red-600 dark:text-red-400"
},
"text": "{{_local.profileErrors.signature[0]}}"
"text": "{{_local.profileErrors?.signature?.[0] ?? ''}}"
},
{
"type": "basic",
@@ -1084,7 +1084,7 @@
"props": {
"className": "text-sm text-red-600 dark:text-red-400"
},
"text": "{{_local.profileErrors.bio[0]}}"
"text": "{{_local.profileErrors?.bio?.[0] ?? ''}}"
},
{
"type": "basic",
@@ -1182,10 +1182,23 @@
{
"type": "basic",
"name": "Checkbox",
"comment": "저장값이 boolean 이 아닐 수 있는 구간(설정 미저장 등)에도 checked 가 확정되도록 명시 바인딩 — 자동바인딩은 boolean 일 때만 checked 로 붙는다",
"props": {
"name": "notify_post_complete",
"checked": "{{!!_local.profileEditForm?.notify_post_complete}}",
"autoBinding": false,
"className": "w-5 h-5 mt-0.5 text-gray-900 dark:text-white bg-white dark:bg-gray-700 border-gray-300 dark:border-gray-600 rounded focus:ring-gray-900 dark:focus:ring-white"
}
},
"actions": [
{
"type": "change",
"handler": "setState",
"params": {
"target": "local",
"profileEditForm.notify_post_complete": "{{$event.target.checked}}"
}
}
]
},
{
"type": "basic",
@@ -1221,10 +1234,23 @@
{
"type": "basic",
"name": "Checkbox",
"comment": "저장값이 boolean 이 아닐 수 있는 구간(설정 미저장 등)에도 checked 가 확정되도록 명시 바인딩 — 자동바인딩은 boolean 일 때만 checked 로 붙는다",
"props": {
"name": "notify_post_reply",
"checked": "{{!!_local.profileEditForm?.notify_post_reply}}",
"autoBinding": false,
"className": "w-5 h-5 mt-0.5 text-gray-900 dark:text-white bg-white dark:bg-gray-700 border-gray-300 dark:border-gray-600 rounded focus:ring-gray-900 dark:focus:ring-white"
}
},
"actions": [
{
"type": "change",
"handler": "setState",
"params": {
"target": "local",
"profileEditForm.notify_post_reply": "{{$event.target.checked}}"
}
}
]
},
{
"type": "basic",
@@ -1260,10 +1286,23 @@
{
"type": "basic",
"name": "Checkbox",
"comment": "저장값이 boolean 이 아닐 수 있는 구간(설정 미저장 등)에도 checked 가 확정되도록 명시 바인딩 — 자동바인딩은 boolean 일 때만 checked 로 붙는다",
"props": {
"name": "notify_comment",
"checked": "{{!!_local.profileEditForm?.notify_comment}}",
"autoBinding": false,
"className": "w-5 h-5 mt-0.5 text-gray-900 dark:text-white bg-white dark:bg-gray-700 border-gray-300 dark:border-gray-600 rounded focus:ring-gray-900 dark:focus:ring-white"
}
},
"actions": [
{
"type": "change",
"handler": "setState",
"params": {
"target": "local",
"profileEditForm.notify_comment": "{{$event.target.checked}}"
}
}
]
},
{
"type": "basic",
@@ -1299,10 +1338,23 @@
{
"type": "basic",
"name": "Checkbox",
"comment": "저장값이 boolean 이 아닐 수 있는 구간(설정 미저장 등)에도 checked 가 확정되도록 명시 바인딩 — 자동바인딩은 boolean 일 때만 checked 로 붙는다",
"props": {
"name": "notify_reply_comment",
"checked": "{{!!_local.profileEditForm?.notify_reply_comment}}",
"autoBinding": false,
"className": "w-5 h-5 mt-0.5 text-gray-900 dark:text-white bg-white dark:bg-gray-700 border-gray-300 dark:border-gray-600 rounded focus:ring-gray-900 dark:focus:ring-white"
}
},
"actions": [
{
"type": "change",
"handler": "setState",
"params": {
"target": "local",
"profileEditForm.notify_reply_comment": "{{$event.target.checked}}"
}
}
]
},
{
"type": "basic",
@@ -31,7 +31,7 @@
"id": "selectAll",
"name": "selectAll",
"checked": "{{_local.allSelected}}",
"className": "w-5 h-5 rounded border-gray-300 accent-gray-900 focus:ring-gray-500"
"className": "w-5 h-5 rounded border-gray-300 dark:border-gray-600 accent-gray-900 focus:ring-gray-500"
},
"actions": [
{
@@ -54,7 +54,8 @@
"type": "basic",
"name": "Span",
"props": { "className": "text-sm text-gray-500 dark:text-gray-400" },
"text": "({{_local.selectedCount}}/{{cartItems.data.items.length}})"
"comment": "선택 개수는 선택 상태의 SSoT 인 selectedItems 에서 파생한다 (주문 요약 _cart_summary.json 과 동일 표현식)",
"text": "({{_local.selectedItems?.length ?? 0}}/{{cartItems.data.item_count ?? 0}})"
}
]
},
@@ -66,7 +67,7 @@
"disabled": "{{!_local.selectedItems || _local.selectedItems.length === 0}}"
},
"children": [
{ "type": "basic", "name": "Icon", "props": { "name": "trash-can", "className": "w-4 h-4" } },
{ "type": "basic", "name": "Icon", "props": { "name": "trash-can", "className": "text-base" } },
{ "type": "basic", "name": "Span", "text": "$t:shop.cart.delete_selected" }
],
"actions": [
@@ -122,14 +123,14 @@
"if": "{{!cartItems.data.items || cartItems.data.items.length === 0}}",
"props": { "className": "text-center py-16" },
"children": [
{ "type": "basic", "name": "Icon", "props": { "name": "shopping-cart", "className": "w-16 h-16 mx-auto mb-4 text-gray-300 dark:text-gray-600" } },
{ "type": "basic", "name": "Icon", "props": { "name": "shopping-cart", "className": "text-6xl mx-auto mb-4 text-gray-300 dark:text-gray-600" } },
{ "type": "basic", "name": "P", "props": { "className": "text-gray-500 dark:text-gray-400 mb-4" }, "text": "$t:shop.cart.empty" },
{
"type": "basic",
"name": "Button",
"props": { "className": "inline-flex items-center gap-2 px-4 py-2 bg-gray-900 dark:bg-white text-white dark:text-gray-900 rounded-lg font-medium cursor-pointer" },
"children": [
{ "type": "basic", "name": "Icon", "props": { "name": "arrow-left", "className": "w-4 h-4" } },
{ "type": "basic", "name": "Icon", "props": { "name": "arrow-left", "className": "text-base" } },
{ "type": "basic", "name": "Span", "text": "$t:shop.cart.continue_shopping" }
],
"actions": [{ "type": "click", "handler": "navigate", "params": { "path": "{{_global.shopBase}}/products" } }]
@@ -345,7 +345,7 @@
"name": "Div",
"props": { "className": "flex justify-between items-start" },
"children": [
{ "type": "basic", "name": "Span", "props": { "className": "text-sm text-gray-700 dark:text-gray-300" }, "text": "{{$parent._local.matchedOption.option_name_localized ?? $parent._local.matchedOption.option_name?.ko ?? ''}}" },
{ "type": "basic", "name": "Span", "props": { "className": "text-sm text-gray-700 dark:text-gray-300" }, "text": "{{$parent._local.matchedOption?.option_name_localized ?? $parent._local.matchedOption?.option_name?.ko ?? ''}}" },
{
"type": "basic",
"name": "Div",
@@ -355,7 +355,7 @@
"type": "basic",
"name": "Div",
"props": { "className": "text-sm font-bold text-gray-900 dark:text-white" },
"text": "{{$parent._local.matchedOption.multi_currency_selling_price?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? $parent._local.matchedOption.selling_price_formatted}}"
"text": "{{$parent._local.matchedOption?.multi_currency_selling_price?.[_global.preferredCurrency ?? _global.defaultCurrency]?.formatted ?? $parent._local.matchedOption?.selling_price_formatted ?? ''}}"
},
{
"comment": "보조 통화들",
@@ -363,7 +363,7 @@
"name": "Div",
"props": { "className": "flex flex-wrap gap-x-2 justify-end" },
"iteration": {
"source": "{{Object.entries($parent._local.matchedOption.multi_currency_selling_price ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? _global.defaultCurrency))}}",
"source": "{{Object.entries($parent._local.matchedOption?.multi_currency_selling_price ?? {}).filter(([code]) => code !== (_global.preferredCurrency ?? _global.defaultCurrency))}}",
"item_var": "currency"
},
"children": [
@@ -393,16 +393,16 @@
{
"type": "basic",
"name": "Div",
"if": "{{$parent._local.matchedOption.stock_quantity <= 10}}",
"props": { "className": "{{$parent._local.matchedOption.stock_quantity <= 0 ? 'text-xs text-red-500 dark:text-red-400 mt-1 font-medium' : 'text-xs text-gray-500 dark:text-gray-400 mt-1'}}" },
"text": "{{$parent._local.matchedOption.stock_quantity <= 0 ? '$t:shop.cart.option_modal.out_of_stock' : '$t:shop.cart.option_modal.stock_count|count=' + $parent._local.matchedOption.stock_quantity}}"
"if": "{{$parent._local.matchedOption?.stock_quantity <= 10}}",
"props": { "className": "{{$parent._local.matchedOption?.stock_quantity <= 0 ? 'text-xs text-red-500 dark:text-red-400 mt-1 font-medium' : 'text-xs text-gray-500 dark:text-gray-400 mt-1'}}" },
"text": "{{$parent._local.matchedOption?.stock_quantity <= 0 ? '$t:shop.cart.option_modal.out_of_stock' : '$t:shop.cart.option_modal.stock_count|count=' + ($parent._local.matchedOption?.stock_quantity ?? 0)}}"
},
{
"type": "basic",
"name": "Div",
"if": "{{$parent._local.matchedOption.stock_quantity > 10}}",
"if": "{{$parent._local.matchedOption?.stock_quantity > 10}}",
"props": { "className": "text-xs text-gray-500 dark:text-gray-400 mt-1" },
"text": "$t:shop.cart.option_modal.stock_count|count={{$parent._local.matchedOption.stock_quantity}}"
"text": "$t:shop.cart.option_modal.stock_count|count={{$parent._local.matchedOption?.stock_quantity ?? 0}}"
}
]
},
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "sirsoft-basic",
"version": "1.1.0",
"version": "1.1.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sirsoft-basic",
"version": "1.1.0",
"version": "1.1.1",
"license": "MIT",
"dependencies": {
"@dnd-kit/core": "^6.3.1",
@@ -1,6 +1,6 @@
{
"name": "sirsoft-basic",
"version": "1.1.0",
"version": "1.1.1",
"description": "Gnuboard7 Basic User Template Components - Nexibase Style",
"type": "module",
"main": "dist/components.js",
@@ -9,8 +9,7 @@
* 4. auth_required가 아닌 auth_mode: "optional"이 사용되는가
* 5. 기존 403/404 핸들러가 유지되는가
*
* @scenario entry_point:board_list_401,board_show_401
* @effects redirect_preserves_pathname,login_returns_to_original_path
* @effects redirect_preserves_pathname, login_returns_to_original_path
*/
import { describe, it, expect } from 'vitest';
@@ -27,6 +26,10 @@ function getDataSourceErrorHandling(layout: any, dataSourceId: string) {
}
describe('게시판 401 errorHandling — sequence + redirect 방식 (이슈 #228 B-5)', () => {
/**
* @scenario entry_point=board_show_401
* @effects redirect_preserves_pathname, login_returns_to_original_path
*/
describe('show.json — auth_mode 및 데이터소스 401', () => {
// redirect: /board/{{route.slug}}/posts/{{route.id}}
const ds = getDataSource(showLayout, 'post');
@@ -89,6 +92,10 @@ describe('게시판 401 errorHandling — sequence + redirect 방식 (이슈 #22
});
});
/**
* @scenario entry_point=board_list_401
* @effects redirect_preserves_pathname, login_returns_to_original_path
*/
describe('index.json — auth_mode 및 데이터소스 401', () => {
const ds = getDataSource(indexLayout, 'posts');
const dsErrorHandling = ds?.errorHandling ?? null;
@@ -0,0 +1,418 @@
/**
* @file cart-select-count-initial.test.tsx
* @description 장바구니 전체 선택 개수 최초 로딩 표시 회귀 (공개 이슈 #92)
*
* 결함: 장바구니를 처음 열면 전체 선택 옆 개수가 `(/27)` 처럼 선택 개수 없이 나온다.
* 표시식이 `{{_local.selectedCount}}` 인데 `selectedCount` 는 체크박스 change 핸들러에서만
* 기록되므로 최초 마운트 시점에는 undefined 이고, 엔진은 undefined 를 빈 문자열로 서식한다
* (예외·콘솔 에러 없음 — 표시 전용 결함). 체크박스를 한 번 건드리면 정상화된다.
*
* 정정: 표시식을 선택 상태의 SSoT 인 `_local.selectedItems` 파생으로 교체한다.
* 같은 화면 주문 요약(`_cart_summary.json`)이 이미 쓰던 표현식과 동일 형태로 통일해
* 두 카운터의 계산 방식 비대칭도 함께 해소한다.
*
* 함께 검증(동일 근본 원인 — `null` 로만 선언된 키를 옵셔널 없이 하위 접근):
* - `_modal_cart_option_change.json` 재고 안내 (`matchedOption`)
* - `_edit.json` 프로필 오류 메시지 (`profileErrors` — 가드/표시식 옵셔널 엇갈림)
*
* @vitest-environment jsdom
*/
import React from 'react';
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
import {
createLayoutTest,
createMockComponentRegistryWithBasics,
screen,
} from '@core/template-engine/__tests__/utils/layoutTestUtils';
import cartListPartial from '../../../layouts/partials/shop/_cart_list.json';
import cartOptionChangeModal from '../../../layouts/partials/shop/_modal_cart_option_change.json';
import profileEditPartial from '../../../layouts/partials/mypage/profile/_edit.json';
// ========== 공통 유틸 ==========
/**
* JSON 트리를 순회하며 모든 노드에 콜백을 적용합니다.
*
* @param node 순회 시작 노드
* @param visit 노드 방문 콜백
*/
function walk(node: unknown, visit: (n: Record<string, unknown>) => void): void {
if (Array.isArray(node)) {
node.forEach((n) => walk(n, visit));
return;
}
if (!node || typeof node !== 'object') return;
const obj = node as Record<string, unknown>;
visit(obj);
Object.values(obj).forEach((v) => walk(v, visit));
}
/**
* JSON 트리에서 특정 문자열을 포함하는 문자열 값을 모두 수집합니다.
*
* @param node 순회 시작 노드
* @param needle 찾을 부분 문자열
* @returns 매칭된 문자열 값 목록
*/
function collectStringsContaining(node: unknown, needle: string): string[] {
const out: string[] = [];
walk(node, (obj) => {
for (const v of Object.values(obj)) {
if (typeof v === 'string' && v.includes(needle)) out.push(v);
}
});
return out;
}
/**
* 장바구니 데이터소스 mock 응답을 만듭니다.
*
* @param count 장바구니 상품 수
* @returns cart/query 응답 형태
*/
function cartResponse(count: number) {
const items = Array.from({ length: count }, (_, i) => ({
id: i + 1,
quantity: 1,
product: { name: `상품 ${i + 1}` },
product_option: { option_name: '기본', price: 1000 },
}));
return {
data: {
items,
item_ids: items.map((it) => it.id),
item_count: count,
calculation: null,
},
};
}
/** 실 파일(`_cart_list.json`)을 그대로 감싼 테스트용 래퍼 레이아웃 */
const wrapperLayout = {
version: '1.0.0',
layout_name: 'shop/cart#test-wrapper',
data_sources: [
{
id: 'cartItems',
type: 'api',
endpoint: '/api/modules/sirsoft-ecommerce/cart/query',
method: 'POST',
auto_fetch: true,
},
],
components: [cartListPartial],
};
/** 카운터 Span 의 현재 텍스트를 읽는다 (`(선택/전체)` 형태) */
function readCounterText(): string {
// `(3/3)` 정상, `(/3)` 결함 — 두 형태를 모두 잡는 패턴
const el = screen.getByText(/^\(\d*\/\d+\)$/);
return el.textContent ?? '';
}
let registry: ReturnType<typeof createMockComponentRegistryWithBasics>;
beforeEach(() => {
registry = createMockComponentRegistryWithBasics();
// basics 에 없는 컴포넌트 보강
registry.register('basic', 'Checkbox', ({ id, name, checked, className }: any) =>
React.createElement('input', {
type: 'checkbox',
id,
name,
checked: !!checked,
className,
readOnly: true,
})
);
registry.register('basic', 'Icon', ({ name, className }: any) =>
React.createElement('i', { 'data-icon': name, className })
);
});
// ========== 1. 렌더링 회귀 (이슈 #92 본체) ==========
describe('_cart_list.json — 전체 선택 개수 최초 표시 (#92)', () => {
const ITEM_COUNT = 3;
/**
* 최초 마운트 상태를 재현해 카운터 텍스트를 읽는다.
* `selectedCount` 는 의도적으로 주입하지 않는다 — 체크박스를 아직 건드리지 않은 상태.
*
* @param selectedItems 선택된 상품 id 목록
* @returns 렌더 유틸과 카운터 텍스트
*/
async function mountAndRead(selectedItems: number[]) {
const testUtils = createLayoutTest(wrapperLayout as any, {
componentRegistry: registry,
initialState: {
_local: {
selectedItems,
allSelected: selectedItems.length === ITEM_COUNT,
},
},
});
testUtils.mockApi('cartItems', { response: cartResponse(ITEM_COUNT) });
await testUtils.render();
const text = readCounterText();
return { testUtils, text };
}
/**
* @scenario mount_path=initial_load, selection=all
* @effects counter_matches_checked_state, counter_matches_summary_panel
*/
it('최초 로딩 + 전체 선택 상태에서 (3/3) 을 표시한다', async () => {
const { testUtils, text } = await mountAndRead([1, 2, 3]);
expect(text).toBe('(3/3)');
testUtils.cleanup();
});
/**
* @scenario mount_path=initial_load, selection=partial
* @effects counter_matches_checked_state
*/
it('최초 로딩 + 부분 선택 상태에서 (2/3) 을 표시한다', async () => {
const { testUtils, text } = await mountAndRead([1, 2]);
expect(text).toBe('(2/3)');
testUtils.cleanup();
});
/**
* @scenario mount_path=initial_load, selection=none
* @effects counter_matches_checked_state
*/
it('최초 로딩 + 미선택 상태에서 (0/3) 을 표시한다 (빈 문자열 금지)', async () => {
const { testUtils, text } = await mountAndRead([]);
expect(text).toBe('(0/3)');
testUtils.cleanup();
});
/**
* @scenario mount_path=reload, selection=all
* @effects counter_matches_checked_state, counter_matches_summary_panel
*/
it('새로고침(재마운트) 후에도 전체 선택 카운터가 (3/3) 이다', async () => {
const first = await mountAndRead([1, 2, 3]);
first.testUtils.cleanup();
const { testUtils, text } = await mountAndRead([1, 2, 3]);
expect(text).toBe('(3/3)');
testUtils.cleanup();
});
/**
* @scenario mount_path=reload, selection=partial
* @effects counter_matches_checked_state
*/
it('새로고침(재마운트) 후 부분 선택 카운터가 (2/3) 이다', async () => {
const first = await mountAndRead([1, 2]);
first.testUtils.cleanup();
const { testUtils, text } = await mountAndRead([1, 2]);
expect(text).toBe('(2/3)');
testUtils.cleanup();
});
/**
* @scenario mount_path=reload, selection=none
* @effects counter_matches_checked_state
*/
it('새로고침(재마운트) 후 미선택 카운터가 (0/3) 이다', async () => {
const first = await mountAndRead([]);
first.testUtils.cleanup();
const { testUtils, text } = await mountAndRead([]);
expect(text).toBe('(0/3)');
testUtils.cleanup();
});
/**
* @scenario mount_path=spa_return, selection=all
* @effects counter_matches_checked_state, counter_matches_summary_panel
*/
it('SPA 이동 후 복귀(마운트 해제 → 재마운트)에도 (3/3) 이다', async () => {
const away = await mountAndRead([1, 2, 3]);
away.testUtils.cleanup();
const { testUtils, text } = await mountAndRead([1, 2, 3]);
expect(text).toBe('(3/3)');
testUtils.cleanup();
});
/**
* @scenario mount_path=spa_return, selection=partial
* @effects counter_matches_checked_state
*/
it('SPA 복귀 + 부분 선택에서 (2/3) 이다', async () => {
const away = await mountAndRead([1, 2]);
away.testUtils.cleanup();
const { testUtils, text } = await mountAndRead([1, 2]);
expect(text).toBe('(2/3)');
testUtils.cleanup();
});
/**
* @scenario mount_path=spa_return, selection=none
* @effects counter_matches_checked_state
*/
it('SPA 복귀 + 미선택에서 (0/3) 이다', async () => {
const away = await mountAndRead([]);
away.testUtils.cleanup();
const { testUtils, text } = await mountAndRead([]);
expect(text).toBe('(0/3)');
testUtils.cleanup();
});
});
describe('_cart_list.json — 빈 장바구니 (T8 에지)', () => {
/**
* 브라우저 실측에서 이 축은 기존 장바구니를 통째로 비워야만 재현되므로,
* 데이터 파괴 없이 여기서 결정적으로 고정한다.
*
* @scenario mount_path=reload, selection=none
* @effects counter_matches_checked_state
*/
it('상품이 0건이면 전체 선택 카드 자체가 렌더되지 않는다', async () => {
const testUtils = createLayoutTest(wrapperLayout as any, {
componentRegistry: registry,
initialState: { _local: { selectedItems: [], allSelected: false } },
});
testUtils.mockApi('cartItems', { response: cartResponse(0) });
await testUtils.render();
// 감싸는 if 가 `items.length > 0` 이므로 카운터 Span 자체가 없다
expect(screen.queryByText(/^\(\d*\/\d+\)$/)).toBeNull();
testUtils.cleanup();
});
/**
* @scenario mount_path=spa_return, selection=none
* @effects counter_matches_checked_state
*/
it('분모·분자 모두 폴백이 있어 데이터가 비어도 빈 문자열이 되지 않는다', () => {
const counter = collectStringsContaining(cartListPartial, '/{{cartItems').find((t) =>
t.startsWith('(')
);
// 값이 없을 때 나오는 문자열을 실제로 계산해 본다 (엔진과 동일한 네이티브 평가)
const exprs = [...(counter ?? '').matchAll(/\{\{([\s\S]*?)\}\}/g)].map((m) => m[1]);
expect(exprs.length).toBe(2);
const rendered = exprs.map((e) =>
// eslint-disable-next-line no-new-func
new Function('_local', 'cartItems', `return (${e});`)({}, { data: {} })
);
expect(rendered).toEqual([0, 0]);
});
});
// ========== 2. 정적 회귀 가드 ==========
describe('_cart_list.json — 카운터 표시식 정적 가드 (#92)', () => {
const counterTexts = collectStringsContaining(cartListPartial, '/{{cartItems');
it('카운터 표시식이 존재한다', () => {
expect(counterTexts.length, '카운터 표시식을 찾지 못했다').toBeGreaterThan(0);
});
it('초기화되지 않는 _local.selectedCount 를 더 이상 참조하지 않는다', () => {
const json = JSON.stringify(cartListPartial);
expect(json).not.toContain('_local.selectedCount');
});
it('선택 개수는 SSoT(selectedItems) 파생 + 0 폴백으로 표시한다', () => {
const counter = counterTexts.find((t) => t.startsWith('('));
expect(counter, '`(선택/전체)` 형태의 카운터가 없다').toBeTruthy();
expect(counter).toContain('_local.selectedItems?.length ?? 0');
});
it('분모는 주문 요약과 동일한 item_count 폴백을 쓴다', () => {
const counter = counterTexts.find((t) => t.startsWith('('));
expect(counter).toContain('cartItems.data.item_count ?? 0');
});
});
describe('_modal_cart_option_change.json — 재고 표시 옵셔널 가드 (B-6/B-7)', () => {
const refs = collectStringsContaining(cartOptionChangeModal, 'matchedOption');
/**
* @scenario mount_path=initial_load, selection=all
* @effects modal_stock_display_guarded
*/
it('matchedOption 하위 접근은 전부 옵셔널 체이닝을 쓴다', () => {
expect(refs.length).toBeGreaterThan(0);
const unguarded = refs.filter((r) => /matchedOption\.[A-Za-z_]/.test(r));
expect(
unguarded,
`matchedOption 뒤에 '?.' 없는 역참조: ${unguarded.join(' | ')}`
).toEqual([]);
});
});
describe('_edit.json — 알림 수신 Checkbox 명시 바인딩', () => {
/** 게시판 알림 설정 체크박스 4종 */
const NOTIFY_FIELDS = [
'notify_post_complete',
'notify_post_reply',
'notify_comment',
'notify_reply_comment',
];
/** 이름으로 Checkbox 노드를 찾는다 */
function findCheckbox(name: string): any {
let found: any = null;
walk(profileEditPartial, (n) => {
if (n.name === 'Checkbox' && (n.props as any)?.name === name) found = n;
});
return found;
}
/**
* 자동바인딩은 저장값이 boolean 일 때만 checked 로 붙고, 아니면 빈 문자열을 보내
* 저장값을 null 로 고착시킨다. 값의 타입을 화면이 전제하지 않도록 명시 바인딩을 쓴다.
*
* 마운트 경로·선택 상태 축과 무관한 정적 계약이라 @scenario 는 달지 않는다
* (조합 커버리지는 위 9건이 이미 전수 담당한다).
*
* @effects profile_notification_checkbox_explicit_binding
*/
it.each(NOTIFY_FIELDS)('%s 가 autoBinding:false + checked + change 액션을 갖는다', (field) => {
const node = findCheckbox(field);
expect(node, `${field} Checkbox 를 찾지 못했다`).toBeTruthy();
expect(node.props.autoBinding).toBe(false);
expect(node.props.checked).toBe(`{{!!_local.profileEditForm?.${field}}}`);
const change = (node.actions ?? []).find((a: any) => a.type === 'change');
expect(change, `${field} 에 change 액션이 없다`).toBeTruthy();
expect(change.handler).toBe('setState');
expect(change.params.target).toBe('local');
expect(change.params[`profileEditForm.${field}`]).toBe('{{$event.target.checked}}');
});
});
describe('_edit.json — 프로필 오류 메시지 옵셔널 가드 (회색지대)', () => {
const refs = collectStringsContaining(profileEditPartial, 'profileErrors');
/**
* @scenario mount_path=initial_load, selection=none
* @effects profile_error_display_guarded
*/
it('profileErrors 하위 접근은 전부 옵셔널 체이닝을 쓴다', () => {
expect(refs.length).toBeGreaterThan(0);
const unguarded = refs.filter((r) => /profileErrors\.[A-Za-z_]/.test(r));
expect(
unguarded,
`profileErrors 뒤에 '?.' 없는 역참조: ${unguarded.join(' | ')}`
).toEqual([]);
});
/**
* @scenario mount_path=initial_load, selection=partial
* @effects profile_error_display_guarded
*/
it('오류 메시지 표시식은 배열 인덱스에도 옵셔널 + 빈 문자열 폴백을 쓴다', () => {
const messageTexts = refs.filter((r) => /profileErrors\??\.[A-Za-z_]+\??\.\[0\]/.test(r));
expect(messageTexts.length, '오류 메시지 표시식을 찾지 못했다').toBeGreaterThan(0);
for (const t of messageTexts) {
expect(t, `폴백 없는 오류 메시지 표시식: ${t}`).toContain("?? ''");
}
});
});
@@ -201,7 +201,7 @@ const cartLayoutFixture = {
type: 'basic',
name: 'Span',
props: { className: 'text-gray-500', 'data-testid': 'selected-count' },
text: '({{_local.selectedCount ?? 0}}/{{cartItems.data.items?.length ?? 0}})',
text: '({{_local.selectedItems?.length ?? 0}}/{{cartItems.data.item_count ?? 0}})',
},
],
},
@@ -605,7 +605,7 @@ describe('장바구니 페이지 레이아웃 렌더링', () => {
const testUtils = createLayoutTest(cartLayoutFixture, {
componentRegistry: registry,
initialState: {
_local: { selectedItems: [1, 2], allSelected: true, selectedCount: 2 },
_local: { selectedItems: [1, 2], allSelected: true },
},
});
@@ -643,7 +643,7 @@ describe('장바구니 페이지 레이아웃 렌더링', () => {
const testUtils = createLayoutTest(cartLayoutFixture, {
componentRegistry: registry,
initialState: {
_local: { selectedItems: [1], allSelected: false, selectedCount: 1 },
_local: { selectedItems: [1], allSelected: false },
},
});
@@ -680,7 +680,7 @@ describe('장바구니 페이지 레이아웃 렌더링', () => {
const testUtils = createLayoutTest(cartLayoutFixture, {
componentRegistry: registry,
initialState: {
_local: { selectedItems: [1, 2], allSelected: true, selectedCount: 2 },
_local: { selectedItems: [1, 2], allSelected: true },
},
});
@@ -717,7 +717,7 @@ describe('장바구니 페이지 레이아웃 렌더링', () => {
const testUtils = createLayoutTest(cartLayoutFixture, {
componentRegistry: registry,
initialState: {
_local: { selectedItems: [], allSelected: false, selectedCount: 0 },
_local: { selectedItems: [], allSelected: false },
},
});
@@ -117,8 +117,14 @@ describe('cartHandlers', () => {
}));
});
// #131: 선택 변경 후 selectedCount 업데이트
it('#131 선택 변경 후 selectedCount가 업데이트된다', () => {
/**
* #131: 선택 개수는 selectedItems 파생 — 별도 카운터를 기록하지 않는다 (공개 이슈 #92).
* 화면 카운터가 파생해 쓰는 SSoT 를 핸들러가 실제로 갱신하는지 고정한다.
*
* @scenario mount_path=initial_load, selection=partial
* @effects counter_matches_checked_state
*/
it('#131 선택 변경 시 selectedItems 만 갱신하고 selectedCount 는 기록하지 않는다', () => {
// Given
mockG7Core.state.get.mockReturnValue({
cartItems: {
@@ -137,10 +143,14 @@ describe('cartHandlers', () => {
// When
toggleCartItemSelectionHandler(action);
// Then
expect(mockG7Core.state.setLocal).toHaveBeenCalledWith(expect.objectContaining({
selectedCount: 1,
}));
// Then: 선택 목록이 SSoT — 화면 카운터는 여기서 파생한다
expect(mockG7Core.state.setLocal).toHaveBeenCalledWith({
selectedItems: [2],
allSelected: false,
});
// 파생 가능한 값을 별도 키로 중복 저장하면 최초 마운트 구간에서 비어 보인다 (#92)
const payload = mockG7Core.state.setLocal.mock.calls[0][0];
expect(payload).not.toHaveProperty('selectedCount');
});
});
@@ -162,7 +172,6 @@ describe('cartHandlers', () => {
expect(mockG7Core.state.setLocal).toHaveBeenCalledWith({
selectedItems: [],
allSelected: false,
selectedCount: 0,
});
});
@@ -183,7 +192,6 @@ describe('cartHandlers', () => {
expect(mockG7Core.state.setLocal).toHaveBeenCalledWith({
selectedItems: [1, 2, 3],
allSelected: true,
selectedCount: 3,
});
});
});
@@ -6,8 +6,10 @@
* G7Core.dispatch 로 navigate 를 발화한다. errorHandling context 에 route/query 가 없는
* 제약을 우회하는 핵심 동작이므로 실제 호출 인자를 단언한다(거짓 통과 방지).
*
* @scenario has_query:with_query,without_query
* @effects redirect_preserves_pathname,redirect_preserves_query_string
* 이 핸들러는 세 진입점이 공유하므로 특정 entry_point 축에 매이지 않는다 —
* query 유무(with/without) 양쪽을 여기서 한 번 실측하고 effects 로만 마킹한다.
*
* @effects redirect_preserves_pathname, redirect_preserves_query_string
*/
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
@@ -126,10 +126,11 @@ export function toggleCartItemSelectionHandler(
const allItems = globalState.cartItems?.data?.items || [];
const allSelected = allItems.length > 0 && newSelected.length === allItems.length;
// 선택 개수는 selectedItems 에서 파생해 표시하므로 별도 카운터를 기록하지 않는다.
// (카운터를 따로 두면 최초 마운트처럼 핸들러가 아직 실행되지 않은 구간에서 값이 비어 있다 — 공개 이슈 #92)
setLocalState({
selectedItems: newSelected,
allSelected,
selectedCount: newSelected.length,
});
// 선택 변경 후 계산 결과 갱신을 위해 데이터소스 재조회
@@ -151,10 +152,10 @@ export function selectAllCartItemsHandler(
): void {
const { allItemIds, isSelected } = action?.params || {};
// 선택 개수는 selectedItems 파생 (별도 카운터 미기록 — 공개 이슈 #92)
setLocalState({
selectedItems: isSelected ? allItemIds : [],
allSelected: isSelected,
selectedCount: isSelected ? allItemIds.length : 0,
});
// 선택 변경 후 계산 결과 갱신을 위해 데이터소스 재조회
@@ -5,7 +5,7 @@
"ko": "Basic",
"en": "Basic"
},
"version": "1.1.0",
"version": "1.1.1",
"license": "MIT",
"description": {
"ko": "그누보드7 기본 사용자 템플릿",
@@ -11,9 +11,15 @@ description: |
- 비밀글 로그인 버튼이 미설정 {{_global.currentPath}} 를 redirect 로 써 항상 빈 값 → 동일 핸들러로 교체.
- 로그인 폼은 기존 규약 {{query.redirect ?? '/'}} 로 복귀(변경 없음).
# axis 의미:
# 갈라지는 축은 진입 지점 하나다 — 세 지점 각각이 redirectToLoginWithReturn 을 실제로
# 물고 있는지가 화면마다 달라진다.
# 원경로 query 유무는 그 축과 교차하지 않는다. 세 진입점이 같은 핸들러 하나로 수렴하고,
# query 보존은 그 핸들러가 window.location 을 읽는 방식이 정하므로 진입점과 무관하다.
# 따라서 3×2 조합이 아니라 (진입점 3) + (핸들러 성질 1) 이며, query 보존은
# redirect_preserves_query_string effect 로 핸들러 단위테스트가 with/without 양쪽을 실측한다.
axes:
entry_point: [board_list_401, board_show_401, secret_post_login_button] # 진입 지점 3종
has_query: [with_query, without_query] # 원경로 query 유무
effects:
- redirect_preserves_pathname # /login?redirect=<pathname>
@@ -30,10 +36,12 @@ validation:
audit_rule: frontend-change-requires-e2e
browser_check: Chrome MCP # Playwright 인프라 미구축 — Chrome MCP 정밀 점검으로 브라우저 검증 대체
note: |
test-scenario-coverage 는 axes cross-product 와 effects 가 테스트 docblock @scenario/@effects 로
커버되길 요구한다. Playwright spec 부재이므로 위 단위/레이아웃 테스트 docblock 에 @scenario(axis 키)
/@effects 를 마킹해 cross-product·effects 를 커버한다.
- 핸들러 단위테스트: has_query(with/without) + redirect_preserves_pathname/query_string
- 401 레이아웃 테스트: entry_point(board_list_401,board_show_401) + redirect_preserves_pathname/login_returns_to_original_path
- 비밀글 레이아웃 테스트: entry_point(secret_post_login_button) + secret_button_redirect_not_empty/login_returns_to_original_path
test-scenario-coverage 는 axes cross product 와 effects 가 테스트 docblock 의
`@scenario k=v` / `@effects e1, e2` 마킹으로 커버되길 요구한다 (구분자는 `=` 와 `,` 다 —
`k:v` 로 적으면 파서가 조합을 읽지 못해 아무것도 커버하지 못한 채 조용히 통과한다).
Playwright spec 부재이므로 아래 단위/레이아웃 테스트 docblock 이 그 역할을 대신한다.
- 401 레이아웃 테스트: describe 별로 entry_point=board_show_401 / board_list_401 분리 마킹
- 비밀글 레이아웃 테스트: entry_point=secret_post_login_button
- 핸들러 단위테스트: 특정 진입점에 매이지 않으므로 @effects 만 —
redirect_preserves_pathname / redirect_preserves_query_string 을 with/without 양쪽 실측
sirsoft-basic 템플릿 Playwright E2E 인프라 구축은 별도 후속 과제(구축 후 정식 spec 으로 이관).
@@ -0,0 +1,53 @@
feature: 장바구니 전체 선택 개수 표시 (선택 상태 파생 카운터)
description: |
장바구니 상단 "전체 선택" 옆 개수는 선택 상태의 SSoT 인 `_local.selectedItems` 에서 파생해
`(선택/전체)` 로 표시한다. 어떤 마운트 경로(최초 진입 / 새로고침 / SPA 복귀)에서도, 어떤 선택
상태(전체 / 부분 / 미선택)에서도 값이 비지 않고 체크박스·주문 요약과 일치해야 한다.
수정 이력 (공개 이슈 #92):
- 표시식이 `{{_local.selectedCount}}` 였다. `selectedCount` 는 체크박스 change 핸들러에서만
기록되므로 최초 마운트 구간에서는 undefined 이고, 엔진이 undefined 를 빈 문자열로 서식해
`(/27)` 로 보였다. 예외·콘솔 에러가 없어 표시로만 드러나는 결함이었다.
- 표시식을 `{{_local.selectedItems?.length ?? 0}}/{{cartItems.data.item_count ?? 0}}` 로 교체.
같은 화면 주문 요약(`_cart_summary.json`)이 쓰던 표현식과 동일 형태여서 두 카운터의
계산 방식 비대칭도 함께 해소했다.
- 핸들러(`cartHandlers.ts`)의 `selectedCount` 기록은 소비처가 사라져 제거했다.
같은 결함 클래스(초기값 없는 키를 옵셔널 없이 하위 접근)의 방어 수정도 이 시나리오가 함께 고정한다:
- 장바구니 옵션변경 모달 재고 안내(`matchedOption`)
- 마이페이지 프로필 오류 메시지(`profileErrors` — 가드와 표시식의 옵셔널 엇갈림)
- 마이페이지 알림 수신 체크박스 4종 — 값의 타입(boolean)을 화면이 전제하지 않도록
자동바인딩 대신 `autoBinding:false` + `checked` + `change` 명시 바인딩으로 전환
axes:
mount_path: [initial_load, reload, spa_return] # 진입 / 새로고침 / SPA 이동 후 복귀
selection: [all, partial, none] # 선택 상태 3종
effects:
- counter_matches_checked_state # 카운터 선택 수 = 실제 체크된 항목 수 (빈 문자열 금지)
- counter_matches_summary_panel # 카운터 = 주문 요약 "선택 상품 N / M개" 와 동일 값
- modal_stock_display_guarded # 옵션변경 모달 재고 표기가 값 부재 구간에서 공백/NaN 이 아님
- profile_error_display_guarded # 프로필 오류 메시지 표시식이 가드 소실 시에도 안전
- profile_notification_checkbox_explicit_binding # 알림 수신 체크박스가 저장값 타입에 무관하게 checked 를 확정 (자동바인딩 미의존)
test_files:
- templates/_bundled/sirsoft-basic/src/__tests__/layouts/cart-select-count-initial.test.tsx
- templates/_bundled/sirsoft-basic/src/handlers/__tests__/cartHandlers.test.ts
validation:
audit_rule: frontend-change-requires-e2e
browser_check: Chrome MCP # sirsoft-basic Playwright E2E 인프라 미구축 — Chrome MCP 정밀 점검으로 대체
note: |
test-scenario-coverage 는 axes cross product(3×3=9)와 effects 를 테스트 docblock
`@scenario k=v, k=v` / `@effects e1, e2` 마킹으로 커버하길 요구한다. Playwright spec 이
없으므로 레이아웃 렌더링 테스트의 docblock 으로 9개 조합을 전수 마킹했다.
마운트 경로 축의 한계: jsdom 렌더링 테스트에서 initial_load / reload / spa_return 은 모두
"초기 _local 시드 상태로부터의 새 마운트" 라는 같은 코드 경로다. 세 경로가 실제로 갈라지는
지점(브라우저 새로고침, SPA 라우팅 복귀 시 데이터소스 재조회)의 구분은 Chrome MCP 정밀 점검
매트릭스 T1/T6/T7 이 실측으로 담당한다. 단위 계층은 "어느 마운트에서도 카운터가 비지 않는다"
를 고정하는 역할이다.
counter_matches_summary_panel 은 두 카운터가 동일 표현식(selectedItems 파생 + item_count 분모)
을 쓰는지로 판정한다 — 표현식이 같으면 값이 갈릴 수 없다.