{"version":3,"file":"error.C1bhDS7P.mjs","names":[],"sources":["https:/asset.29cm.co.kr/contents/framer/utils/error/error.js"],"sourcesContent":["const parseErrorMessage = (err, fallbackMessage) => {\n  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;\n  const error = err;\n  const errors = error == null ? void 0 : error.errors;\n  if (isArrayErrorDetail(errors == null ? void 0 : errors.detail) && typeof ((_a = errors == null ? void 0 : errors.detail) == null ? void 0 : _a[0]) === \"string\") {\n    return errors.detail[0] || fallbackMessage;\n  }\n  if (isArrayErrorDetail(errors == null ? void 0 : errors.detail) && typeof ((_c = (_b = errors == null ? void 0 : errors.detail) == null ? void 0 : _b[0]) == null ? void 0 : _c.warning) === \"string\") {\n    return errors.detail[0].warning || fallbackMessage;\n  }\n  if (isArrayErrorDetail(errors == null ? void 0 : errors.detail) && typeof ((_f = (_e = (_d = errors == null ? void 0 : errors.detail) == null ? void 0 : _d[0]) == null ? void 0 : _e.warning) == null ? void 0 : _f[0]) === \"string\") {\n    return errors.detail[0].warning[0] || fallbackMessage;\n  }\n  if (isArrayErrorDetail(errors == null ? void 0 : errors.detail) && typeof ((_h = (_g = errors == null ? void 0 : errors.detail) == null ? void 0 : _g[0]) == null ? void 0 : _h.message) === \"string\") {\n    return errors.detail[0].message || fallbackMessage;\n  }\n  if (isArrayErrorDetail(errors == null ? void 0 : errors.detail) && typeof ((_k = (_j = (_i = errors == null ? void 0 : errors.detail) == null ? void 0 : _i[0]) == null ? void 0 : _j.message) == null ? void 0 : _k[0]) === \"string\") {\n    return errors.detail[0].message[0] || fallbackMessage;\n  }\n  if (isErrorDetail(errors == null ? void 0 : errors.detail) && typeof ((_l = errors == null ? void 0 : errors.detail) == null ? void 0 : _l.warning) === \"string\") {\n    return errors.detail.warning || fallbackMessage;\n  }\n  if (isErrorDetail(errors == null ? void 0 : errors.detail) && typeof ((_n = (_m = errors == null ? void 0 : errors.detail) == null ? void 0 : _m.warning) == null ? void 0 : _n[0]) === \"string\") {\n    return errors.detail.warning[0] || fallbackMessage;\n  }\n  if (isErrorDetail(errors == null ? void 0 : errors.detail) && typeof ((_o = errors == null ? void 0 : errors.detail) == null ? void 0 : _o.message) === \"string\") {\n    return errors.detail.message || fallbackMessage;\n  }\n  if (isErrorDetail(errors == null ? void 0 : errors.detail) && typeof ((_q = (_p = errors == null ? void 0 : errors.detail) == null ? void 0 : _p.message) == null ? void 0 : _q[0]) === \"string\") {\n    return errors.detail.message[0] || fallbackMessage;\n  }\n  if (error == null ? void 0 : error.message) {\n    return error.message;\n  }\n  const message = (errors == null ? void 0 : errors.message) ?? fallbackMessage;\n  if (message) {\n    return message;\n  }\n  return \"\";\n};\nconst parseDirectionCode = (err) => {\n  var _a, _b, _c;\n  const error = err;\n  const errors = error == null ? void 0 : error.errors;\n  if (isArrayErrorDetail(errors == null ? void 0 : errors.detail) && errors && Array.isArray((_b = (_a = errors == null ? void 0 : errors.detail) == null ? void 0 : _a[0]) == null ? void 0 : _b.direction_code)) {\n    return errors.detail[0].direction_code;\n  }\n  if (isErrorDetail(errors == null ? void 0 : errors.detail) && errors && Array.isArray((_c = errors == null ? void 0 : errors.detail) == null ? void 0 : _c.direction_code)) {\n    return errors.detail.direction_code;\n  }\n  return null;\n};\nconst isArrayErrorDetail = (detail) => {\n  return Array.isArray(detail);\n};\nconst isErrorDetail = (detail) => {\n  return typeof detail === \"object\" && detail !== null && !(\"length\" in detail);\n};\nexport {\n  parseDirectionCode,\n  parseErrorMessage\n};\n"],"mappings":"0EAAM,GAAqB,EAAK,IAAoB,CAElD,IAAM,EAAQ,EACR,EAAS,GAA+B,OAmC9C,OAlCI,EAAmB,GAAiC,OAAO,EAAI,OAAc,GAAiC,SAA8B,IAAQ,SAC/I,EAAO,OAAO,IAAM,EAEzB,EAAmB,GAAiC,OAAO,EAAI,OAAoB,GAAiC,SAA8B,IAA0B,SAAa,SACpL,EAAO,OAAO,GAAG,SAAW,EAEjC,EAAmB,GAAiC,OAAO,EA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