sales-frontend-components 0.0.68 → 0.0.69

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,18 +1,14 @@
1
1
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
2
  import { useController } from 'react-hook-form';
3
- import { CheckboxButton, Checkbox, DatePicker, DateRangePicker, Accordion, Radio, Table, Button, FormField, Select, Tab, Icon, useModalState, Modal, SegmentGroup, ModalUtils, List, ListItem, Segment, FormCore, RadioGroup } from 'sales-frontend-design-system';
4
- import React, { useState, useEffect, useRef, useCallback, useMemo } from 'react';
3
+ import { CheckboxButton, Checkbox, DatePicker, DateRangePicker, Accordion, Radio, Table, Button, FormField, Select, Tab, Icon, useModalState, Modal, SegmentGroup, ModalUtils, FormCore, RadioGroup } from 'sales-frontend-design-system';
4
+ import React, { useState, useEffect, useRef, useCallback } from 'react';
5
5
  import { useSearchOccupationQuery, useSearchModalAddressQuery, useSearchVehicleQuery } from 'sales-frontend-api/method';
6
6
  import styles from './modal/pre-standard/job-search-modal/job-search-modal.module.scss';
7
7
  import styles$1 from './step-indicator/step-indicator.module.scss';
8
8
  import styles$2 from './camera/camera.module.scss';
9
- import styles$3 from './debug-tool/debug-tool.module.scss';
10
- import { isClient, getEnvironmentFromHostname } from 'sales-frontend-utils';
11
- import { useDebugStore } from 'sales-frontend-api';
12
- import styles$4 from './debug-tool/features/network-log/network-log.module.scss';
13
- import styles$5 from './modal/standard/address-search/select-address.module.scss';
14
- import styles$6 from './modal/pre-standard/job-vehicle-search-modal/job-vehicle-search-modal.module.scss';
15
- import styles$7 from './modal/pre-standard/vehicle-search-modal/vehicle-search-modal.module.scss';
9
+ import styles$3 from './modal/standard/address-search/select-address.module.scss';
10
+ import styles$4 from './modal/pre-standard/job-vehicle-search-modal/job-vehicle-search-modal.module.scss';
11
+ import styles$5 from './modal/pre-standard/vehicle-search-modal/vehicle-search-modal.module.scss';
16
12
 
