@superbright/indexeddb-orm 1.0.7 → 1.0.9
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/features/analytics/analytics.cjs +1 -1
- package/dist/features/analytics/analytics.cjs.map +1 -1
- package/dist/features/analytics/analytics.d.ts +68 -1
- package/dist/features/analytics/analytics.mjs +101 -100
- package/dist/features/analytics/analytics.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +70 -67
- package/dist/utils/dimensions.cjs +1 -1
- package/dist/utils/dimensions.cjs.map +1 -1
- package/dist/utils/dimensions.d.ts +18 -0
- package/dist/utils/dimensions.mjs +61 -20
- package/dist/utils/dimensions.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { OpenDBError as t, SchemaMismatchError as o } from "./errors.mjs";
|
|
2
|
-
import { ApiUserSchema as i, AppStoreDataSchema as m, FavoritesSchema as n, FiltersSchema as s, PropertySchema as p, PropertyStoreDataSchema as S, QueryParamsSchema as f, ResultsModeEnum as l, SCHEMA_VERSION as c, SortByEnum as d, TourContactDataSchema as u, UnifiedStoreDataSchema as x, UnitDataSchema as U, UnitFavoriteSchema as h, UnitSchema as M, UserPropertyStateSchema as
|
|
3
|
-
import { getDB as
|
|
4
|
-
import { defaultIdGenerator as
|
|
2
|
+
import { ApiUserSchema as i, AppStoreDataSchema as m, FavoritesSchema as n, FiltersSchema as s, PropertySchema as p, PropertyStoreDataSchema as S, QueryParamsSchema as f, ResultsModeEnum as l, SCHEMA_VERSION as c, SortByEnum as d, TourContactDataSchema as u, UnifiedStoreDataSchema as x, UnitDataSchema as U, UnitFavoriteSchema as h, UnitSchema as M, UserPropertyStateSchema as y, UserSchema as v, UserUnitDataSchema as g, ViewedUnitSchema as E } from "./schema.mjs";
|
|
3
|
+
import { getDB as P, resetDB as F } from "./db.mjs";
|
|
4
|
+
import { defaultIdGenerator as A, ensureUser as I, getUserUUID as R } from "./api/users.mjs";
|
|
5
5
|
import { debugDump as b, exportJSON as k } from "./debug.mjs";
|
|
6
6
|
import { createORMStringStorage as V, kvGet as B, kvRemove as _, kvSet as G } from "./storage.mjs";
|
|
7
|
-
import { getFavoritedUnitsForProperty as L, isUnitFavorited as
|
|
7
|
+
import { getFavoritedUnitsForProperty as L, isUnitFavorited as N, setFavoriteUnit as Q, toggleFavoriteUnit as w } from "./api/favorites.mjs";
|
|
8
8
|
import { PropertyStore as W, propertyStore as Z } from "./api/properties.mjs";
|
|
9
9
|
import { UnifiedStore as q, UnifiedStore as z, store as K } from "./stores/store.mjs";
|
|
10
10
|
import { createUseUnitState as Y, createZustandUnifiedStore as $ } from "./adapters/zustand-store.mjs";
|
|
@@ -12,117 +12,120 @@ import { createStructuredStore as re, createStructuredStoreActions as te } from
|
|
|
12
12
|
import { favorites as ae } from "./units/favorites.mjs";
|
|
13
13
|
import { DEFAULT_PLACEHOLDER_IMAGE as me, DEFAULT_WEB_ORIGIN as ne, buildExploreUrl as se, buildImageUrl as pe, transformUnitsApiResponse as Se, transformUnitsApiResponseToClient as fe, transformUnitsApiResponseToClientFilters as le } from "./features/units/transformers.mjs";
|
|
14
14
|
import { defaultSortParamMap as de, transformFiltersToPreferences as ue, transformFiltersToUnitsSearchParams as xe } from "./features/filters/transformers.mjs";
|
|
15
|
-
import {
|
|
16
|
-
import { configureValidation as
|
|
17
|
-
import { OverviewImagesOnPropertyModel as
|
|
18
|
-
import { AmenityImagesOnPropertyModel as
|
|
19
|
-
import { FloorPlanModel as
|
|
20
|
-
import { MediaModel as
|
|
21
|
-
import { PropertyModel as
|
|
22
|
-
import { PropertyHighlightModel as
|
|
23
|
-
import { RoomModel as
|
|
24
|
-
import { StyleModel as
|
|
25
|
-
import { UnitModel as
|
|
26
|
-
import { Currency as
|
|
27
|
-
import { RenderedStyleModel as
|
|
28
|
-
import { PropertyAmenityModel as
|
|
29
|
-
import { FavoriteUnitModel as
|
|
30
|
-
import { UserModel as
|
|
31
|
-
import { MixpanelProvider as
|
|
32
|
-
import { generateUserUUID as
|
|
33
|
-
import { QuestionEnumValues as
|
|
15
|
+
import { dimensionToMmNumber as he, formatDimensions as Me, imperialToMm as ye, inchesToMm as ve, mmToInches as ge, toInchesDisplay as Ee } from "./utils/dimensions.mjs";
|
|
16
|
+
import { configureValidation as Pe } from "./validation.mjs";
|
|
17
|
+
import { OverviewImagesOnPropertyModel as Te } from "./base/overviewimagesonproperty.mjs";
|
|
18
|
+
import { AmenityImagesOnPropertyModel as Ie } from "./base/amenityimagesonproperty.mjs";
|
|
19
|
+
import { FloorPlanModel as Oe } from "./base/floorplan.mjs";
|
|
20
|
+
import { MediaModel as ke } from "./base/media.mjs";
|
|
21
|
+
import { PropertyModel as Ve } from "./base/property.mjs";
|
|
22
|
+
import { PropertyHighlightModel as _e } from "./base/propertyhighlight.mjs";
|
|
23
|
+
import { RoomModel as He } from "./base/room.mjs";
|
|
24
|
+
import { StyleModel as Ne } from "./base/style.mjs";
|
|
25
|
+
import { UnitModel as we } from "./base/unit.mjs";
|
|
26
|
+
import { Currency as We, DeliveryStatus as Ze, ExternalService as je, FurnitureAvailability as qe, Highlights as ze, MediaType as Ke, QueueJobStatus as Xe, RenderStatus as Ye, Status as $e, UserRole as er } from "./base/enums.mjs";
|
|
27
|
+
import { RenderedStyleModel as tr } from "./base/renderedstyle.mjs";
|
|
28
|
+
import { PropertyAmenityModel as ar } from "./base/propertyamenity.mjs";
|
|
29
|
+
import { FavoriteUnitModel as mr } from "./base/favoriteunit.mjs";
|
|
30
|
+
import { UserModel as sr } from "./base/user.mjs";
|
|
31
|
+
import { MixpanelProvider as Sr, useMixpanel as fr } from "./features/analytics/MixpanelProvider.mjs";
|
|
32
|
+
import { generateUserUUID as cr } from "./features/analytics/generateUserUUID.mjs";
|
|
33
|
+
import { QuestionEnumValues as ur, QuestionnaireInteractionValues as xr, SortEnumValues as Ur, buildTrackingEvents as hr, useTrackEvent as Mr, useTrackingEvents as yr } from "./features/analytics/analytics.mjs";
|
|
34
34
|
export {
|
|
35
|
-
|
|
35
|
+
Ie as AmenityImagesOnPropertyModel,
|
|
36
36
|
i as ApiUserSchema,
|
|
37
37
|
m as AppStoreDataSchema,
|
|
38
|
-
|
|
38
|
+
We as Currency,
|
|
39
39
|
me as DEFAULT_PLACEHOLDER_IMAGE,
|
|
40
40
|
ne as DEFAULT_WEB_ORIGIN,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
Ze as DeliveryStatus,
|
|
42
|
+
je as ExternalService,
|
|
43
|
+
mr as FavoriteUnitModel,
|
|
44
44
|
n as FavoritesSchema,
|
|
45
45
|
s as FiltersSchema,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
Oe as FloorPlanModel,
|
|
47
|
+
qe as FurnitureAvailability,
|
|
48
|
+
ze as Highlights,
|
|
49
|
+
ke as MediaModel,
|
|
50
|
+
Ke as MediaType,
|
|
51
|
+
Sr as MixpanelProvider,
|
|
52
52
|
t as OpenDBError,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
Te as OverviewImagesOnPropertyModel,
|
|
54
|
+
ar as PropertyAmenityModel,
|
|
55
|
+
_e as PropertyHighlightModel,
|
|
56
|
+
Ve as PropertyModel,
|
|
57
57
|
p as PropertySchema,
|
|
58
58
|
W as PropertyStore,
|
|
59
59
|
S as PropertyStoreDataSchema,
|
|
60
60
|
f as QueryParamsSchema,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
ur as QuestionEnumValues,
|
|
62
|
+
xr as QuestionnaireInteractionValues,
|
|
63
|
+
Xe as QueueJobStatus,
|
|
64
|
+
Ye as RenderStatus,
|
|
65
|
+
tr as RenderedStyleModel,
|
|
66
66
|
l as ResultsModeEnum,
|
|
67
|
-
|
|
67
|
+
He as RoomModel,
|
|
68
68
|
c as SCHEMA_VERSION,
|
|
69
69
|
o as SchemaMismatchError,
|
|
70
70
|
d as SortByEnum,
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
Ur as SortEnumValues,
|
|
72
|
+
$e as Status,
|
|
73
73
|
q as Store,
|
|
74
|
-
|
|
74
|
+
Ne as StyleModel,
|
|
75
75
|
u as TourContactDataSchema,
|
|
76
76
|
z as UnifiedStore,
|
|
77
77
|
x as UnifiedStoreDataSchema,
|
|
78
78
|
U as UnitDataSchema,
|
|
79
79
|
h as UnitFavoriteSchema,
|
|
80
|
-
|
|
80
|
+
we as UnitModel,
|
|
81
81
|
M as UnitSchema,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
sr as UserModel,
|
|
83
|
+
y as UserPropertyStateSchema,
|
|
84
|
+
er as UserRole,
|
|
85
|
+
v as UserSchema,
|
|
86
86
|
g as UserUnitDataSchema,
|
|
87
87
|
E as ViewedUnitSchema,
|
|
88
88
|
se as buildExploreUrl,
|
|
89
89
|
pe as buildImageUrl,
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
hr as buildTrackingEvents,
|
|
91
|
+
Pe as configureValidation,
|
|
92
92
|
V as createORMStringStorage,
|
|
93
93
|
re as createStructuredStore,
|
|
94
94
|
te as createStructuredStoreActions,
|
|
95
95
|
Y as createUseUnitState,
|
|
96
96
|
$ as createZustandUnifiedStore,
|
|
97
97
|
b as debugDump,
|
|
98
|
-
|
|
98
|
+
A as defaultIdGenerator,
|
|
99
99
|
de as defaultSortParamMap,
|
|
100
|
-
|
|
100
|
+
he as dimensionToMmNumber,
|
|
101
|
+
I as ensureUser,
|
|
101
102
|
k as exportJSON,
|
|
102
103
|
ae as favorites,
|
|
103
|
-
|
|
104
|
-
|
|
104
|
+
Me as formatDimensions,
|
|
105
|
+
cr as generateUserUUID,
|
|
106
|
+
P as getDB,
|
|
105
107
|
L as getFavoritedUnitsForProperty,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
R as getUserUUID,
|
|
109
|
+
ye as imperialToMm,
|
|
110
|
+
ve as inchesToMm,
|
|
111
|
+
N as isUnitFavorited,
|
|
110
112
|
B as kvGet,
|
|
111
113
|
_ as kvRemove,
|
|
112
114
|
G as kvSet,
|
|
113
|
-
|
|
115
|
+
ge as mmToInches,
|
|
114
116
|
Z as propertyStore,
|
|
115
117
|
F as resetDB,
|
|
116
|
-
|
|
118
|
+
Q as setFavoriteUnit,
|
|
117
119
|
K as store,
|
|
120
|
+
Ee as toInchesDisplay,
|
|
118
121
|
w as toggleFavoriteUnit,
|
|
119
122
|
ue as transformFiltersToPreferences,
|
|
120
123
|
xe as transformFiltersToUnitsSearchParams,
|
|
121
124
|
Se as transformUnitsApiResponse,
|
|
122
125
|
fe as transformUnitsApiResponseToClient,
|
|
123
126
|
le as transformUnitsApiResponseToClientFilters,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
+
fr as useMixpanel,
|
|
128
|
+
Mr as useTrackEvent,
|
|
129
|
+
yr as useTrackingEvents
|
|
127
130
|
};
|
|
128
131
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=25.4;function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=25.4;function a(n,t=1,r=!1){const e=n/f,i=Math.max(0,t),o=Math.pow(10,i),s=Math.round(e*o)/o;return r?`${s}"`:s}function h(n){return n*f}function p(n){var l,u,m,c;if(typeof n!="string")return null;let t=n.trim();if(!t)return null;t=t.replace(/[’′‵`]/g,"'").replace(/[”″˝❞]/g,'"').toLowerCase();const r=/^(?:\s*(?<feet>\d+(?:\.\d+)?)\s*(?:'|ft|feet))?\s*(?:\s*(?<inches>\d+(?:\.\d+)?)\s*(?:\"|in\b|inch(?:es)?\b))?\s*$/i,e=t.match(r);if(!e||!((l=e.groups)!=null&&l.feet)&&!((u=e.groups)!=null&&u.inches))return null;const i=(m=e.groups)!=null&&m.feet?parseFloat(e.groups.feet):0,o=(c=e.groups)!=null&&c.inches?parseFloat(e.groups.inches):0;if(!isFinite(i)||!isFinite(o))return null;const s=i*12+o;return h(s)}const b=/('|ft|feet|"|in\b|inch(?:es)?\b)/i;function g(n){if(n==null)return;if(typeof n=="number")return Number.isFinite(n)?Math.round(n):void 0;const t=String(n).trim();if(!t)return;const r=b.test(t)?t:`${t}"`,e=p(r);if(!(e==null||!Number.isFinite(e)))return Math.round(e)}const M=n=>{if(n==null)return null;if(typeof n=="number")return Number.isFinite(n)?n:null;const t=String(n).trim();if(!t)return null;const r=Number.parseFloat(t);return Number.isFinite(r)?r:null},d=(n,t=1,r=!1)=>{const e=M(n);if(e==null)return null;const i=a(e,t,r);return typeof i=="number"?i.toString():i};function T({width:n,depth:t,height:r},{precision:e=1,appendSymbol:i=!0,delimiter:o=" x "}={}){const s=(u,m)=>{const c=d(u,e,!1);return c?`${i?`${c}"`:c}${m}`:null};return[s(n,"W"),s(t,"D"),s(r,"H")].filter(u=>u!=null).join(o)}function F(n,{precision:t=1,appendSymbol:r=!1}={}){return d(n,t,r)??""}exports.dimensionToMmNumber=g;exports.formatDimensions=T;exports.imperialToMm=p;exports.inchesToMm=h;exports.mmToInches=a;exports.toInchesDisplay=F;
|
|
2
2
|
//# sourceMappingURL=dimensions.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dimensions.cjs","sources":["../../src/utils/dimensions.ts"],"sourcesContent":["/**\n * Units + formatting helpers for converting millimeters to US customary units.\n */\n\nconst MM_PER_INCH = 25.4;\n// Note: feet/inches helpers removed to keep API minimal\n\n/**\n * Convert millimeters to inches.\n * @param mm - Value in millimeters\n * @param precision - Optional decimal places to round to (no rounding if undefined)\n */\nexport function mmToInches(mm: number, precision: number = 1, appendSymbol = false): number | string {\n const inches = mm / MM_PER_INCH;\n const p = Math.max(0, precision);\n const factor = Math.pow(10, p);\n const value = Math.round(inches * factor) / factor;\n return appendSymbol ? `${value}\\\"` : value;\n}\n\n// Feet/inches helpers were intentionally removed. Use mmToInches with append flag for display.\n\n/**\n * Convert inches to millimeters.\n * Always returns the full-precision value without rounding.\n * @param inches - Value in inches\n */\nexport function inchesToMm(inches: number): number {\n return inches * MM_PER_INCH;\n}\n\n/**\n * Parse a human-entered imperial dimension like:\n * - 15' 4\" (feet and inches with symbols)\n * - 6ft 2in (text units)\n * - 72\" (inches only)\n * - 10' (feet only)\n * and convert it to millimeters.\n *\n * Returns null when the input doesn't contain recognizable feet/inches values.\n */\nexport function imperialToMm(input: string): number | null {\n if (typeof input !== 'string') return null;\n let s = input.trim();\n if (!s) return null;\n\n // Normalize various quote characters to plain ASCII ' and \"\n s = s\n .replace(/[’′‵`]/g, \"'\") // single-quote variants\n .replace(/[”″˝❞]/g, '\"') // double-quote variants\n .toLowerCase();\n\n // Regex to capture optional feet and inches components (decimals allowed)\n // Examples matched: 15' 4\", 6ft 2in, 72\", 10'\n const re = /^(?:\\s*(?<feet>\\d+(?:\\.\\d+)?)\\s*(?:'|ft|feet))?\\s*(?:\\s*(?<inches>\\d+(?:\\.\\d+)?)\\s*(?:\\\"|in\\b|inch(?:es)?\\b))?\\s*$/i;\n const m = s.match(re);\n if (!m || (!m.groups?.feet && !m.groups?.inches)) return null;\n\n const feet = m.groups?.feet ? parseFloat(m.groups.feet) : 0;\n const inches = m.groups?.inches ? parseFloat(m.groups.inches) : 0;\n if (!isFinite(feet) || !isFinite(inches)) return null;\n\n const totalInches = feet * 12 + inches;\n return inchesToMm(totalInches);\n}\n"],"names":["MM_PER_INCH","mmToInches","mm","precision","appendSymbol","inches","p","factor","value","inchesToMm","imperialToMm","input","s","re","m","_a","_b","feet","_c","_d","totalInches"],"mappings":"gFAIA,MAAMA,EAAc,KAQb,SAASC,EAAWC,EAAYC,EAAoB,EAAGC,EAAe,GAAwB,CACnG,MAAMC,EAASH,EAAKF,EACdM,EAAI,KAAK,IAAI,EAAGH,CAAS,EACzBI,EAAS,KAAK,IAAI,GAAID,CAAC,EACvBE,EAAQ,KAAK,MAAMH,EAASE,CAAM,EAAIA,EAC5C,OAAOH,EAAe,GAAGI,CAAK,IAAOA,CACvC,CASO,SAASC,EAAWJ,EAAwB,CACjD,OAAOA,EAASL,CAClB,CAYO,SAASU,EAAaC,EAA8B,aACzD,GAAI,OAAOA,GAAU,SAAU,OAAO,KACtC,IAAIC,EAAID,EAAM,KAAA,EACd,GAAI,CAACC,EAAG,OAAO,KAGfA,EAAIA,EACD,QAAQ,UAAW,GAAG,EACtB,QAAQ,UAAW,GAAG,EACtB,YAAA,EAIH,MAAMC,EAAK,sHACLC,EAAIF,EAAE,MAAMC,CAAE,EACpB,GAAI,CAACC,GAAM,GAACC,EAAAD,EAAE,SAAF,MAAAC,EAAU,OAAQ,GAACC,EAAAF,EAAE,SAAF,MAAAE,EAAU,QAAS,OAAO,KAEzD,MAAMC,GAAOC,EAAAJ,EAAE,SAAF,MAAAI,EAAU,KAAO,WAAWJ,EAAE,OAAO,IAAI,EAAI,EACpDT,GAASc,EAAAL,EAAE,SAAF,MAAAK,EAAU,OAAS,WAAWL,EAAE,OAAO,MAAM,EAAI,EAChE,GAAI,CAAC,SAASG,CAAI,GAAK,CAAC,SAASZ,CAAM,EAAG,OAAO,KAEjD,MAAMe,EAAcH,EAAO,GAAKZ,EAChC,OAAOI,EAAWW,CAAW,CAC/B"}
|
|
1
|
+
{"version":3,"file":"dimensions.cjs","sources":["../../src/utils/dimensions.ts"],"sourcesContent":["/**\n * Units + formatting helpers for converting millimeters to US customary units.\n */\n\nconst MM_PER_INCH = 25.4;\n// Note: feet/inches helpers removed to keep API minimal\n\n/**\n * Convert millimeters to inches.\n * @param mm - Value in millimeters\n * @param precision - Optional decimal places to round to (no rounding if undefined)\n */\nexport function mmToInches(mm: number, precision: number = 1, appendSymbol = false): number | string {\n const inches = mm / MM_PER_INCH;\n const p = Math.max(0, precision);\n const factor = Math.pow(10, p);\n const value = Math.round(inches * factor) / factor;\n return appendSymbol ? `${value}\\\"` : value;\n}\n\n// Feet/inches helpers were intentionally removed. Use mmToInches with append flag for display.\n\n/**\n * Convert inches to millimeters.\n * Always returns the full-precision value without rounding.\n * @param inches - Value in inches\n */\nexport function inchesToMm(inches: number): number {\n return inches * MM_PER_INCH;\n}\n\n/**\n * Parse a human-entered imperial dimension like:\n * - 15' 4\" (feet and inches with symbols)\n * - 6ft 2in (text units)\n * - 72\" (inches only)\n * - 10' (feet only)\n * and convert it to millimeters.\n *\n * Returns null when the input doesn't contain recognizable feet/inches values.\n */\nexport function imperialToMm(input: string): number | null {\n if (typeof input !== 'string') return null;\n let s = input.trim();\n if (!s) return null;\n\n // Normalize various quote characters to plain ASCII ' and \"\n s = s\n .replace(/[’′‵`]/g, \"'\") // single-quote variants\n .replace(/[”″˝❞]/g, '\"') // double-quote variants\n .toLowerCase();\n\n // Regex to capture optional feet and inches components (decimals allowed)\n // Examples matched: 15' 4\", 6ft 2in, 72\", 10'\n const re = /^(?:\\s*(?<feet>\\d+(?:\\.\\d+)?)\\s*(?:'|ft|feet))?\\s*(?:\\s*(?<inches>\\d+(?:\\.\\d+)?)\\s*(?:\\\"|in\\b|inch(?:es)?\\b))?\\s*$/i;\n const m = s.match(re);\n if (!m || (!m.groups?.feet && !m.groups?.inches)) return null;\n\n const feet = m.groups?.feet ? parseFloat(m.groups.feet) : 0;\n const inches = m.groups?.inches ? parseFloat(m.groups.inches) : 0;\n if (!isFinite(feet) || !isFinite(inches)) return null;\n\n const totalInches = feet * 12 + inches;\n return inchesToMm(totalInches);\n}\n\ntype DimensionInput = string | number | null | undefined;\n\nconst unitPattern = /('|ft|feet|\"|in\\b|inch(?:es)?\\b)/i;\n\nexport function dimensionToMmNumber(value?: DimensionInput): number | undefined {\n if (value == null) return undefined;\n\n if (typeof value === \"number\") {\n return Number.isFinite(value) ? Math.round(value) : undefined;\n }\n\n const raw = String(value).trim();\n if (!raw) return undefined;\n\n const candidate = unitPattern.test(raw) ? raw : `${raw}\"`;\n const mm = imperialToMm(candidate);\n\n if (mm == null || !Number.isFinite(mm)) return undefined;\n return Math.round(mm);\n}\n\nconst coerceMillimeters = (value: DimensionInput): number | null => {\n if (value == null) return null;\n if (typeof value === \"number\") return Number.isFinite(value) ? value : null;\n\n const trimmed = String(value).trim();\n if (!trimmed) return null;\n\n const numeric = Number.parseFloat(trimmed);\n return Number.isFinite(numeric) ? numeric : null;\n};\n\nconst mmToInchesString = (\n value: DimensionInput,\n precision = 1,\n appendSymbol = false,\n): string | null => {\n const mm = coerceMillimeters(value);\n if (mm == null) return null;\n\n const converted = mmToInches(mm, precision, appendSymbol);\n return typeof converted === \"number\" ? converted.toString() : converted;\n};\n\ntype FormatDimensionsArgs = {\n width?: DimensionInput;\n depth?: DimensionInput;\n height?: DimensionInput;\n};\n\ntype FormatDimensionsOptions = {\n precision?: number;\n appendSymbol?: boolean;\n delimiter?: string;\n};\n\nexport function formatDimensions(\n { width, depth, height }: FormatDimensionsArgs,\n { precision = 1, appendSymbol = true, delimiter = \" x \" }: FormatDimensionsOptions = {},\n): string {\n const formatPart = (value: DimensionInput, label: string): string | null => {\n const inches = mmToInchesString(value, precision, false);\n if (!inches) return null;\n const measurement = appendSymbol ? `${inches}\"` : inches;\n return `${measurement}${label}`;\n };\n\n const parts = [\n formatPart(width, \"W\"),\n formatPart(depth, \"D\"),\n formatPart(height, \"H\"),\n ].filter((part): part is string => part != null);\n\n return parts.join(delimiter);\n}\n\nexport function toInchesDisplay(\n value?: DimensionInput,\n { precision = 1, appendSymbol = false }: { precision?: number; appendSymbol?: boolean } = {},\n): string {\n return mmToInchesString(value, precision, appendSymbol) ?? \"\";\n}\n"],"names":["MM_PER_INCH","mmToInches","mm","precision","appendSymbol","inches","p","factor","value","inchesToMm","imperialToMm","input","s","re","m","_a","_b","feet","_c","_d","totalInches","unitPattern","dimensionToMmNumber","raw","candidate","coerceMillimeters","trimmed","numeric","mmToInchesString","converted","formatDimensions","width","depth","height","delimiter","formatPart","label","part","toInchesDisplay"],"mappings":"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"}
|
|
@@ -24,3 +24,21 @@ export declare function inchesToMm(inches: number): number;
|
|
|
24
24
|
* Returns null when the input doesn't contain recognizable feet/inches values.
|
|
25
25
|
*/
|
|
26
26
|
export declare function imperialToMm(input: string): number | null;
|
|
27
|
+
type DimensionInput = string | number | null | undefined;
|
|
28
|
+
export declare function dimensionToMmNumber(value?: DimensionInput): number | undefined;
|
|
29
|
+
type FormatDimensionsArgs = {
|
|
30
|
+
width?: DimensionInput;
|
|
31
|
+
depth?: DimensionInput;
|
|
32
|
+
height?: DimensionInput;
|
|
33
|
+
};
|
|
34
|
+
type FormatDimensionsOptions = {
|
|
35
|
+
precision?: number;
|
|
36
|
+
appendSymbol?: boolean;
|
|
37
|
+
delimiter?: string;
|
|
38
|
+
};
|
|
39
|
+
export declare function formatDimensions({ width, depth, height }: FormatDimensionsArgs, { precision, appendSymbol, delimiter }?: FormatDimensionsOptions): string;
|
|
40
|
+
export declare function toInchesDisplay(value?: DimensionInput, { precision, appendSymbol }?: {
|
|
41
|
+
precision?: number;
|
|
42
|
+
appendSymbol?: boolean;
|
|
43
|
+
}): string;
|
|
44
|
+
export {};
|
|
@@ -1,26 +1,67 @@
|
|
|
1
|
-
function
|
|
2
|
-
const e =
|
|
3
|
-
return
|
|
1
|
+
function a(n, t = 1, r = !1) {
|
|
2
|
+
const e = n / 25.4, i = Math.max(0, t), o = Math.pow(10, i), s = Math.round(e * o) / o;
|
|
3
|
+
return r ? `${s}"` : s;
|
|
4
4
|
}
|
|
5
|
-
function
|
|
6
|
-
return
|
|
5
|
+
function p(n) {
|
|
6
|
+
return n * 25.4;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
var
|
|
10
|
-
if (typeof
|
|
11
|
-
let
|
|
12
|
-
if (!
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
if (!e || !((
|
|
16
|
-
const
|
|
17
|
-
if (!isFinite(
|
|
18
|
-
const
|
|
19
|
-
return
|
|
8
|
+
function h(n) {
|
|
9
|
+
var l, u, f, c;
|
|
10
|
+
if (typeof n != "string") return null;
|
|
11
|
+
let t = n.trim();
|
|
12
|
+
if (!t) return null;
|
|
13
|
+
t = t.replace(/[’′‵`]/g, "'").replace(/[”″˝❞]/g, '"').toLowerCase();
|
|
14
|
+
const r = /^(?:\s*(?<feet>\d+(?:\.\d+)?)\s*(?:'|ft|feet))?\s*(?:\s*(?<inches>\d+(?:\.\d+)?)\s*(?:\"|in\b|inch(?:es)?\b))?\s*$/i, e = t.match(r);
|
|
15
|
+
if (!e || !((l = e.groups) != null && l.feet) && !((u = e.groups) != null && u.inches)) return null;
|
|
16
|
+
const i = (f = e.groups) != null && f.feet ? parseFloat(e.groups.feet) : 0, o = (c = e.groups) != null && c.inches ? parseFloat(e.groups.inches) : 0;
|
|
17
|
+
if (!isFinite(i) || !isFinite(o)) return null;
|
|
18
|
+
const s = i * 12 + o;
|
|
19
|
+
return p(s);
|
|
20
|
+
}
|
|
21
|
+
const d = /('|ft|feet|"|in\b|inch(?:es)?\b)/i;
|
|
22
|
+
function g(n) {
|
|
23
|
+
if (n == null) return;
|
|
24
|
+
if (typeof n == "number")
|
|
25
|
+
return Number.isFinite(n) ? Math.round(n) : void 0;
|
|
26
|
+
const t = String(n).trim();
|
|
27
|
+
if (!t) return;
|
|
28
|
+
const r = d.test(t) ? t : `${t}"`, e = h(r);
|
|
29
|
+
if (!(e == null || !Number.isFinite(e)))
|
|
30
|
+
return Math.round(e);
|
|
31
|
+
}
|
|
32
|
+
const M = (n) => {
|
|
33
|
+
if (n == null) return null;
|
|
34
|
+
if (typeof n == "number") return Number.isFinite(n) ? n : null;
|
|
35
|
+
const t = String(n).trim();
|
|
36
|
+
if (!t) return null;
|
|
37
|
+
const r = Number.parseFloat(t);
|
|
38
|
+
return Number.isFinite(r) ? r : null;
|
|
39
|
+
}, m = (n, t = 1, r = !1) => {
|
|
40
|
+
const e = M(n);
|
|
41
|
+
if (e == null) return null;
|
|
42
|
+
const i = a(e, t, r);
|
|
43
|
+
return typeof i == "number" ? i.toString() : i;
|
|
44
|
+
};
|
|
45
|
+
function F({ width: n, depth: t, height: r }, { precision: e = 1, appendSymbol: i = !0, delimiter: o = " x " } = {}) {
|
|
46
|
+
const s = (u, f) => {
|
|
47
|
+
const c = m(u, e, !1);
|
|
48
|
+
return c ? `${i ? `${c}"` : c}${f}` : null;
|
|
49
|
+
};
|
|
50
|
+
return [
|
|
51
|
+
s(n, "W"),
|
|
52
|
+
s(t, "D"),
|
|
53
|
+
s(r, "H")
|
|
54
|
+
].filter((u) => u != null).join(o);
|
|
55
|
+
}
|
|
56
|
+
function N(n, { precision: t = 1, appendSymbol: r = !1 } = {}) {
|
|
57
|
+
return m(n, t, r) ?? "";
|
|
20
58
|
}
|
|
21
59
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
h as
|
|
60
|
+
g as dimensionToMmNumber,
|
|
61
|
+
F as formatDimensions,
|
|
62
|
+
h as imperialToMm,
|
|
63
|
+
p as inchesToMm,
|
|
64
|
+
a as mmToInches,
|
|
65
|
+
N as toInchesDisplay
|
|
25
66
|
};
|
|
26
67
|
//# sourceMappingURL=dimensions.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dimensions.mjs","sources":["../../src/utils/dimensions.ts"],"sourcesContent":["/**\n * Units + formatting helpers for converting millimeters to US customary units.\n */\n\nconst MM_PER_INCH = 25.4;\n// Note: feet/inches helpers removed to keep API minimal\n\n/**\n * Convert millimeters to inches.\n * @param mm - Value in millimeters\n * @param precision - Optional decimal places to round to (no rounding if undefined)\n */\nexport function mmToInches(mm: number, precision: number = 1, appendSymbol = false): number | string {\n const inches = mm / MM_PER_INCH;\n const p = Math.max(0, precision);\n const factor = Math.pow(10, p);\n const value = Math.round(inches * factor) / factor;\n return appendSymbol ? `${value}\\\"` : value;\n}\n\n// Feet/inches helpers were intentionally removed. Use mmToInches with append flag for display.\n\n/**\n * Convert inches to millimeters.\n * Always returns the full-precision value without rounding.\n * @param inches - Value in inches\n */\nexport function inchesToMm(inches: number): number {\n return inches * MM_PER_INCH;\n}\n\n/**\n * Parse a human-entered imperial dimension like:\n * - 15' 4\" (feet and inches with symbols)\n * - 6ft 2in (text units)\n * - 72\" (inches only)\n * - 10' (feet only)\n * and convert it to millimeters.\n *\n * Returns null when the input doesn't contain recognizable feet/inches values.\n */\nexport function imperialToMm(input: string): number | null {\n if (typeof input !== 'string') return null;\n let s = input.trim();\n if (!s) return null;\n\n // Normalize various quote characters to plain ASCII ' and \"\n s = s\n .replace(/[’′‵`]/g, \"'\") // single-quote variants\n .replace(/[”″˝❞]/g, '\"') // double-quote variants\n .toLowerCase();\n\n // Regex to capture optional feet and inches components (decimals allowed)\n // Examples matched: 15' 4\", 6ft 2in, 72\", 10'\n const re = /^(?:\\s*(?<feet>\\d+(?:\\.\\d+)?)\\s*(?:'|ft|feet))?\\s*(?:\\s*(?<inches>\\d+(?:\\.\\d+)?)\\s*(?:\\\"|in\\b|inch(?:es)?\\b))?\\s*$/i;\n const m = s.match(re);\n if (!m || (!m.groups?.feet && !m.groups?.inches)) return null;\n\n const feet = m.groups?.feet ? parseFloat(m.groups.feet) : 0;\n const inches = m.groups?.inches ? parseFloat(m.groups.inches) : 0;\n if (!isFinite(feet) || !isFinite(inches)) return null;\n\n const totalInches = feet * 12 + inches;\n return inchesToMm(totalInches);\n}\n"],"names":["mmToInches","mm","precision","appendSymbol","inches","p","factor","value","inchesToMm","imperialToMm","input","_a","_b","_c","_d","s","re","m","feet","totalInches"],"mappings":"AAYO,SAASA,EAAWC,GAAYC,IAAoB,GAAGC,IAAe,IAAwB;AACnG,QAAMC,IAASH,IAAK,MACdI,IAAI,KAAK,IAAI,GAAGH,CAAS,GACzBI,IAAS,KAAK,IAAI,IAAID,CAAC,GACvBE,IAAQ,KAAK,MAAMH,IAASE,CAAM,IAAIA;AAC5C,SAAOH,IAAe,GAAGI,CAAK,MAAOA;AACvC;AASO,SAASC,EAAWJ,GAAwB;AACjD,SAAOA,IAAS;AAClB;AAYO,SAASK,EAAaC,GAA8B;AArC3D,MAAAC,GAAAC,GAAAC,GAAAC;AAsCE,MAAI,OAAOJ,KAAU,SAAU,QAAO;AACtC,MAAIK,IAAIL,EAAM,KAAA;AACd,MAAI,CAACK,EAAG,QAAO;AAGf,EAAAA,IAAIA,EACD,QAAQ,WAAW,GAAG,EACtB,QAAQ,WAAW,GAAG,EACtB,YAAA;AAIH,QAAMC,IAAK,uHACLC,IAAIF,EAAE,MAAMC,CAAE;AACpB,MAAI,CAACC,KAAM,GAACN,IAAAM,EAAE,WAAF,QAAAN,EAAU,SAAQ,GAACC,IAAAK,EAAE,WAAF,QAAAL,EAAU,QAAS,QAAO;AAEzD,QAAMM,KAAOL,IAAAI,EAAE,WAAF,QAAAJ,EAAU,OAAO,WAAWI,EAAE,OAAO,IAAI,IAAI,GACpDb,KAASU,IAAAG,EAAE,WAAF,QAAAH,EAAU,SAAS,WAAWG,EAAE,OAAO,MAAM,IAAI;AAChE,MAAI,CAAC,SAASC,CAAI,KAAK,CAAC,SAASd,CAAM,EAAG,QAAO;AAEjD,QAAMe,IAAcD,IAAO,KAAKd;AAChC,SAAOI,EAAWW,CAAW;AAC/B;"}
|
|
1
|
+
{"version":3,"file":"dimensions.mjs","sources":["../../src/utils/dimensions.ts"],"sourcesContent":["/**\n * Units + formatting helpers for converting millimeters to US customary units.\n */\n\nconst MM_PER_INCH = 25.4;\n// Note: feet/inches helpers removed to keep API minimal\n\n/**\n * Convert millimeters to inches.\n * @param mm - Value in millimeters\n * @param precision - Optional decimal places to round to (no rounding if undefined)\n */\nexport function mmToInches(mm: number, precision: number = 1, appendSymbol = false): number | string {\n const inches = mm / MM_PER_INCH;\n const p = Math.max(0, precision);\n const factor = Math.pow(10, p);\n const value = Math.round(inches * factor) / factor;\n return appendSymbol ? `${value}\\\"` : value;\n}\n\n// Feet/inches helpers were intentionally removed. Use mmToInches with append flag for display.\n\n/**\n * Convert inches to millimeters.\n * Always returns the full-precision value without rounding.\n * @param inches - Value in inches\n */\nexport function inchesToMm(inches: number): number {\n return inches * MM_PER_INCH;\n}\n\n/**\n * Parse a human-entered imperial dimension like:\n * - 15' 4\" (feet and inches with symbols)\n * - 6ft 2in (text units)\n * - 72\" (inches only)\n * - 10' (feet only)\n * and convert it to millimeters.\n *\n * Returns null when the input doesn't contain recognizable feet/inches values.\n */\nexport function imperialToMm(input: string): number | null {\n if (typeof input !== 'string') return null;\n let s = input.trim();\n if (!s) return null;\n\n // Normalize various quote characters to plain ASCII ' and \"\n s = s\n .replace(/[’′‵`]/g, \"'\") // single-quote variants\n .replace(/[”″˝❞]/g, '\"') // double-quote variants\n .toLowerCase();\n\n // Regex to capture optional feet and inches components (decimals allowed)\n // Examples matched: 15' 4\", 6ft 2in, 72\", 10'\n const re = /^(?:\\s*(?<feet>\\d+(?:\\.\\d+)?)\\s*(?:'|ft|feet))?\\s*(?:\\s*(?<inches>\\d+(?:\\.\\d+)?)\\s*(?:\\\"|in\\b|inch(?:es)?\\b))?\\s*$/i;\n const m = s.match(re);\n if (!m || (!m.groups?.feet && !m.groups?.inches)) return null;\n\n const feet = m.groups?.feet ? parseFloat(m.groups.feet) : 0;\n const inches = m.groups?.inches ? parseFloat(m.groups.inches) : 0;\n if (!isFinite(feet) || !isFinite(inches)) return null;\n\n const totalInches = feet * 12 + inches;\n return inchesToMm(totalInches);\n}\n\ntype DimensionInput = string | number | null | undefined;\n\nconst unitPattern = /('|ft|feet|\"|in\\b|inch(?:es)?\\b)/i;\n\nexport function dimensionToMmNumber(value?: DimensionInput): number | undefined {\n if (value == null) return undefined;\n\n if (typeof value === \"number\") {\n return Number.isFinite(value) ? Math.round(value) : undefined;\n }\n\n const raw = String(value).trim();\n if (!raw) return undefined;\n\n const candidate = unitPattern.test(raw) ? raw : `${raw}\"`;\n const mm = imperialToMm(candidate);\n\n if (mm == null || !Number.isFinite(mm)) return undefined;\n return Math.round(mm);\n}\n\nconst coerceMillimeters = (value: DimensionInput): number | null => {\n if (value == null) return null;\n if (typeof value === \"number\") return Number.isFinite(value) ? value : null;\n\n const trimmed = String(value).trim();\n if (!trimmed) return null;\n\n const numeric = Number.parseFloat(trimmed);\n return Number.isFinite(numeric) ? numeric : null;\n};\n\nconst mmToInchesString = (\n value: DimensionInput,\n precision = 1,\n appendSymbol = false,\n): string | null => {\n const mm = coerceMillimeters(value);\n if (mm == null) return null;\n\n const converted = mmToInches(mm, precision, appendSymbol);\n return typeof converted === \"number\" ? converted.toString() : converted;\n};\n\ntype FormatDimensionsArgs = {\n width?: DimensionInput;\n depth?: DimensionInput;\n height?: DimensionInput;\n};\n\ntype FormatDimensionsOptions = {\n precision?: number;\n appendSymbol?: boolean;\n delimiter?: string;\n};\n\nexport function formatDimensions(\n { width, depth, height }: FormatDimensionsArgs,\n { precision = 1, appendSymbol = true, delimiter = \" x \" }: FormatDimensionsOptions = {},\n): string {\n const formatPart = (value: DimensionInput, label: string): string | null => {\n const inches = mmToInchesString(value, precision, false);\n if (!inches) return null;\n const measurement = appendSymbol ? `${inches}\"` : inches;\n return `${measurement}${label}`;\n };\n\n const parts = [\n formatPart(width, \"W\"),\n formatPart(depth, \"D\"),\n formatPart(height, \"H\"),\n ].filter((part): part is string => part != null);\n\n return parts.join(delimiter);\n}\n\nexport function toInchesDisplay(\n value?: DimensionInput,\n { precision = 1, appendSymbol = false }: { precision?: number; appendSymbol?: boolean } = {},\n): string {\n return mmToInchesString(value, precision, appendSymbol) ?? \"\";\n}\n"],"names":["mmToInches","mm","precision","appendSymbol","inches","p","factor","value","inchesToMm","imperialToMm","input","_a","_b","_c","_d","s","re","m","feet","totalInches","unitPattern","dimensionToMmNumber","raw","candidate","coerceMillimeters","trimmed","numeric","mmToInchesString","converted","formatDimensions","width","depth","height","delimiter","formatPart","label","part","toInchesDisplay"],"mappings":"AAYO,SAASA,EAAWC,GAAYC,IAAoB,GAAGC,IAAe,IAAwB;AACnG,QAAMC,IAASH,IAAK,MACdI,IAAI,KAAK,IAAI,GAAGH,CAAS,GACzBI,IAAS,KAAK,IAAI,IAAID,CAAC,GACvBE,IAAQ,KAAK,MAAMH,IAASE,CAAM,IAAIA;AAC5C,SAAOH,IAAe,GAAGI,CAAK,MAAOA;AACvC;AASO,SAASC,EAAWJ,GAAwB;AACjD,SAAOA,IAAS;AAClB;AAYO,SAASK,EAAaC,GAA8B;AArC3D,MAAAC,GAAAC,GAAAC,GAAAC;AAsCE,MAAI,OAAOJ,KAAU,SAAU,QAAO;AACtC,MAAIK,IAAIL,EAAM,KAAA;AACd,MAAI,CAACK,EAAG,QAAO;AAGf,EAAAA,IAAIA,EACD,QAAQ,WAAW,GAAG,EACtB,QAAQ,WAAW,GAAG,EACtB,YAAA;AAIH,QAAMC,IAAK,uHACLC,IAAIF,EAAE,MAAMC,CAAE;AACpB,MAAI,CAACC,KAAM,GAACN,IAAAM,EAAE,WAAF,QAAAN,EAAU,SAAQ,GAACC,IAAAK,EAAE,WAAF,QAAAL,EAAU,QAAS,QAAO;AAEzD,QAAMM,KAAOL,IAAAI,EAAE,WAAF,QAAAJ,EAAU,OAAO,WAAWI,EAAE,OAAO,IAAI,IAAI,GACpDb,KAASU,IAAAG,EAAE,WAAF,QAAAH,EAAU,SAAS,WAAWG,EAAE,OAAO,MAAM,IAAI;AAChE,MAAI,CAAC,SAASC,CAAI,KAAK,CAAC,SAASd,CAAM,EAAG,QAAO;AAEjD,QAAMe,IAAcD,IAAO,KAAKd;AAChC,SAAOI,EAAWW,CAAW;AAC/B;AAIA,MAAMC,IAAc;AAEb,SAASC,EAAoBd,GAA4C;AAC9E,MAAIA,KAAS,KAAM;AAEnB,MAAI,OAAOA,KAAU;AACnB,WAAO,OAAO,SAASA,CAAK,IAAI,KAAK,MAAMA,CAAK,IAAI;AAGtD,QAAMe,IAAM,OAAOf,CAAK,EAAE,KAAA;AAC1B,MAAI,CAACe,EAAK;AAEV,QAAMC,IAAYH,EAAY,KAAKE,CAAG,IAAIA,IAAM,GAAGA,CAAG,KAChDrB,IAAKQ,EAAac,CAAS;AAEjC,MAAI,EAAAtB,KAAM,QAAQ,CAAC,OAAO,SAASA,CAAE;AACrC,WAAO,KAAK,MAAMA,CAAE;AACtB;AAEA,MAAMuB,IAAoB,CAACjB,MAAyC;AAClE,MAAIA,KAAS,KAAM,QAAO;AAC1B,MAAI,OAAOA,KAAU,SAAU,QAAO,OAAO,SAASA,CAAK,IAAIA,IAAQ;AAEvE,QAAMkB,IAAU,OAAOlB,CAAK,EAAE,KAAA;AAC9B,MAAI,CAACkB,EAAS,QAAO;AAErB,QAAMC,IAAU,OAAO,WAAWD,CAAO;AACzC,SAAO,OAAO,SAASC,CAAO,IAAIA,IAAU;AAC9C,GAEMC,IAAmB,CACvBpB,GACAL,IAAY,GACZC,IAAe,OACG;AAClB,QAAMF,IAAKuB,EAAkBjB,CAAK;AAClC,MAAIN,KAAM,KAAM,QAAO;AAEvB,QAAM2B,IAAY5B,EAAWC,GAAIC,GAAWC,CAAY;AACxD,SAAO,OAAOyB,KAAc,WAAWA,EAAU,aAAaA;AAChE;AAcO,SAASC,EACd,EAAE,OAAAC,GAAO,OAAAC,GAAO,QAAAC,KAChB,EAAE,WAAA9B,IAAY,GAAG,cAAAC,IAAe,IAAM,WAAA8B,IAAY,MAAA,IAAmC,CAAA,GAC7E;AACR,QAAMC,IAAa,CAAC3B,GAAuB4B,MAAiC;AAC1E,UAAM/B,IAASuB,EAAiBpB,GAAOL,GAAW,EAAK;AACvD,WAAKE,IAEE,GADaD,IAAe,GAAGC,CAAM,MAAMA,CAC7B,GAAG+B,CAAK,KAFT;AAAA,EAGtB;AAQA,SANc;AAAA,IACZD,EAAWJ,GAAO,GAAG;AAAA,IACrBI,EAAWH,GAAO,GAAG;AAAA,IACrBG,EAAWF,GAAQ,GAAG;AAAA,EAAA,EACtB,OAAO,CAACI,MAAyBA,KAAQ,IAAI,EAElC,KAAKH,CAAS;AAC7B;AAEO,SAASI,EACd9B,GACA,EAAE,WAAAL,IAAY,GAAG,cAAAC,IAAe,GAAA,IAA0D,IAClF;AACR,SAAOwB,EAAiBpB,GAAOL,GAAWC,CAAY,KAAK;AAC7D;"}
|