Merge pull request from gnuboard:HeuJung/issue647

fix(admin_basic,basic): 상한 총 건수 목록의 페이지 번호 목록 복원
This commit is contained in:
정정홍 authored and GitHub committed 2026-09-04 18:54:39 +09:00
commit 8f072895ff
14 files changed
+356 -43

No files matched your search

+2 -1
View File
@@ -87,6 +87,7 @@ FULLTEXT(`MATCH ... AGAINST`) 검색에서 이 차이가 크게 드러난다.
| 다음 페이지 이동 | **그대로 가능** — `per_page + 1` 조회로 정확히 판정 |
| 이전 페이지 이동 | 그대로 가능 |
| 마지막 페이지 점프 | **감춤** — 총 건수를 알아야 계산되는 유일한 값 |
| 페이지 번호 목록 | 그대로 — 1 부터 현재 페이지까지와, 다음이 있으면 현재+1 을 그린다. 그 너머는 존재 여부를 모르므로 계속됨 표시(`...`)만 둔다 |
마지막 페이지 점프를 감추는 것은 기능 축소가 아니라 **계산 불가 사실의 정직한 표시**다.
그 버튼은 대량 매칭에서 초대형 OFFSET 을 실행하므로, 눌러도 정상 응답이 오지 않는 경우가 많다.
@@ -318,7 +319,7 @@ HookManager::addFilter('core.pagination.filter_result_cap', function (int $cap,
| Prop | 의미 |
|---|---|
| `totalPages` | 마지막 페이지. **`null` 이면 페이지 번호 목록과 마지막 페이지 점프가 사라진다** |
| `totalPages` | 마지막 페이지. **`null` 이면 마지막 페이지 점프만 사라진다** — 번호 목록은 1..현재(+다음이 있으면 현재+1)까지 그대로 그린다. 번호 목록까지 비우면 앞 페이지로 직접 뛰어갈 방법이 없어진다 |
| `hasMorePages` | 다음 페이지 존재 여부. 총 건수를 몰라도 정확하다 |
| `showFirst` / `showLast` | 첫/마지막 버튼을 따로 제어 (미지정 시 `showFirstLast` 를 따름) |
@@ -122,7 +122,7 @@ admin/`)이 이 템플릿의 베이스(`_admin_base`)를 extends 하고 이 템
| 종류 | 개수 | 위치 |
|---|---|---|
| PHPUnit | 0개 | — |
| Vitest | 206개 | `vitest.config.ts` |
| Vitest | 207개 | `vitest.config.ts` |
| Playwright | 9개 | `tests/Playwright` |
| 시나리오 매니페스트 | 2개 | `tests/scenarios` |
@@ -26,6 +26,7 @@
### Fixed
- 기록이 아주 많아 총 건수를 정확히 세지 못한 목록(활동 로그 등)에서 페이지 번호가 전부 사라지고 현재 페이지 숫자 하나만 남던 문제를 수정했습니다. 이제 1 부터 현재 페이지까지의 번호와 다음 페이지 번호가 그대로 표시되어 앞 페이지로 바로 이동할 수 있으며, 감춰지는 것은 마지막 페이지로 뛰는 버튼뿐입니다.
- 설정 파일의 자산 항목이 실제 파일 위치와 달랐던 것을 정정했습니다. 존재하지 않는 글꼴·이미지 폴더 항목은 제거했습니다.
- 환경설정 > 일반의 「자산 URL 방식 자동 감지」가 감지 결과를 선택 항목과 저장 내용에 반영합니다. 종전에는 버튼을 눌러도 선택이 그대로였고 진행·결과 안내도 표시되지 않았습니다.
- 대시보드 알림 중 일부 경고가 일반 안내와 같은 회색으로 표시되어 경고로 보이지 않던 문제를 수정했습니다. 이제 알림의 심각도에 따라 색이 정해집니다.
@@ -1,4 +1,4 @@
var SirsoftAdminBasic=(function(R,h,v,Vn){"use strict";var eD=Object.defineProperty;var tD=(R,h,v)=>h in R?eD(R,h,{enumerable:!0,configurable:!0,writable:!0,value:v}):R[h]=v;var $e=(R,h,v)=>tD(R,typeof h!="symbol"?h+"":h,v);var Xa,Cr;function Wb(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const $=Wb(v),Gb=()=>window.G7Core,le=v.forwardRef(({children:e,variant:t="primary",size:n="md",className:r="",...s},o)=>{const i="button",a=Gb()?.style?.mergeClasses?.(i,r)??`${i} ${r}`;return h.jsx("button",{ref:o,className:a,...s,children:e})});le.displayName="Button";const ou=v.forwardRef(({accept:e,maxSize:t,onChange:n,onError:r,buttonText:s="Browse",placeholder:o="No file selected",className:i="",disabled:a,...l},c)=>{const d=v.useRef(null),u=c||d,[f,g]=v.useState(""),m={},p={};Object.entries(l).forEach(([x,M])=>{x.startsWith("data-editor-")||x==="id"||x==="onMouseMove"||x==="onMouseLeave"?m[x]=M:p[x]=M});const y=v.useCallback(()=>{!a&&u.current&&u.current.click()},[a,u]),b=v.useCallback(x=>{const M=x.target.files?.[0]||null;if(!M){g(""),n?.({target:{value:null,name:""}});return}if(t&&M.size>t*1024*1024){const S=`File size exceeds ${t}MB limit`;r?.(S),u.current&&(u.current.value=""),g("");return}g(M.name),n?.({target:{value:M,name:M.name}})},[t,n,r,u]),_=v.useCallback(x=>{x.stopPropagation(),u.current&&(u.current.value=""),g(""),n?.({target:{value:null,name:""}})},[n,u]);return h.jsxs("div",{className:`flex items-center gap-2 ${i}`,...m,children:[h.jsx("input",{ref:u,type:"file",accept:e,onChange:b,disabled:a,className:"hidden",...p}),h.jsx("button",{type:"button",onClick:y,disabled:a,className:"px-4 py-2 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md text-sm font-medium text-gray-700 dark:text-gray-200 hover:bg-gray-200 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed",children:s}),h.jsx("span",{className:"flex-1 text-sm text-gray-600 dark:text-gray-400 truncate",children:f||o}),f&&!a&&h.jsx("button",{type:"button",onClick:_,className:"p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200","aria-label":"Clear file",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})});ou.displayName="FileInput";const Yb=e=>e==="checkbox"?"checkbox":e==="radio"?"radio":"input",Kb=(e,t)=>{const n=Yb(e);return t?t.split(/\s+/).filter(Boolean).includes(n)?t:`${n} ${t}`:n},Et=v.forwardRef(({label:e,error:t,className:n="",onChange:r,onKeyPress:s,value:o,defaultValue:i,type:a="text",checked:l,defaultChecked:c,...d},u)=>{const f=a==="radio"||a==="checkbox",g=Kb(a,n),m=v.useRef(!1),p=v.useRef(null);v.useImperativeHandle(u,()=>p.current);const[y,b]=v.useState(o??i??"");v.useEffect(()=>{if(!f&&!m.current&&o!==void 0){if(p.current&&document.activeElement===p.current)return;b(o)}},[o,f]);const _=v.useCallback(()=>{m.current=!0},[]),x=v.useCallback(E=>{if(m.current=!1,r){const T=E.target.value;b(T);const P=new Event("change",{bubbles:!0});Object.defineProperty(P,"target",{writable:!1,value:{value:T}}),Object.defineProperty(P,"currentTarget",{writable:!1,value:{value:T}}),r(P)}},[r]),M=v.useCallback(E=>{const T=E.target.value;b(T),!m.current&&r&&r(E)},[r]),S=v.useCallback(E=>{m.current||s&&s(E)},[s]),{loadingactions:k,formdata:N,...C}=d;if(f)return h.jsx("input",{ref:p,type:a,className:g,onChange:r,checked:l,defaultChecked:c,value:o,...C});const w=o!==void 0?{value:y}:{defaultValue:i};return h.jsx("input",{ref:p,type:a,className:g,onChange:M,onKeyPress:S,onCompositionStart:_,onCompositionEnd:x,...w,...C})});Et.displayName="Input";const lr=({label:e,error:t,className:n="",onChange:r,value:s,defaultValue:o,...i})=>{const a=v.useRef(!1),l=v.useRef(null),[c,d]=v.useState(s??o??"");v.useEffect(()=>{!a.current&&s!==void 0&&d(s)},[s]);const u=v.useCallback(()=>{a.current=!0},[]),f=v.useCallback(M=>{if(a.current=!1,r){const S=M.target.value;d(S);const k=new Event("change",{bubbles:!0});Object.defineProperty(k,"target",{writable:!1,value:{value:S}}),Object.defineProperty(k,"currentTarget",{writable:!1,value:{value:S}}),r(k)}},[r]),g=v.useCallback(M=>{const S=M.target.value;d(S),!a.current&&r&&r(M)},[r]),{loadingactions:m,formdata:p,...y}=i,b=s!==void 0?{value:c}:{defaultValue:o},x=(n??"").split(/\s+/).filter(Boolean).includes("textarea")?n??"":["textarea",n].filter(Boolean).join(" ");return h.jsx("textarea",{ref:l,className:x,onChange:g,onCompositionStart:u,onCompositionEnd:f,...b,...y})},gn=({children:e,className:t="",...n})=>h.jsx("label",{className:t,...n,children:e}),I=v.forwardRef(({children:e,className:t="",...n},r)=>h.jsx("div",{ref:r,classNameLine truncated
var SirsoftAdminBasic=(function(R,h,v,Vn){"use strict";var eD=Object.defineProperty;var tD=(R,h,v)=>h in R?eD(R,h,{enumerable:!0,configurable:!0,writable:!0,value:v}):R[h]=v;var $e=(R,h,v)=>tD(R,typeof h!="symbol"?h+"":h,v);var Xa,Cr;function Wb(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const $=Wb(v),Gb=()=>window.G7Core,le=v.forwardRef(({children:e,variant:t="primary",size:n="md",className:r="",...s},o)=>{const i="button",a=Gb()?.style?.mergeClasses?.(i,r)??`${i} ${r}`;return h.jsx("button",{ref:o,className:a,...s,children:e})});le.displayName="Button";const ou=v.forwardRef(({accept:e,maxSize:t,onChange:n,onError:r,buttonText:s="Browse",placeholder:o="No file selected",className:i="",disabled:a,...l},c)=>{const d=v.useRef(null),u=c||d,[f,g]=v.useState(""),m={},p={};Object.entries(l).forEach(([x,M])=>{x.startsWith("data-editor-")||x==="id"||x==="onMouseMove"||x==="onMouseLeave"?m[x]=M:p[x]=M});const y=v.useCallback(()=>{!a&&u.current&&u.current.click()},[a,u]),b=v.useCallback(x=>{const M=x.target.files?.[0]||null;if(!M){g(""),n?.({target:{value:null,name:""}});return}if(t&&M.size>t*1024*1024){const S=`File size exceeds ${t}MB limit`;r?.(S),u.current&&(u.current.value=""),g("");return}g(M.name),n?.({target:{value:M,name:M.name}})},[t,n,r,u]),_=v.useCallback(x=>{x.stopPropagation(),u.current&&(u.current.value=""),g(""),n?.({target:{value:null,name:""}})},[n,u]);return h.jsxs("div",{className:`flex items-center gap-2 ${i}`,...m,children:[h.jsx("input",{ref:u,type:"file",accept:e,onChange:b,disabled:a,className:"hidden",...p}),h.jsx("button",{type:"button",onClick:y,disabled:a,className:"px-4 py-2 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md text-sm font-medium text-gray-700 dark:text-gray-200 hover:bg-gray-200 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed",children:s}),h.jsx("span",{className:"flex-1 text-sm text-gray-600 dark:text-gray-400 truncate",children:f||o}),f&&!a&&h.jsx("button",{type:"button",onClick:_,className:"p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200","aria-label":"Clear file",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})});ou.displayName="FileInput";const Yb=e=>e==="checkbox"?"checkbox":e==="radio"?"radio":"input",Kb=(e,t)=>{const n=Yb(e);return t?t.split(/\s+/).filter(Boolean).includes(n)?t:`${n} ${t}`:n},Et=v.forwardRef(({label:e,error:t,className:n="",onChange:r,onKeyPress:s,value:o,defaultValue:i,type:a="text",checked:l,defaultChecked:c,...d},u)=>{const f=a==="radio"||a==="checkbox",g=Kb(a,n),m=v.useRef(!1),p=v.useRef(null);v.useImperativeHandle(u,()=>p.current);const[y,b]=v.useState(o??i??"");v.useEffect(()=>{if(!f&&!m.current&&o!==void 0){if(p.current&&document.activeElement===p.current)return;b(o)}},[o,f]);const _=v.useCallback(()=>{m.current=!0},[]),x=v.useCallback(E=>{if(m.current=!1,r){const T=E.target.value;b(T);const P=new Event("change",{bubbles:!0});Object.defineProperty(P,"target",{writable:!1,value:{value:T}}),Object.defineProperty(P,"currentTarget",{writable:!1,value:{value:T}}),r(P)}},[r]),M=v.useCallback(E=>{const T=E.target.value;b(T),!m.current&&r&&r(E)},[r]),S=v.useCallback(E=>{m.current||s&&s(E)},[s]),{loadingactions:k,formdata:N,...C}=d;if(f)return h.jsx("input",{ref:p,type:a,className:g,onChange:r,checked:l,defaultChecked:c,value:o,...C});const w=o!==void 0?{value:y}:{defaultValue:i};return h.jsx("input",{ref:p,type:a,className:g,onChange:M,onKeyPress:S,onCompositionStart:_,onCompositionEnd:x,...w,...C})});Et.displayName="Input";const lr=({label:e,error:t,className:n="",onChange:r,value:s,defaultValue:o,...i})=>{const a=v.useRef(!1),l=v.useRef(null),[c,d]=v.useState(s??o??"");v.useEffect(()=>{!a.current&&s!==void 0&&d(s)},[s]);const u=v.useCallback(()=>{a.current=!0},[]),f=v.useCallback(M=>{if(a.current=!1,r){const S=M.target.value;d(S);const k=new Event("change",{bubbles:!0});Object.defineProperty(k,"target",{writable:!1,value:{value:S}}),Object.defineProperty(k,"currentTarget",{writable:!1,value:{value:S}}),r(k)}},[r]),g=v.useCallback(M=>{const S=M.target.value;d(S),!a.current&&r&&r(M)},[r]),{loadingactions:m,formdata:p,...y}=i,b=s!==void 0?{value:c}:{defaultValue:o},x=(n??"").split(/\s+/).filter(Boolean).includes("textarea")?n??"":["textarea",n].filter(Boolean).join(" ");return h.jsx("textarea",{ref:l,className:x,onChange:g,onCompositionStart:u,onCompositionEnd:f,...b,...y})},gn=({children:e,className:t="",...n})=>h.jsx("label",{className:t,...n,children:e}),I=v.forwardRef(({children:e,className:t="",...n},r)=>h.jsx("div",{ref:r,classNameLine truncated
inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-medium
${ue?"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300":"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300"}
`,children:[h.jsx(ae,{name:"globe",className:"w-3 h-3"}),U(K),ue&&h.jsx(J,{className:"text-red-500 dark:text-red-400",children:"*"}),!ue&&h.jsx(le,{type:"button",className:"ml-0.5 p-0.5 rounded-full hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",onClick:()=>z(K),disabled:l,children:h.jsx(ae,{name:"xmark",className:"w-3 h-3"})})]}),ue&&Q&&Y()]}),n==="textarea"?h.jsx(lr,{name:`${f}[${K}]`,value:S[K]||"",onChange:me=>D(K,me.target.value),placeholder:ee,required:a&&ue,disabled:l,maxLength:c,rows:d,className:`${se} resize-vertical`}):h.jsx(Et,{type:"text",name:`${f}[${K}]`,value:S[K]||"",onChange:me=>D(K,me.target.value),placeholder:ee,required:a&&ue,disabled:l,maxLength:c,className:ne})]},K)},[f,S,D,i,a,l,c,d,n,U,x,z,Y,b]),W=v.useCallback(K=>{const Q=b?"input input-error":"input",ne=b?"textarea input-error":"textarea",se=`${i}${i?" (":""}${U(K)}${i?")":""}`;return h.jsx(I,{children:n==="textarea"?h.jsx(lr,{name:`${f}[${K}]`,value:S[K]||"",onChange:ue=>D(K,ue.target.value),placeholder:se,required:a&&K===x,disabled:l,maxLength:c,rows:d,className:`${ne} resize-vertical`}):h.jsx(Et,{type:"text",name:`${f}[${K}]`,value:S[K]||"",onChange:ue=>D(K,ue.target.value),placeholder:se,required:a&&K===x,disabled:l,maxLength:c,className:Q})},K)},[f,S,D,i,a,l,c,d,n,x,U,b]),G=()=>h.jsx(I,{className:u,children:h.jsx(I,{className:"space-y-4",children:w.map((K,Q)=>B(K,Q===0))})}),V=()=>h.jsxs(I,{className:u,children:[h.jsxs(I,{className:"flex flex-wrap items-center gap-2 mb-3",children:[w.map(K=>h.jsxs(le,{type:"button",className:`
@@ -280,4 +280,4 @@ self.addEventListener('message', async (e) => {
* Released under the MIT License
*/class AO{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,s){const o=n.listeners[s],i=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:i,currentStep:Math.min(r-n.start,i)}))}_refresh(){this._request||(this._running=!0,this._request=H0.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,s)=>{if(!r.running||!r.items.length)return;const o=r.items;let i=o.length-1,a=!1,l;for(;i>=0;--i)l=o[i],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(o[i]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,r,t,"progress")),o.length||(r.running=!1,this._notify(s,r,t,"complete"),r.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,s)=>Math.max(r,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let s=r.length-1;for(;s>=0;--s)r[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var sr=new AO;const dm="transparent",DO={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=G0(e||dm),s=r.valid&&G0(t||dm);return s&&s.valid?s.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class IO{constructor(t,n,r,s){const o=n[r];s=_a([t.to,s,o,t.from]);const i=_a([t.from,o,s]);this._active=!0,this._fn=t.fn||DO[t.type||typeof i],this._easing=Do[t.easing]||Do.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=i,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const s=this._target[this._prop],o=r-this._start,i=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(i,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=_a([t.to,n,s,t.from]),this._from=_a([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,s=this._prop,o=this._from,i=this._loop,a=this._to;let l;if(this._active=o!==a&&(i||n<r),!this._active){this._target[s]=a,this._notify(!0);return}if(n<0){this._target[s]=o;return}l=n/r%2,l=i&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let s=0;s<r.length;s++)r[s][n]()}}class um{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Qe(t))return;const n=Object.keys(_t.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!Qe(o))return;const i={};for(const a of n)i[a]=o[a];(Dt(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!r.has(a))&&r.set(a,i)})})}_animateOptions(t,n){const r=n.options,s=PO(t,r);if(!s)return[];const o=this._createAnimations(s,r);return r.$shared&&LO(t.options.$animations,r).then(()=>{t.options=r},()=>{}),o}_createAnimations(t,n){const r=this._properties,s=[],o=t.$animations||(t.$animations={}),i=Object.keys(n),a=Date.now();let l;for(l=i.length-1;l>=0;--l){const c=i[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,n));continue}const d=n[c];let u=o[c];const f=r.get(c);if(u)if(f&&u.active()){u.update(f,d,a);continue}else u.cancel();if(!f||!f.duration){t[c]=d;continue}o[c]=u=new IO(f,t,c,d),s.push(u)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return sr.add(this._chart,r),!0}}function LO(e,t){const n=[],r=Object.keys(t);for(let s=0;s<r.length;s++){const o=e[r[s]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function PO(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function fm(e,t){const n=e&&e.options||{},r=n.reverse,s=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:r?o:s,end:r?s:o}}function $O(e,t,n){if(n===!1)return!1;const r=fm(e,n),s=fm(t,n);return{top:s.end,right:r.end,bottom:s.start,left:r.start}}function FO(e){let t,n,r,s;return Qe(e)?(t=e.top,n=e.right,r=e.bottom,s=e.left):t=n=r=s=e,{top:t,right:n,bottom:r,left:s,disabled:e===!1}}function hm(e,t){const n=[],r=e._getSortedDatasetMetas(t);let s,o;for(s=0,o=r.length;s<o;++s)n.push(r[s].indLine truncated
`)>-1?e.split(`
`):e}function O5(e,t){const{element:n,datasetIndex:r,index:s}=t,o=e.getDatasetMeta(r).controller,{label:i,value:a}=o.getLabelAndValue(s);return{chart:e,label:i,parsed:o.getParsed(s),raw:e.data.datasets[r].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:r,element:n}}function nb(e,t){const n=e.chart.ctx,{body:r,footer:s,title:o}=e,{boxWidth:i,boxHeight:a}=t,l=Rt(t.bodyFont),c=Rt(t.titleFont),d=Rt(t.footerFont),u=o.length,f=s.length,g=r.length,m=_n(t.padding);let p=m.height,y=0,b=r.reduce((M,S)=>M+S.before.length+S.lines.length+S.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,u&&(p+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),b){const M=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=g*M+(b-g)*l.lineHeight+(b-1)*t.bodySpacing}f&&(p+=t.footerMarginTop+f*d.lineHeight+(f-1)*t.footerSpacing);let _=0;const x=function(M){y=Math.max(y,n.measureText(M).width+_)};return n.save(),n.font=c.string,at(e.title,x),n.font=l.string,at(e.beforeBody.concat(e.afterBody),x),_=t.displayColors?i+2+t.boxPadding:0,at(r,M=>{at(M.before,x),at(M.lines,x),at(M.after,x)}),_=0,n.font=d.string,at(e.footer,x),n.restore(),y+=m.width,{width:y,height:p}}function T5(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function A5(e,t,n,r){const{x:s,width:o}=r,i=n.caretSize+n.caretPadding;if(e==="left"&&s+o+i>t.width||e==="right"&&s-o-i<0)return!0}function D5(e,t,n,r){const{x:s,width:o}=n,{width:i,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=i-o/2&&(c="right"),A5(c,e,t,n)&&(c="center"),c}function rb(e,t,n){const r=n.yAlign||t.yAlign||T5(e,n);return{xAlign:n.xAlign||t.xAlign||D5(e,t,n,r),yAlign:r}}function I5(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function L5(e,t,n){let{y:r,height:s}=e;return t==="top"?r+=n:t==="bottom"?r-=s+n:r-=s/2,r}function sb(e,t,n,r){const{caretSize:s,caretPadding:o,cornerRadius:i}=e,{xAlign:a,yAlign:l}=n,c=s+o,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:g}=Ns(i);let m=I5(t,a);const p=L5(t,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(d,f)+s:a==="right"&&(m+=Math.max(u,g)+s),{x:cn(m,0,r.width-t.width),y:cn(p,0,r.height-t.height)}}function Ha(e,t,n){const r=_n(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function ob(e){return qn([],or(e))}function P5(e,t,n){return Os(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function ib(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const ab={beforeTitle:nr,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:nr,beforeBody:nr,beforeLabel:nr,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return ft(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:nr,afterBody:nr,beforeFooter:nr,footer:nr,afterFooter:nr};function dn(e,t,n,r){const s=e[t].call(n,r);return typeof s>"u"?ab[t].call(n,r):s}class jd extends Yr{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),s=r.enabled&&n.options.animation&&r.animations,o=new um(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=P5(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,s=dn(r,"beforeTitle",this,t),o=dn(r,"title",this,t),i=dn(r,"afterTitle",this,t);let a=[];return a=qn(a,or(s)),a=qn(a,or(o)),a=qn(a,or(i)),a}getBeforeBody(t,n){return ob(dn(n.call Line truncated
`):e}function O5(e,t){const{element:n,datasetIndex:r,index:s}=t,o=e.getDatasetMeta(r).controller,{label:i,value:a}=o.getLabelAndValue(s);return{chart:e,label:i,parsed:o.getParsed(s),raw:e.data.datasets[r].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:r,element:n}}function nb(e,t){const n=e.chart.ctx,{body:r,footer:s,title:o}=e,{boxWidth:i,boxHeight:a}=t,l=Rt(t.bodyFont),c=Rt(t.titleFont),d=Rt(t.footerFont),u=o.length,f=s.length,g=r.length,m=_n(t.padding);let p=m.height,y=0,b=r.reduce((M,S)=>M+S.before.length+S.lines.length+S.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,u&&(p+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),b){const M=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=g*M+(b-g)*l.lineHeight+(b-1)*t.bodySpacing}f&&(p+=t.footerMarginTop+f*d.lineHeight+(f-1)*t.footerSpacing);let _=0;const x=function(M){y=Math.max(y,n.measureText(M).width+_)};return n.save(),n.font=c.string,at(e.title,x),n.font=l.string,at(e.beforeBody.concat(e.afterBody),x),_=t.displayColors?i+2+t.boxPadding:0,at(r,M=>{at(M.before,x),at(M.lines,x),at(M.after,x)}),_=0,n.font=d.string,at(e.footer,x),n.restore(),y+=m.width,{width:y,height:p}}function T5(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function A5(e,t,n,r){const{x:s,width:o}=r,i=n.caretSize+n.caretPadding;if(e==="left"&&s+o+i>t.width||e==="right"&&s-o-i<0)return!0}function D5(e,t,n,r){const{x:s,width:o}=n,{width:i,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=i-o/2&&(c="right"),A5(c,e,t,n)&&(c="center"),c}function rb(e,t,n){const r=n.yAlign||t.yAlign||T5(e,n);return{xAlign:n.xAlign||t.xAlign||D5(e,t,n,r),yAlign:r}}function I5(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function L5(e,t,n){let{y:r,height:s}=e;return t==="top"?r+=n:t==="bottom"?r-=s+n:r-=s/2,r}function sb(e,t,n,r){const{caretSize:s,caretPadding:o,cornerRadius:i}=e,{xAlign:a,yAlign:l}=n,c=s+o,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:g}=Ns(i);let m=I5(t,a);const p=L5(t,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(d,f)+s:a==="right"&&(m+=Math.max(u,g)+s),{x:cn(m,0,r.width-t.width),y:cn(p,0,r.height-t.height)}}function Ha(e,t,n){const r=_n(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function ob(e){return qn([],or(e))}function P5(e,t,n){return Os(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function ib(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const ab={beforeTitle:nr,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:nr,beforeBody:nr,beforeLabel:nr,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return ft(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:nr,afterBody:nr,beforeFooter:nr,footer:nr,afterFooter:nr};function dn(e,t,n,r){const s=e[t].call(n,r);return typeof s>"u"?ab[t].call(n,r):s}class jd extends Yr{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),s=r.enabled&&n.options.animation&&r.animations,o=new um(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=P5(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,s=dn(r,"beforeTitle",this,t),o=dn(r,"title",this,t),i=dn(r,"afterTitle",this,t);let a=[];return a=qn(a,or(s)),a=qn(a,or(o)),a=qn(a,or(i)),a}getBeforeBody(t,n){return ob(dn(n.call Line truncated
@@ -6,8 +6,8 @@ export interface PaginationProps {
* 마지막 페이지 번호
*
* 총 건수가 상한을 넘겨 정확히 세지 않은 목록은 마지막 페이지를 계산할 수 없다.
* 그 경우 서버가 `null` 을 보내며, 페이지 번호 목록과 마지막 페이지 점프가 사라지고
* 이전/다음 이동만 남는다. 0 이나 1 로 채우면 화면이 "1페이지뿐" 이라고 잘못 말하게 된다.
* 그 경우 서버가 `null` 을 보내며, 마지막 페이지 점프만 사라진다. 1 부터 현재 페이지까지와
* (`hasMorePages` 가 참이면) 다음 페이지 번호는 그대로 그린다. 0 이나 1 로 채우면 화면이 "1페이지뿐" 이라고 잘못 말하게 된다.
*/
totalPages: number | null;
onPageChange: (page: number) => void;
@@ -14,8 +14,8 @@ export interface PaginationProps {
* 마지막 페이지 번호
*
* 총 건수가 상한을 넘겨 정확히 세지 않은 목록은 마지막 페이지를 계산할 수 없다.
* 그 경우 서버가 `null` 을 보내며, 페이지 번호 목록과 마지막 페이지 점프가 사라지고
* 이전/다음 이동만 남는다. 0 이나 1 로 채우면 화면이 "1페이지뿐" 이라고 잘못 말하게 된다.
* 그 경우 서버가 `null` 을 보내며, 마지막 페이지 점프만 사라진다. 1 부터 현재 페이지까지와
* (`hasMorePages` 가 참이면) 다음 페이지 번호는 그대로 그린다. 0 이나 1 로 채우면 화면이 "1페이지뿐" 이라고 잘못 말하게 된다.
*/
totalPages: number | null;
onPageChange: (page: number) => void;
@@ -91,8 +91,8 @@ export const Pagination: React.FC<PaginationProps> = ({
editorAttrs,
}) => {
// 총 건수를 정확히 세지 못한 목록은 마지막 페이지를 계산할 수 없다.
// 이때는 페이지 번호 목록과 마지막 페이지 점프를 감추고 이전/다음 이동만 남긴다 —
// 끝까지 넘겨 보는 것은 그대로 가능하다.
// 계산 불가한 값은 마지막 페이지 번호 하나뿐이므로 그 점프만 감춘다. 1 부터 현재
// 페이지까지는 확실히 존재하고, 다음 페이지 존재 여부는 서버가 `hasMorePages` 로 알린다.
const isBounded = totalPages !== null && totalPages !== undefined;
const resolvedTotalPages = isBounded ? (totalPages as number) : 0;
@@ -112,7 +112,21 @@ export const Pagination: React.FC<PaginationProps> = ({
const pages: (number | string)[] = [];
if (!isBounded) {
// 마지막 페이지를 모르면 번호 목록을 만들 수 없다 (현재 페이지만 별도로 표시)
// 마지막 페이지를 모르면 아는 범위(1..현재, 다음이 있으면 현재+1)만 그린다.
// 현재+1 너머는 존재 여부를 모르므로 번호 대신 계속됨 표시만 둔다.
const halfVisible = Math.floor(maxVisiblePages / 2);
const startPage = currentPage <= maxVisiblePages ? 1 : currentPage - halfVisible;
if (startPage > 1) {
pages.push(1);
if (startPage > 2) pages.push('...');
}
for (let i = startPage; i <= currentPage; i++) {
pages.push(i);
}
if (hasMorePages) {
pages.push(currentPage + 1);
pages.push('...');
}
return pages;
}
@@ -160,7 +174,7 @@ export const Pagination: React.FC<PaginationProps> = ({
}
return pages;
}, [currentPage, resolvedTotalPages, isBounded, maxVisiblePages]);
}, [currentPage, resolvedTotalPages, isBounded, maxVisiblePages, hasMorePages]);
const handlePageClick = (page: number) => {
if (page < 1 || page === currentPage) return;
@@ -210,13 +224,8 @@ export const Pagination: React.FC<PaginationProps> = ({
{prevText || <>&#8249;</>}
</Button>
{/* Page Numbers — 마지막 페이지를 모르면 현재 페이지만 표시 */}
{/* Page Numbers — 마지막 페이지를 모르면 아는 범위까지만 표시 */}
<Div className="pagination">
{!isBounded && (
<Span className="px-3 py-1 text-sm text-gray-700 dark:text-gray-300">
{currentPage}
</Span>
)}
{pageNumbers.map((page, index) => {
if (page === '...') {
return (
@@ -0,0 +1,110 @@
import { describe, it, expect, vi } from 'vitest';
import { render, screen, fireEvent } from '@testing-library/react';
import { Pagination } from '../Pagination';
/**
* 마지막 페이지를 모르는 목록의 페이지 번호 목록 회귀
*
* 총 건수가 상한을 넘겨 `last_page` 가 `null` 이면 계산할 수 없는 값은 마지막 페이지
* 번호 하나뿐이다. 1 부터 현재 페이지까지는 확실히 존재하고, 다음 페이지 존재 여부는
* 서버가 `has_more_pages` 로 알린다. 그런데 종전 구현은 번호 목록을 통째로 비우고
* 현재 페이지 숫자 하나만 남겨, 운영자가 앞 페이지로 직접 뛰어갈 방법을 잃었다
* (활동 로그 화면 실측: "총 10000건 이상" 인데 페이저에 "1" 하나).
*
* 합의된 동작(CHANGELOG 7.0.10): 마지막 페이지로 바로 뛰는 버튼만 감춘다.
*/
describe('Pagination — last_page 를 모를 때의 페이지 번호 목록', () => {
// 접근성 이름은 「N페이지」 라벨이므로 번호 버튼은 표시 텍스트로 찾는다
const pageButton = (n: number) =>
screen.queryAllByRole('button').find((b) => b.textContent?.trim() === String(n)) ?? null;
it('1 부터 현재 페이지까지의 번호가 그대로 그려진다', () => {
render(
<Pagination currentPage={5} totalPages={null} hasMorePages={true} onPageChange={vi.fn()} />
);
for (let n = 1; n <= 5; n++) {
expect(pageButton(n)).toBeInTheDocument();
}
expect(pageButton(5)).toHaveAttribute('aria-current', 'page');
});
it('다음 페이지가 있으면 그 번호 하나와 계속됨 표시가 붙고, 그 너머는 그리지 않는다', () => {
render(
<Pagination currentPage={5} totalPages={null} hasMorePages={true} onPageChange={vi.fn()} />
);
expect(pageButton(6)).toBeInTheDocument();
expect(pageButton(7)).not.toBeInTheDocument();
expect(screen.getByText('...')).toBeInTheDocument();
});
it('다음 페이지가 없으면 현재 페이지가 끝이다 — 계속됨 표시도 없다', () => {
render(
<Pagination currentPage={3} totalPages={null} hasMorePages={false} onPageChange={vi.fn()} />
);
expect(pageButton(3)).toBeInTheDocument();
expect(pageButton(4)).not.toBeInTheDocument();
expect(screen.queryByText('...')).not.toBeInTheDocument();
});
it('첫 페이지에서도 번호가 버튼으로 그려진다', () => {
render(
<Pagination currentPage={1} totalPages={null} hasMorePages={true} onPageChange={vi.fn()} />
);
expect(pageButton(1)).toBeInTheDocument();
expect(pageButton(2)).toBeInTheDocument();
});
it('깊은 페이지에서는 앞쪽을 접고 현재 페이지 주변만 남긴다', () => {
render(
<Pagination
currentPage={12}
totalPages={null}
hasMorePages={true}
maxVisiblePages={5}
onPageChange={vi.fn()}
/>
);
expect(pageButton(1)).toBeInTheDocument();
expect(pageButton(2)).not.toBeInTheDocument();
expect(pageButton(10)).toBeInTheDocument();
expect(pageButton(11)).toBeInTheDocument();
expect(pageButton(12)).toBeInTheDocument();
expect(pageButton(13)).toBeInTheDocument();
expect(pageButton(14)).not.toBeInTheDocument();
expect(screen.getAllByText('...')).toHaveLength(2);
});
it('앞 페이지 번호와 다음 페이지 번호를 클릭하면 그 페이지로 이동한다', () => {
const onPageChange = vi.fn();
render(
<Pagination currentPage={5} totalPages={null} hasMorePages={true} onPageChange={onPageChange} />
);
fireEvent.click(pageButton(3)!);
expect(onPageChange).toHaveBeenCalledWith(3);
fireEvent.click(pageButton(6)!);
expect(onPageChange).toHaveBeenCalledWith(6);
});
it('마지막 페이지 점프 버튼만 감춰진다', () => {
render(
<Pagination
currentPage={5}
totalPages={null}
hasMorePages={true}
showFirstLast={true}
onPageChange={vi.fn()}
/>
);
expect(screen.queryByLabelText('마지막 페이지')).not.toBeInTheDocument();
expect(screen.getByLabelText('이전 페이지')).toBeInTheDocument();
expect(screen.getByLabelText('다음 페이지')).toBeInTheDocument();
});
});
+1 -1
View File
@@ -158,7 +158,7 @@ API 까지만 소유하고, 그 API 를 소비해 실제로 그리는 것은 이
| 종류 | 개수 | 위치 |
|---|---|---|
| PHPUnit | 0개 | — |
| Vitest | 142개 | `vitest.config.ts` |
| Vitest | 143개 | `vitest.config.ts` |
| Playwright | 8개 | `tests/Playwright` |
| 시나리오 매니페스트 | 3개 | `tests/scenarios` |
@@ -17,6 +17,7 @@
### Fixed
- 총 건수를 정확히 세지 못한 목록(대량 검색 결과, 게시글이 아주 많은 게시판 등)에서 페이지 번호가 전부 사라지고 현재 페이지 숫자 하나만 남던 문제를 수정했습니다. 이제 1 부터 현재 페이지까지의 번호와 다음 페이지 번호가 그대로 표시되며, 감춰지는 것은 마지막 페이지로 뛰는 버튼뿐입니다.
- 게시글·페이지 본문을 표시할 때 쓰는 HTML 정화 라이브러리가 구버전에 머물러 있던 문제를 고쳤습니다. 관리자 템플릿과 동일한 최신 버전으로 맞췄습니다. (#126 @jiwonpapa 님께서 제보해주셨습니다.)
- 통화 표시·선호 통화 저장 관련 화면 동작 함수 4종이 실제 호출 규약과 다른 형태로 작성돼 있어, 호출되면 값이 전달되지 않고 상태가 잘못 기록되던 문제를 고쳤습니다.
- 주소 검색을 불러오지 못한 상태에서 주문서의 우편번호·주소를 직접 입력해도 값이 주문에 반영되지 않아 결제 버튼이 계속 눌리지 않던 문제를 고쳤습니다. 이제 직접 입력한 주소로 주문을 끝까지 진행할 수 있습니다.
+10 -10
View File
@@ -1,4 +1,4 @@
var SirsoftBasic=(function(ee,d,C,tr){"use strict";function md(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 A=md(C),bd=()=>window.G7Core,R=C.forwardRef(({children:e,variant:t="primary",size:r="md",className:n="",...o},a)=>{const s="inline-flex items-center justify-center",l=bd()?.style?.mergeClasses?.(s,n)??`${s} ${n}`;return d.jsx("button",{ref:a,className:l,...o,children:e})});R.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}),At=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,w]=C.useState(a??s??"");C.useEffect(()=>{!u&&!g.current&&a!==void 0&&w(a)},[a,u]);const k=C.useCallback(()=>{g.current=!0},[]),M=C.useCallback(y=>{if(g.current=!1,n){const E=y.target.value;w(E);const O=new Event("change",{bubbles:!0});Object.defineProperty(O,"target",{writable:!1,value:{value:E}}),Object.defineProperty(O,"currentTarget",{writable:!1,value:{value:E}}),n(O)}},[n]),v=C.useCallback(y=>{const E=y.target.value;w(E),!g.current&&n&&n(y)},[n]),T=C.useCallback(y=>{g.current||o&&o(y)},[o]),{loadingactions:I,formdata:S,...N}=c;if(u)return d.jsx("input",{ref:p,type:l,className:r,onChange:n,checked:f,defaultChecked:h,value:a,...N});const x=a!==void 0?{value:m}:{defaultValue:s};return d.jsx("input",{ref:p,type:l,className:r,onChange:v,onKeyPress:T,onCompositionStart:k,onCompositionEnd:M,...x,...N})});At.displayName="Input";const cs=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,T])=>{v.startsWith("data-editor-")||v==="id"||v==="onMouseMove"||v==="onMouseLeave"?p[v]=T:m[v]=T});const w=C.useCallback(()=>{!l&&i.current&&i.current.click()},[l,i]),k=C.useCallback(v=>{const T=v.target.files?.[0]||null;if(!T){g(""),r?.(null);return}if(t&&T.size>t*1024*1024){const I=`File size exceeds ${t}MB limit`;n?.(I),i.current&&(i.current.value=""),g("");return}g(T.name),r?.(T)},[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(At,{ref:i,type:"file",accept:e,onChange:k,disabled:l,className:"hidden",...m}),d.jsx(R,{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(te,{className:"flex-1 text-sm text-gray-600 dark:text-gray-400 truncate",children:u||a}),u&&!l&&d.jsx(R,{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"})})})]})});cs.displayName="FileInput";var nt=(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
var SirsoftBasic=(function(ee,d,C,tr){"use strict";function md(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 A=md(C),bd=()=>window.G7Core,R=C.forwardRef(({children:e,variant:t="primary",size:r="md",className:n="",...o},a)=>{const s="inline-flex items-center justify-center",l=bd()?.style?.mergeClasses?.(s,n)??`${s} ${n}`;return d.jsx("button",{ref:a,className:l,...o,children:e})});R.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}),At=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 E=y.target.value;x(E);const O=new Event("change",{bubbles:!0});Object.defineProperty(O,"target",{writable:!1,value:{value:E}}),Object.defineProperty(O,"currentTarget",{writable:!1,value:{value:E}}),n(O)}},[n]),v=C.useCallback(y=>{const E=y.target.value;x(E),!g.current&&n&&n(y)},[n]),T=C.useCallback(y=>{g.current||o&&o(y)},[o]),{loadingactions:I,formdata:S,...N}=c;if(u)return d.jsx("input",{ref:p,type:l,className:r,onChange:n,checked:f,defaultChecked:h,value:a,...N});const w=a!==void 0?{value:m}:{defaultValue:s};return d.jsx("input",{ref:p,type:l,className:r,onChange:v,onKeyPress:T,onCompositionStart:k,onCompositionEnd:M,...w,...N})});At.displayName="Input";const cs=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,T])=>{v.startsWith("data-editor-")||v==="id"||v==="onMouseMove"||v==="onMouseLeave"?p[v]=T:m[v]=T});const x=C.useCallback(()=>{!l&&i.current&&i.current.click()},[l,i]),k=C.useCallback(v=>{const T=v.target.files?.[0]||null;if(!T){g(""),r?.(null);return}if(t&&T.size>t*1024*1024){const I=`File size exceeds ${t}MB limit`;n?.(I),i.current&&(i.current.value=""),g("");return}g(T.name),r?.(T)},[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(At,{ref:i,type:"file",accept:e,onChange:k,disabled:l,className:"hidden",...m}),d.jsx(R,{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(R,{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"})})})]})});cs.displayName="FileInput";var nt=(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(fe,{name:nt.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(fe,{name:nt.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),d.jsxs(R,{onClick:()=>g("light"),className:`
@@ -7,18 +7,18 @@ var SirsoftBasic=(function(ee,d,C,tr){"use strict";function md(e){const t=Object
`,children:[d.jsx(fe,{name:nt.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(fe,{name:nt.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),d.jsxs(R,{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(fe,{name:nt.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(fe,{name:nt.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]})]})})]})},Ld=Object.freeze(Object.defineProperty({__proto__:null,ThemeToggle:An,default:An},Symbol.toStringTag,{value:"Module"})),ys={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"},$d="rounded-full overflow-hidden flex-shrink-0 border border-gray-200 dark:border-gray-700",Fd="grayscale opacity-50",Ao={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"},Qr=({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(()=>[ys[n]||ys.md,$d,u?Fd:"",o].filter(Boolean).join(" "),[n,u,o]),m=g?Ao.guest:u?Ao.withdrawn:Ao.normal,w=()=>g?d.jsx(j,{className:`w-full h-full flex items-center justify-center ${m}`,children:d.jsx(fe,{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(fe,{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(jt,{src:c,alt:i,className:"w-full h-full object-cover"}):w()})},Ud=Object.freeze(Object.defineProperty({__proto__:null,Avatar:Qr},Symbol.toStringTag,{value:"Module"})),zd=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 vs(e,t){return t&&e&&typeof e.id=="string"&&e.id.length>0?{...e,id:`${e.id}__${t}`}:e}const Nn=({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?(zd.error("G7Core or DynamicRenderer not available"),null):d.jsxs(j,{className:t,style:n,id:o,children:[s.map(p=>{const{componentDef:m,dataContext:w,parentFormContext:k,getParentComponentContext:M,translationContext:v}=p,T=vs(m,o);return d.jsx(u,{componentDef:T,dataContext:w,translationContext:v,registry:g.getComponentRegistry(),bindingEngine:g.getDataBindingEngine(),translationEngine:g.getTranslationEngine(),actionDispatcher:g.getActionDispatcher(),parentComponentContext:M?.(),parentFormContextProp:k,isRootRenderer:!1},T.id||`slot-${e}-${p.order}`)}),a]})},Hd=Object.freeze(Object.defineProperty({__proto__:null,SlotContainer:Nn,default:Nn,scopeSlotChildDef:vs},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:w,dropdownAlign:k="right",className:M="",id:v,editorAttrs:T})=>{const[I,S]=C.useState(!1),N=C.useRef(null),x=C.useRef(null),y=C.useRef(null),E=C.useRef(null),O=C.useRef(new Set),$=C.useRef(u),D=C.useRef(r),L=C.useRef(n),U=C.useRef(e.length),_=C.useRef(-1);C.useEffect(()=>{$.current=u,D.current=r,L.current=n,U.current=e.length}),C.useEffect(()=>{if(!E.current||!y.current||!I)return;_.current=-1;const G=new IntersectionObserver(([X])=>{X.isIntersecting&&(L.current||!D.current||_.current!==U.current&&(_.current=U.current,$.current?.()))},{root:y.current,threshold:.1});return G.observe(E.current),()=>G.disconnect()},[I]),C.useEffect(()=>{if(!y.current||!I)return;const G=new IntersectionObserver(B=>{B.forEach(Y=>{const H=Y.target.getAttribute("data-notification-id"),W=Y.target.getAttribute("data-unread")==="true";H&&W&&Y.isIntersecting&&O.current.add(H)})},{root:y.current,threshold:.5});return y.current.querySelectorAll("[data-notification-id]").forEach(B=>G.observe(B)),()=>G.disconnect()},[I, Line truncated
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qd(e,t){return Xd(e)||qd(e,t)||Jd(e,t)||Zd()}function Jd(e,t){if(e){if(typeof e=="string")return _s(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)?_s(e,t):void 0}}const Ss=Object.entries,Es=Object.setPrototypeOf,Rd=Object.isFrozen,eu=Object.getPrototypeOf,tu=Object.getOwnPropertyDescriptor;let ot=Object.freeze,lt=Object.seal,Nr=Object.create,Ts=typeof Reflect<"u"&&Reflect,No=Ts.apply,Oo=Ts.construct;ot||(ot=function(t){return t}),lt||(lt=function(t){return t}),No||(No=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)}),Oo||(Oo=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 dr=tt(Array.prototype.forEach),ru=tt(Array.prototype.lastIndexOf),As=tt(Array.prototype.pop),Jr=tt(Array.prototype.push),nu=tt(Array.prototype.splice),Or=Array.isArray,Rr=tt(String.prototype.toLowerCase),Mo=tt(String.prototype.toString),Ns=tt(String.prototype.match),en=tt(String.prototype.replace),Os=tt(String.prototype.indexOf),ou=tt(String.prototype.trim),au=tt(Number.prototype.toString),su=tt(Boolean.prototype.toString),Ms=typeof BigInt>"u"?null:tt(BigInt.prototype.toString),Is=typeof Symbol>"u"?null:tt(Symbol.prototype.toString),wt=tt(Object.prototype.hasOwnProperty),tn=tt(Object.prototype.toString),gt=tt(RegExp.prototype.test),ur=lu(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 No(e,t,n)}}function lu(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Oo(e,r)}}function Ge(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Rr;if(Es&&Es(e,null),!Or(t))return e;let n=t.length;for(;n--;){let o=t[n];if(typeof o=="string"){const a=r(o);a!==o&&(Rd(t)||(t[n]=a),o=a)}e[o]=!0}return e}function iu(e){for(let t=0;t<e.length;t++)wt(e,t)||(e[t]=null);return e}function Ot(e){const t=Nr(null);for(const n of Ss(e)){var r=Qd(n,2);const o=r[0],a=r[1];wt(e,o)&&(Or(a)?t[o]=iu(a):a&&typeof a=="object"&&a.constructor===Object?t[o]=Ot(a):t[o]=a)}return t}function cu(e){switch(typeof e){case"string":return e;case"number":return au(e);case"boolean":return su(e);case"bigint":return Ms?Ms(e):"0";case"symbol":return Is?Is(e):"Symbol()";case"undefined":return tn(e);case"function":case"object":{if(e===null)return tn(e);const t=e,r=Wt(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 Wt(e,t){for(;e!==null;){const n=tu(e,t);if(n){if(n.get)return tt(n.get);if(typeof n.value=="function")return tt(n.value)}e=eu(e)}function r(){return null}return r}function du(e){try{return gt(e,""),!0}catch{return!1}}const Ps=ot(["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"]),Io=ot(["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"]),Po=ot(["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"]),uu=ot(["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
`+Re),Ee&&(Re=bo(Re)),y&&ie?U(Re):Re},t.setConfig=function(){let J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};as(J),Ke=!0,De=me,q=ge},t.clearConfig=function(){Xr=null,Ke=!1,De=null,q=null,y=O,E=""},t.isValidAttribute=function(J,P,V){Xr||as({});const Z=et(J),re=et(P);return gd(Z,re,V)},t.addHook=function(J,P){typeof P=="function"&&wt(H,J)&&Jr(H[J],P)},t.removeHook=function(J,P){if(wt(H,J)){if(P!==void 0){const V=ru(H[J],P);return V===-1?void 0:nu(H[J],V,1)[0]}return As(H[J])}},t.removeHooks=function(J){wt(H,J)&&(H[J]=[])},t.removeAllHooks=function(){H=Gs()},t}var Fo=js();const Au=()=>{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},Nu=(e,t=!1)=>{window.G7Core?.dispatch?.({handler:"navigate",params:t?{path:e,mergeQuery:!0,query:{}}:{path:e}})},Ou=e=>{const t=Math.round(e*2)/2;return[1,2,3,4,5].map(r=>t>=r?"full":t>=r-.5?"half":"empty")},Bs=({product:e,onClick:t,shopBase:r="/shop",preserveListQuery:n=!1,className:o="",id:a,editorAttrs:s})=>{const l=Au(),f=v=>{const T=`multi_currency_${v}`,I=e[T];if(I&&I[l])return I[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=>Fo.sanitize(v,{ALLOWED_TAGS:["mark"],ALLOWED_ATTR:[]}),w=e.name_highlighted,k=e.description_highlighted??e.short_description,M=()=>{if(t)t(e.id);else{const v=r==="/"?"":r,T=e.product_code??e.id;Nu(`${v}/products/${T}`,n)}};return d.jsxs(R,{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(jt,{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,T)=>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},T))})]}),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})]}),w?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(w)}}):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:[Ou(e.rating_avg??0).map((v,T)=>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"})]},T)),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})]})]})]})},Mu=Object.freeze(Object.defineProperty({__proto__:null,default:Bs},Symbol.toStringTag,{value:"Module"})),Iu={ALLOWED_TAGS:["svg","g","defs","title", Line truncated
`,children:[d.jsx(fe,{name:nt.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(fe,{name:nt.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]})]})})]})},Ld=Object.freeze(Object.defineProperty({__proto__:null,ThemeToggle:An,default:An},Symbol.toStringTag,{value:"Module"})),ys={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"},$d="rounded-full overflow-hidden flex-shrink-0 border border-gray-200 dark:border-gray-700",Fd="grayscale opacity-50",Ao={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"},Qr=({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(()=>[ys[n]||ys.md,$d,u?Fd:"",o].filter(Boolean).join(" "),[n,u,o]),m=g?Ao.guest:u?Ao.withdrawn:Ao.normal,x=()=>g?d.jsx(j,{className:`w-full h-full flex items-center justify-center ${m}`,children:d.jsx(fe,{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(fe,{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(jt,{src:c,alt:i,className:"w-full h-full object-cover"}):x()})},Ud=Object.freeze(Object.defineProperty({__proto__:null,Avatar:Qr},Symbol.toStringTag,{value:"Module"})),zd=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 vs(e,t){return t&&e&&typeof e.id=="string"&&e.id.length>0?{...e,id:`${e.id}__${t}`}:e}const Nn=({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?(zd.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,T=vs(m,o);return d.jsx(u,{componentDef:T,dataContext:x,translationContext:v,registry:g.getComponentRegistry(),bindingEngine:g.getDataBindingEngine(),translationEngine:g.getTranslationEngine(),actionDispatcher:g.getActionDispatcher(),parentComponentContext:M?.(),parentFormContextProp:k,isRootRenderer:!1},T.id||`slot-${e}-${p.order}`)}),a]})},Hd=Object.freeze(Object.defineProperty({__proto__:null,SlotContainer:Nn,default:Nn,scopeSlotChildDef:vs},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:T})=>{const[I,S]=C.useState(!1),N=C.useRef(null),w=C.useRef(null),y=C.useRef(null),E=C.useRef(null),O=C.useRef(new Set),$=C.useRef(u),P=C.useRef(r),L=C.useRef(n),U=C.useRef(e.length),_=C.useRef(-1);C.useEffect(()=>{$.current=u,P.current=r,L.current=n,U.current=e.length}),C.useEffect(()=>{if(!E.current||!y.current||!I)return;_.current=-1;const G=new IntersectionObserver(([X])=>{X.isIntersecting&&(L.current||!P.current||_.current!==U.current&&(_.current=U.current,$.current?.()))},{root:y.current,threshold:.1});return G.observe(E.current),()=>G.disconnect()},[I]),C.useEffect(()=>{if(!y.current||!I)return;const G=new IntersectionObserver(B=>{B.forEach(Y=>{const H=Y.target.getAttribute("data-notification-id"),W=Y.target.getAttribute("data-unread")==="true";H&&W&&Y.isIntersecting&&O.current.add(H)})},{root:y.current,threshold:.5});return y.current.querySelectorAll("[data-notification-id]").forEach(B=>G.observe(B)),()=>G.disconnect()},[I, Line truncated
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qd(e,t){return Xd(e)||qd(e,t)||Jd(e,t)||Zd()}function Jd(e,t){if(e){if(typeof e=="string")return _s(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)?_s(e,t):void 0}}const Ss=Object.entries,Es=Object.setPrototypeOf,Rd=Object.isFrozen,eu=Object.getPrototypeOf,tu=Object.getOwnPropertyDescriptor;let ot=Object.freeze,lt=Object.seal,Nr=Object.create,Ts=typeof Reflect<"u"&&Reflect,No=Ts.apply,Oo=Ts.construct;ot||(ot=function(t){return t}),lt||(lt=function(t){return t}),No||(No=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)}),Oo||(Oo=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 dr=tt(Array.prototype.forEach),ru=tt(Array.prototype.lastIndexOf),As=tt(Array.prototype.pop),Jr=tt(Array.prototype.push),nu=tt(Array.prototype.splice),Or=Array.isArray,Rr=tt(String.prototype.toLowerCase),Mo=tt(String.prototype.toString),Ns=tt(String.prototype.match),en=tt(String.prototype.replace),Os=tt(String.prototype.indexOf),ou=tt(String.prototype.trim),au=tt(Number.prototype.toString),su=tt(Boolean.prototype.toString),Ms=typeof BigInt>"u"?null:tt(BigInt.prototype.toString),Is=typeof Symbol>"u"?null:tt(Symbol.prototype.toString),wt=tt(Object.prototype.hasOwnProperty),tn=tt(Object.prototype.toString),gt=tt(RegExp.prototype.test),ur=lu(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 No(e,t,n)}}function lu(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Oo(e,r)}}function Ge(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Rr;if(Es&&Es(e,null),!Or(t))return e;let n=t.length;for(;n--;){let o=t[n];if(typeof o=="string"){const a=r(o);a!==o&&(Rd(t)||(t[n]=a),o=a)}e[o]=!0}return e}function iu(e){for(let t=0;t<e.length;t++)wt(e,t)||(e[t]=null);return e}function Ot(e){const t=Nr(null);for(const n of Ss(e)){var r=Qd(n,2);const o=r[0],a=r[1];wt(e,o)&&(Or(a)?t[o]=iu(a):a&&typeof a=="object"&&a.constructor===Object?t[o]=Ot(a):t[o]=a)}return t}function cu(e){switch(typeof e){case"string":return e;case"number":return au(e);case"boolean":return su(e);case"bigint":return Ms?Ms(e):"0";case"symbol":return Is?Is(e):"Symbol()";case"undefined":return tn(e);case"function":case"object":{if(e===null)return tn(e);const t=e,r=Wt(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 Wt(e,t){for(;e!==null;){const n=tu(e,t);if(n){if(n.get)return tt(n.get);if(typeof n.value=="function")return tt(n.value)}e=eu(e)}function r(){return null}return r}function du(e){try{return gt(e,""),!0}catch{return!1}}const Ds=ot(["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"]),Io=ot(["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"]),Do=ot(["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"]),uu=ot(["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
`+Re),Ee&&(Re=bo(Re)),y&&ie?U(Re):Re},t.setConfig=function(){let J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};as(J),Ke=!0,Pe=me,q=ge},t.clearConfig=function(){Xr=null,Ke=!1,Pe=null,q=null,y=O,E=""},t.isValidAttribute=function(J,D,V){Xr||as({});const Z=et(J),re=et(D);return gd(Z,re,V)},t.addHook=function(J,D){typeof D=="function"&&wt(H,J)&&Jr(H[J],D)},t.removeHook=function(J,D){if(wt(H,J)){if(D!==void 0){const V=ru(H[J],D);return V===-1?void 0:nu(H[J],V,1)[0]}return As(H[J])}},t.removeHooks=function(J){wt(H,J)&&(H[J]=[])},t.removeAllHooks=function(){H=Gs()},t}var Fo=js();const Au=()=>{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},Nu=(e,t=!1)=>{window.G7Core?.dispatch?.({handler:"navigate",params:t?{path:e,mergeQuery:!0,query:{}}:{path:e}})},Ou=e=>{const t=Math.round(e*2)/2;return[1,2,3,4,5].map(r=>t>=r?"full":t>=r-.5?"half":"empty")},Bs=({product:e,onClick:t,shopBase:r="/shop",preserveListQuery:n=!1,className:o="",id:a,editorAttrs:s})=>{const l=Au(),f=v=>{const T=`multi_currency_${v}`,I=e[T];if(I&&I[l])return I[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=>Fo.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,T=e.product_code??e.id;Nu(`${v}/products/${T}`,n)}};return d.jsxs(R,{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(jt,{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,T)=>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},T))})]}),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:[Ou(e.rating_avg??0).map((v,T)=>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"})]},T)),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})]})]})]})},Mu=Object.freeze(Object.defineProperty({__proto__:null,default:Bs},Symbol.toStringTag,{value:"Module"})),Iu={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:oi(u.labelKey),children:[d.jsx(te,{className:h[o],children:u.emoji}),d.jsx(te,{children:oi(u.labelKey)}),g>0&&d.jsx(te,{className:"font-medium",children:g})]},u.type)})})},Bg=Object.freeze(Object.defineProperty({__proto__:null,default:ai},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)},Pt=(e,t)=>window.G7Core?.t?.(e,t)??e,si=({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,w]=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=E=>{jn.log("Apply format:",E)},T=async E=>{const O=new FormData;O.append("file",E);try{const $=await fetch(o,{method:"POST",body:O,credentials:"include"});if(!$.ok)throw new Error("업로드 실패");const D=await $.json();jn.log("Image uploaded:",D.url)}catch($){jn.error("이미지 업로드 오류:",$)}},I=E=>{const O=E.target.files?.[0];O&&T(O)},S=()=>{k&&(jn.log("Insert link:",k),w(!1),M(""))},N=[{format:"bold",icon:"B",title:Pt("editor.toolbar.bold")},{format:"italic",icon:"I",title:Pt("editor.toolbar.italic")},{format:"underline",icon:"U",title:Pt("editor.toolbar.underline")},{format:"strike",icon:"S",title:Pt("editor.toolbar.strike")},{format:"code",icon:"</>",title:Pt("editor.toolbar.code")}],x=[{format:"h1",label:"H1"},{format:"h2",label:"H2"},{format:"h3",label:"H3"}],y=[{format:"bulletList",icon:"•",title:Pt("editor.toolbar.bullet_list")},{format:"orderedList",icon:"1.",title:Pt("editor.toolbar.ordered_list")},{format:"blockquote",icon:"❝",title:Pt("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:N.map(E=>d.jsx(R,{type:"button",onClick:()=>v(E.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:E.title,children:E.icon},E.format))}),d.jsx(j,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:x.map(E=>d.jsx(R,{type:"button",onClick:()=>v(E.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:E.label},E.format))}),d.jsx(j,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:y.map(E=>d.jsx(R,{type:"button",onClick:()=>v(E.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:E.title,children:E.icon},E.format))}),d.jsxs(j,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:[d.jsx(R,{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:Pt("editor.toolbar.link"),children:"🔗"}),d.jsxs(Ar,{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(At,{type:"file",accept:"image/*",onChange:I,disabled:s,className:"hidden"})]})]}),d.jsxs(R,{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:["</>",Pt("editor.toolbar.code_view")]})]}),g?d.jsx(ko,{value:i,onChange:E=>u(E.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:E=>u(E.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(At,{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:Pt("edi Line truncated
`,title:oi(u.labelKey),children:[d.jsx(te,{className:h[o],children:u.emoji}),d.jsx(te,{children:oi(u.labelKey)}),g>0&&d.jsx(te,{className:"font-medium",children:g})]},u.type)})})},Bg=Object.freeze(Object.defineProperty({__proto__:null,default:ai},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)},Dt=(e,t)=>window.G7Core?.t?.(e,t)??e,si=({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=E=>{jn.log("Apply format:",E)},T=async E=>{const O=new FormData;O.append("file",E);try{const $=await fetch(o,{method:"POST",body:O,credentials:"include"});if(!$.ok)throw new Error("업로드 실패");const P=await $.json();jn.log("Image uploaded:",P.url)}catch($){jn.error("이미지 업로드 오류:",$)}},I=E=>{const O=E.target.files?.[0];O&&T(O)},S=()=>{k&&(jn.log("Insert link:",k),x(!1),M(""))},N=[{format:"bold",icon:"B",title:Dt("editor.toolbar.bold")},{format:"italic",icon:"I",title:Dt("editor.toolbar.italic")},{format:"underline",icon:"U",title:Dt("editor.toolbar.underline")},{format:"strike",icon:"S",title:Dt("editor.toolbar.strike")},{format:"code",icon:"</>",title:Dt("editor.toolbar.code")}],w=[{format:"h1",label:"H1"},{format:"h2",label:"H2"},{format:"h3",label:"H3"}],y=[{format:"bulletList",icon:"•",title:Dt("editor.toolbar.bullet_list")},{format:"orderedList",icon:"1.",title:Dt("editor.toolbar.ordered_list")},{format:"blockquote",icon:"❝",title:Dt("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:N.map(E=>d.jsx(R,{type:"button",onClick:()=>v(E.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:E.title,children:E.icon},E.format))}),d.jsx(j,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:w.map(E=>d.jsx(R,{type:"button",onClick:()=>v(E.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:E.label},E.format))}),d.jsx(j,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:y.map(E=>d.jsx(R,{type:"button",onClick:()=>v(E.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:E.title,children:E.icon},E.format))}),d.jsxs(j,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:[d.jsx(R,{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:Dt("editor.toolbar.link"),children:"🔗"}),d.jsxs(Ar,{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(At,{type:"file",accept:"image/*",onChange:I,disabled:s,className:"hidden"})]})]}),d.jsxs(R,{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:["</>",Dt("editor.toolbar.code_view")]})]}),g?d.jsx(ko,{value:i,onChange:E=>u(E.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:E=>u(E.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(At,{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:Dt("edi Line truncated
whitespace-pre-wrap
text-gray-900 dark:text-gray-100
font-sans
${n}
`.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 Fo.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 Fo.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
@@ -40,7 +40,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
[&_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(j,{id:a,className:c,dangerouslySetInnerHTML:{__html:h},...s})},Vg=Object.freeze(Object.defineProperty({__proto__:null,HtmlContent:ga},Symbol.toStringTag,{value:"Module"})),ha=()=>window.G7Core,pa=(e,t)=>ha()?.t?.(e,t)??e,li=({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,k]=C.useState(r),[M,v]=C.useState(e),[T,I]=C.useState(!1);C.useEffect(()=>{k(r)},[r]),C.useEffect(()=>{v(e)},[e]);const S=C.useCallback(y=>{const E=y.target.value;if(v(E),t){const O=ha()?.createChangeEvent?.({value:E,name:i,type:"textarea"})??{target:{name:i,value:E}};t(O)}},[t,i]),N=C.useCallback(y=>{const E=y.target.checked;if(k(E),E||I(!1),n){const O=ha()?.createChangeEvent?.({checked:E,name:u,type:"checkbox"})??{target:{name:u,checked:E}};n(O)}},[n,u]),x=C.useCallback(()=>{I(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(Ar,{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:[w&&!g&&d.jsx(R,{type:"button",onClick:x,className:`px-3 py-1.5 text-xs font-bold rounded-lg focus:outline-none focus:ring-2 ${T?"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:pa(T?"common.preview_off":"common.preview")}),l&&d.jsxs(Ar,{className:"flex items-center gap-2 p-2 cursor-pointer",children:[d.jsx(At,{type:"checkbox",name:u,checked:w,onChange:N,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:pa("common.html_mode")})]})]})]}),!T&&d.jsx(ko,{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 ${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"}`}),T&&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(ga,{content:M,isHtml:!0,className:f||"prose dark:prose-invert max-w-none text-gray-900 dark:text-gray-100",purifyConfig:h})})]})},Kg=Object.freeze(Object.defineProperty({__proto__:null,HtmlEditor:li},Symbol.toStringTag,{value:"Module"})),ii=e=>window.G7Core?.t?.(e)??e,ma=({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 w=i.current.scrollHeight;c(w>e)}},[e]);C.useEffect(()=>{u();const w=i.current;if(!w)return;const k=w.querySelectorAll("img");k.forEach(v=>{v.complete||v.addEventListener("load",u)});let M=null;return typeof ResizeObserver<"u"&&(M=new ResizeObserver(u),M.observe(w)),()=>{k.forEach(v=>{v.removeEventListener("load",u)}),M?.disconnect()}},[u,o]);const g=()=>{f(w=>!w)},p=t||ii("sirsoft-ecommerce.shop.product.expand_detail"),m=r||ii("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(R,{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(fe,{name:l?"chevron-up":"chevron-down",size:"sm"})]})]})},Yg=Object.freeze(Object.defineProperty({__proto__:null,ExpandableContent:ma,default:ma},Symbol.toStringTag,{value:"Module"})),Xg=(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})},Vg=Object.freeze(Object.defineProperty({__proto__:null,HtmlContent:ga},Symbol.toStringTag,{value:"Module"})),ha=()=>window.G7Core,pa=(e,t)=>ha()?.t?.(e,t)??e,li=({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),[T,I]=C.useState(!1);C.useEffect(()=>{k(r)},[r]),C.useEffect(()=>{v(e)},[e]);const S=C.useCallback(y=>{const E=y.target.value;if(v(E),t){const O=ha()?.createChangeEvent?.({value:E,name:i,type:"textarea"})??{target:{name:i,value:E}};t(O)}},[t,i]),N=C.useCallback(y=>{const E=y.target.checked;if(k(E),E||I(!1),n){const O=ha()?.createChangeEvent?.({checked:E,name:u,type:"checkbox"})??{target:{name:u,checked:E}};n(O)}},[n,u]),w=C.useCallback(()=>{I(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(Ar,{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(R,{type:"button",onClick:w,className:`px-3 py-1.5 text-xs font-bold rounded-lg focus:outline-none focus:ring-2 ${T?"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:pa(T?"common.preview_off":"common.preview")}),l&&d.jsxs(Ar,{className:"flex items-center gap-2 p-2 cursor-pointer",children:[d.jsx(At,{type:"checkbox",name:u,checked:x,onChange:N,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:pa("common.html_mode")})]})]})]}),!T&&d.jsx(ko,{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"}`}),T&&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(ga,{content:M,isHtml:!0,className:f||"prose dark:prose-invert max-w-none text-gray-900 dark:text-gray-100",purifyConfig:h})})]})},Kg=Object.freeze(Object.defineProperty({__proto__:null,HtmlEditor:li},Symbol.toStringTag,{value:"Module"})),ii=e=>window.G7Core?.t?.(e)??e,ma=({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||ii("sirsoft-ecommerce.shop.product.expand_detail"),m=r||ii("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(R,{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(fe,{name:l?"chevron-up":"chevron-down",size:"sm"})]})]})},Yg=Object.freeze(Object.defineProperty({__proto__:null,ExpandableContent:ma,default:ma},Symbol.toStringTag,{value:"Module"})),Xg=(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
@@ -59,14 +59,14 @@ self.addEventListener('message', async (e) => {
self.postMessage({ error: e.message + '\\n' + e.stack, id })
}
})
`;let ka;function ah(e,t){return new Promise(((r,n)=>{ka||(ka=(function(s){const l=[];return l.push(s),URL.createObjectURL(new Blob(l))})(oh));const o=new Worker(ka);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 nh))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 ki(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 ki(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",ah(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=ui(e,a))}catch{}return r(a)}}))}mt.getDataUrlFromFile=pi,mt.getFilefromDataUrl=xa,mt.loadImage=mi,mt.drawImageInCanvas=yi,mt.drawFileInCanvas=Yn,mt.canvasToFile=Xn,mt.getExifOrientation=vi,mt.handleMaxWidthOrHeight=wi,mt.followExifOrientation=xi,mt.cleanupCanvasMemory=Qt,mt.isAutoOrientationInBrowser=Hr,mt.approximateBelowMaximumCanvasSizeOfBrowser=bi,mt.copyExifWithoutOrientation=ui,mt.getBrowserName=wr,mt.version="2.0.2";const sh=window.G7Core,qn=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]}`},Ci=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:"업로드 실패"},_i=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",at=(e,t)=>sh?.t?.(e,t)??e,lh="2.0.2";function ih(){const e=window?.G7Core?.asset;if(typeof e?.template=="function")return e.template("sirsoft-basic",`vendor/browser-image-compression/${lh}/browser-image-compression.js`)}const xr=window.G7Core;function Si(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:k,uploadTriggerEvent:M,confirmBeforeRemove:v,uploadParams:T}=e,[I,S]=C.useState(i),[N,x]=C.useState([]),[y,E]=C.useState(!1),O=C.useRef(null),$=C.useRef(0),D=C.useRef(new Set),L=C.useRef(new Map),[U,_]=C.useState(!1),[b,z]=C.useState(null),[F,G]=C.useState(!1),X=C.useRef(!1),[B,Y]=C.useState([]),H=C.useRef(i),[W,Q]=C.useState(!1),[be,se]=C.useState(0),pe=C.useRef(0),[ne,Ae]=C.useState(new Map),ve=C.useRef(new Map);C.useEffect(()=>{g?.(N)},[N,g]);const We=C.useMemo(()=>{const q=H.current;return q===i?q:q.length!==i.length?(H.current=i,i):q.length===0&&i.length===0?q:i.some((de,ue)=>de.id!==q[ue]?.id)?(H.current=i,i):q},[i]);C.useEffect(()=>{if(X.current)return;const q=We.filter(ue=>!D.current.has(ue.id)&&(!ue.hash||!D.current.has(ue.hash))),le=new Set(q.map(ue=>ue.id)),de=Array.from(L.current.values()).filter(ue=>!le.has(ue.id)&&!D.current.has(ue.id));S([...q,...de])},[We]);const me=C.useCallback(async q=>{const le={maxSizeMB:f?.maxSizeMB??1,maxWidthOrHeight:f?.maxWidthOrHeight??1920,useWebWorker:!0,libURL:ih()};return await mt(q,le)},[f]),Te=C.useCallback(async q=>{const le=I.length+N.length,de=Math.max(0,o-le),ue=Array.from(q).slice(0,de);if(q.length>de){const ie=Array.from(q).slice(de),Fe=at("attachment.upload_limit_exceeded",{max:o});m?.(Fe,ie[0]??q[0])}for(const ie of ue){if(ie.size>a*1024*1024){m?.(`[${ie.name}] 파일 크기(${qn(ie.size)})가 최대 Line truncated
`;let ka;function ah(e,t){return new Promise(((r,n)=>{ka||(ka=(function(s){const l=[];return l.push(s),URL.createObjectURL(new Blob(l))})(oh));const o=new Worker(ka);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 nh))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 ki(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 ki(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",ah(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=ui(e,a))}catch{}return r(a)}}))}mt.getDataUrlFromFile=pi,mt.getFilefromDataUrl=xa,mt.loadImage=mi,mt.drawImageInCanvas=yi,mt.drawFileInCanvas=Yn,mt.canvasToFile=Xn,mt.getExifOrientation=vi,mt.handleMaxWidthOrHeight=wi,mt.followExifOrientation=xi,mt.cleanupCanvasMemory=Qt,mt.isAutoOrientationInBrowser=Hr,mt.approximateBelowMaximumCanvasSizeOfBrowser=bi,mt.copyExifWithoutOrientation=ui,mt.getBrowserName=wr,mt.version="2.0.2";const sh=window.G7Core,qn=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]}`},Ci=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:"업로드 실패"},_i=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",at=(e,t)=>sh?.t?.(e,t)??e,lh="2.0.2";function ih(){const e=window?.G7Core?.asset;if(typeof e?.template=="function")return e.template("sirsoft-basic",`vendor/browser-image-compression/${lh}/browser-image-compression.js`)}const xr=window.G7Core;function Si(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:T}=e,[I,S]=C.useState(i),[N,w]=C.useState([]),[y,E]=C.useState(!1),O=C.useRef(null),$=C.useRef(0),P=C.useRef(new Set),L=C.useRef(new Map),[U,_]=C.useState(!1),[b,z]=C.useState(null),[F,G]=C.useState(!1),X=C.useRef(!1),[B,Y]=C.useState([]),H=C.useRef(i),[W,Q]=C.useState(!1),[be,se]=C.useState(0),pe=C.useRef(0),[ne,Ae]=C.useState(new Map),ve=C.useRef(new Map);C.useEffect(()=>{g?.(N)},[N,g]);const We=C.useMemo(()=>{const q=H.current;return q===i?q:q.length!==i.length?(H.current=i,i):q.length===0&&i.length===0?q:i.some((de,ue)=>de.id!==q[ue]?.id)?(H.current=i,i):q},[i]);C.useEffect(()=>{if(X.current)return;const q=We.filter(ue=>!P.current.has(ue.id)&&(!ue.hash||!P.current.has(ue.hash))),le=new Set(q.map(ue=>ue.id)),de=Array.from(L.current.values()).filter(ue=>!le.has(ue.id)&&!P.current.has(ue.id));S([...q,...de])},[We]);const me=C.useCallback(async q=>{const le={maxSizeMB:f?.maxSizeMB??1,maxWidthOrHeight:f?.maxWidthOrHeight??1920,useWebWorker:!0,libURL:ih()};return await mt(q,le)},[f]),Te=C.useCallback(async q=>{const le=I.length+N.length,de=Math.max(0,o-le),ue=Array.from(q).slice(0,de);if(q.length>de){const ie=Array.from(q).slice(de),Fe=at("attachment.upload_limit_exceeded",{max:o});m?.(Fe,ie[0]??q[0])}for(const ie of ue){if(ie.size>a*1024*1024){m?.(`[${ie.name}] 파일 크기(${qn(ie.size)})가 최대 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(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(It,{className:"fa-solid fa-cloud-arrow-up text-4xl text-gray-400 dark:text-gray-500 mb-4"}),d.jsx(Gt,{className:"text-sm text-gray-600 dark:text-gray-400",children:at("attachment.drop_or_click")}),d.jsxs(Gt,{className:"text-xs text-gray-500 dark:text-gray-500 mt-2",children:[at("attachment.upload_limit",{maxFiles:s,maxSize:l}),a&&` (${a})`]})]}),f]});function ch(){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 Zn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Gr(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Ca(e){return"nodeType"in e}function Ct(e){var t,r;return e?Gr(e)?e:Ca(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function _a(e){const{Document:t}=Ct(e);return e instanceof t}function dn(e){return Gr(e)?!1:e instanceof Ct(e).HTMLElement}function Ti(e){return e instanceof Ct(e).SVGElement}function jr(e){return e?Gr(e)?e.document:Ca(e)?_a(e)?e:dn(e)||Ti(e)?e.ownerDocument:document:document:document}const Jt=Zn?C.useLayoutEffect:C.useEffect;function Sa(e){const t=C.useRef(e);return Jt(()=>{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 dh(){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 Jt(()=>{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=Sa(e),r=C.useRef(null),n=C.useCallback(o=>{o!==r.current&&t?.(o,r.current),r.current=o},[]);return[r,n]}function Ea(e){const t=C.useRef();return C.useEffect(()=>{t.current=e},[e]),t.current}let Ta={};function gn(e,t){return C.useMemo(()=>{if(t)return t;const r=Ta[e]==null?0:Ta[e]+1;return Ta[e]=r,e+"-"+r},[e,t])}function Ai(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 Br=Ai(1),hn=Ai(-1);function uh(e){return"clientX"in e&&"clientY"in e}function Aa(e){if(!e)return!1;const{KeyboardEvent:t}=Ct(e.target);return t&&e instanceof t}function fh(e){if(!e)return!1;const{TouchEvent:t}=Ct(e.target);return t&&e instanceof t}function Na(e){if(fh(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 uh(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}}}),Ni="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function gh(e){return e.matches(Ni)?e:e.querySelector(Ni)}const hh={display:"none"};function ph(e){let{id:t,value:r}=e;return C.createElement("div",{id:t,style:hh},r)}function mh(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 bh(){const[e,t]=C.useState("");return{announce:C.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const Oi=C.createContext(null);function yh(e){const t=C.useContext(Oi);C.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function vh(){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 wh={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.
`},xh={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 kh(e){let{announcements:t=xh,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=wh}=e;const{announce:a,announcement:s}=bh(),l=gn("DndLiveRegion"),[f,h]=C.useState(!1);if(C.useEffect(()=>{h(!0)},[]),yh(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(ph,{id:n,value:o.draggable}),C.createElement(mh,{id:l,announcement:s}));return r?tr.createPortal(c,r):c}var st;(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"})(st||(st={}));function Jn(){}function Mi(e,t){return C.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Ch(){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 qt=Object.freeze({x:0,y:0});function Ii(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Pi(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function _h(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function Di(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 $i(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 Sh=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=$i(t,t.left,t.top),a=[];for(const s of n){const{id:l}=s,f=r.get(l);if(f){const h=Ii($i(f),o);a.push({id:l,data:{droppableContainer:s,value:h}})}}return a.sort(Pi)},Eh=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=Di(t),a=[];for(const s of n){const{id:l}=s,f=r.get(l);if(f){const h=Di(f),c=o.reduce((u,g,p)=>u+Ii(h[p],g),0),i=Number((c/4).toFixed(4));a.push({id:l,data:{droppableContainer:s,value:i}})}}return a.sort(Pi)};function Th(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 Ah=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=Th(l,t);f>0&&o.push({id:s,data:{droppableContainer:a,value:f}})}}return o.sort(_h)};function Nh(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function Fi(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:qt}function Oh(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 Mh=Oh(1);function Ih(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 Ph(e,t,r){const n=Ih(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 Dh={ignoreTransform:!1};function Wr(e,t){t===void 0&&(t=Dh);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:h,transformOrigin:c}=Ct(e).getComputedStyle(e);h&&(r=Ph(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 Ui(e){return Wr(e,{ignoreTransform:!0})}function Lh(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 Fh(e,t){t===void 0&&(t=Ct(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","o Line truncated
`},xh={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 kh(e){let{announcements:t=xh,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=wh}=e;const{announce:a,announcement:s}=bh(),l=gn("DndLiveRegion"),[f,h]=C.useState(!1);if(C.useEffect(()=>{h(!0)},[]),yh(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(ph,{id:n,value:o.draggable}),C.createElement(mh,{id:l,announcement:s}));return r?tr.createPortal(c,r):c}var st;(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"})(st||(st={}));function Jn(){}function Mi(e,t){return C.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Ch(){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 qt=Object.freeze({x:0,y:0});function Ii(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Di(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function _h(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function Pi(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 $i(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 Sh=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=$i(t,t.left,t.top),a=[];for(const s of n){const{id:l}=s,f=r.get(l);if(f){const h=Ii($i(f),o);a.push({id:l,data:{droppableContainer:s,value:h}})}}return a.sort(Di)},Eh=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=Pi(t),a=[];for(const s of n){const{id:l}=s,f=r.get(l);if(f){const h=Pi(f),c=o.reduce((u,g,p)=>u+Ii(h[p],g),0),i=Number((c/4).toFixed(4));a.push({id:l,data:{droppableContainer:s,value:i}})}}return a.sort(Di)};function Th(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 Ah=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=Th(l,t);f>0&&o.push({id:s,data:{droppableContainer:a,value:f}})}}return o.sort(_h)};function Nh(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function Fi(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:qt}function Oh(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 Mh=Oh(1);function Ih(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 Dh(e,t,r){const n=Ih(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 Ph={ignoreTransform:!1};function Wr(e,t){t===void 0&&(t=Ph);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:h,transformOrigin:c}=Ct(e).getComputedStyle(e);h&&(r=Dh(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 Ui(e){return Wr(e,{ignoreTransform:!0})}function Lh(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 Fh(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
@@ -84,4 +84,4 @@ self.addEventListener('message', async (e) => {
transform: translateX(-100%);
}
}
`})]}):null},rp=Object.freeze(Object.defineProperty({__proto__:null,PageTransitionIndicator:ja,default:ja},Symbol.toStringTag,{value:"Module"})),wc=window.G7Core?.createLogger?.("Comp:PageTransitionBlur")??{log:(...e)=>console.log("[Comp:PageTransitionBlur]",...e),warn:(...e)=>console.warn("[Comp:PageTransitionBlur]",...e)},Ba=({className:e="",style:t})=>{const[r,n]=C.useState(!1);return C.useEffect(()=>{const o=window.G7Core?.TransitionManager;if(!o){wc.warn("TransitionManager를 찾을 수 없습니다.");return}return n(o.getIsPending()),o.subscribe(s=>{wc.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},np=Object.freeze(Object.defineProperty({__proto__:null,PageTransitionBlur:Ba,default:Ba},Symbol.toStringTag,{value:"Module"})),xc={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},kc=new Set(["hidden","block","inline-block","inline","flex","inline-flex","grid","inline-grid","table","table-row","table-cell","contents","list-item","flow-root"]),op=new Set(["Div","Flex","Grid","Section","Article","Nav","Aside","Main","Header","Footer","Fragment","Form","Container"]),ap=new Set(["H1","H2","H3","H4","H5","H6","P","Span","Label","A","Strong","Em","Small","Badge"]),sp=new Set(["Input","Textarea","Select","Checkbox","Radio","Toggle","DatePicker","TagInput","SearchBar"]),lp=new Set(["Img","Image","Avatar","AvatarUploader","ImageGallery","ProductImageViewer","FileUploader"]),Cc={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},rp=Object.freeze(Object.defineProperty({__proto__:null,PageTransitionIndicator:ja,default:ja},Symbol.toStringTag,{value:"Module"})),wc=window.G7Core?.createLogger?.("Comp:PageTransitionBlur")??{log:(...e)=>console.log("[Comp:PageTransitionBlur]",...e),warn:(...e)=>console.warn("[Comp:PageTransitionBlur]",...e)},Ba=({className:e="",style:t})=>{const[r,n]=C.useState(!1);return C.useEffect(()=>{const o=window.G7Core?.TransitionManager;if(!o){wc.warn("TransitionManager를 찾을 수 없습니다.");return}return n(o.getIsPending()),o.subscribe(s=>{wc.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},np=Object.freeze(Object.defineProperty({__proto__:null,PageTransitionBlur:Ba,default:Ba},Symbol.toStringTag,{value:"Module"})),xc={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},kc=new Set(["hidden","block","inline-block","inline","flex","inline-flex","grid","inline-grid","table","table-row","table-cell","contents","list-item","flow-root"]),op=new Set(["Div","Flex","Grid","Section","Article","Nav","Aside","Main","Header","Footer","Fragment","Form","Container"]),ap=new Set(["H1","H2","H3","H4","H5","H6","P","Span","Label","A","Strong","Em","Small","Badge"]),sp=new Set(["Input","Textarea","Select","Checkbox","Radio","Toggle","DatePicker","TagInput","SearchBar"]),lp=new Set(["Img","Image","Avatar","AvatarUploader","ImageGallery","ProductImageViewer","FileUploader"]),Cc={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
@@ -6,8 +6,8 @@ export interface PaginationProps {
* 마지막 페이지 번호
*
* 총 건수가 상한을 넘겨 정확히 세지 않은 목록은 마지막 페이지를 계산할 수 없다.
* 그 경우 서버가 `null` 을 보내며, 페이지 번호 목록과 마지막 페이지 점프가 사라지고
* 이전/다음 이동만 남는다. 0 이나 1 로 채우면 화면이 "1페이지뿐" 이라고 잘못 말하게 된다.
* 그 경우 서버가 `null` 을 보내며, 마지막 페이지 점프만 사라진다. 1 부터 현재 페이지까지와
* (`hasMorePages` 가 참이면) 다음 페이지 번호는 그대로 그린다. 0 이나 1 로 채우면 화면이 "1페이지뿐" 이라고 잘못 말하게 된다.
*/
totalPages: number | null;
onPageChange: (page: number) => void;
@@ -14,8 +14,8 @@ export interface PaginationProps {
* 마지막 페이지 번호
*
* 총 건수가 상한을 넘겨 정확히 세지 않은 목록은 마지막 페이지를 계산할 수 없다.
* 그 경우 서버가 `null` 을 보내며, 페이지 번호 목록과 마지막 페이지 점프가 사라지고
* 이전/다음 이동만 남는다. 0 이나 1 로 채우면 화면이 "1페이지뿐" 이라고 잘못 말하게 된다.
* 그 경우 서버가 `null` 을 보내며, 마지막 페이지 점프만 사라진다. 1 부터 현재 페이지까지와
* (`hasMorePages` 가 참이면) 다음 페이지 번호는 그대로 그린다. 0 이나 1 로 채우면 화면이 "1페이지뿐" 이라고 잘못 말하게 된다.
*/
totalPages: number | null;
onPageChange: (page: number) => void;
@@ -93,8 +93,8 @@ export const Pagination: React.FC<PaginationProps> = ({
editorAttrs,
}) => {
// 총 건수를 정확히 세지 못한 목록은 마지막 페이지를 계산할 수 없다.
// 이때는 페이지 번호 목록과 마지막 페이지 점프를 감추고 이전/다음 이동만 남긴다 —
// 끝까지 넘겨 보는 것은 그대로 가능하다.
// 계산 불가한 값은 마지막 페이지 번호 하나뿐이므로 그 점프만 감춘다. 1 부터 현재
// 페이지까지는 확실히 존재하고, 다음 페이지 존재 여부는 서버가 `hasMorePages` 로 알린다.
const isBounded = totalPages !== null && totalPages !== undefined;
const resolvedTotalPages = isBounded ? (totalPages as number) : 0;
@@ -114,7 +114,21 @@ export const Pagination: React.FC<PaginationProps> = ({
const pages: (number | string)[] = [];
if (!isBounded) {
// 마지막 페이지를 모르면 번호 목록을 만들 수 없다 (현재 페이지만 별도로 표시)
// 마지막 페이지를 모르면 아는 범위(1..현재, 다음이 있으면 현재+1)만 그린다.
// 현재+1 너머는 존재 여부를 모르므로 번호 대신 계속됨 표시만 둔다.
const halfVisible = Math.floor(maxVisiblePages / 2);
const startPage = currentPage <= maxVisiblePages ? 1 : currentPage - halfVisible;
if (startPage > 1) {
pages.push(1);
if (startPage > 2) pages.push('...');
}
for (let i = startPage; i <= currentPage; i++) {
pages.push(i);
}
if (hasMorePages) {
pages.push(currentPage + 1);
pages.push('...');
}
return pages;
}
@@ -162,7 +176,7 @@ export const Pagination: React.FC<PaginationProps> = ({
}
return pages;
}, [currentPage, resolvedTotalPages, isBounded, maxVisiblePages]);
}, [currentPage, resolvedTotalPages, isBounded, maxVisiblePages, hasMorePages]);
const handlePageClick = (page: number) => {
if (page < 1 || page === currentPage) return;
@@ -212,13 +226,8 @@ export const Pagination: React.FC<PaginationProps> = ({
{prevText || <>&#8249;</>}
</Button>
{/* Page Numbers — 마지막 페이지를 모르면 현재 페이지만 표시 */}
{/* Page Numbers — 마지막 페이지를 모르면 아는 범위까지만 표시 */}
<Div className="flex items-center gap-1">
{!isBounded && (
<Span className="px-3 py-1 text-sm text-gray-700 dark:text-gray-300">
{currentPage}
</Span>
)}
{pageNumbers.map((page, index) => {
if (page === '...') {
return (
@@ -0,0 +1,110 @@
import { describe, it, expect, vi } from 'vitest';
import { render, screen, fireEvent } from '@testing-library/react';
import { Pagination } from '../Pagination';
/**
* 마지막 페이지를 모르는 목록의 페이지 번호 목록 회귀
*
* 총 건수가 상한을 넘겨 `last_page` 가 `null` 이면 계산할 수 없는 값은 마지막 페이지
* 번호 하나뿐이다. 1 부터 현재 페이지까지는 확실히 존재하고, 다음 페이지 존재 여부는
* 서버가 `has_more_pages` 로 알린다. 그런데 종전 구현은 번호 목록을 통째로 비우고
* 현재 페이지 숫자 하나만 남겨, 운영자가 앞 페이지로 직접 뛰어갈 방법을 잃었다
* (활동 로그 화면 실측: "총 10000건 이상" 인데 페이저에 "1" 하나).
*
* 합의된 동작(CHANGELOG 7.0.10): 마지막 페이지로 바로 뛰는 버튼만 감춘다.
*/
describe('Pagination — last_page 를 모를 때의 페이지 번호 목록', () => {
// 접근성 이름은 「N페이지」 라벨이므로 번호 버튼은 표시 텍스트로 찾는다
const pageButton = (n: number) =>
screen.queryAllByRole('button').find((b) => b.textContent?.trim() === String(n)) ?? null;
it('1 부터 현재 페이지까지의 번호가 그대로 그려진다', () => {
render(
<Pagination currentPage={5} totalPages={null} hasMorePages={true} onPageChange={vi.fn()} />
);
for (let n = 1; n <= 5; n++) {
expect(pageButton(n)).toBeInTheDocument();
}
expect(pageButton(5)).toHaveAttribute('aria-current', 'page');
});
it('다음 페이지가 있으면 그 번호 하나와 계속됨 표시가 붙고, 그 너머는 그리지 않는다', () => {
render(
<Pagination currentPage={5} totalPages={null} hasMorePages={true} onPageChange={vi.fn()} />
);
expect(pageButton(6)).toBeInTheDocument();
expect(pageButton(7)).not.toBeInTheDocument();
expect(screen.getByText('...')).toBeInTheDocument();
});
it('다음 페이지가 없으면 현재 페이지가 끝이다 — 계속됨 표시도 없다', () => {
render(
<Pagination currentPage={3} totalPages={null} hasMorePages={false} onPageChange={vi.fn()} />
);
expect(pageButton(3)).toBeInTheDocument();
expect(pageButton(4)).not.toBeInTheDocument();
expect(screen.queryByText('...')).not.toBeInTheDocument();
});
it('첫 페이지에서도 번호가 버튼으로 그려진다', () => {
render(
<Pagination currentPage={1} totalPages={null} hasMorePages={true} onPageChange={vi.fn()} />
);
expect(pageButton(1)).toBeInTheDocument();
expect(pageButton(2)).toBeInTheDocument();
});
it('깊은 페이지에서는 앞쪽을 접고 현재 페이지 주변만 남긴다', () => {
render(
<Pagination
currentPage={12}
totalPages={null}
hasMorePages={true}
maxVisiblePages={5}
onPageChange={vi.fn()}
/>
);
expect(pageButton(1)).toBeInTheDocument();
expect(pageButton(2)).not.toBeInTheDocument();
expect(pageButton(10)).toBeInTheDocument();
expect(pageButton(11)).toBeInTheDocument();
expect(pageButton(12)).toBeInTheDocument();
expect(pageButton(13)).toBeInTheDocument();
expect(pageButton(14)).not.toBeInTheDocument();
expect(screen.getAllByText('...')).toHaveLength(2);
});
it('앞 페이지 번호와 다음 페이지 번호를 클릭하면 그 페이지로 이동한다', () => {
const onPageChange = vi.fn();
render(
<Pagination currentPage={5} totalPages={null} hasMorePages={true} onPageChange={onPageChange} />
);
fireEvent.click(pageButton(3)!);
expect(onPageChange).toHaveBeenCalledWith(3);
fireEvent.click(pageButton(6)!);
expect(onPageChange).toHaveBeenCalledWith(6);
});
it('마지막 페이지 점프 버튼만 감춰진다', () => {
render(
<Pagination
currentPage={5}
totalPages={null}
hasMorePages={true}
showFirstLast={true}
onPageChange={vi.fn()}
/>
);
expect(screen.queryByLabelText('마지막 페이지')).not.toBeInTheDocument();
expect(screen.getByLabelText('이전 페이지')).toBeInTheDocument();
expect(screen.getByLabelText('다음 페이지')).toBeInTheDocument();
});
});
@@ -0,0 +1,72 @@
/**
* E2E: 총 건수를 정확히 세지 못한 목록의 페이지 번호 목록
*
* @scenario activity_log_unbounded_pager_numbers, activity_log_unbounded_pager_no_last
* @effects page_numbers_visible, last_page_jump_hidden
*
* 총 건수 집계 상한(관리자 > 환경설정 > 고급)을 활동 로그 건수보다 작게 낮춰
* `last_page: null` 응답을 실제 서버에서 만들고, 활동 로그 화면의 페이저가
* 1. 1 페이지 번호 버튼과 다음 페이지(2) 번호 버튼을 그리고
* 2. 마지막 페이지 점프 버튼은 그리지 않으며
* 3. 번호 버튼을 눌러 그 페이지로 이동하는지
* 를 확인한다. 종전에는 현재 페이지 숫자 하나만 남아 앞 페이지로 뛸 방법이 없었다.
* 테스트가 끝나면 상한을 원래 값으로 되돌린다.
*/
import { test, expect, issueToken, authenticatePage } from '../../fixtures/auth';
const SETTINGS_URL = '/api/admin/settings';
async function readResultCap(page: import('@playwright/test').Page, token: string): Promise<number> {
const res = await page.request.get(SETTINGS_URL, { headers: { Authorization: `Bearer ${token}` } });
expect(res.ok()).toBeTruthy();
const body = await res.json();
return Number(body?.data?.advanced?.pagination_result_cap ?? 10000);
}
async function writeResultCap(page: import('@playwright/test').Page, token: string, cap: number): Promise<void> {
const res = await page.request.post(SETTINGS_URL, {
headers: { Authorization: `Bearer ${token}` },
data: { advanced: { pagination_result_cap: cap } },
});
expect(res.ok(), `설정 저장 실패: ${res.status()}`).toBeTruthy();
}
// @scenario link=activity_log_unbounded_pager_numbers, permitted=na
// @effects page_numbers_visible, last_page_jump_hidden
test('#519 후속 - 총 건수를 모르는 활동 로그에서도 페이지 번호가 그려지고 마지막 페이지 버튼만 감춰진다', async ({ page }) => {
const token = issueToken('core.settings.update');
await authenticatePage(page, token);
const originalCap = await readResultCap(page, token);
await writeResultCap(page, token, 5);
try {
await page.goto('/admin/activity-logs?per_page=5');
await page.waitForLoadState('domcontentloaded', { timeout: 30_000 });
const list = await page.request.get('/api/admin/activity-logs?per_page=5', {
headers: { Authorization: `Bearer ${token}` },
});
const listBody = await list.json();
const meta = listBody?.data?.pagination ?? listBody?.meta;
test.skip(!meta || meta.last_page !== null, '활동 로그가 상한(5건) 이하라 last_page 가 계산된다 — 이 시나리오의 전제가 성립하지 않는다');
// 페이저 루트는 Div(role=navigation) 이라 태그가 아니라 역할·이름으로 찾는다
const nav = page.getByRole('navigation', { name: '페이지네이션' }).first();
await expect(nav).toBeVisible({ timeout: 15_000 });
const pageButton = (n: number) => nav.locator('button', { hasText: new RegExp(`^${n}$`) });
await expect(pageButton(1)).toBeVisible();
await expect(pageButton(1)).toHaveAttribute('aria-current', 'page');
await expect(pageButton(2)).toBeVisible();
await expect(nav.locator('button[aria-label="마지막 페이지"]')).toHaveCount(0);
await expect(nav.locator('button[aria-label="다음 페이지"]')).toBeEnabled();
await pageButton(2).click();
await expect(pageButton(2)).toHaveAttribute('aria-current', 'page', { timeout: 15_000 });
await expect(pageButton(1)).toBeVisible();
await expect(pageButton(3)).toBeVisible();
} finally {
await writeResultCap(page, token, originalCap);
}
});