Deploy via committed dist: local Nest build, server runs with .env

Build on the developer machine without Docker, commit dist/, and run on the server with Dockerfile.dist plus compose env_file.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-05 21:35:22 +03:30
co-authored by Cursor
parent 67cfc17079
commit cbcea58e94
199 changed files with 10895 additions and 4 deletions
+71
View File
@@ -0,0 +1,71 @@
import { CatalogsService } from './catalogs.service';
import { CreateCatalogDto, SetCatalogActiveDto, UpdateCatalogDto } from './dto/catalog.dto';
export declare class CatalogsController {
private readonly catalogsService;
constructor(catalogsService: CatalogsService);
findAll(companyId?: string, activeOnly?: string): Promise<{
id: string;
companyId: string;
companyName: string;
name: string;
code: string;
description: string | undefined;
displayOrder: number;
isActive: boolean;
productCount: number;
createdAt: string;
updatedAt: string;
}[]>;
findOne(id: string): Promise<{
id: string;
companyId: string;
companyName: string;
name: string;
code: string;
description: string | undefined;
displayOrder: number;
isActive: boolean;
productCount: number;
createdAt: string;
updatedAt: string;
}>;
create(dto: CreateCatalogDto): Promise<{
id: string;
companyId: string;
companyName: string;
name: string;
code: string;
description: string | undefined;
displayOrder: number;
isActive: boolean;
productCount: number;
createdAt: string;
updatedAt: string;
}>;
update(id: string, dto: UpdateCatalogDto): Promise<{
id: string;
companyId: string;
companyName: string;
name: string;
code: string;
description: string | undefined;
displayOrder: number;
isActive: boolean;
productCount: number;
createdAt: string;
updatedAt: string;
}>;
setActive(id: string, dto: SetCatalogActiveDto): Promise<{
id: string;
companyId: string;
companyName: string;
name: string;
code: string;
description: string | undefined;
displayOrder: number;
isActive: boolean;
productCount: number;
createdAt: string;
updatedAt: string;
}>;
}
+89
View File
@@ -0,0 +1,89 @@
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CatalogsController = void 0;
const common_1 = require("@nestjs/common");
const catalogs_service_1 = require("./catalogs.service");
const auth_decorators_1 = require("../common/decorators/auth.decorators");
const catalog_dto_1 = require("./dto/catalog.dto");
let CatalogsController = class CatalogsController {
catalogsService;
constructor(catalogsService) {
this.catalogsService = catalogsService;
}
findAll(companyId, activeOnly) {
return this.catalogsService.findAll(companyId, activeOnly === 'true' || activeOnly === '1');
}
findOne(id) {
return this.catalogsService.findOne(id);
}
create(dto) {
return this.catalogsService.create(dto);
}
update(id, dto) {
return this.catalogsService.update(id, dto);
}
setActive(id, dto) {
return this.catalogsService.setActive(id, dto.isActive);
}
};
exports.CatalogsController = CatalogsController;
__decorate([
(0, auth_decorators_1.AuthType)('any'),
(0, common_1.Get)(),
__param(0, (0, common_1.Query)('companyId')),
__param(1, (0, common_1.Query)('activeOnly')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String, String]),
__metadata("design:returntype", void 0)
], CatalogsController.prototype, "findAll", null);
__decorate([
(0, auth_decorators_1.AuthType)('any'),
(0, common_1.Get)(':id'),
__param(0, (0, common_1.Param)('id')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),
__metadata("design:returntype", void 0)
], CatalogsController.prototype, "findOne", null);
__decorate([
(0, auth_decorators_1.AuthType)('admin'),
(0, common_1.Post)(),
__param(0, (0, common_1.Body)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [catalog_dto_1.CreateCatalogDto]),
__metadata("design:returntype", void 0)
], CatalogsController.prototype, "create", null);
__decorate([
(0, auth_decorators_1.AuthType)('admin'),
(0, common_1.Patch)(':id'),
__param(0, (0, common_1.Param)('id')),
__param(1, (0, common_1.Body)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String, catalog_dto_1.UpdateCatalogDto]),
__metadata("design:returntype", void 0)
], CatalogsController.prototype, "update", null);
__decorate([
(0, auth_decorators_1.AuthType)('admin'),
(0, common_1.Patch)(':id/active'),
__param(0, (0, common_1.Param)('id')),
__param(1, (0, common_1.Body)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String, catalog_dto_1.SetCatalogActiveDto]),
__metadata("design:returntype", void 0)
], CatalogsController.prototype, "setActive", null);
exports.CatalogsController = CatalogsController = __decorate([
(0, common_1.Controller)('catalogs'),
__metadata("design:paramtypes", [catalogs_service_1.CatalogsService])
], CatalogsController);
//# sourceMappingURL=catalogs.controller.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"catalogs.controller.js","sourceRoot":"","sources":["../../src/catalogs/catalogs.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAQwB;AACxB,yDAAqD;AACrD,0EAAgE;AAChE,mDAI2B;AAGpB,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IACA;IAA7B,YAA6B,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;IAAG,CAAC;IAIjE,OAAO,CACe,SAAkB,EACjB,UAAmB;QAExC,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,CACjC,SAAS,EACT,UAAU,KAAK,MAAM,IAAI,UAAU,KAAK,GAAG,CAC5C,CAAC;IACJ,CAAC;IAID,OAAO,CAAc,EAAU;QAC7B,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC1C,CAAC;IAID,MAAM,CAAS,GAAqB;QAClC,OAAO,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC1C,CAAC;IAID,MAAM,CAAc,EAAU,EAAU,GAAqB;Q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0 +1,23 @@
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CatalogsModule = void 0;
const common_1 = require("@nestjs/common");
const catalogs_controller_1 = require("./catalogs.controller");
const catalogs_service_1 = require("./catalogs.service");
let CatalogsModule = class CatalogsModule {
};
exports.CatalogsModule = CatalogsModule;
exports.CatalogsModule = CatalogsModule = __decorate([
(0, common_1.Module)({
controllers: [catalogs_controller_1.CatalogsController],
providers: [catalogs_service_1.CatalogsService],
exports: [catalogs_service_1.CatalogsService],
})
], CatalogsModule);
//# sourceMappingURL=catalogs.module.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"catalogs.module.js","sourceRoot":"","sources":["../../src/catalogs/catalogs.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,+DAA2D;AAC3D,yDAAqD;AAO9C,IAAM,cAAc,GAApB,MAAM,cAAc;CAAG,CAAA;AAAjB,wCAAc;yBAAd,cAAc;IAL1B,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,CAAC,wCAAkB,CAAC;QACjC,SAAS,EAAE,CAAC,kCAAe,CAAC;QAC5B,OAAO,EAAE,CAAC,kCAAe,CAAC;KAC3B,CAAC;GACW,cAAc,CAAG"}
+73
View File
@@ -0,0 +1,73 @@
import { PrismaService } from '../prisma/prisma.service';
import { CreateCatalogDto, UpdateCatalogDto } from './dto/catalog.dto';
export declare class CatalogsService {
private readonly prisma;
constructor(prisma: PrismaService);
findAll(companyId?: string, activeOnly?: boolean): Promise<{
id: string;
companyId: string;
companyName: string;
name: string;
code: string;
description: string | undefined;
displayOrder: number;
isActive: boolean;
productCount: number;
createdAt: string;
updatedAt: string;
}[]>;
findOne(id: string): Promise<{
id: string;
companyId: string;
companyName: string;
name: string;
code: string;
description: string | undefined;
displayOrder: number;
isActive: boolean;
productCount: number;
createdAt: string;
updatedAt: string;
}>;
create(dto: CreateCatalogDto): Promise<{
id: string;
companyId: string;
companyName: string;
name: string;
code: string;
description: string | undefined;
displayOrder: number;
isActive: boolean;
productCount: number;
createdAt: string;
updatedAt: string;
}>;
update(id: string, dto: UpdateCatalogDto): Promise<{
id: string;
companyId: string;
companyName: string;
name: string;
code: string;
description: string | undefined;
displayOrder: number;
isActive: boolean;
productCount: number;
createdAt: string;
updatedAt: string;
}>;
setActive(id: string, isActive: boolean): Promise<{
id: string;
companyId: string;
companyName: string;
name: string;
code: string;
description: string | undefined;
displayOrder: number;
isActive: boolean;
productCount: number;
createdAt: string;
updatedAt: string;
}>;
private ensure;
private map;
}
+144
View File
@@ -0,0 +1,144 @@
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CatalogsService = void 0;
const common_1 = require("@nestjs/common");
const client_1 = require("@prisma/client");
const prisma_service_1 = require("../prisma/prisma.service");
let CatalogsService = class CatalogsService {
prisma;
constructor(prisma) {
this.prisma = prisma;
}
async findAll(companyId, activeOnly = false) {
const catalogs = await this.prisma.catalog.findMany({
where: {
...(companyId ? { companyId } : {}),
...(activeOnly ? { isActive: true } : {}),
},
orderBy: [{ displayOrder: 'asc' }, { name: 'asc' }],
include: {
company: { select: { name: true } },
_count: { select: { products: true } },
},
});
return catalogs.map((c) => this.map(c));
}
async findOne(id) {
const catalog = await this.prisma.catalog.findUnique({
where: { id },
include: {
company: { select: { name: true } },
_count: { select: { products: true } },
},
});
if (!catalog)
throw new common_1.NotFoundException('کاتالوگ یافت نشد');
return this.map(catalog);
}
async create(dto) {
const company = await this.prisma.company.findUnique({
where: { id: dto.companyId },
});
if (!company)
throw new common_1.NotFoundException('شرکت یافت نشد');
try {
const catalog = await this.prisma.catalog.create({
data: {
companyId: dto.companyId,
name: dto.name.trim(),
code: dto.code.trim(),
description: dto.description?.trim() || null,
displayOrder: dto.displayOrder ?? 0,
isActive: dto.isActive ?? true,
},
include: {
company: { select: { name: true } },
_count: { select: { products: true } },
},
});
return this.map(catalog);
}
catch (e) {
if (e instanceof client_1.Prisma.PrismaClientKnownRequestError && e.code === 'P2002') {
throw new common_1.ConflictException('کد کاتالوگ در این شرکت تکراری است');
}
throw e;
}
}
async update(id, dto) {
await this.ensure(id);
try {
const catalog = await this.prisma.catalog.update({
where: { id },
data: {
name: dto.name?.trim(),
code: dto.code?.trim(),
description: dto.description === undefined
? undefined
: dto.description?.trim() || null,
displayOrder: dto.displayOrder,
isActive: dto.isActive,
},
include: {
company: { select: { name: true } },
_count: { select: { products: true } },
},
});
return this.map(catalog);
}
catch (e) {
if (e instanceof client_1.Prisma.PrismaClientKnownRequestError && e.code === 'P2002') {
throw new common_1.ConflictException('کد کاتالوگ در این شرکت تکراری است');
}
throw e;
}
}
async setActive(id, isActive) {
await this.ensure(id);
const catalog = await this.prisma.catalog.update({
where: { id },
data: { isActive },
include: {
company: { select: { name: true } },
_count: { select: { products: true } },
},
});
return this.map(catalog);
}
async ensure(id) {
const catalog = await this.prisma.catalog.findUnique({ where: { id } });
if (!catalog)
throw new common_1.NotFoundException('کاتالوگ یافت نشد');
return catalog;
}
map(catalog) {
return {
id: catalog.id,
companyId: catalog.companyId,
companyName: catalog.company.name,
name: catalog.name,
code: catalog.code,
description: catalog.description ?? undefined,
displayOrder: catalog.displayOrder,
isActive: catalog.isActive,
productCount: catalog._count.products,
createdAt: catalog.createdAt.toISOString(),
updatedAt: catalog.updatedAt.toISOString(),
};
}
};
exports.CatalogsService = CatalogsService;
exports.CatalogsService = CatalogsService = __decorate([
(0, common_1.Injectable)(),
__metadata("design:paramtypes", [prisma_service_1.PrismaService])
], CatalogsService);
//# sourceMappingURL=catalogs.service.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"catalogs.service.js","sourceRoot":"","sources":["../../src/catalogs/catalogs.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAIwB;AACxB,2CAAwC;AACxC,6DAAyD;AAIlD,IAAM,eAAe,GAArB,MAAM,eAAe;IACG;IAA7B,YAA6B,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAEtD,KAAK,CAAC,OAAO,CAAC,SAAkB,EAAE,UAAU,GAAG,KAAK;QAClD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC;YAClD,KAAK,EAAE;gBACL,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACnC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC1C;YACD,OAAO,EAAE,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;YACnD,OAAO,EAAE;gBACP,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;gBACnC,MAAM,EAAE,EAAE,MAAM,EAA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C,CAAC;QAC9D,OAAO,OAAO,CAAC;IACjB,CAAC;IAEO,GAAG,CAAC,OAYX;QACC,OAAO;YACL,EAAE,EAAE,OAAO,CAAC,EAAE;YACd,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI;YACjC,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,SAAS;YAC7C,YAAY,EAAE,OAAO,CAAC,YAAY;YAClC,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ;YACrC,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,WAAW,EAAE;YAC1C,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,WAAW,EAAE;SAC3C,CAAC;IACJ,CAAC;CACF,CAAA;AAvIY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;qCAE0B,8BAAa;GADvC,eAAe,CAuI3B"}
+18
View File
@@ -0,0 +1,18 @@
export declare class CreateCatalogDto {
companyId: string;
name: string;
code: string;
description?: string;
displayOrder?: number;
isActive?: boolean;
}
export declare class UpdateCatalogDto {
name?: string;
code?: string;
description?: string | null;
displayOrder?: number;
isActive?: boolean;
}
export declare class SetCatalogActiveDto {
isActive: boolean;
}
+98
View File
@@ -0,0 +1,98 @@
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SetCatalogActiveDto = exports.UpdateCatalogDto = exports.CreateCatalogDto = void 0;
const class_validator_1 = require("class-validator");
const class_transformer_1 = require("class-transformer");
class CreateCatalogDto {
companyId;
name;
code;
description;
displayOrder;
isActive;
}
exports.CreateCatalogDto = CreateCatalogDto;
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateCatalogDto.prototype, "companyId", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.MinLength)(1),
__metadata("design:type", String)
], CreateCatalogDto.prototype, "name", void 0);
__decorate([
(0, class_validator_1.IsString)(),
(0, class_validator_1.MinLength)(1),
__metadata("design:type", String)
], CreateCatalogDto.prototype, "code", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateCatalogDto.prototype, "description", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_transformer_1.Type)(() => Number),
(0, class_validator_1.IsInt)(),
__metadata("design:type", Number)
], CreateCatalogDto.prototype, "displayOrder", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsBoolean)(),
__metadata("design:type", Boolean)
], CreateCatalogDto.prototype, "isActive", void 0);
class UpdateCatalogDto {
name;
code;
description;
displayOrder;
isActive;
}
exports.UpdateCatalogDto = UpdateCatalogDto;
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.MinLength)(1),
__metadata("design:type", String)
], UpdateCatalogDto.prototype, "name", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.MinLength)(1),
__metadata("design:type", String)
], UpdateCatalogDto.prototype, "code", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", Object)
], UpdateCatalogDto.prototype, "description", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_transformer_1.Type)(() => Number),
(0, class_validator_1.IsInt)(),
__metadata("design:type", Number)
], UpdateCatalogDto.prototype, "displayOrder", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsBoolean)(),
__metadata("design:type", Boolean)
], UpdateCatalogDto.prototype, "isActive", void 0);
class SetCatalogActiveDto {
isActive;
}
exports.SetCatalogActiveDto = SetCatalogActiveDto;
__decorate([
(0, class_validator_1.IsBoolean)(),
__metadata("design:type", Boolean)
], SetCatalogActiveDto.prototype, "isActive", void 0);
//# sourceMappingURL=catalog.dto.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"catalog.dto.js","sourceRoot":"","sources":["../../../src/catalogs/dto/catalog.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAMyB;AACzB,yDAAyC;AAEzC,MAAa,gBAAgB;IAE3B,SAAS,CAAU;IAInB,IAAI,CAAU;IAId,IAAI,CAAU;IAId,WAAW,CAAU;IAKrB,YAAY,CAAU;IAItB,QAAQ,CAAW;CACpB;AAxBD,4CAwBC;AAtBC;IADC,IAAA,0BAAQ,GAAE;;mDACQ;AAInB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,CAAC,CAAC;;8CACC;AAId;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,CAAC,CAAC;;8CACC;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;qDACU;AAKrB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IAClB,IAAA,uBAAK,GAAE;;sDACc;AAItB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;;kDACO;AAGrB,MAAa,gBAAgB;IAI3B,IAAI,CAAU;IAKd,IAAI,CAAU;IAId,WAAW,C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