17
13
  const FormCheckboxButton = ({
18
14
  name,
@@ -1383,758 +1379,7 @@ function useCanvasPaint(paintProps = {}) {
1383
1379
 
1384
1380
  const testSignatureBase64Data = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAABkCAYAAACoy2Z3AAAQAElEQVR4AeydV6g2ORnHj733smvBiliws9jbhYoFREVQsYIFVBBRUBQRvbCgKIgFCyqoCCqiXiioN/ZesKEXYlkVXV11Xdde/z+/L/u95z0zSeadlmT+h+RkJvMkeZ5/kudJm3kveeQ/I1AvAncX67+S/+8B/glKM6X7uzIbwofI7YxA3QjYgNRdf1vl/p4S/Dz5L8qfLT/UfVkJLpSfymE8LjtVZs7HCNSCgA1ILTVlPkHg4/r3Z/nPy19XPteh4En7ICW4sjwzl48qHOMwQP9RBsw6hhoP0h0dKbGdEagZARuQmmuvfd6fLhF/Kv9veRT1gxVeUT7HMUN5nwjvKn95+YfKf0IeA6RglIOfqyiHS8jnun+IEHr8pXRtZwSqR8AGpPoqbE6Ar0miv8pjMN6q8Mbyue30t6J9vjxKmqWtx+n6q/JTOWYy8JXDz67BgJ/LTcWE8zECpSCQ0xFK4XWPD982gsBLJMfv5VHM+HN0zYxBQbY7V5S3l2dZ6zUKp3bMWuAtd6nqn2LABkMg2LWNgA1I2/VbqnTvFmP/kkcpv0zhNeQPcT9SolvIM0v5rsKpXTAcuctmyMPMI9fQTM2v8zMCiyJgA7Io3JstjKUolpcYmaNkOUJ76D4A6X8oJK8vj/HAiOhyUjfUcDCDYpmK/rSJmcekaDuzahGgwVfLvBkvFoEPiTNOGqHs8WyGX1txl5Y/xGF4vqWEN5Knzd5aIe9/KJjUYdTgd8iMA8NxrUm5cGZGoBIE6IyVsGo2K0DgXeIRBfxIhShWBQc7Nqw/otTkw5LQnXX9c/k5HKeq4Jtltdz84c/9Jxct0zWJgDvAGtXaXpm/kUgo4CcrHONYCnqeMsBosJH+CF3P5cJJL/ge0g8wHIG/uXhzvkagCgSGdJwqBDKTiyDA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g1IDzCONgJGwAgYgTgCNiBxfPzUCBgBI2AEehCwAekBxtFGYDoEnJMRaBMBG5A269VSGQEjYARmR8AGZHaIXYARMAJGoE0EajAgbSJvqYyAETAClSNgA1J5BZp9I2AEjMBaCNiArIW8yzUCNSBgHo1ABAEbkAg4fmQEjIARMAL9CNiA9GPjJ0bACBgBIxBBwAYkAs74R87BCBgBI9AuAjYg7datJTMCRsAIzIqADcis8DpzI2AE1kLA5c6PwP8AAAD//+3/3TsAAAAGSURBVAMAJI6e9smFlTAAAAAASUVORK5CYII=";
1385
1381
 
1386
- const FloatingButton = ({ onClick }) => {
1387
- const [position, setPosition] = useState({ x: 0, y: 0 });
1388
- const [isDragging, setIsDragging] = useState(false);
1389
- const dragHappened = useRef(false);
1390
- const dragStartPos = useRef({ x: 0, y: 0 });
1391
- const elementStartPos = useRef({ x: 0, y: 0 });
1392
- const handleMouseDown = (e) => {
1393
- if (e.button !== 0) {
1394
- return;
1395
- }
1396
- dragHappened.current = false;
1397
- setIsDragging(true);
1398
- dragStartPos.current = { x: e.clientX, y: e.clientY };
1399
- elementStartPos.current = { ...position };
1400
- const handleMouseMove = (event) => {
1401
- const dx = event.clientX - dragStartPos.current.x;
1402
- const dy = event.clientY - dragStartPos.current.y;
1403
- if (!dragHappened.current && (Math.abs(dx) > 5 || Math.abs(dy) > 5)) {
1404
- dragHappened.current = true;
1405
- }
1406
- setPosition({
1407
- x: elementStartPos.current.x + dx,
1408
- y: elementStartPos.current.y + dy
1409
- });
1410
- };
1411
- const handleMouseUp = () => {
1412
- window.removeEventListener("mousemove", handleMouseMove);
1413
- window.removeEventListener("mouseup", handleMouseUp);
1414
- setIsDragging(false);
1415
- };
1416
- window.addEventListener("mousemove", handleMouseMove);
1417
- window.addEventListener("mouseup", handleMouseUp);
1418
- };
1419
- const handleClick = (e) => {
1420
- if (dragHappened.current) {
1421
- e.preventDefault();
1422
- e.stopPropagation();
1423
- return;
1424
- }
1425
- onClick();
1426
- };
1427
- return /* @__PURE__ */ jsx(
1428
- Button,
1429
- {
1430
- variant: "secondary",
1431
- appearance: "filled",
1432
- size: "xsmall",
1433
- className: styles$3["debug-floating-button"],
1434
- style: {
1435
- transform: `translate(${position.x}px, ${position.y}px)`,
1436
- cursor: isDragging ? "grabbing" : "grab"
1437
- },
1438
- onMouseDown: handleMouseDown,
1439
- onClick: handleClick,
1440
- children: "DEBUG"
1441
- }
1442
- );
1443
- };
1444
-
1445
- const MenuPanel = ({ menuItems, onMenuItemClick, onClose }) => {
1446
- return /* @__PURE__ */ jsxs(Modal.Root, { isOpen: true, onClose, modalSize: "small", children: [
1447
- /* @__PURE__ */ jsx(Modal.Overlay, {}),
1448
- /* @__PURE__ */ jsxs(Modal.Content, { children: [
1449
- /* @__PURE__ */ jsx(Modal.Header, { headerTitle: "Debug Menu", showCloseButton: true }),
1450
- /* @__PURE__ */ jsx(Modal.Body, { children: /* @__PURE__ */ jsx(List, { selectable: true, children: menuItems.map((item) => /* @__PURE__ */ jsx(ListItem, { onClick: () => onMenuItemClick(item.component), children: item.label }, item.id)) }) })
1451
- ] })
1452
- ] });
1453
- };
1454
-
1455
- let globalLogs = [];
1456
- let listeners = [];
1457
- const originalConsoleMethods = {};
1458
- let isConsoleOverridden = false;
1459
- const addLog = (type, ...args) => {
1460
- const newLog = {
1461
- id: Date.now() + Math.random(),
1462
- type,
1463
- timestamp: (/* @__PURE__ */ new Date()).toLocaleTimeString(),
1464
- message: args
1465
- };
1466
- globalLogs = [...globalLogs, newLog];
1467
- listeners.forEach((listener) => listener([...globalLogs]));
1468
- };
1469
- const initializeConsoleLogOverride = () => {
1470
- if (!isClient() || isConsoleOverridden) {
1471
- return;
1472
- }
1473
- const logTypes = ["log", "info", "warn", "error", "debug"];
1474
- logTypes.forEach((type) => {
1475
- originalConsoleMethods[type] = console[type];
1476
- console[type] = (...args) => {
1477
- if (originalConsoleMethods[type]) {
1478
- originalConsoleMethods[type]?.apply(console, args);
1479
- }
1480
- addLog(type, ...args);
1481
- };
1482
- });
1483
- isConsoleOverridden = true;
1484
- };
1485
- const restoreConsoleLog = () => {
1486
- if (!isClient() || !isConsoleOverridden) {
1487
- return;
1488
- }
1489
- const logTypes = ["log", "info", "warn", "error", "debug"];
1490
- logTypes.forEach((type) => {
1491
- if (originalConsoleMethods[type]) {
1492
- console[type] = originalConsoleMethods[type];
1493
- }
1494
- });
1495
- isConsoleOverridden = false;
1496
- };
1497
- const useConsoleLog = () => {
1498
- const [logs, setLogs] = useState(globalLogs);
1499
- useEffect(() => {
1500
- listeners.push(setLogs);
1501
- return () => {
1502
- listeners = listeners.filter((l) => l !== setLogs);
1503
- };
1504
- }, []);
1505
- const clearLogs = useCallback(() => {
1506
- globalLogs = [];
1507
- listeners.forEach((listener) => listener([]));
1508
- }, []);
1509
- return { logs, clearLogs };
1510
- };
1511
-
1512
- const safeStringify$1 = (obj) => {
1513
- try {
1514
- return JSON.stringify(obj, null, 2);
1515
- } catch (e) {
1516
- return "[Unserializable Object]";
1517
- }
1518
- };
1519
- const LogMessage = ({ entry }) => {
1520
- const messageParts = entry.message.map((part) => {
1521
- if (typeof part === "object" && part !== null) {
1522
- return safeStringify$1(part);
1523
- }
1524
- return String(part);
1525
- });
1526
- return /* @__PURE__ */ jsx("pre", { className: `${styles$3["log-message"]} ${styles$3[`log-${entry.type}`]}`, children: messageParts.join(" ") });
1527
- };
1528
- const ConsoleLogPanel = ({ onClose }) => {
1529
- const { logs, clearLogs } = useConsoleLog();
1530
- const [filter, setFilter] = useState("all");
1531
- const logContainerRef = useRef(null);
1532
- const filteredLogs = useMemo(() => {
1533
- if (filter === "all") {
1534
- return logs;
1535
- }
1536
- return logs.filter((log) => log.type === filter);
1537
- }, [logs, filter]);
1538
- useEffect(() => {
1539
- if (logContainerRef.current) {
1540
- logContainerRef.current.scrollTop = logContainerRef.current.scrollHeight;
1541
- }
1542
- }, [filteredLogs]);
1543
- return /* @__PURE__ */ jsx(Modal.Root, { isOpen: true, onClose, modalSize: "full-screen", children: /* @__PURE__ */ jsxs(Modal.Content, { children: [
1544
- /* @__PURE__ */ jsx(Modal.Header, { headerTitle: "Console Logs", showCloseButton: true }),
1545
- /* @__PURE__ */ jsxs(Modal.Body, { children: [
1546
- /* @__PURE__ */ jsxs("div", { className: styles$3["panel-toolbar"], children: [
1547
- /* @__PURE__ */ jsxs(
1548
- Segment.Root,
1549
- {
1550
- size: "xsmall",
1551
- appearance: "outline",
1552
- align: "left",
1553
- defaultValue: filter,
1554
- onValueChange: (value) => setFilter(value),
1555
- children: [
1556
- /* @__PURE__ */ jsx(Segment.Item, { value: "all", children: "All" }),
1557
- /* @__PURE__ */ jsx(Segment.Item, { value: "log", children: "Log" }),
1558
- /* @__PURE__ */ jsx(Segment.Item, { value: "warn", children: "Warn" }),
1559
- /* @__PURE__ */ jsx(Segment.Item, { value: "error", children: "Error" })
1560
- ]
1561
- }
1562
- ),
1563
- /* @__PURE__ */ jsx(
1564
- Button,
1565
- {
1566
- variant: "neutral",
1567
- appearance: "outline",
1568
- size: "xsmall",
1569
- onClick: clearLogs,
1570
- style: { marginLeft: "auto" },
1571
- children: "Clear"
1572
- }
1573
- )
1574
- ] }),
1575
- /* @__PURE__ */ jsx("div", { className: styles$3["log-list-container"], ref: logContainerRef, children: filteredLogs.map((log) => /* @__PURE__ */ jsxs("div", { className: styles$3["log-item"], children: [
1576
- /* @__PURE__ */ jsx("span", { className: styles$3["log-timestamp"], children: log.timestamp }),
1577
- /* @__PURE__ */ jsx(LogMessage, { entry: log })
1578
- ] }, log.id)) })
1579
- ] })
1580
- ] }) });
1581
- };
1582
-
1583
- const LoginPanel = ({ onClose, onLogin }) => {
1584
- const [selectedTypeId, setSelectedTypeId] = useState(loginTypes[0]?.id || "");
1585
- const [formData, setFormData] = useState({});
1586
- const selectedType = useMemo(() => loginTypes.find((t) => t.id === selectedTypeId), [selectedTypeId]);
1587
- const handleInputChange = (e) => {
1588
- const { name, value } = e.target;
1589
- setFormData((prev) => ({ ...prev, [name]: value }));
1590
- };
1591
- const handleSubmit = (e) => {
1592
- e.preventDefault();
1593
- if (selectedType) {
1594
- onLogin(selectedType.id, formData);
1595
- onClose();
1596
- }
1597
- };
1598
- useEffect(() => {
1599
- setFormData({});
1600
- }, [selectedType]);
1601
- return /* @__PURE__ */ jsx(Modal.Root, { isOpen: true, onClose, modalSize: "full-screen", children: /* @__PURE__ */ jsxs(Modal.Content, { children: [
1602
- /* @__PURE__ */ jsx(Modal.Header, { headerTitle: "\uAC04\uD3B8 \uB85C\uADF8\uC778", showCloseButton: true }),
1603
- /* @__PURE__ */ jsx(Modal.Body, { children: /* @__PURE__ */ jsxs("form", { className: styles$3["login-form-container"], onSubmit: handleSubmit, children: [
1604
- /* @__PURE__ */ jsxs(FormField.FieldControl, { children: [
1605
- /* @__PURE__ */ jsx(FormField.Label, { htmlFor: "login-type-select", children: "\uB85C\uADF8\uC778 \uC720\uD615" }),
1606
- /* @__PURE__ */ jsx(
1607
- Select,
1608
- {
1609
- value: selectedTypeId,
1610
- onChange: setSelectedTypeId,
1611
- size: "xsmall",
1612
- rootProps: { style: { width: "100%" } },
1613
- children: loginTypes.map((type) => /* @__PURE__ */ jsx(Select.Option, { value: type.id, children: type.label }, type.id))
1614
- }
1615
- )
1616
- ] }),
1617
- selectedType?.fields.map((field) => /* @__PURE__ */ jsxs(FormField.FieldControl, { children: [
1618
- /* @__PURE__ */ jsx(FormField.Label, { htmlFor: field.name, children: field.label }),
1619
- /* @__PURE__ */ jsx(
1620
- FormField.TextField,
1621
- {
1622
- size: "xsmall",
1623
- type: field.type,
1624
- id: field.name,
1625
- name: field.name,
1626
- placeholder: field.placeholder,
1627
- value: formData[field.name] || "",
1628
- onChange: handleInputChange,
1629
- required: true
1630
- }
1631
- )
1632
- ] }, field.name)),
1633
- /* @__PURE__ */ jsx("div", { className: styles$3["form-actions"], children: /* @__PURE__ */ jsx(Button, { type: "submit", variant: "primary", appearance: "filled", size: "xsmall", children: "\uB85C\uADF8\uC778" }) })
1634
- ] }) })
1635
- ] }) });
1636
- };
1637
-
1638
- const SEARCH_SECTIONS = [
1639
- { value: "all", label: "\uC804\uCCB4" },
1640
- { value: "url", label: "\uC8FC\uC18C" },
1641
- { value: "headers", label: "\uD5E4\uB354" },
1642
- { value: "params", label: "\uD30C\uB77C\uBBF8\uD130" },
1643
- { value: "data", label: "\uC694\uCCAD" },
1644
- { value: "response", label: "\uC751\uB2F5" },
1645
- { value: "error", label: "\uC5D0\uB7EC" }
1646
- ];
1647
- const getLogInfo = (log) => {
1648
- if (log.holdStatus === "held") {
1649
- if ("request" in log) {
1650
- return log.request;
1651
- }
1652
- if ("response" in log) {
1653
- return log.response;
1654
- }
1655
- if ("error" in log) {
1656
- return log.error;
1657
- }
1658
- }
1659
- return log;
1660
- };
1661
- const NetworkLog = ({ onClose }) => {
1662
- const {
1663
- requests,
1664
- responses,
1665
- errors,
1666
- clear,
1667
- isHold,
1668
- toggleHold,
1669
- heldRequests,
1670
- heldResponses,
1671
- heldErrors,
1672
- playAllRequests,
1673
- playAllResponses
1674
- } = useDebugStore();
1675
- const [searchTerm, setSearchTerm] = useState("");
1676
- const [searchSection, setSearchSection] = useState(SEARCH_SECTIONS[0]?.value);
1677
- const allLogs = useMemo(() => {
1678
- const logs = [];
1679
- requests.forEach((req) => logs.push({ ...req, type: "request" }));
1680
- responses.forEach((res) => logs.push({ ...res, type: "response" }));
1681
- errors.forEach((err) => logs.push({ ...err, type: "error" }));
1682
- heldRequests.forEach((req) => logs.push({ ...req, type: "request", holdStatus: "held" }));
1683
- heldResponses.forEach((res) => logs.push({ ...res, type: "response", holdStatus: "held" }));
1684
- heldErrors.forEach((err) => logs.push({ ...err, type: "error", holdStatus: "held" }));
1685
- logs.sort((a, b) => {
1686
- const aInfo = getLogInfo(a);
1687
- const bInfo = getLogInfo(b);
1688
- const aTime = "startTime" in aInfo ? aInfo.startTime : 0;
1689
- const bTime = "startTime" in bInfo ? bInfo.startTime : 0;
1690
- return bTime - aTime;
1691
- });
1692
- return logs;
1693
- }, [requests, responses, errors, heldRequests, heldResponses, heldErrors]);
1694
- const filteredLogs = useMemo(() => {
1695
- if (!searchTerm) {
1696
- return allLogs;
1697
- }
1698
- const lowercasedTerm = searchTerm.toLowerCase();
1699
- return allLogs.filter((log) => {
1700
- const logInfo = getLogInfo(log);
1701
- switch (searchSection) {
1702
- case "url":
1703
- return logInfo.url?.toLowerCase().includes(lowercasedTerm);
1704
- case "headers":
1705
- return "headers" in logInfo && logInfo.headers && JSON.stringify(logInfo.headers)?.toLowerCase().includes(lowercasedTerm);
1706
- case "params":
1707
- return "params" in logInfo && logInfo.params && JSON.stringify(logInfo.params)?.toLowerCase().includes(lowercasedTerm);
1708
- case "data":
1709
- return "data" in logInfo && logInfo.data && log.type === "request" && JSON.stringify(logInfo.data)?.toLowerCase().includes(lowercasedTerm);
1710
- case "response":
1711
- return "data" in logInfo && logInfo.data && log.type === "response" && JSON.stringify(logInfo.data)?.toLowerCase().includes(lowercasedTerm);
1712
- case "error":
1713
- return log.type === "error" && JSON.stringify(logInfo)?.toLowerCase().includes(lowercasedTerm);
1714
- case "all":
1715
- default:
1716
- return JSON.stringify(logInfo).toLowerCase().includes(lowercasedTerm);
1717
- }
1718
- });
1719
- }, [allLogs, searchTerm, searchSection]);
1720
- const renderLogSummary = (log) => {
1721
- const logInfo = getLogInfo(log);
1722
- const prefix = log.holdStatus === "held" ? "[HELD] " : "";
1723
- if (log.type === "request") {
1724
- return `${prefix}[REQ] ${logInfo.method.toUpperCase()} ${logInfo.url}`;
1725
- }
1726
- if (log.type === "response" && "status" in logInfo) {
1727
- return `${prefix}[RES] ${logInfo.method.toUpperCase()} ${logInfo.url} - ${logInfo.status}`;
1728
- }
1729
- if (log.type === "error" && "message" in logInfo) {
1730
- return `${prefix}[ERR] ${logInfo.method.toUpperCase()} ${logInfo.url} - ${logInfo.message}`;
1731
- }
1732
- return "Unknown Log";
1733
- };
1734
- const renderLogContent = (log) => {
1735
- const logInfo = getLogInfo(log);
1736
- return /* @__PURE__ */ jsx("pre", { children: JSON.stringify(logInfo, null, 2) });
1737
- };
1738
- return /* @__PURE__ */ jsxs(Modal.Root, { isOpen: true, onClose, modalSize: "full-screen", children: [
1739
- /* @__PURE__ */ jsx(Modal.Overlay, {}),
1740
- /* @__PURE__ */ jsxs(Modal.Content, { children: [
1741
- /* @__PURE__ */ jsx(Modal.Header, { headerTitle: "\uB124\uD2B8\uC6CC\uD06C \uB85C\uADF8", showCloseButton: true }),
1742
- /* @__PURE__ */ jsxs(Modal.Body, { children: [
1743
- /* @__PURE__ */ jsxs("div", { className: styles$4["search-container"], children: [
1744
- /* @__PURE__ */ jsx(Select, { value: searchSection, onChange: (value) => setSearchSection(value), size: "xsmall", children: SEARCH_SECTIONS.map((option) => /* @__PURE__ */ jsx(Select.Option, { value: option.value, children: option.label }, option.value)) }),
1745
- /* @__PURE__ */ jsx(
1746
- FormField.TextField,
1747
- {
1748
- placeholder: "\uAC80\uC0C9...",
1749
- value: searchTerm,
1750
- size: "xsmall",
1751
- onChange: (e) => setSearchTerm(e.target.value)
1752
- }
1753
- ),
1754
- /* @__PURE__ */ jsx(Checkbox, { id: "hold-checkbox", checked: isHold, onChange: toggleHold, size: "small", variant: "main", children: "Hold" }),
1755
- /* @__PURE__ */ jsx(Button, { variant: "neutral", appearance: "outline", size: "xsmall", onClick: clear, children: "clear" })
1756
- ] }),
1757
- isHold && /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "row" }, children: [
1758
- /* @__PURE__ */ jsx(Button, { size: "xsmall", onClick: () => playAllRequests(), variant: "primary", appearance: "outline", children: "REQ Resolve" }),
1759
- /* @__PURE__ */ jsx(Button, { size: "xsmall", onClick: () => playAllResponses(), variant: "primary", appearance: "outline", children: "RES Resolve" })
1760
- ] }),
1761
- /* @__PURE__ */ jsx("div", { className: styles$4["log-list"], children: filteredLogs.length === 0 ? /* @__PURE__ */ jsx("p", { children: "\uD45C\uC2DC\uD560 \uB85C\uADF8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4." }) : /* @__PURE__ */ jsx(Accordion.Root, { children: filteredLogs.map((log, index) => /* @__PURE__ */ jsxs(Accordion.Item, { children: [
1762
- /* @__PURE__ */ jsx(Accordion.HeaderButton, { children: /* @__PURE__ */ jsx("p", { className: styles$4["log-summary"], children: renderLogSummary(log) }) }),
1763
- /* @__PURE__ */ jsx(Accordion.Content, { variant: "text", children: /* @__PURE__ */ jsx("div", { className: styles$4["log-content"], children: renderLogContent(log) }) })
1764
- ] }, index)) }) })
1765
- ] })
1766
- ] })
1767
- ] });
1768
- };
1769
-
1770
- const PageNavigationPanel = ({ onClose }) => {
1771
- const [url, setUrl] = useState("");
1772
- const handleNavigate = () => {
1773
- if (url) {
1774
- self.location.href = url;
1775
- }
1776
- };
1777
- return /* @__PURE__ */ jsx(Modal.Root, { isOpen: true, onClose, modalSize: "full-screen", children: /* @__PURE__ */ jsxs(Modal.Content, { children: [
1778
- /* @__PURE__ */ jsx(Modal.Header, { headerTitle: "\uD398\uC774\uC9C0 \uC774\uB3D9", showCloseButton: true }),
1779
- /* @__PURE__ */ jsx(Modal.Body, { children: /* @__PURE__ */ jsxs("div", { className: styles$3["page-navigation-content"], children: [
1780
- /* @__PURE__ */ jsx(
1781
- FormField.TextField,
1782
- {
1783
- size: "xsmall",
1784
- type: "text",
1785
- value: url,
1786
- onChange: (e) => setUrl(e.target.value),
1787
- placeholder: "\uC774\uB3D9\uD560 URL\uC744 \uC785\uB825\uD558\uC138\uC694 (\uC608: /main)",
1788
- rootProps: { style: { flex: 1 } }
1789
- }
1790
- ),
1791
- /* @__PURE__ */ jsx(Button, { variant: "primary", appearance: "filled", size: "xsmall", onClick: handleNavigate, children: "\uC774\uB3D9" })
1792
- ] }) })
1793
- ] }) });
1794
- };
1795
-
1796
- const safeStringify = (obj) => {
1797
- try {
1798
- const replacer = (key, value) => typeof value === "bigint" ? value.toString() : value;
1799
- return JSON.stringify(obj, replacer, 2);
1800
- } catch (e) {
1801
- return "[Unserializable Object]";
1802
- }
1803
- };
1804
- const ResultMessage = ({ log }) => {
1805
- const messageParts = log.message.map((part) => {
1806
- if (typeof part === "object" && part !== null) {
1807
- return safeStringify(part);
1808
- }
1809
- return String(part);
1810
- });
1811
- const prefix = log.type === "return" ? "\u21A9 " : "";
1812
- return /* @__PURE__ */ jsxs("pre", { className: `${styles$3["log-message"]} ${styles$3[`log-${log.type}`]}`, children: [
1813
- prefix,
1814
- messageParts.join(" ")
1815
- ] });
1816
- };
1817
- const ScriptExecutorPanel = ({ onClose }) => {
1818
- const [code, setCode] = useState('// \uC5EC\uAE30\uC5D0 \uC2E4\uD589\uD560 \uCF54\uB4DC\uB97C \uC785\uB825\uD558\uC138\uC694\nconsole.log("Hello, World!");');
1819
- const [results, setResults] = useState([]);
1820
- const addResult = (type, ...args) => {
1821
- setResults((prevResults) => [
1822
- ...prevResults,
1823
- {
1824
- id: Date.now() + Math.random(),
1825
- type,
1826
- timestamp: (/* @__PURE__ */ new Date()).toLocaleTimeString(),
1827
- message: args
1828
- }
1829
- ]);
1830
- };
1831
- const handleExecute = () => {
1832
- const originalConsole = { ...console };
1833
- const newConsole = {
1834
- log: (...args) => {
1835
- originalConsole.log(...args);
1836
- addResult("log", ...args);
1837
- },
1838
- warn: (...args) => {
1839
- originalConsole.warn(...args);
1840
- addResult("warn", ...args);
1841
- },
1842
- error: (...args) => {
1843
- originalConsole.error(...args);
1844
- addResult("error", ...args);
1845
- }
1846
- };
1847
- try {
1848
- Object.assign(console, newConsole);
1849
- const result = new Function(code)();
1850
- if (result !== void 0) {
1851
- addResult("return", result);
1852
- }
1853
- } catch (e) {
1854
- addResult("error", e.name, e.message);
1855
- } finally {
1856
- Object.assign(console, originalConsole);
1857
- }
1858
- };
1859
- const handleClear = () => {
1860
- setResults([]);
1861
- };
1862
- return /* @__PURE__ */ jsx(Modal.Root, { isOpen: true, onClose, modalSize: "full-screen", children: /* @__PURE__ */ jsxs(Modal.Content, { children: [
1863
- /* @__PURE__ */ jsx(Modal.Header, { headerTitle: "\uC2A4\uD06C\uB9BD\uD2B8 \uC2E4\uD589", showCloseButton: true }),
1864
- /* @__PURE__ */ jsx(Modal.Body, { children: /* @__PURE__ */ jsx("div", { className: `${styles$3["debug-feature-panel"]} ${styles$3["script-executor-panel"]}`, children: /* @__PURE__ */ jsxs("div", { className: styles$3["script-executor-content"], children: [
1865
- /* @__PURE__ */ jsxs("div", { className: styles$3["script-input-section"], children: [
1866
- /* @__PURE__ */ jsx(
1867
- "textarea",
1868
- {
1869
- className: styles$3["script-textarea"],
1870
- value: code,
1871
- onChange: (e) => setCode(e.target.value),
1872
- spellCheck: "false"
1873
- }
1874
- ),
1875
- /* @__PURE__ */ jsxs("div", { className: styles$3["script-actions"], children: [
1876
- /* @__PURE__ */ jsx(Button, { variant: "neutral", appearance: "outline", size: "xsmall", onClick: handleExecute, children: "\uC2E4\uD589 (\u25B6)" }),
1877
- /* @__PURE__ */ jsx(Button, { variant: "neutral", appearance: "outline", size: "xsmall", onClick: handleClear, children: "\uACB0\uACFC \uC9C0\uC6B0\uAE30" })
1878
- ] })
1879
- ] }),
1880
- /* @__PURE__ */ jsxs("div", { className: styles$3["script-output-section"], children: [
1881
- /* @__PURE__ */ jsx("div", { className: styles$3["panel-header"], children: /* @__PURE__ */ jsx("h3", { children: "\uACB0\uACFC" }) }),
1882
- /* @__PURE__ */ jsx("div", { className: styles$3["log-list-container"], children: results.map((log) => /* @__PURE__ */ jsxs("div", { className: styles$3["log-item"], children: [
1883
- /* @__PURE__ */ jsx("span", { className: styles$3["log-timestamp"], children: log.timestamp }),
1884
- /* @__PURE__ */ jsx(ResultMessage, { log })
1885
- ] }, log.id)) })
1886
- ] })
1887
- ] }) }) })
1888
- ] }) });
1889
- };
1890
-
1891
- const setCookie = (name, value) => {
1892
- document.cookie = `${name}=${encodeURIComponent(value)};path=/`;
1893
- };
1894
- const removeCookie = (name) => {
1895
- document.cookie = `${name}=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;`;
1896
- };
1897
- const useStorage = (storageType) => {
1898
- const [items, setItems] = useState([]);
1899
- const loadItems = useCallback(() => {
1900
- const newItems = [];
1901
- if (storageType === "localStorage") {
1902
- for (let i = 0; i < localStorage.length; i++) {
1903
- const key = localStorage.key(i);
1904
- if (key) {
1905
- newItems.push({ key, value: localStorage.getItem(key) || "" });
1906
- }
1907
- }
1908
- } else {
1909
- const cookies = document.cookie.split(";");
1910
- cookies.forEach((cookie) => {
1911
- const parts = cookie.split("=");
1912
- const key = parts.shift()?.trim();
1913
- if (key) {
1914
- newItems.push({ key, value: decodeURIComponent(parts.join("=")) });
1915
- }
1916
- });
1917
- }
1918
- setItems(newItems);
1919
- }, [storageType]);
1920
- useEffect(() => {
1921
- loadItems();
1922
- }, [loadItems]);
1923
- const setItem = useCallback(
1924
- (key, value) => {
1925
- if (storageType === "localStorage") {
1926
- localStorage.setItem(key, value);
1927
- } else {
1928
- setCookie(key, value);
1929
- }
1930
- loadItems();
1931
- },
1932
- [storageType, loadItems]
1933
- );
1934
- const removeItem = useCallback(
1935
- (key) => {
1936
- if (storageType === "localStorage") {
1937
- localStorage.removeItem(key);
1938
- } else {
1939
- removeCookie(key);
1940
- }
1941
- loadItems();
1942
- },
1943
- [storageType, loadItems]
1944
- );
1945
- return { items, setItem, removeItem, loadItems };
1946
- };
1947
-
1948
- const ValueDisplay = ({ value }) => {
1949
- try {
1950
- const parsed = JSON.parse(value);
1951
- if (typeof parsed === "object" && parsed !== null) {
1952
- return /* @__PURE__ */ jsx("pre", { className: styles$3["log-content"], children: JSON.stringify(parsed, null, 2) });
1953
- }
1954
- } catch (e) {
1955
- }
1956
- return /* @__PURE__ */ jsx("div", { className: styles$3["log-content"], children: value });
1957
- };
1958
- const EditableRow = ({ item, onSave, onRemove }) => {
1959
- const [isEditing, setIsEditing] = useState(false);
1960
- const [value, setValue] = useState(item.value);
1961
- const handleSave = () => {
1962
- onSave(item.key, value);
1963
- setIsEditing(false);
1964
- };
1965
- const handleEdit = () => {
1966
- setValue(item.value);
1967
- setIsEditing(true);
1968
- };
1969
- return /* @__PURE__ */ jsx(Accordion.Root, { children: /* @__PURE__ */ jsxs(Accordion.Item, { children: [
1970
- /* @__PURE__ */ jsxs(Accordion.HeaderButton, { children: [
1971
- " ",
1972
- item.key
1973
- ] }),
1974
- /* @__PURE__ */ jsxs(Accordion.Content, { variant: "text", style: { flex: 1, display: "flex", flexDirection: "column" }, children: [
1975
- isEditing ? /* @__PURE__ */ jsx(Button, { variant: "neutral", appearance: "outline", size: "xsmall", onClick: handleSave, children: "Save" }) : /* @__PURE__ */ jsx(Button, { variant: "neutral", appearance: "outline", size: "xsmall", onClick: handleEdit, children: "Edit" }),
1976
- /* @__PURE__ */ jsx(Button, { variant: "neutral", appearance: "outline", size: "xsmall", onClick: () => onRemove(item.key), children: "Remove" }),
1977
- isEditing ? /* @__PURE__ */ jsx("textarea", { value, onChange: (e) => setValue(e.target.value) }) : /* @__PURE__ */ jsx(ValueDisplay, { value: item.value })
1978
- ] })
1979
- ] }) });
1980
- };
1981
- const StoragePanel = ({ onClose, storageType }) => {
1982
- const { items, setItem, removeItem } = useStorage(storageType);
1983
- const [filter, setFilter] = useState("");
1984
- const filteredItems = useMemo(() => {
1985
- if (!filter) {
1986
- return items;
1987
- }
1988
- return items.filter(
1989
- (item) => item.key.toLowerCase().includes(filter.toLowerCase()) || item.value.toLowerCase().includes(filter.toLowerCase())
1990
- );
1991
- }, [items, filter]);
1992
- return /* @__PURE__ */ jsx(Modal.Root, { isOpen: true, onClose, modalSize: "full-screen", children: /* @__PURE__ */ jsxs(Modal.Content, { children: [
1993
- /* @__PURE__ */ jsx(Modal.Header, { headerTitle: storageType === "localStorage" ? "Local Storage" : "Cookies", showCloseButton: true }),
1994
- /* @__PURE__ */ jsxs(Modal.Body, { children: [
1995
- /* @__PURE__ */ jsx("div", { className: styles$3["panel-toolbar"], children: /* @__PURE__ */ jsx(
1996
- FormField.TextField,
1997
- {
1998
- placeholder: "Search key or value...",
1999
- size: "xsmall",
2000
- value: filter,
2001
- onChange: (e) => setFilter(e.target.value),
2002
- rootProps: { style: { width: "100%" } }
2003
- }
2004
- ) }),
2005
- /* @__PURE__ */ jsx("ul", { children: filteredItems.map((item) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(EditableRow, { item, onSave: setItem, onRemove: removeItem }) }, item.key)) })
2006
- ] })
2007
- ] }) });
2008
- };
2009
-
2010
- const loginTypes = [
2011
- {
2012
- id: "fp",
2013
- label: "FP \uB85C\uADF8\uC778",
2014
- fields: [{ name: "employeeId", label: "\uC0AC\uBC88", type: "text", placeholder: "\uC0AC\uBC88\uC744 \uC785\uB825\uD558\uC138\uC694" }]
2015
- },
2016
- {
2017
- id: "customer",
2018
- label: "\uACE0\uAC1D \uB85C\uADF8\uC778",
2019
- fields: [
2020
- { name: "name", label: "\uC774\uB984", type: "text", placeholder: "\uC774\uB984" },
2021
- { name: "phone", label: "\uC804\uD654\uBC88\uD638", type: "tel", placeholder: "\uC804\uD654\uBC88\uD638" },
2022
- { name: "residentNumber", label: "\uC8FC\uBBFC\uBC88\uD638", type: "text", placeholder: "\uC8FC\uBBFC\uBC88\uD638 \uC55E 7\uC790\uB9AC" },
2023
- { name: "userId", label: "\uC544\uC774\uB514", type: "text", placeholder: "\uC544\uC774\uB514" },
2024
- { name: "password", label: "\uBE44\uBC00\uBC88\uD638", type: "password", placeholder: "\uBE44\uBC00\uBC88\uD638" }
2025
- ]
2026
- }
2027
- ];
2028
- const menuItems = [
2029
- {
2030
- id: "network-log",
2031
- label: "\uB124\uD2B8\uC6CC\uD06C \uB85C\uADF8",
2032
- component: NetworkLog,
2033
- display: true
2034
- },
2035
- {
2036
- id: "console-log",
2037
- label: "\uCF58\uC194 \uB85C\uADF8 \uD655\uC778",
2038
- component: ConsoleLogPanel,
2039
- display: true
2040
- },
2041
- {
2042
- id: "local-storage",
2043
- label: "\uB85C\uCEEC \uC2A4\uD1A0\uB9AC\uC9C0 \uAD00\uB9AC",
2044
- // StoragePanel은 재사용 가능한 컴포넌트이므로, props를 통해 어떤 스토리지를 다룰지 지정합니다.
2045
- component: (props) => /* @__PURE__ */ jsx(StoragePanel, { ...props, storageType: "localStorage" }),
2046
- display: true
2047
- },
2048
- {
2049
- id: "cookie-management",
2050
- label: "\uCFE0\uD0A4 \uAD00\uB9AC",
2051
- component: (props) => /* @__PURE__ */ jsx(StoragePanel, { ...props, storageType: "cookie" }),
2052
- display: true
2053
- },
2054
- {
2055
- id: "quick-login",
2056
- label: "\uAC04\uD3B8 \uB85C\uADF8\uC778",
2057
- component: LoginPanel,
2058
- display: true
2059
- // 실제 표시는 DebugTool.tsx에서 onLogin prop 존재 여부에 따라 결정됩니다.
2060
- },
2061
- {
2062
- id: "script-executor",
2063
- label: "\uC2A4\uD06C\uB9BD\uD2B8 \uC2E4\uD589",
2064
- component: ScriptExecutorPanel,
2065
- display: true
2066
- },
2067
- {
2068
- id: "page-navigation",
2069
- label: "\uD398\uC774\uC9C0 \uC774\uB3D9",
2070
- component: PageNavigationPanel,
2071
- display: true
2072
- }
2073
- ];
2074
-
2075
- const useEnvironment = () => {
2076
- const [envInfo, setEnvInfo] = useState({
2077
- env: "prd"
2078
- });
2079
- useEffect(() => {
2080
- const { hostname } = window.location;
2081
- setEnvInfo({ env: getEnvironmentFromHostname(hostname) });
2082
- }, []);
2083
- return envInfo;
2084
- };
2085
-
2086
- const DebugTool = ({ onLogin, envOverride, menuItemsOverride }) => {
2087
- useEffect(() => {
2088
- initializeConsoleLogOverride();
2089
- return () => {
2090
- restoreConsoleLog();
2091
- };
2092
- }, []);
2093
- const environment = useEnvironment();
2094
- const env = envOverride || environment.env;
2095
- const menuItems$1 = menuItemsOverride || menuItems;
2096
- const [isMenuOpen, setMenuOpen] = useState(false);
2097
- const [activeFeature, setActiveFeature] = useState(null);
2098
- const isVisible = ["local", "dev", "stg"].includes(env);
2099
- const handleMenuClick = (itemComponent) => {
2100
- setActiveFeature(() => itemComponent);
2101
- setMenuOpen(false);
2102
- };
2103
- const handleCloseFeature = () => {
2104
- setActiveFeature(null);
2105
- };
2106
- if (!isVisible) {
2107
- return null;
2108
- }
2109
- const toggleMenu = () => {
2110
- setMenuOpen((prev) => !prev);
2111
- if (!isMenuOpen) {
2112
- setActiveFeature(null);
2113
- }
2114
- };
2115
- const availableMenuItems = menuItems$1.filter(
2116
- (item) => item.display && // config에서 display가 true인 항목만 필터링합니다.
2117
- // 'quick-login' 기능은 onLogin prop이 제공된 경우에만 활성화합니다.
2118
- (item.id !== "quick-login" || item.id === "quick-login" && onLogin)
2119
- );
2120
- if (activeFeature) {
2121
- const FeatureComponent = activeFeature;
2122
- return /* @__PURE__ */ jsx(FeatureComponent, { onClose: handleCloseFeature, onLogin });
2123
- }
2124
- return /* @__PURE__ */ jsxs("div", { className: "debug-tool-container", children: [
2125
- /* @__PURE__ */ jsx(FloatingButton, { onClick: toggleMenu }),
2126
- isMenuOpen && /* @__PURE__ */ jsx(
2127
- MenuPanel,
2128
- {
2129
- menuItems: availableMenuItems,
2130
- onMenuItemClick: handleMenuClick,
2131
- onClose: () => setMenuOpen(false)
2132
- }
2133
- )
2134
- ] });
2135
- };
2136
-
2137
- const cx$3 = classNames.bind(styles$5);
1382
+ const cx$3 = classNames.bind(styles$3);
2138
1383
  const { InputBox, Input } = FormCore;
2139
1384
  const AddressSearchInitialText = () => {
2140
1385
  return /* @__PURE__ */ jsxs("div", { children: [
@@ -2424,7 +1669,7 @@ const useAddressComponent = () => {
2424
1669
  };
2425
1670
  };
2426
1671
 
2427
- const cx$2 = classNames.bind(styles$6);
1672
+ const cx$2 = classNames.bind(styles$4);
2428
1673
  const JobVehicleSearchGrade = ({ riskGrade, hospitalizationGrade }) => {
2429
1674
  return /* @__PURE__ */ jsxs("div", { className: cx$2("grade-section"), children: [
2430
1675
  /* @__PURE__ */ jsxs("div", { className: cx$2("icon-title"), children: [
@@ -2445,7 +1690,7 @@ const JobVehicleSearchGrade = ({ riskGrade, hospitalizationGrade }) => {
2445
1690
  ] });
2446
1691
  };
2447
1692
 
2448
- const cx$1 = classNames.bind(styles$7);
1693
+ const cx$1 = classNames.bind(styles$5);
2449
1694
  function VehicleSearch({ vehicles, onVehicleSelect }) {
2450
1695
  return /* @__PURE__ */ jsxs("div", { className: cx$1("vehicle-search-section"), children: [
2451
1696
  /* @__PURE__ */ jsx("p", { children: "\uC6B4\uC804 \uCC28\uC885" }),
@@ -2511,7 +1756,7 @@ const useJobVehicleSearch = () => {
2511
1756
  };
2512
1757
  };
2513
1758
 
2514
- const cx = classNames.bind(styles$6);
1759
+ const cx = classNames.bind(styles$4);
2515
1760
  function useJobVehicleSearchModal() {
2516
1761
  const {
2517
1762
  selectedVehicle,
@@ -2616,5 +1861,5 @@ const JobSearchModal = ({ onClose }) => {
2616
1861
  ] });
2617
1862
  };
2618
1863
 
2619
- export { Attachment, DebugTool, FormCheckbox, FormCheckboxButton, FormDatePicker, FormDateRangePicker, FormSearchJobField, FormSegmentGroup, FormSelect, FormTextField, JobSearchModal, StepIndicator, resize, testSignatureBase64Data, useAddressComponent, useCamera, useCanvasPaint, useJobVehicleSearchModal, useSearchAddress };
1864
+ export { Attachment, FormCheckbox, FormCheckboxButton, FormDatePicker, FormDateRangePicker, FormSearchJobField, FormSegmentGroup, FormSelect, FormTextField, JobSearchModal, StepIndicator, resize, testSignatureBase64Data, useAddressComponent, useCamera, useCanvasPaint, useJobVehicleSearchModal, useSearchAddress };
2620
1865
  //# sourceMappingURL=index.esm.js.map